-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdrawDelphes1.C
252 lines (197 loc) · 10 KB
/
drawDelphes1.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
#include "drawDelphesBase.C"
/*
--- to compile ---
.L TSelectorMultiDraw.C+
.L CrossSectionTable.cxx+
.L ConfigurationDescriptions.cxx+
.L drawDelphes1.C+
*/
void drawDelphes1(TString plotsToMake="all") {
initSamples();
setOutputDirectory("Delphes1");
int nbins;
float low,high;
TString var,xtitle;
doOverflowAddition(true);
doRatio_=false;
//normalize to unit area
setStackMode(false,true,false); //stack,norm,label override
stackSignal_=false;
selection_ = "(1)"; //no cuts!
nbins=40; low=0; high=1000;
var="MET"; xtitle="MET (GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("001")) drawPlots(var,nbins,low,high,xtitle,"Events", "MET",0,"GeV");
selection_ = "(1)"; //no cuts!
nbins=50; low=0; high=3000;
var="HT"; xtitle="HT (GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("002")) drawPlots(var,nbins,low,high,xtitle,"Events", "HT",0,"GeV");
selection_ = "(1)"; //no cuts!
nbins=14; low=0; high=14;
var="njets40"; xtitle="njets (40 GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("003")) drawPlots(var,nbins,low,high,xtitle,"Events", "njets40",0,"");
selection_ = "(1)"; //no cuts!
nbins=6; low=0; high=6;
var="nbjets40tight"; xtitle="n tight b jets (40 GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("004")) drawPlots(var,nbins,low,high,xtitle,"Events", "nTbjets40",0,"");
selection_ = "(1)"; //no cuts!
nbins=50; low=0; high=2000;
var="MT2"; xtitle="MT2 (GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("005")) drawPlots(var,nbins,low,high,xtitle,"Events", "MT2",0,"GeV");
//edge selection cuts
TCut dileptons="mll>20";
TCut sf = "isSF==1";
TCut jetsloose = "njets30eta3p0>=2";
TCut jetstight = "njets30eta3p0>=3";
TCut metloose = "MET>100";
TCut mettight = "MET>150";
selection_ = dileptons&&sf&&jetsloose&&mettight; //Edge selection 1
nbins=60; low=0; high=300;
var="mll"; xtitle="m_{l+l-} (GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("006")) drawPlots(var,nbins,low,high,xtitle,"Events", "edge_sel1_mll",0,"GefV");
//same plot, zoom on low mass region
nbins=100; low=0; high=100;
var="mll"; xtitle="m_{l+l-} (GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("012")) drawPlots(var,nbins,low,high,xtitle,"Events", "edge_sel1_mll_zoom",0,"GeV");
if (plotsToMake=="013") {//not compatible with other plots
clearSamples();
addSample("susyhit_slhaScenario1_v02",kRed,"Scenario 1");
drawPlots(var,nbins,low,high,xtitle,"Events", "edge_sel1_mll_zoom_sigonly",0,"GeV");
nbins=100; low=0; high=500;
drawPlots(var,nbins,low,high,xtitle,"Events", "edge_sel1_mll_wide_sigonly",0,"GeV");
selection_ = dileptons&&!sf&&jetsloose&&mettight; //sanity check -- veto SF
drawPlots(var,nbins,low,high,xtitle,"Events", "edge_sel1_mllOF_zoom_sigonly",0,"GeV");
}
//also show with 'real' normalization
setStackMode(true,false,false); //stack,norm,label override
stackSignal_=false;
if (plotsToMake.Contains("all")||plotsToMake.Contains("007")) drawPlots(var,nbins,low,high,xtitle,"Events", "edge_sel1_mll",0,"GeV");
setStackMode(false,true,false); //stack,norm,label override
selection_ = dileptons&&sf&&jetstight&&metloose; //Edge selection 2
nbins=50; low=0; high=300;
var="mll"; xtitle="m_{l+l-} (GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("008")) drawPlots(var,nbins,low,high,xtitle,"Events", "edge_sel2_mll",0,"GeV");
//also show with 'real' normalization
setStackMode(true,false,false); //stack,norm,label override
stackSignal_=false;
if (plotsToMake.Contains("all")||plotsToMake.Contains("009")) drawPlots(var,nbins,low,high,xtitle,"Events", "edge_sel2_mll",0,"GeV");
//now try a hadronic analysis selection
TCut noleptons = "nElectrons==0 && nMuons==0";
TCut ht600 = "HT>=600";
TCut jets="njets40>=3";
selection_=noleptons && ht600 && metloose && jets;
nbins=40; low=0; high=800;
var="MT2"; xtitle="MT2 (GeV)";
setStackMode(false,true,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("010")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_presel_MT2",0,"GeV");
setStackMode(true,false,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("011")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_presel_MT2",0,"GeV");
//try an MT2 cut instead?
TCut mt2baseline = "MT2>=200";
selection_=noleptons&&ht600&&jets&&mt2baseline;
nbins=40; low=0; high=2000;
var="HT"; xtitle="HT (GeV)";
setStackMode(false,true,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("014")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel_HT",0,"GeV");
setStackMode(true,false,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("014")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel_HT",0,"GeV");
//cut much tighter on HT and plot MT2
TCut tighterht = "HT>1500";
selection_ = noleptons && tighterht && jets && mt2baseline;
//plot MT2 and njets
nbins=40; low=0; high=2000;
var="MT2"; xtitle="MT2 (GeV)";
setStackMode(false,true,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("015")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel2_MT2",0,"GeV");
setStackMode(true,false,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("015")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel2_MT2",0,"GeV");
nbins=12; low=0; high=12;
var="njets40"; xtitle="njets40 (GeV)";
setStackMode(false,true,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("015")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel2_njets40",0,"GeV");
setStackMode(true,false,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("015")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel2_njets40",0,"GeV");
//tighter further!
TCut tightermt2 = "MT2>350";
TCut tighterjets = "njets40>=8";
selection_ = noleptons&&TCut("HT>1000")&&tightermt2&&tighterjets;
//plot HT again
nbins=40; low=1000; high=3000;
var="HT"; xtitle="HT (GeV)";
setStackMode(true,false,false); //stack,norm,label override
customDivisionsVal_ = 505;
customDivisions_=true;
if (plotsToMake.Contains("all")||plotsToMake.Contains("016")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel3_HT",0,"GeV");
customDivisions_=false;
//ok, now we're getting somewhere!
TCut ht2000="HT>2000";
selection_ = noleptons && ht2000 && tightermt2 && tighterjets;
//nbjets
nbins=9; low=0; high=9;
var="nbjets40tight"; xtitle="n tight b tags";
setStackMode(true,false,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("017")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel4_nbjets",0,"");
//ntaus
nbins=3; low=0; high=3;
var="nTaus"; xtitle="n tau tags";
setStackMode(true,false,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("017")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel4_ntaus",0,"");
setStackMode(false,true,false); //stack,norm,label override
if (plotsToMake.Contains("all")||plotsToMake.Contains("017")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel4_ntaus",0,"");
//and MT2
setStackMode(true,false,false); //stack,norm,label override
selection_ = noleptons && ht2000 && TCut("MT2>250") && tighterjets;
nbins=65; low=250; high=1000;
var="MT2"; xtitle="MT2 (GeV)";
if (plotsToMake.Contains("all")||plotsToMake.Contains("017")) drawPlots(var,nbins,low,high,xtitle,"Events", "hadronic_mt2sel4_mt2",0,"GeV");
//try a 2d plot
selection_ = noleptons && TCut("HT>800") && TCut("MT2>200") && tighterjets;
if (plotsToMake.Contains("all")||plotsToMake.Contains("018"))
draw2d("MT2",15,200,500,"HT",15,800,3000,"MT2","HT", "hadronic_mt2sel5_mt2Vht",0,0,"susyhit_slhaScenario1_v02");
}
void comp7to10() {
initSamples("comp7to10");
setOutputDirectory("DelphesV07toV10");
int nbins;
float low,high;
TString var,xtitle;
doOverflowAddition(true);
doRatio_=false;
setStackMode(false,false,false); //stack,norm,label override
stackSignal_=false;
selection_ = "(1)"; //no cuts!
nbins=40; low=0; high=1000;
var="MET"; xtitle="MET (GeV)";
// if (plotsToMake.Contains("all")||plotsToMake.Contains("001"))
drawPlots(var,nbins,low,high,xtitle,"Events", "MET",0,"GeV");
nbins=40; low=0; high=2000;
var="HT"; xtitle="HT (GeV)";
// if (plotsToMake.Contains("all")||plotsToMake.Contains("001"))
drawPlots(var,nbins,low,high,xtitle,"Events", "HT",0,"GeV");
nbins=10; low=0; high=10;
var="njets40"; xtitle=var;
// if (plotsToMake.Contains("all")||plotsToMake.Contains("001"))
drawPlots(var,nbins,low,high,xtitle,"Events", "njets40",0,"GeV");
//nbjets is not trivial to plot
removeSample("tt-4p-0-600-v1510_14TEV_v10"); //plot only v07
savePlots_=false;
nbins=4; low=0; high=4;
var="nbjets40tight"; xtitle=var;
// if (plotsToMake.Contains("all")||plotsToMake.Contains("002"))
drawPlots(var,nbins,low,high,xtitle,"Events", var,0,"");
TH1D* bjets_v07=(TH1D*) totalsm->Clone("bjets_v07");
addSample("tt-4p-0-600-v1510_14TEV_v10",kBlue,"v10 tt");
removeSample("tt-4p-0-600-v1510_14TEV_v07"); //plot only v10
var="nbjets40medium"; xtitle=var;
// if (plotsToMake.Contains("all")||plotsToMake.Contains("002"))
drawPlots(var,nbins,low,high,xtitle,"Events", var,0,"");
TH1D* bjets_v10=(TH1D*) totalsm->Clone("bjets_v10");
renewCanvas();
bjets_v07->SetLineColor(kRed);
bjets_v10->SetLineColor(kBlue);
bjets_v10->Draw("e hist");
bjets_v07->Draw("e hist same");
thecanvas->SaveAs("DelphesV07toV10/bjets.pdf");
cout<<"Fraction of events in 0 b-tag bin (v07) = "<<bjets_v07->GetBinContent(1) / bjets_v07->Integral()<<endl;
cout<<"Fraction of events in 0 b-tag bin (v10) = "<<bjets_v10->GetBinContent(1) / bjets_v10->Integral()<<endl;
savePlots_=true;
}