-
Notifications
You must be signed in to change notification settings - Fork 0
/
drawHists.C
230 lines (173 loc) · 11.8 KB
/
drawHists.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
#include <iostream>
#include <vector>
#include "TStyle.h"
//#include "histtools.C"
#include "browseStacks.C"
#include "getMyHistosNames.C"
#include "TSystem.h"
#include "tdrStyle.C"
#include "DYest.C"
#include "CommonFunctions.C"
#include "EstimateSignalSpillage.C"
/*
replacewFRest = replace the yields and errors for WJets, QCD with the FR estimate results
Does the Spillage subtraction as well
replacewDYest = replace the yields and errors for DY with the data driven estimate
drawFullErrors = draw the errors in all their glory. Includes the systematic errors:
50% on the WJets estimate
100% on the QCD estimate
50% on DY estimate
50% on the backgrounds from MC
*/
//void makePSFile(const TString dataFName="results_data/hist_usePtGt2020_applyTriggers_hypDisamb_usejptJets_usetcMET_requireEcalEls_useOS_vetoHypMassLt12_require2BTag_applylepIDCuts_applylepIsoCuts_vetoZmass_veto2Jets_vetoMET.root", const TString mcFName="results/hist_usePtGt2020_applyTriggers_hypDisamb_usejptJets_usetcMET_requireEcalEls_useOS_vetoHypMassLt12_require2BTag_applylepIDCuts_applylepIsoCuts_vetoZmass_veto2Jets_vetoMET.root", float scaleMC=36.1, bool drawLogY = true, bool drawDiffs = false,
void makePSFile(const TString FName="results/hist_usePtGt2020_applyTriggers_hypDisamb_usepfMET_usepfJets_requireEcalEls_useOS_vetoHypMassLt12_require2BTag_sortJetCandidatesbyDR_applylepIDCuts_applylepIsoCuts_vetoZmass_veto2Jets_vetoMET.root",
int rebin=1, bool drawtprime = false,
const TString pat="default",
float scaleMC=4.98, bool drawLogY = false, bool allhypOnly = false, bool drawDiffs = false,
bool replacewFRest = false, bool replacewDYest = false,
bool drawFullErrors = false, bool scalebTagMCbyDataDrivenEsts = false) {
setTDRStyle();
// hist::loadHist(FName.Data(),0,"*hnJet*");
if(pat!="default") hist::loadHist(FName.Data(),0,pat.Data());
else {
hist::loadHist(FName.Data(),0,"*hnJet_allj*");
hist::loadHist(FName.Data(),0,"*hnVtx_allj*");
hist::loadHist(FName.Data(),0,"*hnBtagJet_allj*");
hist::loadHist(FName.Data(),0,"*hlepPt_allj*");
//hist::loadHist(FName.Data(),0,"*hlepPlusPt_allj*");
//hist::loadHist(FName.Data(),0,"*hlepMinusPt_allj*");
hist::loadHist(FName.Data(),0,"*hlepEta_allj*");
//hist::loadHist(FName.Data(),0,"*hlepPlusEta_allj*");
//hist::loadHist(FName.Data(),0,"*hlepMinusEta_allj*");
hist::loadHist(FName.Data(),0,"*theSumLepPt_allj*");
//hist::loadHist(FName.Data(),0,"*hlepPhi_allj*");
//hist::loadHist(FName.Data(),0,"*hlepPlusPhi_allj*");
//hist::loadHist(FName.Data(),0,"*hlepMinusPhi_allj*");
//hist::loadHist(FName.Data(),0,"*hlepAzimAsym_allj*");
hist::loadHist(FName.Data(),0,"*hjetPt_allj*");
hist::loadHist(FName.Data(),0,"*hjetEta_allj*");
//hist::loadHist(FName.Data(),0,"*hjetPhi_allj*");
//hist::loadHist(FName.Data(),0,"*thefirstJetPt_allj*");
//hist::loadHist(FName.Data(),0,"*thesecondJetPt_allj*");
hist::loadHist(FName.Data(),0,"*theSumJetPt_allj*");
//hist::loadHist(FName.Data(),0,"*theSumBtagJetPt_allj*");
//hist::loadHist(FName.Data(),0,"*htheleadinglepPt_allj*");
//hist::loadHist(FName.Data(),0,"*hthesecondlepPt_allj*");
hist::loadHist(FName.Data(),0,"*hMET_allj*");
//hist::loadHist(FName.Data(),0,"*hmassltb_allj*");
//hist::loadHist(FName.Data(),0,"*hmassllb_allj*");
hist::loadHist(FName.Data(),0,"*hNsolns_allj*");
hist::loadHist(FName.Data(),0,"*hmaxAMWTweight_allj*");
hist::loadHist(FName.Data(),0,"*hsumAMWTweight_allj*");
hist::loadHist(FName.Data(),0,"*haveAMWTweight_allj*");
//hist::loadHist(FName.Data(),0,"*hAMWTweight_nojetsmear_allj*");
hist::loadHist(FName.Data(),0,"*htopMass_allj*");
hist::loadHist(FName.Data(),0,"*httMass_allj*");
hist::loadHist(FName.Data(),0,"*httpT_allj*");
hist::loadHist(FName.Data(),0,"*httRapidity_allj*");
hist::loadHist(FName.Data(),0,"*httRapidity2_allj*");
hist::loadHist(FName.Data(),0,"*hlepChargeAsym_allj*");
hist::loadHist(FName.Data(),0,"*hlepAzimAsym_allj*");
hist::loadHist(FName.Data(),0,"*hlepAzimAsym2_allj*");
hist::loadHist(FName.Data(),0,"*htopCosTheta_allj*");
hist::loadHist(FName.Data(),0,"*hpseudorapiditydiff_allj*");
hist::loadHist(FName.Data(),0,"*hrapiditydiff_allj*");
hist::loadHist(FName.Data(),0,"*hrapiditydiffMarco_allj*");
hist::loadHist(FName.Data(),0,"*hlepPlusCosTheta_allj*");
hist::loadHist(FName.Data(),0,"*hlepMinusCosTheta_allj*");
hist::loadHist(FName.Data(),0,"*hlepCosTheta_allj*");
hist::loadHist(FName.Data(),0,"*htopSpinCorr_allj*");
//hist::loadHist(FName.Data(),0,"*hpseudorapiditydiff2_allj*");
//hist::loadHist(FName.Data(),0,"*hrapiditydiff2_allj*");
//hist::loadHist(FName.Data(),0,"*hlepRapDiff_allj*");
//hist::loadHist(FName.Data(),0,"*hlepAngleBetween_allj*");
//hist::loadHist(FName.Data(),0,"*hlepAngleBetweenCMS_allj*");
//hist::loadHist(FName.Data(),0,"*hjetAzimAsym_allj*");
//hist::loadHist(FName.Data(),0,"*hjetRapDiff_allj*");
//hist::loadHist(FName.Data(),0,"*hjetAngleBetween_allj*");
//hist::loadHist(FName.Data(),0,"*hjetAngleBetweenCMS_allj*");
// hist::loadHist(FName.Data(),0,"*htopCosThetaGen_allj*");
// hist::loadHist(FName.Data(),0,"*hlepChargeAsymGen_allj*");
// hist::loadHist(FName.Data(),0,"*hlepCosThetaGen_allj*");
// hist::loadHist(FName.Data(),0,"*htopSpinCorrGen_allj*");
}
//if(drawtprime && ! drawLogY) hist::scale("ttprime*", 10);
//hist::scale("ttdil_*", 1.+(9824. - 10086.77)/9344.25); //scale mc@nlo to data
hist::scale("ttdil_*", 1.+(9824. - 10063.47)/9323.84); //scale mc@nlo to data, after pT reweighting
//if(scalebTagMCbyDataDrivenEsts) {
vector<TString> v_samples;
vector<Color_t> v_colors;
vector<TString> v_legEntries;
vector<Style_t> v_styles;
//the order you put the sample into the vector is the order
//that the histogram gets drawn. So if you put ttdil in first,
//it will be drawn first, i.e, it will be drawn on the bottom
//of the stack!
if(drawLogY) {
v_samples.push_back("ttdil");
v_colors.push_back(kRed+1);
v_legEntries.push_back("t#bar{t}");
v_styles.push_back(1001);
}
if(!drawLogY) {
v_samples.push_back("wjets");
v_colors.push_back(kGreen-3);
if(!scalebTagMCbyDataDrivenEsts)
v_legEntries.push_back("W#rightarrowl#nu");
else
v_legEntries.push_back("Non-W/Z prediction");
v_styles.push_back(1001);
}
// v_samples.push_back("FR");
// v_colors.push_back(kGreen-3);
//v_legEntries.push_back("Non-W/Z prediction");
//v_styles.push_back(1001);
v_samples.push_back("VV");
v_colors.push_back(kYellow-10);
v_legEntries.push_back("VV");
v_styles.push_back(1001);
v_samples.push_back("tw");
v_colors.push_back(kMagenta);
v_legEntries.push_back("Single top");
v_styles.push_back(1001);
v_samples.push_back("DYtautau");
v_colors.push_back(kAzure+8);
v_legEntries.push_back("Z/#gamma*#rightarrow#tau^{+}#tau^{-}");
v_styles.push_back(1001);
std::vector<TString> v_prfxsToCombine;
v_prfxsToCombine.clear();
v_prfxsToCombine.push_back("DYee");
v_prfxsToCombine.push_back("DYmm");
hist::combineHists(v_prfxsToCombine, "DYeemm");
v_samples.push_back("DYeemm");
v_colors.push_back(kAzure - 2);
//if(replacewDYest || scalebTagMCbyDataDrivenEsts)
// v_legEntries.push_back("Z/#gamma*#rightarrowl^{+}l^{-} prediction");
//else
v_legEntries.push_back("Z/#gamma*#rightarrowl^{+}l^{-}");
v_styles.push_back(1001);
v_samples.push_back("ttotr");
v_colors.push_back(kRed-1);
v_legEntries.push_back("t#bar{t} (other)");
v_styles.push_back(1001);
if(!drawLogY) {
v_samples.push_back("ttdil");
v_colors.push_back(kRed+1);
v_legEntries.push_back("t#bar{t} (dilepton)");
v_styles.push_back(1001);
}
if(drawtprime) {
v_samples.push_back("wprime400");
v_colors.push_back(kBlue-2);
if(drawLogY) v_legEntries.push_back("W' 400 GeV");
else v_legEntries.push_back("W' 400 GeV");
v_styles.push_back(0);
}
//data should be the last thing put into the vectors
v_samples.push_back("data");
v_colors.push_back(kBlack);
v_legEntries.push_back("Data");
v_styles.push_back(20);
browseStacks(v_samples, v_colors, FName, v_legEntries, drawLogY, v_styles, drawFullErrors, drawDiffs, scaleMC, rebin, allhypOnly);
hist::deleteHistos();
}