1 |
buchmann |
1.1 |
#include <iostream>
|
2 |
|
|
|
3 |
|
|
using namespace std;
|
4 |
|
|
|
5 |
|
|
TGraphErrors* MakeErrorGraph(TH1F *histo) {
|
6 |
|
|
|
7 |
|
|
float dx[histo->GetNbinsX()];
|
8 |
|
|
float dy[histo->GetNbinsX()];
|
9 |
|
|
float x[histo->GetNbinsX()];
|
10 |
|
|
float y[histo->GetNbinsX()];
|
11 |
|
|
for(int i=1;i<=histo->GetNbinsX();i++) {
|
12 |
|
|
x[i-1]=histo->GetBinCenter(i);
|
13 |
|
|
y[i-1]=histo->GetBinContent(i);
|
14 |
|
|
if(i>1) dx[i-1]=(histo->GetBinCenter(i)-histo->GetBinCenter(i-1))/2.0;
|
15 |
|
|
else dx[i-1]=(histo->GetBinCenter(i+1)-histo->GetBinCenter(i))/2.0;
|
16 |
|
|
dy[i-1]=histo->GetBinError(i);
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
TGraphErrors *gr = new TGraphErrors(histo->GetNbinsX(),x,y,dx,dy);
|
20 |
|
|
gr->SetFillColor(TColor::GetColor("#2E9AFE"));
|
21 |
|
|
return gr;
|
22 |
|
|
}
|
23 |
|
|
|
24 |
fronga |
1.7 |
void ProduceMetPlotsWithCut(TCut cut, string name, float cutat, int njets, bool doMC = false ) {
|
25 |
buchmann |
1.1 |
TCanvas *tcan = new TCanvas("tcan","tcan");
|
26 |
|
|
cout << "Doing met plots" << endl;
|
27 |
buchmann |
1.2 |
stringstream MetBaseCuts;
|
28 |
fronga |
1.7 |
MetBaseCuts << "met[4]>" << cutat << "&&" << cut.GetTitle();
|
29 |
|
|
stringstream snjets;
|
30 |
|
|
snjets << njets;
|
31 |
buchmann |
1.2 |
TCut MetBaseCut(MetBaseCuts.str().c_str());
|
32 |
fronga |
1.10 |
TCut nJetsSignal(PlottingSetup::basicqualitycut&&("pfJetGoodNum40>="+snjets.str()).c_str());
|
33 |
|
|
TCut nJetsControl(("pfJetGoodID[0]!=0&&pfJetGoodNum40<"+snjets.str()).c_str());
|
34 |
buchmann |
1.1 |
|
35 |
|
|
//compute SF / OF rate in (CR1+CR2), should give 0.941 +/- 0.05
|
36 |
fronga |
1.7 |
|
37 |
|
|
// Create histograms
|
38 |
fronga |
1.9 |
//int nbins = 30;
|
39 |
|
|
int nbins = 60;
|
40 |
fronga |
1.7 |
float xmin=20., xmax = 320.;
|
41 |
fronga |
1.8 |
TH1F *mllsigEE =allsamples.Draw("mllsigEE","mll",nbins,xmin,xmax,"m_{ee} [GeV]", "events",TCut(cutOSSF&&MetBaseCut&&nJetsSignal&&"id1==0"),data,PlottingSetup::luminosity);
|
42 |
|
|
TH1F *mllsigMM =allsamples.Draw("mllsigMM","mll",nbins,xmin,xmax,"m_{#mu#mu} [GeV]","events",TCut(cutOSSF&&MetBaseCut&&nJetsSignal&&"id1==1"),data,PlottingSetup::luminosity);
|
43 |
|
|
TH1F *mllscon=allsamples.Draw("mllscon","mll",nbins,xmin,xmax,"m_{ll} [GeV]", "events",TCut(cutOSSF&&MetBaseCut&&nJetsControl),data,PlottingSetup::luminosity);
|
44 |
fronga |
1.7 |
TH1F *mllOsig = allsamples.Draw("mllOsig", "mll",nbins,xmin,xmax,"m_{ll} [GeV]","events",TCut(cutOSOF&&MetBaseCut&&nJetsSignal),data,PlottingSetup::luminosity);
|
45 |
|
|
TH1F *mllOscon = allsamples.Draw("mllOscon","mll",nbins,xmin,xmax,"m_{ll} [GeV]","events",TCut(cutOSOF&&MetBaseCut&&nJetsControl),data,PlottingSetup::luminosity);
|
46 |
|
|
|
47 |
fronga |
1.8 |
TH1F* mllsig = (TH1F*)mllsigEE->Clone("mllsig");
|
48 |
|
|
mllsig->Add(mllsigMM);
|
49 |
|
|
mllsig->GetXaxis()->SetTitle("m_{ll} [GeV]");
|
50 |
|
|
|
51 |
|
|
THStack *mcMllsig, *mcMllsigEE,*mcMllsigMM,*mcMllscon,*mcMllsconEE,*mcMllsconMM, *mcMllOsig, *mcMllOscon;
|
52 |
fronga |
1.7 |
if ( doMC ) {
|
53 |
|
|
name += "_mc";
|
54 |
fronga |
1.8 |
mcMllsig = new THStack(allsamples.DrawStack("mcMllsig","mll",nbins,xmin,xmax,"m_{ll} [GeV]","events",TCut(cutOSSF&&MetBaseCut&&nJetsSignal),mc,PlottingSetup::luminosity));
|
55 |
|
|
mcMllsigEE = new THStack(allsamples.DrawStack("mcMllsigEE","mll",nbins,xmin,xmax,"m_{ee} [GeV]","events",TCut(cutOSSF&&MetBaseCut&&nJetsSignal&&"id1==0"),mc,PlottingSetup::luminosity));
|
56 |
|
|
mcMllsigMM = new THStack(allsamples.DrawStack("mcMllsigMM","mll",nbins,xmin,xmax,"m_{#mu#mu} [GeV]","events",TCut(cutOSSF&&MetBaseCut&&nJetsSignal&&"id1==1"),mc,PlottingSetup::luminosity));
|
57 |
|
|
mcMllscon = new THStack(allsamples.DrawStack("mcMllscon","mll",nbins,xmin,xmax,"m_{ll} [GeV]","events",TCut(cutOSSF&&MetBaseCut&&nJetsControl),mc,PlottingSetup::luminosity));
|
58 |
|
|
mcMllOsig = new THStack(allsamples.DrawStack("mcMllOsig","mll",nbins,xmin,xmax,"m_{ll} [GeV]","events",TCut(cutOSOF&&MetBaseCut&&nJetsSignal),mc,PlottingSetup::luminosity));
|
59 |
fronga |
1.7 |
mcMllOscon= new THStack(allsamples.DrawStack("mcMllOscon","mll",nbins,xmin,xmax,"m_{ll} [GeV]","events",TCut(cutOSOF&&MetBaseCut&&nJetsControl),mc,PlottingSetup::luminosity));
|
60 |
fronga |
1.8 |
|
61 |
fronga |
1.7 |
}
|
62 |
fronga |
1.8 |
|
63 |
buchmann |
1.1 |
mllOsig->SetLineColor(kRed);
|
64 |
|
|
mllOscon->SetLineColor(kRed);
|
65 |
|
|
|
66 |
fronga |
1.7 |
TH1F *zlineshape = allsamples.Draw("zlineshape","mll",nbins,xmin,xmax,"m_{ll} (GeV)","events",cutOSSF&&TCut("pfJetGoodNum40==1")&&cut,data,PlottingSetup::luminosity);
|
67 |
fronga |
1.4 |
//float scalefactor=(mllsig->GetBinContent(mllsig->GetMaximumBin()-1)+mllsig->GetBinContent(mllsig->GetMaximumBin())+mllsig->GetBinContent(mllsig->GetMaximumBin()+1)-mllOsig->GetBinContent(mllsig->GetMaximumBin()-1)-mllOsig->GetBinContent(mllsig->GetMaximumBin())-mllOsig->GetBinContent(mllsig->GetMaximumBin())+1);
|
68 |
|
|
//scalefactor/=(zlineshape->GetBinContent(zlineshape->GetMaximumBin()-1)+zlineshape->GetBinContent(zlineshape->GetMaximumBin())+zlineshape->GetBinContent(zlineshape->GetMaximumBin()+1));
|
69 |
|
|
// Alternative scale factor: use 90+-5 GeV
|
70 |
buchmann |
1.6 |
Int_t scaleBinLow = mllsig->FindBin(86);
|
71 |
|
|
Int_t scaleBinHigh = mllsig->FindBin(94);
|
72 |
fronga |
1.4 |
float scalefactor = (mllsig->Integral(scaleBinLow,scaleBinHigh)-mllOsig->Integral(scaleBinLow,scaleBinHigh));
|
73 |
|
|
scalefactor /= zlineshape->Integral(scaleBinLow,scaleBinHigh);
|
74 |
buchmann |
1.6 |
|
75 |
|
|
cout << "Bins for scaling : " << scaleBinLow << " : " << scaleBinHigh << endl;
|
76 |
|
|
|
77 |
buchmann |
1.3 |
zlineshape->Scale(scalefactor);
|
78 |
|
|
zlineshape->SetLineColor(kBlue);
|
79 |
|
|
zlineshape->SetLineStyle(2);
|
80 |
|
|
|
81 |
|
|
TH1F *subtracted = (TH1F*)mllsig->Clone("subtracted");
|
82 |
|
|
TH1F *baseline = (TH1F*)mllOsig->Clone("baseline");
|
83 |
|
|
for(int i=1;i<=subtracted->GetNbinsX();i++) {
|
84 |
|
|
subtracted->SetBinContent(i,mllsig->GetBinContent(i)-mllOsig->GetBinContent(i));
|
85 |
|
|
baseline->SetBinContent(i,0);
|
86 |
|
|
}
|
87 |
|
|
|
88 |
|
|
TH1F *prediction = (TH1F*)mllOsig->Clone("prediction");
|
89 |
|
|
prediction->Add(zlineshape);
|
90 |
|
|
prediction->SetLineColor(TColor::GetColor("#CF35CA"));
|
91 |
fronga |
1.7 |
|
92 |
|
|
TH1F *control_prediction = (TH1F*)mllOscon->Clone("control_prediction");
|
93 |
|
|
control_prediction->SetLineColor(TColor::GetColor("#CF35CA"));
|
94 |
|
|
|
95 |
|
|
// FIX Y RANGE TO EASE COMPARISON
|
96 |
fronga |
1.10 |
mllsig->SetMaximum(60);
|
97 |
|
|
mllsigEE->SetMaximum(60);
|
98 |
|
|
mllsigMM->SetMaximum(60);
|
99 |
|
|
mllOsig->SetMaximum(60);
|
100 |
|
|
mllOscon->SetMaximum(140);
|
101 |
|
|
subtracted->SetMaximum(25);
|
102 |
|
|
subtracted->SetMinimum(-15);
|
103 |
fronga |
1.7 |
|
104 |
buchmann |
1.3 |
|
105 |
fronga |
1.7 |
// 1.- Signal region comparison
|
106 |
buchmann |
1.1 |
TBox *srbox = new TBox(20,0,70,mllsig->GetMaximum());
|
107 |
|
|
srbox->SetFillStyle(0);
|
108 |
|
|
srbox->SetLineColor(TColor::GetColor("#298A08"));
|
109 |
|
|
srbox->SetLineWidth(3);
|
110 |
fronga |
1.10 |
|
111 |
buchmann |
1.2 |
stringstream MetHeader;
|
112 |
|
|
MetHeader << "MET>" << cutat << " GeV";
|
113 |
fronga |
1.10 |
stringstream saveasSig;
|
114 |
|
|
saveasSig << "MetPlots/mll_sig" << cutat << "__" << name;
|
115 |
|
|
|
116 |
|
|
TLegend* leg;
|
117 |
|
|
if ( !doMC ) {
|
118 |
|
|
tcan->cd();
|
119 |
|
|
//mllsig->GetYaxis()->SetRangeUser(0,mllsig->GetMaximum()*1.2);
|
120 |
|
|
mllsig->Draw();
|
121 |
|
|
TGraphErrors *stat3j = MakeErrorGraph(prediction);
|
122 |
|
|
stat3j->Draw("2,same");
|
123 |
|
|
mllOsig->Draw("histo,same");
|
124 |
|
|
zlineshape->Draw("histo,same");
|
125 |
|
|
prediction->Draw("histo,same");
|
126 |
|
|
mllsig->Draw("same");
|
127 |
|
|
DrawPrelim();
|
128 |
|
|
leg = make_legend();
|
129 |
|
|
leg->SetX1(0.54);
|
130 |
|
|
leg->SetHeader(((string)"N_{jets}#geq"+snjets.str()+", "+MetHeader.str()).c_str());
|
131 |
|
|
leg->AddEntry(mllsig,"Data","PL");
|
132 |
|
|
leg->AddEntry(prediction,"All bg prediction","L");
|
133 |
fronga |
1.7 |
leg->AddEntry(mllOsig,"bg without Z","L");
|
134 |
|
|
leg->AddEntry(zlineshape,"Z lineshape","L");
|
135 |
|
|
leg->AddEntry(stat3j,"stat. uncert.","F");
|
136 |
fronga |
1.10 |
leg->AddEntry(srbox,"SR","F");
|
137 |
|
|
leg->Draw();
|
138 |
|
|
srbox->Draw();
|
139 |
|
|
CompleteSave(tcan,saveasSig.str());
|
140 |
|
|
} else {
|
141 |
|
|
TPad* rcan = new TPad("rcan","rcan",0,0,1,1);
|
142 |
|
|
rcan->cd();
|
143 |
|
|
mllsig->Draw();
|
144 |
|
|
mcMllsig->Draw("same");
|
145 |
|
|
prediction->Draw("histo,same");
|
146 |
|
|
mllsig->Draw("same");
|
147 |
|
|
DrawPrelim();
|
148 |
|
|
leg = allsamples.allbglegend();
|
149 |
|
|
leg->SetX1(0.54);
|
150 |
|
|
leg->AddEntry(prediction,"All bg prediction","L");
|
151 |
|
|
leg->AddEntry(srbox,"SR","F");
|
152 |
|
|
leg->Draw();
|
153 |
|
|
srbox->Draw();
|
154 |
|
|
save_with_ratio( mllsig, *mcMllsig, rcan, saveasSig.str() );
|
155 |
fronga |
1.7 |
}
|
156 |
buchmann |
1.1 |
|
157 |
|
|
|
158 |
fronga |
1.8 |
// 1b. MC: split ee and mumu
|
159 |
|
|
if ( doMC ) {
|
160 |
fronga |
1.10 |
TPad* rcan = new TPad("rcan","rcan",0,0,1,1);
|
161 |
|
|
rcan->cd();
|
162 |
fronga |
1.8 |
mllsigEE->Draw();
|
163 |
|
|
mcMllsigEE->Draw("same");
|
164 |
|
|
mllsigEE->Draw("same");
|
165 |
|
|
DrawPrelim();
|
166 |
|
|
leg->Draw();
|
167 |
|
|
srbox->Draw();
|
168 |
fronga |
1.10 |
save_with_ratio( mllsigEE, *mcMllsigEE,rcan->cd(),saveasSig.str()+"_ee" );
|
169 |
fronga |
1.8 |
|
170 |
fronga |
1.10 |
rcan = new TPad("rcan","rcan",0,0,1,1);
|
171 |
|
|
rcan->cd();
|
172 |
fronga |
1.8 |
mllsigMM->Draw();
|
173 |
|
|
mcMllsigMM->Draw("same");
|
174 |
|
|
mllsigMM->Draw("same");
|
175 |
|
|
DrawPrelim();
|
176 |
|
|
leg->Draw();
|
177 |
|
|
srbox->Draw();
|
178 |
fronga |
1.10 |
save_with_ratio( mllsigMM, *mcMllsigMM,rcan,saveasSig.str()+"_mm" );
|
179 |
fronga |
1.8 |
}
|
180 |
buchmann |
1.1 |
|
181 |
fronga |
1.7 |
// 2.- Signal region comparison - LOG scale
|
182 |
fronga |
1.10 |
if ( !doMC ) {
|
183 |
|
|
tcan->cd();
|
184 |
|
|
mllsig->SetMinimum(0.2); // FIX Y RANGE TO EASE COMPARISON
|
185 |
|
|
//mllsig->SetMaximum(mllsig->GetMaximum()*4.0);
|
186 |
|
|
srbox->SetY2(mllsig->GetMaximum());
|
187 |
|
|
|
188 |
|
|
tcan->SetLogy(1);
|
189 |
|
|
stringstream saveasSig2;
|
190 |
|
|
saveasSig2 << "MetPlots/mll_sig_ZLINESHAPE_" << cutat << "__" << name;
|
191 |
|
|
|
192 |
|
|
CompleteSave(tcan,saveasSig2.str());
|
193 |
|
|
tcan->SetLogy(0);
|
194 |
|
|
}
|
195 |
buchmann |
1.1 |
|
196 |
fronga |
1.7 |
|
197 |
|
|
// 3.- Signal region, background subtracted
|
198 |
fronga |
1.8 |
if ( !doMC ) {
|
199 |
fronga |
1.10 |
tcan->cd();
|
200 |
fronga |
1.8 |
for(int i=1;i<subtracted->GetNbinsX();i++) {
|
201 |
|
|
subtracted->SetBinContent(i,subtracted->GetBinContent(i)-zlineshape->GetBinContent(i));
|
202 |
|
|
}
|
203 |
buchmann |
1.3 |
|
204 |
fronga |
1.8 |
TGraphErrors *subtrerr = MakeErrorGraph(baseline);
|
205 |
|
|
subtracted->Draw();
|
206 |
|
|
subtrerr->Draw("2,same");
|
207 |
|
|
subtracted->Draw("same");
|
208 |
|
|
DrawPrelim();
|
209 |
|
|
TLegend *DiffLeg = make_legend();
|
210 |
|
|
DiffLeg->SetX1(0.3);
|
211 |
|
|
DiffLeg->SetFillStyle(0);
|
212 |
|
|
DiffLeg->AddEntry(subtracted,"observed - predicted","PL");
|
213 |
|
|
DiffLeg->AddEntry(subtrerr,"stat. uncert on prediction","F");
|
214 |
|
|
DiffLeg->AddEntry((TObject*)0,"","");
|
215 |
|
|
DiffLeg->AddEntry((TObject*)0,"","");
|
216 |
|
|
DiffLeg->Draw();
|
217 |
|
|
|
218 |
|
|
stringstream saveasSigSub;
|
219 |
|
|
saveasSigSub << "MetPlots/mll_sig_SUBTRACTED_" << cutat << "__" << name;
|
220 |
|
|
|
221 |
|
|
CompleteSave(tcan,saveasSigSub.str());
|
222 |
fronga |
1.5 |
|
223 |
fronga |
1.8 |
// 4.- Signal region, background subtracted, errors added in quadrature
|
224 |
|
|
TGraphErrors *subtrerr2 = (TGraphErrors*)subtrerr->Clone("subtrerr2");
|
225 |
|
|
for(int i=0;i<subtrerr2->GetN();i++) {
|
226 |
|
|
subtrerr2->SetPoint(i,subtracted->GetBinCenter(i),subtracted->GetBinContent(i));
|
227 |
|
|
subtrerr2->SetPointError(i,subtrerr2->GetErrorX(i),TMath::Sqrt(subtrerr2->GetErrorY(i)*subtrerr2->GetErrorY(i)+subtracted->GetBinError(i)*subtracted->GetBinError(i)));
|
228 |
|
|
}
|
229 |
|
|
TLine* l = new TLine(subtracted->GetBinLowEdge(1),0.,subtracted->GetBinLowEdge(subtracted->GetNbinsX()-1)+subtracted->GetBinWidth(1),0.);
|
230 |
|
|
l->SetLineWidth(subtracted->GetLineWidth());
|
231 |
|
|
subtracted->Draw();
|
232 |
|
|
subtrerr2->Draw("2,same");
|
233 |
|
|
l->Draw("same");
|
234 |
|
|
subtracted->Draw("same");
|
235 |
|
|
DrawPrelim();
|
236 |
|
|
TLegend *DiffLeg2 = make_legend();
|
237 |
|
|
DiffLeg2->SetX1(0.3);
|
238 |
|
|
DiffLeg2->SetFillStyle(0);
|
239 |
|
|
DiffLeg2->AddEntry(subtracted,"observed - predicted","PL");
|
240 |
|
|
DiffLeg2->AddEntry(subtrerr2,"stat. uncert on prediction","F");
|
241 |
|
|
DiffLeg2->AddEntry((TObject*)0,"","");
|
242 |
|
|
DiffLeg2->AddEntry((TObject*)0,"","");
|
243 |
|
|
DiffLeg2->Draw();
|
244 |
|
|
|
245 |
|
|
stringstream saveasSigSub2;
|
246 |
|
|
saveasSigSub2 << "MetPlots/mll_sig_SUBTRACTED_quadr_" << cutat << "__" << name;
|
247 |
fronga |
1.5 |
|
248 |
fronga |
1.8 |
CompleteSave(tcan,saveasSigSub2.str());
|
249 |
fronga |
1.5 |
|
250 |
fronga |
1.8 |
delete DiffLeg;
|
251 |
|
|
delete DiffLeg2;
|
252 |
|
|
} // !doMC
|
253 |
buchmann |
1.3 |
|
254 |
|
|
|
255 |
fronga |
1.7 |
// 5.- Control region comparison
|
256 |
buchmann |
1.6 |
scalefactor = (mllscon->Integral(scaleBinLow,scaleBinHigh)-mllOscon->Integral(scaleBinLow,scaleBinHigh));
|
257 |
|
|
scalefactor /= zlineshape->Integral(scaleBinLow,scaleBinHigh);
|
258 |
|
|
zlineshape->Scale(scalefactor);
|
259 |
|
|
control_prediction->Add(zlineshape);
|
260 |
fronga |
1.10 |
control_prediction->SetMaximum(140); // FIX Y RANGE TO EASE COMPARISON
|
261 |
fronga |
1.7 |
|
262 |
buchmann |
1.6 |
TBox *cr1box = new TBox(20,0,70,control_prediction->GetMaximum());
|
263 |
buchmann |
1.1 |
cr1box->SetFillStyle(0);
|
264 |
|
|
cr1box->SetLineColor(TColor::GetColor("#0404B4"));
|
265 |
|
|
cr1box->SetLineWidth(3);
|
266 |
|
|
|
267 |
buchmann |
1.6 |
TBox *cr2box = new TBox(150,0,320,control_prediction->GetMaximum());
|
268 |
buchmann |
1.1 |
cr2box->SetFillStyle(0);
|
269 |
|
|
cr2box->SetLineColor(TColor::GetColor("#0404B4"));
|
270 |
|
|
cr2box->SetLineWidth(3);
|
271 |
|
|
cr2box->SetLineStyle(2);
|
272 |
|
|
|
273 |
fronga |
1.10 |
stringstream saveasCon;
|
274 |
|
|
saveasCon << "MetPlots/mll_con" << cutat << "__" << name;
|
275 |
|
|
|
276 |
fronga |
1.7 |
TLegend *legc;
|
277 |
fronga |
1.10 |
//control_prediction->GetYaxis()->SetRangeUser(0,control_prediction->GetMaximum()*1.3);
|
278 |
|
|
if ( !doMC ) {
|
279 |
|
|
tcan->cd();
|
280 |
|
|
control_prediction->Draw("hist");
|
281 |
|
|
TGraphErrors *stat2j = MakeErrorGraph(control_prediction);
|
282 |
|
|
stat2j->Draw("2,same");
|
283 |
|
|
mllOscon->Draw("same,hist");
|
284 |
|
|
zlineshape->Draw("histo,same");
|
285 |
|
|
control_prediction->Draw("histo,same");
|
286 |
|
|
mllscon->Draw("same");
|
287 |
|
|
DrawPrelim();
|
288 |
fronga |
1.7 |
legc = make_legend();
|
289 |
fronga |
1.10 |
legc->SetX1(0.54);
|
290 |
|
|
legc->SetHeader(((string)"N_{jets} < "+snjets.str()+", "+MetHeader.str()).c_str());
|
291 |
|
|
legc->AddEntry(mllscon,"Data","PL");
|
292 |
|
|
legc->AddEntry(control_prediction,"All bg","L");
|
293 |
fronga |
1.7 |
legc->AddEntry(zlineshape,"Z lineshape","L");
|
294 |
|
|
legc->AddEntry(mllOscon,"bg without Z","L");
|
295 |
|
|
legc->AddEntry(stat2j,"stat. uncert.","F");
|
296 |
fronga |
1.10 |
legc->AddEntry(cr1box,"CR1","F");
|
297 |
|
|
legc->AddEntry(cr2box,"CR2","F");
|
298 |
|
|
legc->Draw();
|
299 |
|
|
cr1box->Draw();
|
300 |
|
|
cr2box->Draw();
|
301 |
|
|
CompleteSave(tcan,saveasCon.str());
|
302 |
|
|
} else {
|
303 |
|
|
TPad* rcan = new TPad("rcan","rcan",0,0,1,1);
|
304 |
|
|
rcan->cd();
|
305 |
|
|
control_prediction->Draw("hist");
|
306 |
|
|
mcMllscon->Draw("same");
|
307 |
|
|
control_prediction->Draw("histo,same");
|
308 |
|
|
mllscon->Draw("same");
|
309 |
|
|
DrawPrelim();
|
310 |
|
|
legc = allsamples.allbglegend();
|
311 |
|
|
legc->SetX1(0.54);
|
312 |
|
|
legc->SetHeader(((string)"N_{jets} < "+snjets.str()+", "+MetHeader.str()).c_str());
|
313 |
|
|
legc->AddEntry(control_prediction,"All bg","L");
|
314 |
|
|
legc->AddEntry(cr1box,"CR1","F");
|
315 |
|
|
legc->AddEntry(cr2box,"CR2","F");
|
316 |
|
|
legc->Draw();
|
317 |
|
|
cr1box->Draw();
|
318 |
|
|
cr2box->Draw();
|
319 |
|
|
save_with_ratio( mllscon, *mcMllscon, rcan, saveasCon.str());
|
320 |
|
|
}
|
321 |
buchmann |
1.1 |
|
322 |
fronga |
1.7 |
// 6. - Opposite-flavour data/MC comparison
|
323 |
|
|
if ( doMC ) {
|
324 |
fronga |
1.10 |
TPad* rcan = new TPad("rcan","rcan",0,0,1,1);
|
325 |
|
|
rcan->cd();
|
326 |
fronga |
1.7 |
mllOsig->SetLineColor(kBlack);
|
327 |
|
|
mllOsig->Draw();
|
328 |
|
|
mcMllOsig->Draw("same");
|
329 |
|
|
mllOsig->Draw("same");
|
330 |
|
|
TLegend *legsdm = allsamples.allbglegend();
|
331 |
|
|
legsdm->SetHeader(((string)"N_{jets}#geq"+snjets.str()+", "+MetHeader.str()+", OF").c_str());
|
332 |
|
|
legsdm->SetX1(0.54);
|
333 |
|
|
legsdm->Draw();
|
334 |
|
|
stringstream saveasSigOF;
|
335 |
|
|
saveasSigOF << "MetPlots/mll_sig_of_" << cutat << "__" << name;
|
336 |
fronga |
1.10 |
save_with_ratio( mllOsig, *mcMllOsig, rcan, saveasSigOF.str());
|
337 |
fronga |
1.7 |
|
338 |
fronga |
1.10 |
rcan = new TPad("rcan","rcan",0,0,1,1);
|
339 |
|
|
rcan->cd();
|
340 |
fronga |
1.7 |
mllOscon->SetLineColor(kBlack);
|
341 |
|
|
mllOscon->Draw();
|
342 |
|
|
mcMllOscon->Draw("same");
|
343 |
|
|
mllOscon->Draw("same");
|
344 |
|
|
TLegend *legcdm = allsamples.allbglegend();
|
345 |
|
|
legcdm->SetHeader(((string)"N_{jets}<"+snjets.str()+", "+MetHeader.str()+", OF").c_str());
|
346 |
|
|
legcdm->SetX1(0.54);
|
347 |
|
|
legcdm->Draw();
|
348 |
|
|
stringstream saveasConOF;
|
349 |
|
|
saveasConOF << "MetPlots/mll_con_of_" << cutat << "__" << name;
|
350 |
fronga |
1.10 |
save_with_ratio( mllOscon, *mcMllOscon, rcan, saveasConOF.str());
|
351 |
|
|
|
352 |
fronga |
1.7 |
delete legsdm;
|
353 |
|
|
delete legcdm;
|
354 |
fronga |
1.10 |
}
|
355 |
fronga |
1.7 |
|
356 |
fronga |
1.10 |
// Memory clean-up
|
357 |
|
|
if (doMC) {
|
358 |
fronga |
1.7 |
delete mcMllscon;
|
359 |
|
|
delete mcMllOscon;
|
360 |
|
|
delete mcMllsig;
|
361 |
fronga |
1.8 |
delete mcMllsigEE;
|
362 |
|
|
delete mcMllsigMM;
|
363 |
fronga |
1.7 |
delete mcMllOsig;
|
364 |
|
|
}
|
365 |
buchmann |
1.1 |
|
366 |
|
|
delete cr1box;
|
367 |
|
|
delete cr2box;
|
368 |
|
|
delete srbox;
|
369 |
|
|
delete legc;
|
370 |
|
|
delete leg;
|
371 |
fronga |
1.7 |
|
372 |
buchmann |
1.1 |
delete mllscon;
|
373 |
|
|
delete mllOscon;
|
374 |
|
|
delete mllsig;
|
375 |
fronga |
1.8 |
delete mllsigEE;
|
376 |
|
|
delete mllsigMM;
|
377 |
buchmann |
1.1 |
delete mllOsig;
|
378 |
fronga |
1.7 |
delete zlineshape;
|
379 |
buchmann |
1.6 |
delete tcan;
|
380 |
buchmann |
1.1 |
}
|
381 |
|
|
|
382 |
|
|
void DoMetPlots() {
|
383 |
fronga |
1.7 |
float metCuts[] = { 100., 150. };
|
384 |
|
|
int jetCuts[] = { 3, 2 };
|
385 |
|
|
string leptCuts[] = { "pt1>20&&pt2>20&&abs(eta1)<1.4&&abs(eta2)<1.4",
|
386 |
fronga |
1.10 |
//"pt1>20&&pt2>20&&abs(eta1)<1.4&&abs(eta2)<1.4"
|
387 |
fronga |
1.7 |
"pt1>20&&pt2>10"
|
388 |
|
|
};
|
389 |
|
|
bool nomc(0),domc(1);
|
390 |
|
|
for ( int i=0; i<2; ++i ) {
|
391 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&"+leptCuts[i]).c_str()),"",metCuts[i], jetCuts[i],nomc);
|
392 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&"+leptCuts[i]).c_str()),"",metCuts[i], jetCuts[i],domc);
|
393 |
fronga |
1.10 |
// continue;
|
394 |
fronga |
1.7 |
if (!PlottingSetup::is53reco) { // Old 5_2
|
395 |
fronga |
1.10 |
ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag==0&&"+leptCuts[i]).c_str()),"bTagVeto30",metCuts[i], jetCuts[i], nomc);
|
396 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag>0&&"+leptCuts[i]).c_str()),"AtLeastOneBJet30",metCuts[i], jetCuts[i], nomc);
|
397 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag==0&&"+leptCuts[i]).c_str()),"bTagVeto30",metCuts[i], jetCuts[i], domc);
|
398 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag>0&&"+leptCuts[i]).c_str()),"AtLeastOneBJet30",metCuts[i], jetCuts[i], domc);
|
399 |
fronga |
1.7 |
} else {
|
400 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag30==0&&"+leptCuts[i]).c_str()),"bTagVeto30",metCuts[i], jetCuts[i],nomc);
|
401 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag30>0&&"+leptCuts[i]).c_str()),"AtLeastOneBJet30",metCuts[i], jetCuts[i],nomc);
|
402 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag30==0&&"+leptCuts[i]).c_str()),"bTagVeto30",metCuts[i], jetCuts[i],domc);
|
403 |
|
|
ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag30>0&&"+leptCuts[i]).c_str()),"AtLeastOneBJet30",metCuts[i], jetCuts[i],domc);
|
404 |
fronga |
1.10 |
// ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag40==0&&"+leptCuts[i]).c_str()),"bTagVeto40",metCuts[i], jetCuts[i]);
|
405 |
|
|
// ProduceMetPlotsWithCut(TCut(("mll>20&&pfJetGoodNumBtag40>0&&"+leptCuts[i]).c_str()),"AtLeastOneBJet40",metCuts[i], jetCuts[i]);
|
406 |
fronga |
1.7 |
}
|
407 |
|
|
}
|
408 |
buchmann |
1.1 |
}
|