33 |
|
|
34 |
|
|
35 |
|
|
36 |
< |
void find_one_peak_combination(TCut specialcut, float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, float &MCSigma, float &MCSigmaError, float &DataSigma, float& DataSigmaError, stringstream &result, bool doPUreweighting = true, string saveas="") |
36 |
> |
void find_one_peak_combination(TCut specialcut, bool SwitchOffNJetsCut, float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, float &MCSigma, float &MCSigmaError, float &DataSigma, float& DataSigmaError, stringstream &result, bool doPUreweighting = true, string saveas="") |
37 |
|
{ |
38 |
|
// Temporarily switch off PU reweighting, if asked |
39 |
|
TCut weightbackup=cutWeight; |
42 |
|
int nbins=100; |
43 |
|
if(PlottingSetup::DoBTag) nbins=25; |
44 |
|
|
45 |
+ |
TCut nJetsCut(cutnJets); |
46 |
+ |
if(SwitchOffNJetsCut) nJetsCut=specialcut; |
47 |
+ |
|
48 |
|
TCanvas *tempcan = new TCanvas("tempcan","Temporary canvas for peak finding preparations"); |
49 |
< |
TH1F *rawJZBeemmMC = allsamples.Draw("rawJZBeemmMC",jzbvariablemc,nbins,-50,50, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&specialcut,mc, luminosity); |
50 |
< |
TH1F *rawJZBeemmData = allsamples.Draw("rawJZBeemmData",jzbvariabledata,nbins, -50,50, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&specialcut,data, luminosity); |
51 |
< |
TH1F *rawJZBemMC = allsamples.Draw("rawJZBemMC",jzbvariablemc,nbins,-50,50, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&specialcut,mc, luminosity); |
52 |
< |
TH1F *rawJZBemData = allsamples.Draw("rawJZBemData",jzbvariabledata,nbins, -50,50, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&specialcut,data, luminosity); |
49 |
> |
TH1F *rawJZBeemmMC = allsamples.Draw("rawJZBeemmMC",jzbvariablemc,nbins,-50,50, "JZB [GeV]", "events", cutmass&&cutOSSF&&nJetsCut&&specialcut,mc, luminosity); |
50 |
> |
TH1F *rawJZBeemmData = allsamples.Draw("rawJZBeemmData",jzbvariabledata,nbins, -50,50, "JZB [GeV]", "events", cutmass&&cutOSSF&&nJetsCut&&specialcut,data, luminosity); |
51 |
> |
TH1F *rawJZBemMC = allsamples.Draw("rawJZBemMC",jzbvariablemc,nbins,-50,50, "JZB [GeV]", "events", cutmass&&cutOSOF&&nJetsCut&&specialcut,mc, luminosity); |
52 |
> |
TH1F *rawJZBemData = allsamples.Draw("rawJZBemData",jzbvariabledata,nbins, -50,50, "JZB [GeV]", "events", cutmass&&cutOSOF&&nJetsCut&&specialcut,data, luminosity); |
53 |
|
TH1F *rawttbarjzbeemmMC; |
54 |
|
|
55 |
|
if(method==doKM) { |
56 |
|
//we only need this histo for the KM fitting... |
57 |
< |
rawttbarjzbeemmMC = allsamples.Draw("rawttbarjzbeemmMC",jzbvariablemc,nbins, -50,50, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&&specialcut,mc,luminosity,allsamples.FindSample("TTJet")); |
57 |
> |
rawttbarjzbeemmMC = allsamples.Draw("rawttbarjzbeemmMC",jzbvariablemc,nbins, -50,50, "JZB [GeV]", "events",cutmass&&cutOSSF&&nJetsCut&&specialcut,mc,luminosity,allsamples.FindSample("TTJet")); |
58 |
|
MCPeak=find_peak(rawJZBeemmMC, rawttbarjzbeemmMC, -40, 40, mc, MCPeakError,MCSigma,MCSigmaError,method,saveas); |
59 |
|
DataPeak=find_peak(rawJZBeemmData, rawJZBeemmData, -40, 40, data, DataPeakError,DataSigma,DataSigmaError,method,saveas); |
60 |
|
delete rawttbarjzbeemmMC; |
87 |
|
delete tempcan; |
88 |
|
} |
89 |
|
|
90 |
< |
void find_peaks(float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, stringstream &result, bool doPUreweighting, stringstream &datajzb, stringstream &mcjzb) |
90 |
> |
void find_peaks(float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, stringstream &result, bool doPUreweighting, stringstream &datajzb, stringstream &mcjzb, string sSpecialCut="", bool SwitchOffNJetsCut=false) |
91 |
|
{ |
92 |
+ |
bool overunderflowstatus=addoverunderflowbins; |
93 |
+ |
switch_overunderflow(false); |
94 |
+ |
|
95 |
+ |
TCut SpecialCut("mll>=0"); |
96 |
+ |
if(sSpecialCut!="") SpecialCut=TCut(sSpecialCut.c_str()); |
97 |
|
|
98 |
|
bool DoInvidualeemmPeaks=false; |
99 |
|
|
109 |
|
float mcSigma,mcSigmaError, dataSigma, dataSigmaError; |
110 |
|
|
111 |
|
dout << "Finding global peak : " << endl; |
112 |
< |
find_one_peak_combination(TCut(""),mcpeak,mcpeakerr, datapeak,datapeakerr,mcSigma,mcSigmaError, dataSigma,dataSigmaError,result,doPUreweighting,""); |
112 |
> |
find_one_peak_combination(SpecialCut,SwitchOffNJetsCut,mcpeak,mcpeakerr, datapeak,datapeakerr,mcSigma,mcSigmaError, dataSigma,dataSigmaError,result,doPUreweighting,""); |
113 |
|
|
114 |
|
if(DoInvidualeemmPeaks) { |
115 |
|
dout << "Finding peak for electrons : " << endl; |
116 |
< |
find_one_peak_combination(TCut("id1==0"),mceepeak,mceepeakerr,dataeepeak,dataeepeakerr,mcSigma,mcSigmaError,dataSigma,dataSigmaError,result,doPUreweighting,"_ele"); |
116 |
> |
find_one_peak_combination(SpecialCut&&TCut("id1==0"),SwitchOffNJetsCut,mceepeak,mceepeakerr,dataeepeak,dataeepeakerr,mcSigma,mcSigmaError,dataSigma,dataSigmaError,result,doPUreweighting,"_ele"); |
117 |
|
dout << "Finding peak for muons : " << endl; |
118 |
< |
find_one_peak_combination(TCut("id1==1"),mcmmpeak,mcmmpeakerr,datammpeak,datammpeakerr,mcSigma,mcSigmaError,dataSigma,dataSigmaError,result,doPUreweighting,"_mu"); |
118 |
> |
find_one_peak_combination(SpecialCut&&TCut("id1==1"),SwitchOffNJetsCut,mcmmpeak,mcmmpeakerr,datammpeak,datammpeakerr,mcSigma,mcSigmaError,dataSigma,dataSigmaError,result,doPUreweighting,"_mu"); |
119 |
|
|
120 |
|
datajzb << "(" << jzbvariabledata; |
121 |
|
mcjzb << "(" << jzbvariablemc; |
141 |
|
else mcjzb << "+ (id1!=id2)*" << TMath::Abs(mcpeak) << " "; |
142 |
|
|
143 |
|
mcjzb << ")"; |
144 |
+ |
|
145 |
|
} else { |
146 |
|
datajzb << "(" << jzbvariabledata; |
147 |
|
mcjzb << "(" << jzbvariablemc; |
157 |
|
mcjzb << ")"; |
158 |
|
} |
159 |
|
|
160 |
< |
|
160 |
> |
MCPeak=mcpeak; |
161 |
> |
MCPeakError=mcpeakerr; |
162 |
> |
DataPeak=datapeak; |
163 |
> |
DataPeakError=datapeakerr; |
164 |
> |
switch_overunderflow(overunderflowstatus); |
165 |
|
} |
166 |
|
|
167 |
|
void make_special_obs_pred_mll_plot(string datajzb, string mcjzb, float jzbthreshold, float binWidth = 5.0) { |
201 |
|
|
202 |
|
// TH1F *RcorrJZBeemmNoS; |
203 |
|
|
204 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
204 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
205 |
|
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzeroD,data, luminosity); |
206 |
|
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzeroD,data, luminosity); |
207 |
|
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzeroD,data, luminosity); |
212 |
|
TH1F* SFN = (TH1F*)LcorrJZBeemm->Clone("SFN"); |
213 |
|
TH1F* OFP = (TH1F*)RcorrJZBem->Clone("OFP"); |
214 |
|
TH1F* OFN = (TH1F*)LcorrJZBem->Clone("OFN"); |
215 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
215 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
216 |
|
OFP->Scale(1.0/3.0); |
217 |
|
OFP->Add(RcorrJZBSBem,1.0/3.); |
218 |
|
OFP->Add(RcorrJZBSBeemm,1.0/3.); |
228 |
|
|
229 |
|
RcorrJZBeemm->SetTitleOffset(1.3,"y"); |
230 |
|
RcorrJZBeemm->Draw(); |
231 |
< |
mcRcorrJZBeemm.Draw("same"); |
231 |
> |
mcRcorrJZBeemm.Draw("histo,same"); |
232 |
|
Bpred->Draw("histo,same"); |
233 |
|
RcorrJZBeemm->Draw("same"); |
234 |
|
|
277 |
|
delete LcorrJZBeemm; |
278 |
|
delete RcorrJZBem; |
279 |
|
delete LcorrJZBem; |
280 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
280 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
281 |
|
delete RcorrJZBSBeemm; |
282 |
|
delete LcorrJZBSBeemm; |
283 |
|
delete RcorrJZBSBem; |
285 |
|
} |
286 |
|
delete Bpred; |
287 |
|
delete ckin; |
288 |
+ |
CleanLegends(); |
289 |
|
} |
290 |
|
|
291 |
|
void make_special_mll_plot(int nbins, float min, float max, bool logscale,string xlabel) { |
306 |
|
datahistoOSSF->SetMarkerSize(DataMarkerSize); |
307 |
|
datahistoOSSF->Draw(); |
308 |
|
|
309 |
< |
mcstackOSSF.Draw("same"); |
309 |
> |
mcstackOSSF.Draw("histo,same"); |
310 |
|
datahistoOSSF->Draw("same"); |
311 |
|
|
312 |
|
datahistoOSOF->SetMarkerColor(TColor::GetColor("#FE642E")); |
332 |
|
delete datahistoOSOF; |
333 |
|
delete datahistoOSSF; |
334 |
|
delete ckin; |
335 |
+ |
CleanLegends(); |
336 |
|
} |
337 |
|
|
338 |
|
|
373 |
|
oneline->Draw("same"); |
374 |
|
} |
375 |
|
|
376 |
< |
void make_OFSF_plot(string variable, string addcut, string legendTitle, int nbins, float min, float max, bool logscale, |
377 |
< |
string xlabel, string filename, bool isPF=true, bool plotratio=true, bool loadlastminmax=false, float legendPosition=0.3) { |
376 |
> |
float make_one_OFSF_plot(string variable, string addcut, string legendTitle, int nbins, float min, float max, float ymax, bool logscale, |
377 |
> |
string xlabel, string filename, float legendPosition=0.55) { |
378 |
|
|
379 |
|
TCut ibasiccut=basiccut; |
380 |
|
bool draw_separation_lines=false; |
381 |
|
|
367 |
– |
if(isPF) ibasiccut=basiccut&&"pfjzb[0]>-998"; |
368 |
– |
|
382 |
|
if(addcut != "") ibasiccut = ibasiccut && addcut.c_str(); |
383 |
|
|
384 |
|
TCut cutSF; |
385 |
|
TCut cutOF; |
386 |
|
|
387 |
< |
cutOF=cutOSOF&&cutnJets&&ibasiccut; |
388 |
< |
cutSF=cutOSSF&&cutnJets&&ibasiccut; |
387 |
> |
cutOF = cutOSOF&&cutnJets&&ibasiccut; |
388 |
> |
cutSF = cutOSSF&&cutnJets&&ibasiccut; |
389 |
> |
|
390 |
> |
TCanvas *ofsf_can = new TCanvas("ofsf_can","ofsf_can"); |
391 |
|
|
392 |
+ |
TPad* rcan = new TPad("rcan","rcan",0,0,1,1); |
393 |
+ |
rcan->SetLogy(logscale); |
394 |
+ |
rcan->cd(); |
395 |
|
|
396 |
< |
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
379 |
< |
ckin->SetLogy(logscale); |
396 |
> |
std::cout << "OF/SF comparison: variable = " << variable << ", cut = " << cutSF.GetTitle() << std::endl; |
397 |
|
TH1F *datahistoSF = allsamples.Draw("datahistoSF",variable,nbins,min,max, xlabel, "events",cutSF,data,luminosity); |
398 |
|
TH1F *datahistoOF = allsamples.Draw("datahistoOF",variable,nbins,min,max, xlabel, "events",cutOF,data,luminosity); |
399 |
< |
string signal("LM3"); |
400 |
< |
TH1F* signalhisto = new TH1F("signalhisto",signal.c_str(),nbins,min,max); |
401 |
< |
int idx = signalsamples.FindSample(signal)[0]; |
402 |
< |
(signalsamples.collection)[idx].events->Project("signalhisto",variable.c_str(),cutSF); |
403 |
< |
signalhisto->Scale((signalsamples.collection)[idx].weight*luminosity); |
404 |
< |
signalhisto->SetLineColor((signalsamples.collection)[idx].samplecolor); |
399 |
> |
// string signal("LM3"); |
400 |
> |
// TH1F* signalhisto = new TH1F("signalhisto",signal.c_str(),nbins,min,max); |
401 |
> |
// int idx = signalsamples.FindSample(signal)[0]; |
402 |
> |
// (signalsamples.collection)[idx].events->Project("signalhisto",variable.c_str(),cutSF); |
403 |
> |
// signalhisto->Scale((signalsamples.collection)[idx].weight*luminosity); |
404 |
> |
// signalhisto->SetLineColor((signalsamples.collection)[idx].samplecolor); |
405 |
> |
// signalhisto->SetLineStyle(2); |
406 |
|
datahistoSF->SetMarkerSize(DataMarkerSize); |
407 |
|
datahistoOF->SetLineColor(kRed); |
408 |
|
|
409 |
|
if ( !logscale ) { |
410 |
|
datahistoSF->SetMinimum(0); // Defaults |
393 |
– |
datahistoOF->SetMinimum(0); // Defaults |
411 |
|
} else { |
412 |
|
datahistoSF->SetMinimum(0.5); |
396 |
– |
datahistoOF->SetMinimum(0.5); |
413 |
|
} |
414 |
< |
if (logscale) { |
415 |
< |
datahistoSF->SetMaximum(5.3*datahistoSF->GetMaximum()); |
416 |
< |
datahistoOF->SetMaximum(5.3*datahistoSF->GetMaximum()); |
414 |
> |
if (ymax<0) { |
415 |
> |
if ( logscale ) datahistoSF->SetMaximum(5.3*datahistoSF->GetMaximum()); |
416 |
> |
else datahistoSF->SetMaximum(0.8*datahistoSF->GetMaximum()); |
417 |
|
} else { |
418 |
< |
datahistoSF->SetMaximum(2.0*datahistoSF->GetMaximum()); |
403 |
< |
datahistoOF->SetMaximum(2.0*datahistoOF->GetMaximum()); |
418 |
> |
datahistoSF->SetMaximum(ymax); |
419 |
|
} |
420 |
|
|
421 |
+ |
float ymaxSet = datahistoSF->GetMaximum(); |
422 |
+ |
|
423 |
|
datahistoSF->GetXaxis()->SetTitle(xlabel.c_str()); |
424 |
< |
datahistoOF->GetXaxis()->SetTitle(xlabel.c_str()); |
408 |
< |
signalhisto->GetXaxis()->SetTitle(xlabel.c_str()); |
409 |
< |
datahistoSF->GetYaxis()->SetTitle("N. Events"); |
410 |
< |
datahistoOF->GetYaxis()->SetTitle("N. Events"); |
411 |
< |
signalhisto->GetYaxis()->SetTitle("N. Events"); |
424 |
> |
datahistoSF->GetYaxis()->SetTitle("Events"); |
425 |
|
datahistoSF->GetXaxis()->CenterTitle(); |
413 |
– |
datahistoOF->GetXaxis()->CenterTitle(); |
414 |
– |
signalhisto->GetXaxis()->CenterTitle(); |
426 |
|
datahistoSF->GetYaxis()->CenterTitle(); |
416 |
– |
datahistoOF->GetYaxis()->CenterTitle(); |
417 |
– |
signalhisto->GetYaxis()->CenterTitle(); |
427 |
|
|
428 |
< |
TLegend *mleg = new TLegend(0.2+legendPosition, 0.72, 0.55+legendPosition, 0.87, legendTitle.c_str()); |
429 |
< |
mleg->SetFillColor(kWhite); |
430 |
< |
mleg->SetTextFont(42); |
431 |
< |
mleg->SetTextSize(0.048); |
432 |
< |
mleg->SetLineWidth(0); |
433 |
< |
mleg->SetBorderSize(0); |
434 |
< |
mleg->AddEntry(datahistoSF, "S. Flavor", "PL"); |
435 |
< |
mleg->AddEntry(datahistoOF, "O. Flavor", "L"); |
427 |
< |
mleg->AddEntry(signalhisto, "LM3", "L"); |
428 |
> |
TLegend *mleg = make_legend(legendTitle.c_str(),legendPosition,0.7,false,legendPosition+0.2); |
429 |
> |
mleg->AddEntry(datahistoSF, "Same-flavor", "PL"); |
430 |
> |
if (datahistoOF->Integral()>0) { |
431 |
> |
mleg->AddEntry(datahistoOF, "Opposite-flavor", "L"); |
432 |
> |
} else { |
433 |
> |
mleg->AddEntry((TObject*)0, "", ""); |
434 |
> |
} |
435 |
> |
//mleg->AddEntry(signalhisto, "LM3", "L"); |
436 |
|
|
437 |
|
datahistoSF->Draw("E1"); |
438 |
< |
datahistoOF->Draw("HIST,SAMES"); |
439 |
< |
signalhisto->Draw("HIST,SAMES"); |
438 |
> |
if (datahistoOF->Integral()>0) datahistoOF->Draw("HIST,SAMES"); |
439 |
> |
//signalhisto->Draw("HIST,SAMES"); |
440 |
|
mleg->Draw(); |
441 |
|
DrawPrelim(); |
442 |
< |
CompleteSave(ckin, "./SFOF/" + filename); |
442 |
> |
if (datahistoOF->Integral()>0) { |
443 |
> |
Save_With_Ratio( datahistoSF, datahistoOF, rcan, "SFOF/" + filename, false, false, "SF/OF" ); |
444 |
> |
} else { |
445 |
> |
CompleteSave(rcan, "SFOF/" + filename); |
446 |
> |
} |
447 |
|
|
448 |
|
datahistoSF->Delete(); |
449 |
|
datahistoOF->Delete(); |
450 |
< |
signalhisto->Delete(); |
450 |
> |
//signalhisto->Delete(); |
451 |
> |
delete mleg; |
452 |
> |
delete rcan; |
453 |
> |
delete ofsf_can; |
454 |
> |
|
455 |
> |
return ymaxSet; |
456 |
> |
|
457 |
> |
} |
458 |
> |
|
459 |
> |
// Compare data to data |
460 |
> |
float make_data_comparison_plot(string variable, TCut cut, int nbins, float min, float max, float ymax, bool logscale, |
461 |
> |
string xlabel, string filename, float legendPosition=0.55) { |
462 |
> |
|
463 |
> |
TCut ibasiccut=basiccut&&cut; |
464 |
> |
|
465 |
> |
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
466 |
> |
TPad* rcan = new TPad("rcan","rcan",0,0,1,1); |
467 |
> |
rcan->SetLogy(logscale); |
468 |
> |
rcan->cd(); |
469 |
> |
|
470 |
> |
std::cout << "Data comparison: variable = " << variable << ", cut = " << ibasiccut.GetTitle() << std::endl; |
471 |
> |
|
472 |
> |
TH1F *data1 = allsamples.Draw("data1",variable,nbins,min,max, xlabel, "events",ibasiccut,data,luminosity); |
473 |
> |
TH1F *data2 = comparesamples.Draw("data2",variable,nbins,min,max, xlabel, "events",ibasiccut,data,luminosity); |
474 |
> |
data1->Scale(5.0/9.2); |
475 |
> |
|
476 |
> |
data1->SetMarkerSize(DataMarkerSize); |
477 |
> |
data2->SetLineColor(kRed); |
478 |
> |
|
479 |
> |
if ( !logscale ) { |
480 |
> |
data1->SetMinimum(0); // Defaults |
481 |
> |
} else { |
482 |
> |
data1->SetMinimum(0.5); |
483 |
> |
} |
484 |
> |
if (ymax<0) { |
485 |
> |
if ( logscale ) data1->SetMaximum(5.3*data1->GetMaximum()); |
486 |
> |
else data1->SetMaximum(1.5*data1->GetMaximum()); |
487 |
> |
} else { |
488 |
> |
data1->SetMaximum(ymax); |
489 |
> |
} |
490 |
> |
|
491 |
> |
float ymaxSet = data1->GetMaximum(); |
492 |
> |
|
493 |
> |
data1->GetXaxis()->SetTitle(xlabel.c_str()); |
494 |
> |
data1->GetYaxis()->SetTitle("Events"); |
495 |
> |
data1->GetXaxis()->CenterTitle(); |
496 |
> |
data1->GetYaxis()->CenterTitle(); |
497 |
> |
|
498 |
> |
TLegend *mleg = make_legend("",legendPosition,0.7,false,legendPosition+0.2); |
499 |
> |
mleg->AddEntry(data1, "2012 data (scaled)", "PL"); |
500 |
> |
mleg->AddEntry(data2, "2011 data", "L"); |
501 |
> |
|
502 |
> |
data1->Draw("E1"); |
503 |
> |
data2->Draw("HIST,SAMES"); |
504 |
> |
mleg->Draw(); |
505 |
> |
DrawPrelim(); |
506 |
> |
Save_With_Ratio( data1, data2, rcan, "compareData/" + filename, false, false, "new/old" ); |
507 |
> |
|
508 |
> |
data1->Delete(); |
509 |
> |
data2->Delete(); |
510 |
|
delete mleg; |
511 |
+ |
delete rcan; |
512 |
|
delete ckin; |
513 |
|
|
514 |
|
} |
515 |
|
|
516 |
+ |
void make_OFSF_plots(string variable, string addcut, int nbins, float min, float max, bool logscale, |
517 |
+ |
string xlabel, string filename, float legendPosition=0.55) { |
518 |
+ |
|
519 |
+ |
string mllcuts[] = { "mll>20","mll>15&&mll<70", "mll>75&&mll<105", "mll>120" }; |
520 |
+ |
string mllcutname[] = { "m_{ll} > 20 GeV", "20 < m_{ll} < 70 GeV", "70 < m_{ll} < 110 GeV", "m_{ll} > 120 GeV" }; |
521 |
+ |
string plotname[] = {"_all","_low","_peak","_high"}; |
522 |
+ |
float ymax; |
523 |
+ |
|
524 |
+ |
int start = 0; |
525 |
+ |
if ( !PlottingSetup::openBox ) start = 3; |
526 |
+ |
|
527 |
+ |
for ( int i=start; i<4; ++i ) { |
528 |
+ |
if ( addcut != "" ) mllcuts[i] += "&&"+addcut; |
529 |
+ |
if ( i==start ) { |
530 |
+ |
ymax = make_one_OFSF_plot(variable, mllcuts[i], mllcutname[i], nbins, min, max, -1, logscale, xlabel, |
531 |
+ |
filename+plotname[i], legendPosition ); |
532 |
+ |
} else { |
533 |
+ |
make_one_OFSF_plot(variable, mllcuts[i], mllcutname[i], nbins, min, max, ymax, logscale, xlabel, |
534 |
+ |
filename+plotname[i], legendPosition ); |
535 |
+ |
} |
536 |
+ |
make_one_OFSF_plot(variable, "id1==1&&id1==id2&&"+mllcuts[i], mllcutname[i], nbins, min, max, ymax, logscale, xlabel, |
537 |
+ |
filename+plotname[i]+"_mm", legendPosition ); |
538 |
+ |
make_one_OFSF_plot(variable, "id1==0&&id1==id2&&"+mllcuts[i], mllcutname[i], nbins, min, max, ymax, logscale, xlabel, |
539 |
+ |
filename+plotname[i]+"_ee", legendPosition ); |
540 |
+ |
} |
541 |
+ |
|
542 |
+ |
} |
543 |
+ |
|
544 |
+ |
TCut ReplaceInCut(TCut cut, string replacethis, string withthis) { |
545 |
+ |
string scut=(string)(const char*)cut; |
546 |
+ |
string acut=ReplaceAll(scut,replacethis,withthis); |
547 |
+ |
return TCut(acut.c_str()); |
548 |
+ |
} |
549 |
+ |
|
550 |
+ |
void DoMCSystPlot(string datavariable, string mcvariable, int nbins, float min, float max, TCut addcut, bool dolog, string xlabel, string filename) { |
551 |
+ |
TCut cut=addcut&&basiccut; |
552 |
|
|
553 |
+ |
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
554 |
+ |
ckin->SetLogy(dolog); |
555 |
+ |
cout << "\r Creating " << filename << " : data (1/6)" << std::flush; |
556 |
+ |
TH1F *datahisto = allsamples.Draw("datahisto",datavariable,nbins,min,max, xlabel, "events",cut,data,luminosity); |
557 |
+ |
datahisto->SetMarkerSize(DataMarkerSize); |
558 |
+ |
if ( !dolog ) datahisto->SetMinimum(0); // Defaults |
559 |
+ |
else datahisto->SetMinimum(0.5); |
560 |
+ |
if (dolog) datahisto->SetMaximum(5.3*datahisto->GetMaximum()); |
561 |
+ |
else datahisto->SetMaximum(1.3*datahisto->GetMaximum()); |
562 |
+ |
cout << "\r Creating " << filename << " : MC central (2/6)" << std::flush; |
563 |
+ |
THStack mcstack = allsamples.DrawStack("mcstack", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
564 |
+ |
TH1F *MCcentral = CollapseStack(mcstack); |
565 |
+ |
|
566 |
+ |
TCut bkpcut = cut; |
567 |
+ |
cut = ReplaceInCut(cut,"pfJetGoodNum40","pfJetGoodNum40p1sigma"); |
568 |
+ |
cout << "\r Creating " << filename << " : MC JES up (3/6)" << std::flush; |
569 |
+ |
TH1F *MCJESup = allsamples.Draw("MCJESup", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
570 |
+ |
|
571 |
+ |
cut = ReplaceInCut(cut,"pfJetGoodNum40p1sigma","pfJetGoodNum40n1sigma"); |
572 |
+ |
cout << "\r Creating " << filename << " : MC JES down (4/6)" << std::flush; |
573 |
+ |
TH1F *MCJESdn = allsamples.Draw("MCJESdn", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
574 |
+ |
|
575 |
+ |
cut=bkpcut; |
576 |
+ |
TCut bkpweight = cutWeight; |
577 |
+ |
cutWeight= ReplaceInCut(cutWeight,"weight","PUweightUP"); |
578 |
+ |
cout << "\r Creating " << filename << " : MC PU up (5/6)" << std::flush; |
579 |
+ |
TH1F *MCPUup = allsamples.Draw("MCPUup", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
580 |
+ |
|
581 |
+ |
cutWeight= ReplaceInCut(cutWeight,"PUweightUP","PUweightDOWN"); |
582 |
+ |
cout << "\r Creating " << filename << " : MC PU down (6/6)" << std::flush; |
583 |
+ |
TH1F *MCPUdn = allsamples.Draw("MCPUdn", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
584 |
+ |
cutWeight=bkpweight; |
585 |
+ |
cout << "\r Creating " << filename << " : Processing systematics ..." << std::flush; |
586 |
+ |
TH1F *Systematic = (TH1F*)MCPUdn->Clone("Systematic"); |
587 |
+ |
for(int i=1;i<=Systematic->GetNbinsX();i++) { |
588 |
+ |
float jesdn = abs(MCcentral->GetBinContent(i)-MCJESdn->GetBinContent(i)); |
589 |
+ |
float jesup = abs(MCcentral->GetBinContent(i)-MCJESup->GetBinContent(i)); |
590 |
+ |
float jes = jesdn>jesup?jesdn:jesup; |
591 |
+ |
|
592 |
+ |
float PUup = abs(MCcentral->GetBinContent(i)-MCPUup->GetBinContent(i)); |
593 |
+ |
float PUdn = abs(MCcentral->GetBinContent(i)-MCPUdn->GetBinContent(i)); |
594 |
+ |
float pu = PUdn>PUup?PUdn:PUup; |
595 |
+ |
|
596 |
+ |
float sys=sqrt(jes*jes+pu*pu); |
597 |
+ |
sys/=MCcentral->GetBinContent(i); |
598 |
+ |
if(MCcentral->GetBinContent(i)==0) sys=0; |
599 |
+ |
Systematic->SetBinContent(i,sys); |
600 |
+ |
} |
601 |
+ |
|
602 |
+ |
datahisto->Draw("e1"); |
603 |
+ |
ckin->Update(); |
604 |
+ |
mcstack.Draw("histo,same"); |
605 |
+ |
|
606 |
+ |
datahisto->Draw("same,e1"); |
607 |
+ |
TLegend *kinleg = allsamples.allbglegend(); |
608 |
+ |
kinleg->Draw(); |
609 |
+ |
|
610 |
+ |
TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1); |
611 |
+ |
kinpad->SetLogy(dolog); |
612 |
+ |
kinpad->cd(); |
613 |
+ |
datahisto->Draw("e1"); |
614 |
+ |
mcstack.Draw("histo,same"); |
615 |
+ |
datahisto->Draw("same,e1"); |
616 |
+ |
datahisto->Draw("same,axis"); |
617 |
+ |
|
618 |
+ |
kinleg->Draw("same"); |
619 |
+ |
DrawPrelim(); |
620 |
+ |
string saveas="kin/"+filename; |
621 |
+ |
|
622 |
+ |
cout << "Passing filename to be saved : " << filename << " as " << saveas << endl; |
623 |
+ |
save_with_ratio_and_sys_band( datahisto, CollapseStack(mcstack), kinpad->cd(), saveas, false, false, "data/mc",Systematic ); |
624 |
+ |
|
625 |
+ |
ckin->cd(); |
626 |
+ |
MCcentral->SetFillColor(kWhite); |
627 |
+ |
MCcentral->SetLineColor(kBlack); |
628 |
+ |
MCcentral->SetLineWidth(2); |
629 |
+ |
MCPUdn->SetLineColor(kRed); |
630 |
+ |
MCPUup->SetLineColor(kYellow); |
631 |
+ |
MCJESdn->SetLineColor(kBlue); |
632 |
+ |
MCJESup->SetLineColor(kGreen); |
633 |
+ |
|
634 |
+ |
TLegend *legsmall = new TLegend(0.0,0.85,1.0,1.00); |
635 |
+ |
legsmall->SetNColumns(5); |
636 |
+ |
legsmall->AddEntry(MCcentral,"central","L"); |
637 |
+ |
legsmall->AddEntry(MCPUdn,"PU down","L"); |
638 |
+ |
legsmall->AddEntry(MCPUup,"PU up","L"); |
639 |
+ |
legsmall->AddEntry(MCJESdn,"JES down","L"); |
640 |
+ |
legsmall->AddEntry(MCJESup,"JES up","L"); |
641 |
+ |
legsmall->SetFillColor(kWhite); |
642 |
+ |
legsmall->SetBorderSize(0); |
643 |
+ |
|
644 |
+ |
datahisto->Draw("e1"); |
645 |
+ |
MCcentral->Draw("histo,same"); |
646 |
+ |
MCPUdn->Draw("histo,same"); |
647 |
+ |
MCPUup->Draw("histo,same"); |
648 |
+ |
MCJESdn->Draw("histo,same"); |
649 |
+ |
MCJESup->Draw("histo,same"); |
650 |
+ |
datahisto->Draw("e1,same"); |
651 |
+ |
legsmall->Draw(); |
652 |
+ |
CompleteSave(ckin,saveas+"___AllLines"); |
653 |
+ |
|
654 |
+ |
delete datahisto; |
655 |
+ |
delete MCcentral; |
656 |
+ |
delete MCPUdn; |
657 |
+ |
delete MCPUup; |
658 |
+ |
delete MCJESdn; |
659 |
+ |
delete MCJESup; |
660 |
+ |
delete ckin; |
661 |
+ |
} |
662 |
|
|
663 |
+ |
void DoMCSystPlot(string variable, int nbins, float min, float max, TCut addcut, bool dolog, string xlabel, string filename) { |
664 |
+ |
DoMCSystPlot(variable, variable, nbins, min, max, addcut, dolog, xlabel, filename); |
665 |
+ |
} |
666 |
+ |
|
667 |
|
float lastrange_min=0; |
668 |
|
float lastrange_max=0; |
669 |
|
|
672 |
|
// TCut basiccut("(pfJetGoodNum>=2&&pfJetGoodID[0])&&(pfJetGoodNum>=2&&pfJetGoodID[1])&&(passed_triggers||!is_data)"); |
673 |
|
TCut ibasiccut=basiccut; |
674 |
|
bool draw_separation_lines=false; |
675 |
+ |
bool drawsignal = false; |
676 |
|
|
677 |
|
if(isPF) ibasiccut=basiccut&&"pfjzb[0]>-998"; |
678 |
|
|
694 |
|
//Step 2: Refine the cut |
695 |
|
TCut cut; |
696 |
|
cut=cutmass&&cutOSSF&&cutnJets&&ibasiccut; |
697 |
< |
if(filename=="nJets") cut=cutmass&&cutOSSF&&ibasiccut; |
698 |
< |
if(filename=="nJets_osof") cut=cutmass&&cutOSOF&&ibasiccut; |
697 |
> |
if(filename=="nJets" || filename=="nJets_inclusive" || filename=="nJets_met100" || filename=="nJets_inclusive_met100") cut=cutmass&&cutOSSF&&ibasiccut; |
698 |
> |
if(filename=="nJets_osof" || filename=="nJets_osof_inclusive" || filename=="nJets_osof_met100" || filename=="nJets_osof_inclusive_met100") cut=cutmass&&cutOSOF&&ibasiccut; |
699 |
|
if(filename=="nJets_nocuts_except_mll_ossf") cut=cutmass&&cutOSSF; |
700 |
< |
if(filename=="mll") { |
700 |
> |
if(filename=="mll"||filename=="mll_met100") { |
701 |
|
cut=cutOSSF&&cutnJets&&ibasiccut; |
702 |
|
draw_separation_lines=true; |
703 |
|
} |
704 |
< |
if(filename=="mll_ee") cut=cutOSSF&&cutnJets&&ibasiccut&&"id1==0"; |
705 |
< |
if(filename=="mll_osof") { |
704 |
> |
if(filename=="mll_ee"||filename=="mll_ee_met100") cut=cutOSSF&&cutnJets&&ibasiccut&&"id1==0"; |
705 |
> |
if(filename=="mll_mm"||filename=="mll_mm_met100") cut=cutOSSF&&cutnJets&&ibasiccut&&"id1==1"; |
706 |
> |
if(filename=="mll_osof"||filename=="mll_osof_met100") { |
707 |
|
cut=cutOSOF&&cutnJets&&ibasiccut; |
708 |
|
draw_separation_lines=true; |
709 |
|
} |
487 |
– |
if(filename=="mll_mm") cut=cutOSSF&&cutnJets&&ibasiccut&&"id1==1"; |
710 |
|
if(Contains(filename,"aboveJZB")) cut=cutOSSF&&cutnJets&&ibasiccut; |
711 |
|
if(Contains(filename,"mll_ee_above")) cut=cut&&"id1==0"; |
712 |
|
if(Contains(filename,"mll_mm_above")) cut=cut&&"id1==1"; |
717 |
|
if(filename=="mll_inclusive_mm") cut=cutOSSF&&"id1==1"; |
718 |
|
if(filename=="pfJetGoodEta_0") cut=cutOSSF&&cutmass&&ibasiccut&&cutnJets; |
719 |
|
if(filename=="pfJetGoodPt_0") cut=cutOSSF&&cutmass&&ibasiccut&&cutnJets; |
720 |
+ |
if(filename=="numVtx") cut=cutmass&&ibasiccut; |
721 |
|
|
722 |
|
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
723 |
|
ckin->SetLogy(logscale); |
735 |
|
if (logscale) datahisto->SetMaximum(5.3*datahisto->GetMaximum()); |
736 |
|
else datahisto->SetMaximum(1.3*datahisto->GetMaximum()); |
737 |
|
|
738 |
+ |
cout << "******** Cut used : " << (const char*) cut << " for plot " << filename << endl; |
739 |
|
if(loadlastminmax) { |
740 |
|
datahisto->SetMinimum(lastrange_min); |
741 |
|
datahisto->SetMaximum(lastrange_max); |
749 |
|
string signal("LM3"); |
750 |
|
TH1F* signalhisto = new TH1F("signalhisto",signal.c_str(),nbins,min,max); |
751 |
|
int idx = signalsamples.FindSample(signal)[0]; |
752 |
< |
(signalsamples.collection)[idx].events->Project("signalhisto",variable.c_str(),cut); |
753 |
< |
signalhisto->Scale((signalsamples.collection)[idx].weight*luminosity); |
754 |
< |
signalhisto->SetLineColor(kOrange); |
752 |
> |
if(drawsignal) (signalsamples.collection)[idx].events->Project("signalhisto",variable.c_str(),cut); |
753 |
> |
if(drawsignal) signalhisto->Scale((signalsamples.collection)[idx].weight*luminosity); |
754 |
> |
if(drawsignal) signalhisto->SetLineColor(kOrange); |
755 |
|
|
756 |
|
THStack mcstack = allsamples.DrawStack("mcstack", variable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
757 |
|
datahisto->Draw("e1"); |
758 |
|
ckin->Update(); |
759 |
< |
mcstack.Draw("same"); |
759 |
> |
mcstack.Draw("histo,same"); |
760 |
|
|
761 |
|
datahisto->Draw("same,e1"); |
762 |
|
TLegend *kinleg = allsamples.allbglegend(); |
799 |
|
kinpad->cd(); |
800 |
|
kinpad->SetLogy(logscale); |
801 |
|
datahisto->Draw("e1"); |
802 |
< |
mcstack.Draw("same"); |
803 |
< |
signalhisto->Draw("same"); |
802 |
> |
mcstack.Draw("histo,same"); |
803 |
> |
if(drawsignal) signalhisto->Draw("same"); |
804 |
|
datahisto->Draw("same,e1"); |
805 |
|
datahisto->Draw("same,axis"); |
806 |
|
if(RestrictToMassPeak&&draw_separation_lines) { |
808 |
|
upperboundary->Draw("same"); |
809 |
|
} |
810 |
|
|
811 |
< |
kinleg->AddEntry("signalhisto",signal.c_str(),"l"); |
811 |
> |
if(drawsignal) kinleg->AddEntry("signalhisto",signal.c_str(),"l"); |
812 |
|
kinleg->Draw(); |
813 |
|
write_cut->Draw(); |
814 |
|
DrawPrelim(); |
815 |
|
string saveas="kin/"+filename; |
816 |
|
if(isPF) saveas="kin/"+filename+"__PF"; |
817 |
< |
save_with_ratio(datahisto,mcstack,kinpad->cd(),saveas); |
817 |
> |
Save_With_Ratio(datahisto,mcstack,kinpad->cd(),saveas); |
818 |
|
// if(isPF) CompleteSave(with_ratio,"kin/"+filename+"__PF_withratio"); |
819 |
|
// else CompleteSave(with_ratio,"kin/"+filename+"_withratio"); |
820 |
|
// delete with_ratio; |
823 |
|
else CompleteSave(ckin,"kin/"+filename); |
824 |
|
} |
825 |
|
datahisto->Delete(); |
826 |
+ |
delete signalhisto; |
827 |
+ |
delete ckin; |
828 |
+ |
} |
829 |
+ |
|
830 |
+ |
|
831 |
+ |
void make_plain_kin_plot(string variable, string addcut, int nbins, float min, float max, bool logscale, |
832 |
+ |
string xlabel, string filename, bool isPF=true, bool plotratio=true, bool loadlastminmax=false ) { |
833 |
+ |
TCut cut=TCut(addcut.c_str())&&basiccut; |
834 |
+ |
|
835 |
+ |
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
836 |
+ |
ckin->SetLogy(logscale); |
837 |
+ |
TH1F *datahisto = allsamples.Draw("datahisto",variable,nbins,min,max, xlabel, "events",cut,data,luminosity); |
838 |
+ |
datahisto->SetMarkerSize(DataMarkerSize); |
839 |
+ |
if ( !logscale ) datahisto->SetMinimum(0); // Defaults |
840 |
+ |
else datahisto->SetMinimum(0.5); |
841 |
+ |
// Custom max. |
842 |
+ |
if (logscale) datahisto->SetMaximum(5.3*datahisto->GetMaximum()); |
843 |
+ |
else datahisto->SetMaximum(1.3*datahisto->GetMaximum()); |
844 |
+ |
|
845 |
+ |
cout << "******** Cut used : " << (const char*) cut << " for plot " << filename << endl; |
846 |
+ |
if(loadlastminmax) { |
847 |
+ |
datahisto->SetMinimum(lastrange_min); |
848 |
+ |
datahisto->SetMaximum(lastrange_max); |
849 |
+ |
if(logscale) { |
850 |
+ |
datahisto->SetMinimum(pow(10,lastrange_min)); |
851 |
+ |
datahisto->SetMaximum(pow(10,lastrange_max)); |
852 |
+ |
} |
853 |
+ |
} |
854 |
+ |
|
855 |
+ |
THStack mcstack = allsamples.DrawStack("mcstack", variable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
856 |
+ |
datahisto->Draw("e1"); |
857 |
+ |
ckin->Update(); |
858 |
+ |
mcstack.Draw("histo,same"); |
859 |
+ |
|
860 |
+ |
datahisto->Draw("same,e1"); |
861 |
+ |
TLegend *kinleg = allsamples.allbglegend(); |
862 |
+ |
kinleg->Draw(); |
863 |
+ |
|
864 |
+ |
lastrange_min=ckin->GetUymin(); |
865 |
+ |
lastrange_max=ckin->GetUymax(); |
866 |
+ |
|
867 |
+ |
if ( plotratio ) { |
868 |
+ |
TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1); |
869 |
+ |
kinpad->cd(); |
870 |
+ |
kinpad->SetLogy(logscale); |
871 |
+ |
datahisto->Draw("e1"); |
872 |
+ |
mcstack.Draw("histo,same"); |
873 |
+ |
datahisto->Draw("same,e1"); |
874 |
+ |
datahisto->Draw("same,axis"); |
875 |
+ |
|
876 |
+ |
kinleg->Draw(); |
877 |
+ |
DrawPrelim(); |
878 |
+ |
string saveas="kin/"+filename; |
879 |
+ |
if(isPF) saveas="kin/"+filename+"__PF"; |
880 |
+ |
Save_With_Ratio(datahisto,mcstack,kinpad->cd(),saveas); |
881 |
+ |
} else { |
882 |
+ |
if(isPF) CompleteSave(ckin,"kin/"+filename+"__PF"); |
883 |
+ |
else CompleteSave(ckin,"kin/"+filename); |
884 |
+ |
} |
885 |
+ |
datahisto->Delete(); |
886 |
|
delete ckin; |
887 |
|
} |
888 |
|
|
889 |
+ |
|
890 |
|
void make_JES_plot(TCut cut, string name) { |
891 |
|
|
892 |
|
int nbins=10; |
920 |
|
JESunc->SetFillColor(TColor::GetColor("#00ADE1")); |
921 |
|
JESunc->SetFillStyle(3002); |
922 |
|
datahisto->Draw("e1"); |
923 |
< |
mcstack.Draw("same"); |
923 |
> |
mcstack.Draw("histo,same"); |
924 |
|
JESunc->Draw("2"); |
925 |
|
datahisto->Draw("same,e1"); |
926 |
|
TLegend *kinleg = allsamples.allbglegend(); |
929 |
|
CompleteSave(ckin,"Systematics/JES"+name); |
930 |
|
datahisto->Delete(); |
931 |
|
delete ckin; |
932 |
+ |
delete JESunc; |
933 |
+ |
delete JESup; |
934 |
+ |
delete JESdn; |
935 |
+ |
CleanLegends(); |
936 |
+ |
} |
937 |
+ |
|
938 |
+ |
string Cut2Str(TCut cut) { |
939 |
+ |
return ((string)(const char*)cut); |
940 |
+ |
} |
941 |
+ |
|
942 |
+ |
void MakeElegantTwoThreeComparisons() { |
943 |
+ |
|
944 |
+ |
TCut signal("met[4]>100&&met[4]<150&&mll>20"&&PlottingSetup::basicqualitycut); |
945 |
+ |
TCut TwoJets("pfJetGoodNum40==2"); |
946 |
+ |
TCut ThreeJets("pfJetGoodNum40>=3"); |
947 |
+ |
|
948 |
+ |
float min=20; |
949 |
+ |
float max=300; |
950 |
+ |
int nbins=int((max-min)/5.0); |
951 |
+ |
string xlabel="m_{ll} [GeV]"; |
952 |
+ |
|
953 |
+ |
TCanvas *can2 = new TCanvas("can2","can2"); |
954 |
+ |
TH1F *TwoOF = allsamples.Draw("TwoOF","mll",nbins,min,max, xlabel, "events",cutOSOF&&signal&&TwoJets,mc,luminosity,allsamples.FindSample("TTJets_")); |
955 |
+ |
TH1F *TwoSF = allsamples.Draw("TwoSF","mll",nbins,min,max, xlabel, "events",cutOSSF&&signal&&TwoJets,mc,luminosity,allsamples.FindSample("TTJets_")); |
956 |
+ |
TH1F *ThreeOF = allsamples.Draw("ThreeOF","mll",nbins,min,max, xlabel, "events",cutOSOF&&signal&&ThreeJets,mc,luminosity,allsamples.FindSample("TTJets_")); |
957 |
+ |
TH1F *ThreeSF = allsamples.Draw("ThreeSF","mll",nbins,min,max, xlabel, "events",cutOSSF&&signal&&ThreeJets,mc,luminosity,allsamples.FindSample("TTJets_")); |
958 |
+ |
|
959 |
+ |
can2->cd(1); |
960 |
+ |
|
961 |
+ |
TwoSF->SetFillColor(kWhite); |
962 |
+ |
TwoOF->SetFillColor(kWhite); |
963 |
+ |
ThreeSF->SetFillColor(kWhite); |
964 |
+ |
ThreeOF->SetFillColor(kWhite); |
965 |
+ |
|
966 |
+ |
TPad *kin3 = new TPad("kin3","kin3",0,0,1,1); |
967 |
+ |
kin3->cd(); |
968 |
+ |
TwoOF->Draw("histo"); |
969 |
+ |
TwoSF->Draw("e1,same"); |
970 |
+ |
TLegend *leg_SFOF_Two = make_legend(); |
971 |
+ |
leg_SFOF_Two->SetHeader("t#bar{t} MC:"); |
972 |
+ |
leg_SFOF_Two->AddEntry(TwoOF,"OF, nJets==2","l"); |
973 |
+ |
leg_SFOF_Two->AddEntry(TwoSF,"SF, nJets==2","lp"); |
974 |
+ |
leg_SFOF_Two->Draw(); |
975 |
+ |
Save_With_Ratio(TwoSF,TwoOF,kin3->cd(),"DoubleRatios/SFOF_Two"); |
976 |
+ |
|
977 |
+ |
TPad *kin4 = new TPad("kin4","kin4",0,0,1,1); |
978 |
+ |
kin4->cd(); |
979 |
+ |
ThreeOF->Draw("histo"); |
980 |
+ |
ThreeSF->Draw("e1,same"); |
981 |
+ |
TLegend *leg_SFOF_Three = make_legend(); |
982 |
+ |
leg_SFOF_Three->SetHeader("t#bar{t} MC:"); |
983 |
+ |
leg_SFOF_Three->AddEntry(TwoOF,"OF, nJet#geq3","l"); |
984 |
+ |
leg_SFOF_Three->AddEntry(TwoSF,"SF, nJets#geq3","lp"); |
985 |
+ |
leg_SFOF_Three->Draw(); |
986 |
+ |
Save_With_Ratio(ThreeSF,ThreeOF,kin4->cd(),"DoubleRatios/SFOF_Three"); |
987 |
+ |
|
988 |
+ |
|
989 |
+ |
TwoSF->Scale(ThreeSF->Integral()/TwoSF->Integral()); |
990 |
+ |
TPad *kin = new TPad("kin","kin",0,0,1,1); |
991 |
+ |
kin->cd(); |
992 |
+ |
TwoSF->Draw("histo"); |
993 |
+ |
ThreeSF->Draw("e1,same"); |
994 |
+ |
TLegend *leg_SF_Two_Three = make_legend(); |
995 |
+ |
leg_SF_Two_Three->SetHeader("t#bar{t} MC:"); |
996 |
+ |
leg_SF_Two_Three->AddEntry(TwoSF,"#splitline{SF, nJets==2}{ (scaled)}","l"); |
997 |
+ |
leg_SF_Two_Three->AddEntry(ThreeSF,"SF, nJets#geq3","lp"); |
998 |
+ |
leg_SF_Two_Three->Draw(); |
999 |
+ |
Save_With_Ratio(TwoSF,ThreeSF,kin->cd(),"DoubleRatios/SF_Two_Three"); |
1000 |
+ |
|
1001 |
+ |
TwoOF->Scale(ThreeOF->Integral()/TwoOF->Integral()); |
1002 |
+ |
TPad *kin2 = new TPad("kin2","kin2",0,0,1,1); |
1003 |
+ |
kin2->cd(); |
1004 |
+ |
TwoOF->Draw("histo"); |
1005 |
+ |
ThreeOF->Draw("e1,same"); |
1006 |
+ |
TLegend *leg_OF_Two_Three = make_legend(); |
1007 |
+ |
leg_OF_Two_Three->SetHeader("t#bar{t} MC:"); |
1008 |
+ |
leg_OF_Two_Three->AddEntry(TwoSF,"#splitline{OF, nJets==2}{ (scaled)}","l"); |
1009 |
+ |
leg_OF_Two_Three->AddEntry(ThreeSF,"OF, nJets#geq3","lp"); |
1010 |
+ |
leg_OF_Two_Three->Draw(); |
1011 |
+ |
Save_With_Ratio(TwoOF,ThreeOF,kin2->cd(),"DoubleRatios/OF_Two_Three"); |
1012 |
+ |
|
1013 |
+ |
} |
1014 |
+ |
|
1015 |
+ |
void PresentRange(TH1F *Down, TH1F *Up, TH1F *central, TVirtualPad *pad, string title) { |
1016 |
+ |
pad->cd(); |
1017 |
+ |
TGraphErrors *gr = new TGraphErrors(Down->GetNbinsX()); |
1018 |
+ |
for(int i=1;i<=Down->GetNbinsX();i++) { |
1019 |
+ |
float average=0.5*(Down->GetBinContent(i)+Up->GetBinContent(i)); |
1020 |
+ |
float error=abs(Down->GetBinContent(i)-average); |
1021 |
+ |
gr->SetPoint(i-1,Down->GetBinCenter(i),average); |
1022 |
+ |
gr->SetPointError(i-1,Down->GetBinWidth(i)/2.0,error); |
1023 |
+ |
} |
1024 |
+ |
gr->SetFillColor(TColor::GetColor("#F79F81")); |
1025 |
+ |
gr->GetYaxis()->SetRangeUser(0,2); |
1026 |
+ |
gr->GetXaxis()->SetTitle(central->GetXaxis()->GetTitle()); |
1027 |
+ |
gr->GetYaxis()->SetTitle(central->GetYaxis()->GetTitle()); |
1028 |
+ |
gr->GetXaxis()->CenterTitle(); |
1029 |
+ |
gr->GetYaxis()->CenterTitle(); |
1030 |
+ |
|
1031 |
+ |
gr->Draw("A2"); |
1032 |
+ |
central->Draw("e1,same"); |
1033 |
+ |
DrawMCPrelim(); |
1034 |
+ |
TText *rtitle = write_text(0.8,0.8,title); |
1035 |
+ |
TLine *line = new TLine(Down->GetBinLowEdge(1),1.0,Down->GetBinLowEdge(Down->GetNbinsX())+Down->GetBinWidth(Down->GetNbinsX()),1.0); |
1036 |
+ |
line->SetLineColor(kBlue); |
1037 |
+ |
line->SetLineStyle(2); |
1038 |
+ |
line->Draw("same"); |
1039 |
+ |
rtitle->Draw("same"); |
1040 |
+ |
} |
1041 |
+ |
|
1042 |
+ |
TH1F* ProduceTTbarRatio(TH1F *datahisto, TH1F *fullmc, TH1F *originalttbar, TH1F *httbar) { |
1043 |
+ |
TH1F *basehisto = (TH1F*)fullmc->Clone("basehisto"); |
1044 |
+ |
basehisto->Add(originalttbar,-1); |
1045 |
+ |
basehisto->Add(httbar); |
1046 |
+ |
|
1047 |
+ |
string sname=httbar->GetName(); |
1048 |
+ |
sname="R"+sname.substr(1,sname.length()); |
1049 |
+ |
TH1F *ratio = (TH1F*)datahisto->Clone(sname.c_str()); |
1050 |
+ |
ratio->Divide(basehisto); |
1051 |
+ |
delete basehisto; |
1052 |
+ |
return ratio; |
1053 |
+ |
} |
1054 |
+ |
|
1055 |
+ |
void make_ttbar_comparison(string datavariable, string mcvariable, int nbins, float min, float max, TCut addcut, bool dolog, string xlabel, string filename) { |
1056 |
+ |
|
1057 |
+ |
TCut cut=addcut&&basiccut; |
1058 |
+ |
|
1059 |
+ |
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
1060 |
+ |
ckin->SetLogy(dolog); |
1061 |
+ |
cout << "\r Creating " << filename << " : data (1/11)" << std::flush; |
1062 |
+ |
TH1F *datahisto = allsamples.Draw("datahisto",datavariable,nbins,min,max, xlabel, "events",cut,data,luminosity); |
1063 |
+ |
datahisto->SetMarkerSize(DataMarkerSize); |
1064 |
+ |
if ( !dolog ) datahisto->SetMinimum(0); // Defaults |
1065 |
+ |
else datahisto->SetMinimum(0.5); |
1066 |
+ |
if (dolog) datahisto->SetMaximum(5.3*datahisto->GetMaximum()); |
1067 |
+ |
else datahisto->SetMaximum(1.3*datahisto->GetMaximum()); |
1068 |
+ |
cout << "\r Creating " << filename << " : MC central (stack) (2/11)" << std::flush; |
1069 |
+ |
THStack mcstack = allsamples.DrawStack("mcstack", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
1070 |
+ |
TH1F *MCcentral = CollapseStack(mcstack); |
1071 |
+ |
|
1072 |
+ |
cout << "\r Creating " << filename << " : MC central (histo) (3/11)" << std::flush; |
1073 |
+ |
TH1F *TCentral = allsamples.Draw ("TCentral", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity,allsamples.FindSample("TTJets_")); |
1074 |
+ |
TH1F *RCentral = ProduceTTbarRatio(datahisto,MCcentral,TCentral,TCentral); |
1075 |
+ |
|
1076 |
+ |
cout << "\r Creating " << filename << " : MC Matching up (4/11)" << std::flush; |
1077 |
+ |
TH1F *TMatchingUp = systsamples.Draw("TMatchingUp", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity,systsamples.FindSample("TTJets_matchingup")); |
1078 |
+ |
TH1F *RMatchingUp = ProduceTTbarRatio(datahisto,MCcentral,TCentral,TMatchingUp); |
1079 |
+ |
|
1080 |
+ |
cout << "\r Creating " << filename << " : MC Matching down (5/11)" << std::flush; |
1081 |
+ |
TH1F *TMatchingDown = systsamples.Draw("TMatchingDown",mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity,systsamples.FindSample("TTJets_matchingdown")); |
1082 |
+ |
TH1F *RMatchingDown = ProduceTTbarRatio(datahisto,MCcentral,TCentral,TMatchingDown); |
1083 |
+ |
|
1084 |
+ |
cout << "\r Creating " << filename << " : MC Scale up (6/11)" << std::flush; |
1085 |
+ |
TH1F *TScaleUp = systsamples.Draw("TScaleUp", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity,systsamples.FindSample("TTJets_scaleup")); |
1086 |
+ |
TH1F *RScaleUp = ProduceTTbarRatio(datahisto,MCcentral,TCentral,TScaleUp); |
1087 |
+ |
|
1088 |
+ |
cout << "\r Creating " << filename << " : MC Scale down (7/11)" << std::flush; |
1089 |
+ |
TH1F *TScaleDown = systsamples.Draw("TScaleDown", mcvariable,nbins,min,max,xlabel,"events",cut,mc,luminosity,systsamples.FindSample("TTJets_scaledown")); |
1090 |
+ |
TH1F *RScaleDown = ProduceTTbarRatio(datahisto,MCcentral,TCentral,TScaleDown); |
1091 |
+ |
|
1092 |
+ |
datahisto->Draw("e1"); |
1093 |
+ |
ckin->Update(); |
1094 |
+ |
mcstack.Draw("histo,same"); |
1095 |
+ |
|
1096 |
+ |
datahisto->Draw("same,e1"); |
1097 |
+ |
TLegend *kinleg = allsamples.allbglegend(); |
1098 |
+ |
kinleg->Draw(); |
1099 |
+ |
|
1100 |
+ |
TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1); |
1101 |
+ |
kinpad->SetLogy(dolog); |
1102 |
+ |
kinpad->cd(); |
1103 |
+ |
datahisto->Draw("e1"); |
1104 |
+ |
mcstack.Draw("histo,same"); |
1105 |
+ |
datahisto->Draw("same,e1"); |
1106 |
+ |
datahisto->Draw("same,axis"); |
1107 |
+ |
|
1108 |
+ |
kinleg->Draw("same"); |
1109 |
+ |
DrawPrelim(); |
1110 |
+ |
string saveas="kin/"+filename; |
1111 |
+ |
|
1112 |
+ |
cout << "Passing filename to be saved : " << filename << " as " << saveas << endl; |
1113 |
+ |
Save_With_Ratio( datahisto, CollapseStack(mcstack), kinpad->cd(), saveas, false, false, "data/mc"); |
1114 |
+ |
delete kinpad; |
1115 |
+ |
|
1116 |
+ |
ckin->cd(); |
1117 |
+ |
TCentral->SetLineColor(kBlack); |
1118 |
+ |
|
1119 |
+ |
TMatchingUp->SetLineColor(TColor::GetColor("#2c17b1"));//blue |
1120 |
+ |
TMatchingUp->SetLineStyle(2);//dashed |
1121 |
+ |
TMatchingDown->SetLineColor(TColor::GetColor("#2c17b1")); |
1122 |
+ |
TMatchingDown->SetLineStyle(3);//dotted |
1123 |
+ |
|
1124 |
+ |
TScaleUp->SetLineColor(TColor::GetColor("#FF8500"));//orange |
1125 |
+ |
TScaleUp->SetLineStyle(2);//dashed |
1126 |
+ |
TScaleDown->SetLineColor(TColor::GetColor("#FF8500")); |
1127 |
+ |
TScaleDown->SetLineStyle(3);//dotted |
1128 |
+ |
|
1129 |
+ |
MCcentral->SetLineStyle(3); |
1130 |
+ |
MCcentral->SetLineColor(kRed); |
1131 |
+ |
|
1132 |
+ |
TCentral->Draw("e1,same"); |
1133 |
+ |
TCentral->Draw("histo,same"); |
1134 |
+ |
TMatchingUp->Draw("histo,same"); |
1135 |
+ |
TMatchingDown->Draw("histo,same"); |
1136 |
+ |
TScaleUp->Draw("histo,same"); |
1137 |
+ |
TScaleDown->Draw("histo,same"); |
1138 |
+ |
|
1139 |
+ |
TLegend *sleg = make_legend(); |
1140 |
+ |
sleg->AddEntry(TCentral,"Central","L"); |
1141 |
+ |
sleg->AddEntry(TMatchingUp,"matching up","L"); |
1142 |
+ |
sleg->AddEntry(TMatchingDown,"matching down","L"); |
1143 |
+ |
sleg->AddEntry(TScaleUp,"scale up","L"); |
1144 |
+ |
sleg->AddEntry(TScaleDown,"scale down","L"); |
1145 |
+ |
sleg->Draw(); |
1146 |
+ |
|
1147 |
+ |
CompleteSave(ckin,saveas+"___AllLines"); |
1148 |
+ |
ckin->cd(); |
1149 |
+ |
ckin->SetLogy(0); |
1150 |
+ |
|
1151 |
+ |
RCentral->SetLineColor(kBlack); |
1152 |
+ |
|
1153 |
+ |
RMatchingUp->SetLineColor(TColor::GetColor("#2c17b1"));//blue |
1154 |
+ |
RMatchingUp->SetLineStyle(2);//dashed |
1155 |
+ |
RMatchingDown->SetLineColor(TColor::GetColor("#2c17b1")); |
1156 |
+ |
RMatchingDown->SetLineStyle(3);//dotted |
1157 |
+ |
|
1158 |
+ |
RScaleUp->SetLineColor(TColor::GetColor("#FF8500"));//orange |
1159 |
+ |
RScaleUp->SetLineStyle(2);//dashed |
1160 |
+ |
RScaleDown->SetLineColor(TColor::GetColor("#FF8500")); |
1161 |
+ |
RScaleDown->SetLineStyle(3);//dotted |
1162 |
+ |
|
1163 |
+ |
RCentral->GetYaxis()->SetRangeUser(0,2); |
1164 |
+ |
RCentral->Draw("e1"); |
1165 |
+ |
RMatchingUp->Draw("histo,same"); |
1166 |
+ |
RMatchingDown->Draw("histo,same"); |
1167 |
+ |
RScaleUp->Draw("histo,same"); |
1168 |
+ |
RScaleDown->Draw("histo,same"); |
1169 |
+ |
|
1170 |
+ |
CompleteSave(ckin,saveas+"___AllRatios"); |
1171 |
+ |
|
1172 |
+ |
TCanvas *multicanvas = new TCanvas("multicanvas","multicanvas",1400,700); |
1173 |
+ |
multicanvas->Divide(2,1); |
1174 |
+ |
PresentRange(RMatchingUp,RMatchingDown,RCentral,multicanvas->cd(1),"Matching"); |
1175 |
+ |
PresentRange(RScaleUp,RScaleDown,RCentral,multicanvas->cd(2),"Scale"); |
1176 |
+ |
CompleteSave(multicanvas,saveas+"___RangeIllustration"); |
1177 |
+ |
|
1178 |
+ |
|
1179 |
+ |
delete datahisto; |
1180 |
+ |
delete TCentral; |
1181 |
+ |
delete TMatchingUp; |
1182 |
+ |
delete TMatchingDown; |
1183 |
+ |
delete TScaleUp; |
1184 |
+ |
delete TScaleDown; |
1185 |
+ |
// delete Ttmass166; |
1186 |
+ |
// delete Ttmass169; |
1187 |
+ |
// delete Ttmass175; |
1188 |
+ |
// delete Ttmass178; |
1189 |
+ |
|
1190 |
+ |
delete ckin; |
1191 |
+ |
|
1192 |
+ |
} |
1193 |
+ |
|
1194 |
+ |
void make_ttbar_comparison(string variable, int nbins, float min, float max, TCut addcut, bool dolog, string xlabel, string filename) { |
1195 |
+ |
make_ttbar_comparison(variable, variable, nbins, min, max, addcut, dolog, xlabel, filename); |
1196 |
+ |
} |
1197 |
+ |
|
1198 |
+ |
void ProduceJanPlots() { |
1199 |
+ |
TCanvas *c1 = new TCanvas("c1","c1"); |
1200 |
+ |
TH1F *metSF = allsamples.Draw("metSF","met[4]",30,100,400, "E_{T}^{miss} [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data, luminosity); |
1201 |
+ |
TH1F *metOF = allsamples.Draw("metOF","met[4]",30,100,400, "E_{T}^{miss} [GeV]", "events", cutmass&&cutOSOF&&cutnJets,data, luminosity); |
1202 |
+ |
|
1203 |
+ |
TPad* rcan = new TPad("rcan","rcan",0,0,1,1); |
1204 |
+ |
rcan->cd(); |
1205 |
+ |
|
1206 |
+ |
metOF->SetLineColor(kRed); |
1207 |
+ |
metSF->Draw("e1"); |
1208 |
+ |
metOF->Draw("histo,same"); |
1209 |
+ |
metSF->Draw("e1,same"); |
1210 |
+ |
|
1211 |
+ |
TLegend *leg = make_legend(); |
1212 |
+ |
|
1213 |
+ |
leg->AddEntry(metSF,"Data SF","p"); |
1214 |
+ |
leg->AddEntry(metOF,"Data OF","l"); |
1215 |
+ |
leg->Draw(); |
1216 |
+ |
|
1217 |
+ |
DrawPrelim(); |
1218 |
+ |
|
1219 |
+ |
Save_With_Ratio(metSF,metOF,rcan,"JanPlots/ETHConfig",false,false,"SF/OF"); |
1220 |
+ |
|
1221 |
+ |
delete rcan; |
1222 |
+ |
delete metSF; |
1223 |
+ |
delete metOF; |
1224 |
+ |
delete c1; |
1225 |
+ |
} |
1226 |
+ |
|
1227 |
+ |
THStack MakeOneSystematicsPlot(TCut cut, string saveas, string variation, TH1F *hdata, string variable, int nbins, float bmin, float bmax, string label, TH1F* &thisto) { |
1228 |
+ |
THStack SystPlot = allsamples.DrawStack(variation,variable,nbins,bmin,bmax,label,"events",cut,mc,PlottingSetup::luminosity); |
1229 |
+ |
|
1230 |
+ |
//now need to process the plot (calculate the variation and set the member of thstack accordingly!) |
1231 |
+ |
if(variation!="Central") { |
1232 |
+ |
TH1F *varttbar; |
1233 |
+ |
if(variation=="MatchingUp") varttbar = systsamples.Draw("varttbar",variable,nbins,bmin,bmax,label,"events",cut,mc,PlottingSetup::luminosity,systsamples.FindSample("TTJets_matchingup_TuneZ2s")); |
1234 |
+ |
if(variation=="MatchingDown") varttbar = systsamples.Draw("varttbar",variable,nbins,bmin,bmax,label,"events",cut,mc,PlottingSetup::luminosity,systsamples.FindSample("TTJets_matchingdown")); |
1235 |
+ |
if(variation=="ScaleUp") varttbar = systsamples.Draw("varttbar",variable,nbins,bmin,bmax,label,"events",cut,mc,PlottingSetup::luminosity,systsamples.FindSample("TTJets_scaleup")); |
1236 |
+ |
if(variation=="ScaleDown") varttbar = systsamples.Draw("varttbar",variable,nbins,bmin,bmax,label,"events",cut,mc,PlottingSetup::luminosity,systsamples.FindSample("TTJets_scaledown")); |
1237 |
+ |
assert(varttbar); |
1238 |
+ |
|
1239 |
+ |
TIter nextHisto(SystPlot.GetHists()); |
1240 |
+ |
TH1F* h; |
1241 |
+ |
while ( h = (TH1F*)nextHisto() ) { |
1242 |
+ |
if(Contains(h->GetName(),"t_bar_t")) { |
1243 |
+ |
varttbar->Scale(h->Integral()/varttbar->Integral()); |
1244 |
+ |
for(int i=0;i<=h->GetNbinsX()+1;i++) {//note that we deliberatly consider the under/overflow bin as well! |
1245 |
+ |
h->SetBinContent(i,varttbar->GetBinContent(i)); |
1246 |
+ |
h->SetBinError(i,varttbar->GetBinError(i)); |
1247 |
+ |
} |
1248 |
+ |
thisto=(TH1F*)varttbar->Clone(variation.c_str()); |
1249 |
+ |
SystPlot.Modified(); |
1250 |
+ |
} |
1251 |
+ |
} |
1252 |
+ |
delete varttbar; |
1253 |
+ |
} else { |
1254 |
+ |
TIter nextHisto(SystPlot.GetHists()); |
1255 |
+ |
TH1F* h; |
1256 |
+ |
while ( h = (TH1F*)nextHisto() ) { |
1257 |
+ |
if(Contains(h->GetName(),"t_bar_t")) thisto=(TH1F*)h->Clone(variation.c_str()); |
1258 |
+ |
} |
1259 |
+ |
} |
1260 |
+ |
|
1261 |
+ |
TLegend *fullleg = allsamples.allbglegend(); |
1262 |
+ |
fullleg->SetHeader(variation.c_str()); |
1263 |
+ |
TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1); |
1264 |
+ |
kinpad->SetLogy(1); |
1265 |
+ |
kinpad->cd(); |
1266 |
+ |
|
1267 |
+ |
hdata->Draw("e1"); |
1268 |
+ |
SystPlot.Draw("histo,same"); |
1269 |
+ |
hdata->Draw("e1,same"); |
1270 |
+ |
fullleg->Draw(); |
1271 |
+ |
DrawPrelim(); |
1272 |
+ |
|
1273 |
+ |
Save_With_Ratio(hdata,SystPlot,kinpad,saveas+"_"+variation); |
1274 |
+ |
CleanLegends(); |
1275 |
+ |
|
1276 |
+ |
delete kinpad; |
1277 |
+ |
return SystPlot; |
1278 |
+ |
} |
1279 |
+ |
|
1280 |
+ |
|
1281 |
+ |
|
1282 |
+ |
void ProduceMCSystematicPlot(string variable, int nbins, float bmin, float bmax, string label, TCut thiscut, string saveas) { |
1283 |
+ |
TCanvas *ca = new TCanvas("ca","ca"); |
1284 |
+ |
TH1F *hdata = allsamples.Draw("hdata",variable,nbins,bmin,bmax,label,"events",thiscut,data,luminosity); |
1285 |
+ |
|
1286 |
+ |
TH1F *tScaleUp,*tScaleDown,*tMatchingUp,*tMatchingDown,*tCentral; |
1287 |
+ |
|
1288 |
+ |
THStack ScaleUp = MakeOneSystematicsPlot(thiscut,saveas,"ScaleUp",hdata,variable, nbins, bmin, bmax, label,tScaleUp); |
1289 |
+ |
THStack ScaleDown = MakeOneSystematicsPlot(thiscut,saveas,"ScaleDown",hdata,variable, nbins, bmin, bmax, label,tScaleDown); |
1290 |
+ |
THStack MatchingUp = MakeOneSystematicsPlot(thiscut,saveas,"MatchingUp",hdata,variable, nbins, bmin, bmax, label,tMatchingUp); |
1291 |
+ |
THStack MatchingDown = MakeOneSystematicsPlot(thiscut,saveas,"MatchingDown",hdata,variable, nbins, bmin, bmax, label,tMatchingDown); |
1292 |
+ |
|
1293 |
+ |
TH1F *HScaleUp = CollapseStack(ScaleUp); |
1294 |
+ |
TH1F *HScaleDown = CollapseStack(ScaleDown); |
1295 |
+ |
TH1F *HMatchingUp = CollapseStack(MatchingUp); |
1296 |
+ |
TH1F *HMatchingDown = CollapseStack(MatchingDown); |
1297 |
+ |
|
1298 |
+ |
THStack Central = MakeOneSystematicsPlot(thiscut,saveas,"Central",hdata,variable, nbins, bmin, bmax, label,tCentral); |
1299 |
+ |
TH1F *HCentral = CollapseStack(Central); |
1300 |
+ |
|
1301 |
+ |
TH1F *Systematic = (TH1F*)hdata->Clone("Systematic"); |
1302 |
+ |
for(int i=1;i<=Systematic->GetNbinsX();i++) { |
1303 |
+ |
float matchingup = abs(HMatchingUp->GetBinContent(i)-HCentral->GetBinContent(i)); |
1304 |
+ |
float matchingdown = abs(HMatchingDown->GetBinContent(i)-HCentral->GetBinContent(i)); |
1305 |
+ |
float scaleup = abs(HScaleUp->GetBinContent(i)-HCentral->GetBinContent(i)); |
1306 |
+ |
float scaledown = abs(HScaleDown->GetBinContent(i)-HCentral->GetBinContent(i)); |
1307 |
+ |
|
1308 |
+ |
float matching = matchingup>matchingdown?matchingup:matchingdown; |
1309 |
+ |
float scale = scaleup>scaledown?scaleup:scaledown; |
1310 |
+ |
|
1311 |
+ |
float sys=sqrt(matching*matching+scale*scale); |
1312 |
+ |
sys/=HCentral->GetBinContent(i); |
1313 |
+ |
if(HCentral->GetBinContent(i)==0) sys=0; |
1314 |
+ |
Systematic->SetBinContent(i,sys); |
1315 |
+ |
} |
1316 |
+ |
|
1317 |
+ |
TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1); |
1318 |
+ |
kinpad->SetLogy(1); |
1319 |
+ |
kinpad->cd(); |
1320 |
+ |
if(variable=="genMET") { |
1321 |
+ |
Central.Draw("histo"); |
1322 |
+ |
} else { |
1323 |
+ |
hdata->Draw("e1"); |
1324 |
+ |
Central.Draw("histo,same"); |
1325 |
+ |
hdata->Draw("e1,same"); |
1326 |
+ |
} |
1327 |
+ |
|
1328 |
+ |
DrawPrelim(); |
1329 |
+ |
|
1330 |
+ |
save_with_ratio_and_sys_band( hdata, HCentral, kinpad->cd(), saveas, false, false, "data/mc",Systematic ); |
1331 |
+ |
|
1332 |
+ |
kinpad->cd(); |
1333 |
+ |
tCentral->SetFillColor(kWhite); |
1334 |
+ |
tCentral->SetLineColor(kBlack); |
1335 |
+ |
tScaleUp->SetLineColor(kRed); |
1336 |
+ |
tScaleDown->SetLineColor(kRed); |
1337 |
+ |
tMatchingUp->SetLineColor(kBlue); |
1338 |
+ |
tMatchingDown->SetLineColor(kBlue); |
1339 |
+ |
tScaleUp->SetLineStyle(2); |
1340 |
+ |
tScaleDown->SetLineStyle(3); |
1341 |
+ |
tMatchingUp->SetLineStyle(2); |
1342 |
+ |
tMatchingDown->SetLineStyle(3); |
1343 |
+ |
|
1344 |
+ |
TLegend *leg2 = make_legend(); |
1345 |
+ |
leg2->AddEntry(hdata,"Data","p"); |
1346 |
+ |
leg2->AddEntry(tCentral,"Central (ttbar)","l"); |
1347 |
+ |
leg2->AddEntry(tScaleUp,"ScaleUp (ttbar)","l"); |
1348 |
+ |
leg2->AddEntry(tScaleDown,"ScaleDown (ttbar)","l"); |
1349 |
+ |
leg2->AddEntry(tMatchingUp,"MatchingUp (ttbar)","l"); |
1350 |
+ |
leg2->AddEntry(tMatchingDown,"MatchingDown (ttbar)","l"); |
1351 |
+ |
if(variable=="genMET") { |
1352 |
+ |
Central.Draw("histo"); |
1353 |
+ |
}else { |
1354 |
+ |
hdata->Draw("e1"); |
1355 |
+ |
Central.Draw("histo,same"); |
1356 |
+ |
hdata->Draw("e1,same"); |
1357 |
+ |
} |
1358 |
+ |
tCentral->Draw("histo,same"); |
1359 |
+ |
tScaleUp->Draw("histo,same"); |
1360 |
+ |
tScaleDown->Draw("histo,same"); |
1361 |
+ |
tMatchingUp->Draw("histo,same"); |
1362 |
+ |
tMatchingDown->Draw("histo,same"); |
1363 |
+ |
leg2->Draw(); |
1364 |
+ |
|
1365 |
+ |
CompleteSave(kinpad,saveas+"__TTbarComparison"); |
1366 |
+ |
|
1367 |
+ |
gStyle->SetOptFit(0); |
1368 |
+ |
|
1369 |
+ |
kinpad->cd(); |
1370 |
+ |
kinpad->SetLogy(0); |
1371 |
+ |
TH1F *MatchingRatio = (TH1F*)tMatchingUp->Clone("MatchingRatio"); |
1372 |
+ |
MatchingRatio->Divide(tMatchingDown); |
1373 |
+ |
TLine *lone = new TLine(tScaleUp->GetBinLowEdge(1),1,tScaleUp->GetBinLowEdge(tScaleUp->GetNbinsX())+tScaleUp->GetBinWidth(tScaleUp->GetNbinsX()),1); |
1374 |
+ |
lone->SetLineColor(TColor::GetColor("#01DF01")); |
1375 |
+ |
lone->SetLineStyle(2); |
1376 |
+ |
TH1F *ScaleRatio = (TH1F*)tScaleUp->Clone("ScaleRatio"); |
1377 |
+ |
ScaleRatio->Divide(tScaleDown); |
1378 |
+ |
MatchingRatio->GetYaxis()->SetRangeUser(0,3); |
1379 |
+ |
MatchingRatio->Draw("e1"); |
1380 |
+ |
TF1 *QP1 = new TF1("QP1","[0]+[1]*x",50,200);//simple linear function ranging from 50 to 200 |
1381 |
+ |
MatchingRatio->Fit("QP1","R"); |
1382 |
+ |
lone->Draw(); |
1383 |
+ |
stringstream summary; |
1384 |
+ |
summary << " #splitline{Fit result for f(x) = a+bx :}{#splitline{a=" << DigitsAfterComma(QP1->GetParameter(0),4) << " +/- " << DigitsAfterComma(QP1->GetParError(0),4) << "}{b=" << DigitsAfterComma(QP1->GetParameter(1),4); |
1385 |
+ |
summary << " +/- " << DigitsAfterComma(QP1->GetParError(1),4) << "}}"; |
1386 |
+ |
TText *infobox = write_title(summary.str()); |
1387 |
+ |
infobox->SetX(0.75); |
1388 |
+ |
infobox->SetTextSize(0.03); |
1389 |
+ |
infobox->SetY(0.75); |
1390 |
+ |
infobox->Draw(); |
1391 |
+ |
CompleteSave(kinpad,saveas+"__TTbarComparison_MatchingUpDividedMatchingDown"); |
1392 |
+ |
kinpad->cd(); |
1393 |
+ |
ScaleRatio->GetYaxis()->SetRangeUser(0,3); |
1394 |
+ |
ScaleRatio->Draw("e1"); |
1395 |
+ |
ScaleRatio->Fit("QP1","R"); |
1396 |
+ |
summary.str(""); |
1397 |
+ |
summary << " #splitline{Fit result for f(x) = a+bx :}{#splitline{a=" << DigitsAfterComma(QP1->GetParameter(0),4) << " +/- " << DigitsAfterComma(QP1->GetParError(0),4) << "}{b=" << DigitsAfterComma(QP1->GetParameter(1),4); |
1398 |
+ |
summary << " +/- " << DigitsAfterComma(QP1->GetParError(1),4) << "}}"; |
1399 |
+ |
TText *infobox2 = write_title(summary.str()); |
1400 |
+ |
infobox2->SetX(0.75); |
1401 |
+ |
infobox2->SetTextSize(0.03); |
1402 |
+ |
infobox2->SetY(0.75); |
1403 |
+ |
infobox2->Draw(); |
1404 |
+ |
|
1405 |
+ |
lone->Draw(); |
1406 |
+ |
CompleteSave(kinpad,saveas+"__TTbarComparison_ScaleUpDividedScaleDown"); |
1407 |
+ |
|
1408 |
+ |
|
1409 |
+ |
delete QP1; |
1410 |
+ |
delete infobox; |
1411 |
+ |
delete infobox2; |
1412 |
+ |
delete MatchingRatio; |
1413 |
+ |
delete ScaleRatio; |
1414 |
+ |
DeleteStack(ScaleUp); |
1415 |
+ |
DeleteStack(ScaleDown); |
1416 |
+ |
DeleteStack(MatchingUp); |
1417 |
+ |
DeleteStack(MatchingDown); |
1418 |
+ |
delete leg2; |
1419 |
+ |
CleanLegends(); |
1420 |
+ |
DeleteStack(Central); |
1421 |
+ |
delete Systematic; |
1422 |
+ |
delete HScaleUp; |
1423 |
+ |
delete HScaleDown; |
1424 |
+ |
delete HMatchingUp; |
1425 |
+ |
delete HMatchingDown; |
1426 |
+ |
delete hdata; |
1427 |
+ |
delete HCentral; |
1428 |
+ |
delete ca; |
1429 |
+ |
} |
1430 |
+ |
|
1431 |
+ |
void QuickProduceMCSystematicPlot(string variable, int nbins, float bmin, float bmax, string label, TCut thiscut, string saveas) { |
1432 |
+ |
TCanvas *ca = new TCanvas("ca","ca"); |
1433 |
+ |
TH1F *tScaleUp = systsamples.Draw("tScaleUp",variable,nbins,bmin,bmax,label,"events",thiscut,mc,luminosity,systsamples.FindSample("scaleup")); |
1434 |
+ |
TH1F *tScaleDown = systsamples.Draw("tScaleDown",variable,nbins,bmin,bmax,label,"events",thiscut,mc,luminosity,systsamples.FindSample("scaledown")); |
1435 |
+ |
TH1F *tMatchingUp = systsamples.Draw("tMatchingUp",variable,nbins,bmin,bmax,label,"events",thiscut,mc,luminosity,systsamples.FindSample("matchingup")); |
1436 |
+ |
TH1F *tMatchingDown = systsamples.Draw("tMatchingDown",variable,nbins,bmin,bmax,label,"events",thiscut,mc,luminosity,systsamples.FindSample("matchingdown")); |
1437 |
+ |
TH1F *tCentral = systsamples.Draw("tCentral",variable,nbins,bmin,bmax,label,"events",thiscut,mc,luminosity,systsamples.FindSample("TTJets_MassiveBinDECAY_TuneZ2sta")); |
1438 |
+ |
|
1439 |
+ |
tScaleUp->Scale(1.0/tScaleUp->Integral()); |
1440 |
+ |
tScaleDown->Scale(1.0/tScaleDown->Integral()); |
1441 |
+ |
tMatchingDown->Scale(1.0/tMatchingDown->Integral()); |
1442 |
+ |
tMatchingUp->Scale(1.0/tMatchingUp->Integral()); |
1443 |
+ |
|
1444 |
+ |
TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1); |
1445 |
+ |
kinpad->SetLogy(1); |
1446 |
+ |
kinpad->cd(); |
1447 |
+ |
tCentral->SetFillColor(kWhite); |
1448 |
+ |
tCentral->SetLineColor(kBlack); |
1449 |
+ |
tScaleUp->SetLineColor(kRed); |
1450 |
+ |
tScaleDown->SetLineColor(kRed); |
1451 |
+ |
tMatchingUp->SetLineColor(kBlue); |
1452 |
+ |
tMatchingDown->SetLineColor(kBlue); |
1453 |
+ |
tScaleUp->SetLineStyle(2); |
1454 |
+ |
tScaleDown->SetLineStyle(3); |
1455 |
+ |
tMatchingUp->SetLineStyle(2); |
1456 |
+ |
tMatchingDown->SetLineStyle(3); |
1457 |
+ |
|
1458 |
+ |
TLegend *leg2 = make_legend(); |
1459 |
+ |
leg2->AddEntry(tCentral,"Central (ttbar)","l"); |
1460 |
+ |
leg2->AddEntry(tScaleUp,"ScaleUp (ttbar)","l"); |
1461 |
+ |
leg2->AddEntry(tScaleDown,"ScaleDown (ttbar)","l"); |
1462 |
+ |
leg2->AddEntry(tMatchingUp,"MatchingUp (ttbar)","l"); |
1463 |
+ |
leg2->AddEntry(tMatchingDown,"MatchingDown (ttbar)","l"); |
1464 |
+ |
|
1465 |
+ |
tCentral->Draw("histo"); |
1466 |
+ |
tScaleUp->Draw("histo,same"); |
1467 |
+ |
tScaleDown->Draw("histo,same"); |
1468 |
+ |
tMatchingUp->Draw("histo,same"); |
1469 |
+ |
tMatchingDown->Draw("histo,same"); |
1470 |
+ |
leg2->Draw(); |
1471 |
+ |
|
1472 |
+ |
CompleteSave(kinpad,saveas+"__TTbarComparison"); |
1473 |
+ |
|
1474 |
+ |
gStyle->SetOptFit(0); |
1475 |
+ |
|
1476 |
+ |
kinpad->cd(); |
1477 |
+ |
kinpad->SetLogy(0); |
1478 |
+ |
TH1F *MatchingRatio = (TH1F*)tMatchingUp->Clone("MatchingRatio"); |
1479 |
+ |
MatchingRatio->Divide(tMatchingDown); |
1480 |
+ |
TLine *lone = new TLine(tScaleUp->GetBinLowEdge(1),1,tScaleUp->GetBinLowEdge(tScaleUp->GetNbinsX())+tScaleUp->GetBinWidth(tScaleUp->GetNbinsX()),1); |
1481 |
+ |
lone->SetLineColor(TColor::GetColor("#01DF01")); |
1482 |
+ |
lone->SetLineStyle(2); |
1483 |
+ |
TH1F *ScaleRatio = (TH1F*)tScaleUp->Clone("ScaleRatio"); |
1484 |
+ |
ScaleRatio->Divide(tScaleDown); |
1485 |
+ |
MatchingRatio->GetYaxis()->SetRangeUser(0,3); |
1486 |
+ |
MatchingRatio->Draw("e1"); |
1487 |
+ |
TF1 *QP1 = new TF1("QP1","[0]+[1]*x",50,200);//simple linear function ranging from 50 to 200 |
1488 |
+ |
MatchingRatio->Fit("QP1","RQ"); |
1489 |
+ |
lone->Draw(); |
1490 |
+ |
stringstream summary; |
1491 |
+ |
summary << " #splitline{Fit result for f(x) = a+bx :}{#splitline{a=" << DigitsAfterComma(QP1->GetParameter(0),4) << " +/- " << DigitsAfterComma(QP1->GetParError(0),4) << "}{b=" << DigitsAfterComma(QP1->GetParameter(1),4); |
1492 |
+ |
summary << " +/- " << DigitsAfterComma(QP1->GetParError(1),4) << "}}"; |
1493 |
+ |
TText *infobox = write_title(summary.str()); |
1494 |
+ |
infobox->SetX(0.75); |
1495 |
+ |
infobox->SetTextSize(0.03); |
1496 |
+ |
infobox->SetY(0.75); |
1497 |
+ |
infobox->Draw(); |
1498 |
+ |
CompleteSave(kinpad,saveas+"__TTbarComparison_MatchingUpDividedMatchingDown"); |
1499 |
+ |
kinpad->cd(); |
1500 |
+ |
ScaleRatio->GetYaxis()->SetRangeUser(0,3); |
1501 |
+ |
ScaleRatio->Draw("e1"); |
1502 |
+ |
ScaleRatio->Fit("QP1","RQ"); |
1503 |
+ |
summary.str(""); |
1504 |
+ |
summary << " #splitline{Fit result for f(x) = a+bx :}{#splitline{a=" << DigitsAfterComma(QP1->GetParameter(0),4) << " +/- " << DigitsAfterComma(QP1->GetParError(0),4) << "}{b=" << DigitsAfterComma(QP1->GetParameter(1),4); |
1505 |
+ |
summary << " +/- " << DigitsAfterComma(QP1->GetParError(1),4) << "}}"; |
1506 |
+ |
TText *infobox2 = write_title(summary.str()); |
1507 |
+ |
infobox2->SetX(0.75); |
1508 |
+ |
infobox2->SetTextSize(0.03); |
1509 |
+ |
infobox2->SetY(0.75); |
1510 |
+ |
infobox2->Draw(); |
1511 |
+ |
|
1512 |
+ |
lone->Draw(); |
1513 |
+ |
CompleteSave(kinpad,saveas+"__TTbarComparison_ScaleUpDividedScaleDown"); |
1514 |
+ |
|
1515 |
+ |
delete tScaleUp; |
1516 |
+ |
delete tScaleDown; |
1517 |
+ |
delete tCentral; |
1518 |
+ |
delete tMatchingUp; |
1519 |
+ |
delete tMatchingDown; |
1520 |
+ |
delete QP1; |
1521 |
+ |
delete infobox; |
1522 |
+ |
delete infobox2; |
1523 |
+ |
delete MatchingRatio; |
1524 |
+ |
delete ScaleRatio; |
1525 |
+ |
delete leg2; |
1526 |
+ |
CleanLegends(); |
1527 |
+ |
delete ca; |
1528 |
+ |
} |
1529 |
+ |
|
1530 |
+ |
void ProduceMCSystematicPlots() { |
1531 |
+ |
cout << "Getting ready to produce systematic plots " << endl; |
1532 |
+ |
TCut cutweightBKP = cutWeight; |
1533 |
+ |
|
1534 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&cutnJets&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/ETH_SameFlavor"); |
1535 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&cutnJets&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/ETH_OppositeFlavor"); |
1536 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&cutnJets&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/ETH_SameFlavor"); |
1537 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&cutnJets&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/ETH_OppositeFlavor"); |
1538 |
+ |
|
1539 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/ETH_SameFlavor_INCLUSIVE"); |
1540 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/ETH_OppositeFlavor_INCLUSIVE"); |
1541 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&TCut("mll>120"),"MCSystPlots/genMET/ETH_SameFlavor_INCLUSIVE_HighMass"); |
1542 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&TCut("mll>120"),"MCSystPlots/genMET/ETH_OppositeFlavor_INCLUSIVE_HighMass"); |
1543 |
+ |
|
1544 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/ETH_SameFlavor_INCLUSIVE"); |
1545 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/ETH_OppositeFlavor_INCLUSIVE"); |
1546 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&TCut("mll>120"),"MCSystPlots/MET/ETH_SameFlavor_INCLUSIVE_HighMass"); |
1547 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&TCut("mll>120"),"MCSystPlots/MET/ETH_OppositeFlavor_INCLUSIVE_HighMass"); |
1548 |
+ |
QuickProduceMCSystematicPlot("pfJetGoodNum40",8,-0.5,7.5,"NJets",cutOSSF&&cutnJets&&TCut("mll>20&&mll<70&&met[4]>100"),"MCSystPlots/NJets/ETH_SameFlavor"); |
1549 |
+ |
QuickProduceMCSystematicPlot("pfJetGoodNum40",8,-0.5,7.5,"NJets",cutOSOF&&cutnJets&&TCut("mll>20&&mll<70&&met[4]>100"),"MCSystPlots/NJets/ETH_OppositeFlavor"); |
1550 |
+ |
|
1551 |
+ |
|
1552 |
+ |
|
1553 |
+ |
cout << "Kicking cutWeight " << (const char*) cutWeight << endl; |
1554 |
+ |
cout << "Keeping OSSF cut " << (const char*)cutOSSF << endl; |
1555 |
+ |
cutWeight="1.0"; |
1556 |
+ |
|
1557 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/ETH_SameFlavor_INCLUSIVE__NOPURW"); |
1558 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/ETH_OppositeFlavor_INCLUSIVE__NOPURW"); |
1559 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&TCut("mll>120"),"MCSystPlots/genMET/ETH_SameFlavor_INCLUSIVE_HighMass__NOPURW"); |
1560 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&TCut("mll>120"),"MCSystPlots/genMET/ETH_OppositeFlavor_INCLUSIVE_HighMass__NOPURW"); |
1561 |
+ |
|
1562 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/ETH_SameFlavor_INCLUSIVE__NOPURW"); |
1563 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/ETH_OppositeFlavor_INCLUSIVE__NOPURW"); |
1564 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&TCut("mll>120"),"MCSystPlots/MET/ETH_SameFlavor_INCLUSIVE_HighMass__NOPURW"); |
1565 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&TCut("mll>120"),"MCSystPlots/MET/ETH_OppositeFlavor_INCLUSIVE_HighMass__NOPURW"); |
1566 |
+ |
|
1567 |
+ |
|
1568 |
+ |
// -------------------------------------- ***** AACHEN ***** -------------------------------------- |
1569 |
+ |
|
1570 |
+ |
|
1571 |
+ |
cutWeight=cutweightBKP; |
1572 |
+ |
TCut essentialcutBKP = essentialcut; |
1573 |
+ |
cout << (const char*) essentialcut << endl; |
1574 |
+ |
|
1575 |
+ |
essentialcut = TCut((ReplaceAll((const char*)essentialcut,"pt2>20","pt2>10")).c_str()); |
1576 |
+ |
essentialcut = TCut((ReplaceAll((const char*)essentialcut,"abs(eta1)<1.4","abs(eta1)<2.4")).c_str()); |
1577 |
+ |
essentialcut = TCut((ReplaceAll((const char*)essentialcut,"abs(eta2)<1.4","abs(eta2)<2.4")).c_str()); |
1578 |
+ |
|
1579 |
+ |
TCut cutnJetsBKP = cutnJets; |
1580 |
+ |
cutnJets = TCut((ReplaceAll((const char*)cutnJets,"pt2>20","pt2>10")).c_str()); |
1581 |
+ |
cutnJets = TCut((ReplaceAll((const char*)cutnJets,"pfJetGoodNum40>=3","pfJetGoodNum40>=2")).c_str()); |
1582 |
+ |
cutnJets = TCut((ReplaceAll((const char*)cutnJets,"abs(eta2)<1.4","abs(eta2)<2.4")).c_str()); |
1583 |
+ |
cutnJets = TCut((ReplaceAll((const char*)cutnJets,"abs(eta1)<1.4","abs(eta1)<2.4")).c_str()); |
1584 |
+ |
|
1585 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&cutnJets&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/Aachen_SameFlavor"); |
1586 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&cutnJets&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/Aachen_OppositeFlavor"); |
1587 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&cutnJets&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/Aachen_SameFlavor"); |
1588 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&cutnJets&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/Aachen_OppositeFlavor"); |
1589 |
+ |
|
1590 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/Aachen_SameFlavor_INCLUSIVE"); |
1591 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/Aachen_OppositeFlavor_INCLUSIVE"); |
1592 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&TCut("mll>120"),"MCSystPlots/genMET/Aachen_SameFlavor_INCLUSIVE_HighMass"); |
1593 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&TCut("mll>120"),"MCSystPlots/genMET/Aachen_OppositeFlavor_INCLUSIVE_HighMass"); |
1594 |
+ |
|
1595 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/Aachen_SameFlavor_INCLUSIVE"); |
1596 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/Aachen_OppositeFlavor_INCLUSIVE"); |
1597 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&TCut("mll>120"),"MCSystPlots/MET/Aachen_SameFlavor_INCLUSIVE_HighMass"); |
1598 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&TCut("mll>120"),"MCSystPlots/MET/Aachen_OppositeFlavor_INCLUSIVE_HighMass"); |
1599 |
+ |
QuickProduceMCSystematicPlot("pfJetGoodNum40",8,-0.5,7.5,"NJets",cutOSSF&&cutnJets&&TCut("mll>20&&mll<70&&met[4]>100"),"MCSystPlots/NJets/Aachen_SameFlavor"); |
1600 |
+ |
QuickProduceMCSystematicPlot("pfJetGoodNum40",8,-0.5,7.5,"NJets",cutOSOF&&cutnJets&&TCut("mll>20&&mll<70&&met[4]>100"),"MCSystPlots/NJets/Aachen_OppositeFlavor"); |
1601 |
+ |
|
1602 |
+ |
|
1603 |
+ |
|
1604 |
+ |
cout << "Kicking cutWeight " << (const char*) cutWeight << endl; |
1605 |
+ |
cout << "Keeping OSSF cut " << (const char*)cutOSSF << endl; |
1606 |
+ |
cutWeight="1.0"; |
1607 |
+ |
|
1608 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/Aachen_SameFlavor_INCLUSIVE__NOPURW"); |
1609 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&TCut("mll>20&&mll<70"),"MCSystPlots/genMET/Aachen_OppositeFlavor_INCLUSIVE__NOPURW"); |
1610 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSSF&&TCut("mll>120"),"MCSystPlots/genMET/Aachen_SameFlavor_INCLUSIVE_HighMass__NOPURW"); |
1611 |
+ |
QuickProduceMCSystematicPlot("genMET",20,0,200,"genMET [GeV]",cutOSOF&&TCut("mll>120"),"MCSystPlots/genMET/Aachen_OppositeFlavor_INCLUSIVE_HighMass__NOPURW"); |
1612 |
+ |
|
1613 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/Aachen_SameFlavor_INCLUSIVE__NOPURW"); |
1614 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&TCut("mll>20&&mll<70"),"MCSystPlots/MET/Aachen_OppositeFlavor_INCLUSIVE__NOPURW"); |
1615 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSSF&&TCut("mll>120"),"MCSystPlots/MET/Aachen_SameFlavor_INCLUSIVE_HighMass__NOPURW"); |
1616 |
+ |
QuickProduceMCSystematicPlot("met[4]",20,0,200,"PFMET [GeV]",cutOSOF&&TCut("mll>120"),"MCSystPlots/MET/Aachen_OppositeFlavor_INCLUSIVE_HighMass__NOPURW"); |
1617 |
+ |
|
1618 |
+ |
cutnJets = cutnJetsBKP; |
1619 |
+ |
cutWeight = cutweightBKP; |
1620 |
+ |
essentialcut = essentialcutBKP; |
1621 |
+ |
|
1622 |
+ |
write_error(__FUNCTION__,"Still need to add systematic shape");assert(0); |
1623 |
+ |
} |
1624 |
+ |
|
1625 |
+ |
void MakeTauPlot(string label, TCut pcut, string filename, bool TauOnly) { |
1626 |
+ |
TCut cut=pcut&&basiccut; |
1627 |
+ |
string variable="mll"; |
1628 |
+ |
string xlabel="m_{ll} [GeV]"; |
1629 |
+ |
int nbins=40; |
1630 |
+ |
float min=0; |
1631 |
+ |
float max=200; |
1632 |
+ |
|
1633 |
+ |
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
1634 |
+ |
TH1F *datahistoSF = allsamples.Draw("datahistoSF",variable,nbins,min,max, xlabel, "events",cut&&cutOSSF,data,luminosity); |
1635 |
+ |
TH1F *datahistoOF = allsamples.Draw("datahistoOF",variable,nbins,min,max, xlabel, "events",cut&&cutOSOF,data,luminosity); |
1636 |
+ |
TH1F *tauSF = allsamples.Draw("tauSF",variable,nbins,min,max, xlabel, "events",cut&&cutOSSF,data,luminosity,systsamples.FindSample("DYToTauTau")); |
1637 |
+ |
TH1F *tauOF = allsamples.Draw("tauOF",variable,nbins,min,max, xlabel, "events",cut&&cutOSOF,data,luminosity,systsamples.FindSample("DYToTauTau")); |
1638 |
+ |
datahistoSF->SetMarkerSize(DataMarkerSize); |
1639 |
+ |
datahistoSF->SetMaximum(1.3*datahistoSF->GetMaximum()); |
1640 |
+ |
datahistoOF->SetMarkerSize(DataMarkerSize); |
1641 |
+ |
datahistoOF->SetMaximum(1.3*datahistoOF->GetMaximum()); |
1642 |
+ |
|
1643 |
+ |
THStack mcstackSF = allsamples.DrawStack("mcstackSF", variable,nbins,min,max,xlabel,"events",cut&&cutOSSF,mc,luminosity); |
1644 |
+ |
THStack mcstackOF = allsamples.DrawStack("mcstackOF", variable,nbins,min,max,xlabel,"events",cut&&cutOSOF,mc,luminosity); |
1645 |
+ |
datahistoSF->Draw("e1"); |
1646 |
+ |
ckin->Update(); |
1647 |
+ |
mcstackSF.Draw("histo,same"); |
1648 |
+ |
|
1649 |
+ |
datahistoSF->Draw("same,e1"); |
1650 |
+ |
TLegend *kinleg = allsamples.allbglegend(); |
1651 |
+ |
kinleg->Draw(); |
1652 |
+ |
|
1653 |
+ |
TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1); |
1654 |
+ |
kinpad->cd(); |
1655 |
+ |
datahistoSF->Draw("e1"); |
1656 |
+ |
mcstackSF.Draw("histo,same"); |
1657 |
+ |
datahistoSF->Draw("same,e1"); |
1658 |
+ |
datahistoSF->Draw("same,axis"); |
1659 |
+ |
kinleg->Draw(); |
1660 |
+ |
DrawPrelim(); |
1661 |
+ |
Save_With_Ratio(datahistoSF,mcstackSF,kinpad->cd(),filename+"__SF_mc"); |
1662 |
+ |
|
1663 |
+ |
kinpad->cd(); |
1664 |
+ |
datahistoOF->Draw("e1"); |
1665 |
+ |
mcstackOF.Draw("histo,same"); |
1666 |
+ |
datahistoOF->Draw("same,e1"); |
1667 |
+ |
datahistoOF->Draw("same,axis"); |
1668 |
+ |
kinleg->Draw(); |
1669 |
+ |
DrawPrelim(); |
1670 |
+ |
Save_With_Ratio(datahistoOF,mcstackOF,kinpad->cd(),filename+"__OF_mc"); |
1671 |
+ |
|
1672 |
+ |
kinpad->cd(); |
1673 |
+ |
tauSF->Draw("e1"); |
1674 |
+ |
tauOF->Draw("histo,same"); |
1675 |
+ |
tauSF->Draw("e1,same"); |
1676 |
+ |
TLegend *legtau = make_legend(); |
1677 |
+ |
legtau->AddEntry(tauSF,"DY->#tau#tau, SF","p"); |
1678 |
+ |
legtau->AddEntry(tauSF,"DY->#tau#tau, OF","l"); |
1679 |
+ |
legtau->Draw(); |
1680 |
+ |
DrawPrelim(); |
1681 |
+ |
Save_With_Ratio(tauSF,tauOF,kinpad->cd(),filename+"__Tau_SF_vs_OF"); |
1682 |
+ |
|
1683 |
+ |
delete datahistoSF; |
1684 |
+ |
delete datahistoOF; |
1685 |
+ |
delete tauSF; |
1686 |
+ |
delete tauOF; |
1687 |
+ |
delete kinpad; |
1688 |
+ |
delete ckin; |
1689 |
+ |
CleanLegends(); |
1690 |
+ |
} |
1691 |
+ |
|
1692 |
|
|
1693 |
+ |
void TauQuestion() { |
1694 |
+ |
// MakeTauPlot("MET>100 GeV, #geq 3 jets",cutnJets&&TCut("met[4]>100"),"TauQ/MET100_3Jets",true); |
1695 |
+ |
// MakeTauPlot("MET>100 GeV",TCut("met[4]>100"),"TauQ/MET100",true); |
1696 |
+ |
// MakeTauPlot("MET>0 GeV",TCut("met[4]>0"),"TauQ/MET0",true); |
1697 |
+ |
MakeTauPlot("b-tag veto, 50<MET<100",TCut("pfJetGoodNumBtag30==0&&met[4]>50&&met[4]<100"),"TauQ/ControlPlots",false); |
1698 |
|
} |
1699 |
|
|
1700 |
|
void do_kinematic_plots(string mcjzb, string datajzb, bool doPF=false) |
1701 |
|
{ |
1702 |
+ |
// switch_overunderflow(true); |
1703 |
|
bool dolog=true; |
1704 |
|
bool nolog=false; |
1705 |
+ |
|
1706 |
+ |
bool doOFSF = false; |
1707 |
+ |
bool doKin = true; |
1708 |
+ |
bool doDataComp = false; |
1709 |
+ |
bool MakeTwoThreeJetComparison = false; |
1710 |
+ |
|
1711 |
+ |
|
1712 |
|
if(doPF) write_warning(__FUNCTION__,"Please use caution when trying to produce PF plots; not all versions of the JZB trees have these variables!"); |
1713 |
|
float mll_low=50; |
1714 |
|
float mll_hi=160; |
1715 |
|
if(!PlottingSetup::RestrictToMassPeak) { |
1716 |
|
mll_low=20; |
1717 |
< |
mll_hi=300; |
1717 |
> |
mll_hi=320; |
1718 |
|
} |
1719 |
+ |
|
1720 |
+ |
if(MakeTwoThreeJetComparison) MakeElegantTwoThreeComparisons(); |
1721 |
+ |
|
1722 |
+ |
//TauQuestion(); |
1723 |
|
|
1724 |
< |
make_OFSF_plot("pfJetGoodNum40", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 5, 3, 8, true, "N. jets", "njetsLow", false, false, false, 0.2); |
1725 |
< |
make_OFSF_plot("pfJetGoodNum40", "mll>40&&mll<70&&met[4]>100", "40 GeV < mll < 70 GeV", 5, 3, 8, true, "N. jets", "njetsMed", false, false, false, 0.2); |
1726 |
< |
make_OFSF_plot("pfJetGoodPt[0]/pfJetGoodPt[1]", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 20, 1, 10, true, "pt_{j}^{1}/pt_{j}^{2}", "jpt1pt2Low", false, false, false, 0.2); |
1727 |
< |
make_OFSF_plot("pfJetGoodPt[0]/pfJetGoodPt[1]", "mll>40&&mll<70&&met[4]>100", "40 GeV < mll < 70 GeV", 20, 1, 10, true, "pt_{j}^{1}/pt_{j}^{2}", "jpt1pt2Med", false, false, false, 0.2); |
1728 |
< |
make_OFSF_plot("TMath::Abs(pfJetDphiMet[0])", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 16, 0, 3.2, false, "|#Delta#phi(jet1,MET)|", "dphijetmetLow", false, false, false, 0.0); |
1729 |
< |
make_OFSF_plot("TMath::Abs(pfJetDphiMet[0])", "mll>40&&mll<70&&met[4]>100", "40 GeV < mll < 70 GeV", 16, 0, 3.2, false, "|#Delta#phi(jet1,MET)|", "dphijetmetMed", false, false, false, 0.0); |
1730 |
< |
make_OFSF_plot("TMath::Abs(dphi)", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 16, 0, 3.2, false, "|#Delta#phi(l1,l2)|", "dphiLow", false, false, false, 0.2); |
1731 |
< |
make_OFSF_plot("TMath::Abs(dphi)", "mll>40&&mll<70&&met[4]>100", "40 GeV < mll < 70 GeV", 16, 0, 3.2, false, "|#Delta#phi(l1,l2)|", "dphiMed", false, false, false, 0.2); |
1732 |
< |
make_OFSF_plot("TMath::Abs(dphiMet1)", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 16, 0, 3.2, false, "|#Delta#phi(l1,MET)|", "dphiMet1Low", false, false, false, 0.2); |
1733 |
< |
make_OFSF_plot("TMath::Abs(dphiMet1)", "mll>40&&mll<70&&met[4]>100", "40 GeV < mll < 70 GeV", 16, 0, 3.2, false, "|#Delta#phi(l1,MET)|", "dphiMet1Med", false, false, false, 0.2); |
1734 |
< |
make_OFSF_plot("TMath::Abs(dphiMet2)", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 16, 0, 3.2, false, "|#Delta#phi(l2,MET)|", "dphiMet2Low", false, false, false, 0.2); |
1735 |
< |
make_OFSF_plot("TMath::Abs(dphiMet2)", "mll>40&&mll<70&&met[4]>100", "40 GeV < mll < 70 GeV", 16, 0, 3.2, false, "|#Delta#phi(l2,MET)|", "dphiMet2Med", false, false, false, 0.2); |
1736 |
< |
make_OFSF_plot("TMath::Min(TMath::Abs(dphiMet1), TMath::Abs(dphiMet2))", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 16, 0, 3.2, false, "Min(|#Delta#phi(l,MET)|)", "dphilcLow", false, false, false, 0.2); |
1737 |
< |
make_OFSF_plot("TMath::Min(TMath::Abs(dphiMet1), TMath::Abs(dphiMet2))", "mll>40&&mll<70&&met[4]>100", "40 GeV < mll < 70 GeV", 16, 0, 3.2, false, "Min(|#Delta#phi(l,MET)|)", "dphilcMed", false, false, false, 0.2); |
1738 |
< |
make_OFSF_plot("TMath::Min(TMath::Abs(pfJetDphiMet[0]), TMath::Min(TMath::Abs(pfJetDphiMet[1]), TMath::Abs(pfJetDphiMet[2])))", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 16, 0, 3.2, false, "Min(|#Delta#phi(jet,MET)|)", "dphijcLow", false, false, false, 0.2); |
1739 |
< |
make_OFSF_plot("TMath::Min(TMath::Abs(pfJetDphiMet[0]), TMath::Min(TMath::Abs(pfJetDphiMet[1]), TMath::Abs(pfJetDphiMet[2])))", "mll>20&&mll<40&&met[4]>100", "40 GeV < mll < 70 GeV", 16, 0, 3.2, false, "Min(|#Delta#phi(jet,MET)|)", "dphijcMed", false, false, false, 0.2); |
1740 |
< |
make_OFSF_plot("TMath::Min((TMath::Pi()-TMath::Abs(dphiMet1)), (TMath::Pi() - TMath::Abs(dphiMet2)))", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 16, 0, 3.2, false, "Min(#Pi - |#Delta#phi(l,MET)|)", "dphilcoLow", false, false, false, 0.2); |
1741 |
< |
make_OFSF_plot("TMath::Min((TMath::Pi()-TMath::Abs(dphiMet1)), (TMath::Pi() - TMath::Abs(dphiMet2)))", "mll>20&&mll<40&&met[4]>100", "40 GeV < mll < 70 GeV", 16, 0, 3.2, false, "Min(#Pi - |#Delta#phi(l,MET)|)", "dphilcoMed", false, false, false, 0.2); |
1742 |
< |
make_OFSF_plot("TMath::Min((TMath::Pi()-TMath::Abs(pfJetDphiMet[0])), TMath::Min( (TMath::Pi()-TMath::Abs(pfJetDphiMet[1])), (TMath::Pi() - TMath::Abs(pfJetDphiMet[2]))))", "mll>20&&mll<40&&met[4]>100", "20 GeV < mll < 40 GeV", 16, 0, 3.2, false, "Min(#Pi - |#Delta#phi(jet,MET)|)", "dphijcoLow", false, false, false, 0.2); |
1743 |
< |
make_OFSF_plot("TMath::Min((TMath::Pi()-TMath::Abs(pfJetDphiMet[0])), TMath::Min( (TMath::Pi()-TMath::Abs(pfJetDphiMet[1])), (TMath::Pi() - TMath::Abs(pfJetDphiMet[2]))))", "mll>20&&mll<40&&met[4]>100", "40 GeV < mll < 70 GeV", 16, 0, 3.2, false, "Min(#Pi - |#Delta#phi(jet,MET)|)", "dphijcoMed", false, false, false, 0.2); |
1744 |
< |
|
1745 |
< |
|
1746 |
< |
|
1747 |
< |
make_kin_plot("met[4]","",70,0,350,dolog,"MET [GeV]","met",doPF,true); |
1748 |
< |
|
1749 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll",doPF,true); |
1750 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof",doPF,true,true); |
1751 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee",doPF,true); |
1752 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_mm",doPF,true); |
1753 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive",doPF,true); |
1754 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_ee",doPF,true); |
1755 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_mm",doPF,true); |
1756 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true); |
1757 |
< |
make_kin_plot("mll","",(int)((350-mll_low))/5,mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF); |
1758 |
< |
if(!doPF) make_special_mll_plot((int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]"); |
1759 |
< |
|
1760 |
< |
make_kin_plot("pfJetGoodPt[0]/pfJetGoodPt[1]","",45,1,10,dolog,"pt_{j}^{1}/pt_{j}^{2}","j1j2ratio",doPF,true); |
1761 |
< |
make_kin_plot("TMath::Abs(pfJetDphiMet[0])","",32,0,3.2,nolog,"|#Delta#phi(jet1,MET)|","dphiJ1MET",doPF,true); |
1762 |
< |
|
1763 |
< |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets",doPF); |
1764 |
< |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_osof",doPF); |
1765 |
< |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_nocuts_except_mll_ossf",doPF); |
1766 |
< |
|
1767 |
< |
make_kin_plot("numVtx","",(int)(30.5-(-0.5)),-0.5,30.5,nolog,"N(Vtx)","numVtx",doPF); |
1768 |
< |
// make_kin_plot("jetpt[0]","",40,0,200,dolog,"leading jet p_{T} [GeV]","pfJetGoodPt_0",doPF); |
1769 |
< |
// make_kin_plot("jeteta[0]","",40,-5,5,nolog,"leading jet #eta","pfJetGoodEta_0",doPF); |
1770 |
< |
make_kin_plot("pt","",50,0,500,dolog,"Z p_{T} [GeV]","Zpt",doPF); |
1771 |
< |
make_kin_plot("pt1","",50,0,200,nolog,"p_{T} [GeV]","pt1",doPF); |
1772 |
< |
make_kin_plot("pt2","",50,0,200,nolog,"p_{T} [GeV]","pt2",doPF); |
1773 |
< |
make_kin_plot("eta1","",40,-3,3,nolog,"#eta_{l}","eta",doPF); |
1774 |
< |
make_kin_plot("jzb[1]","",100,-150,200,dolog,"JZB [GeV]","jzb_ossf",doPF); |
1775 |
< |
stringstream jzbcut; |
1776 |
< |
jzbcut << "((is_data&&("<<datajzb<<")>100)||(!is_data&&("<<mcjzb<<")>100))"; |
1777 |
< |
make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_aboveJZB100",doPF,true); |
1778 |
< |
make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_osof_aboveJZB100",doPF,true); |
1779 |
< |
make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_ee_aboveJZB100",doPF,true); |
1780 |
< |
make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_mm_aboveJZB100",doPF,true); |
1781 |
< |
stringstream jzbcut2; |
1782 |
< |
jzbcut2 << "((is_data&&("<<datajzb<<")>150)||(!is_data&&("<<mcjzb<<")>150))"; |
1783 |
< |
make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_aboveJZB150",doPF,true); |
1784 |
< |
make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_osof_aboveJZB150",doPF,true); |
1785 |
< |
make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_ee_aboveJZB150",doPF,true); |
1786 |
< |
make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_mm_aboveJZB150",doPF,true); |
1787 |
< |
stringstream jzbcut3; |
1788 |
< |
jzbcut3 << "((is_data&&("<<datajzb<<")>50)||(!is_data&&("<<mcjzb<<")>50))"; |
1789 |
< |
make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_aboveJZB50",doPF,true); |
1790 |
< |
make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_osof_aboveJZB50",doPF,true,true); |
1791 |
< |
make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_ee_aboveJZB50",doPF,true); |
1792 |
< |
make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_mm_aboveJZB50",doPF,true); |
1793 |
< |
|
1794 |
< |
make_kin_plot("mll","met[4]>100",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV] (MET>100GeV)","mll_met100",doPF,true); |
1795 |
< |
|
1796 |
< |
make_special_obs_pred_mll_plot(datajzb,mcjzb,0); |
1797 |
< |
make_special_obs_pred_mll_plot(datajzb,mcjzb,50); |
1798 |
< |
make_special_obs_pred_mll_plot(datajzb,mcjzb,80); |
1799 |
< |
make_special_obs_pred_mll_plot(datajzb,mcjzb,100); |
1800 |
< |
// make_special_obs_pred_mll_plot(datajzb,mcjzb,150); |
1801 |
< |
// make_special_obs_pred_mll_plot(datajzb,mcjzb,200); |
1802 |
< |
// make_special_obs_pred_mll_plot(datajzb,mcjzb,250); |
1803 |
< |
|
1804 |
< |
make_JES_plot(cutmass&&cutOSSF&&basiccut,"_ossf"); |
1805 |
< |
make_JES_plot(cutmass&&cutOSOF&&basiccut,"_osof"); |
1806 |
< |
|
1724 |
> |
//ProduceJanPlots(); |
1725 |
> |
//ProduceMCSystematicPlots(); |
1726 |
> |
// make_plain_kin_plot("pt",Cut2Str(cutOSSF&&TCut("mll>20&&pfJetGoodNumBtag30>=2")),40,0,200,nolog,"Z p_{T}","PlotForKostas",doPF,true); |
1727 |
> |
|
1728 |
> |
if ( doOFSF ) { |
1729 |
> |
make_OFSF_plots("mll", "met[4]>100", 60, 20., 320., false, "m_{ll}", "mll"); |
1730 |
> |
make_OFSF_plots("met[4]", "met[4]>100", 30, 100., 400., false, "PFMET", "met"); |
1731 |
> |
make_OFSF_plots("leptonNum", "met[4]>100", 3, 2, 5., false, "N(leptons)", "NLeptons"); |
1732 |
> |
|
1733 |
> |
make_OFSF_plots("pfJetGoodNum40", "met[4]>100", 7, 3, 10, true, "#(jets)", "njets"); |
1734 |
> |
make_OFSF_plots("pfJetGoodNum40", "met[4]>100&&pfJetGoodNumBtag30==0", 7, 3, 10, true, "#(jets)", "njets_btagVeto"); |
1735 |
> |
make_OFSF_plots("pfJetGoodNum40", "met[4]>100&&pfJetGoodNumBtag30>0", 7, 3, 10, true, "#(jets)", "njets_AtLeastOneBJet30"); |
1736 |
> |
|
1737 |
> |
make_OFSF_plots("pfJetGoodNumBtag30", "met[4]>100", 5, 0, 5, true, "#(b-jets)", "nbjets"); |
1738 |
> |
make_OFSF_plots("pfJetGoodPtBtag[0]", "met[4]>100&&pfJetGoodNumBtag30>0", 20, 0, 400, true, "p_{T}(leading b-jet)", "ptb1"); |
1739 |
> |
|
1740 |
> |
make_OFSF_plots("iso1", "met[4]>100", 20, 0, 0.3, true, "lepton 1 isolation", "iso1"); |
1741 |
> |
make_OFSF_plots("iso2", "met[4]>100", 20, 0, 0.3, true, "lepton 2 isolation", "iso2"); |
1742 |
> |
make_OFSF_plots("pt1", "met[4]>100", 30, 0., 300., true, "p_{T,1}", "pt1"); |
1743 |
> |
make_OFSF_plots("pt2", "met[4]>100", 22, 0., 220., true, "p_{T,2}", "pt2"); |
1744 |
> |
make_OFSF_plots("eta1", "met[4]>100", 10, -2.5, 2.5, false, "#eta_{1}", "eta1", 0.15); |
1745 |
> |
make_OFSF_plots("eta2", "met[4]>100", 10, -2.5, 2.5, false, "#eta_{2}", "eta2", 0.15); |
1746 |
> |
make_OFSF_plots("phi1", "met[4]>100", 10, -TMath::Pi(), TMath::Pi(), false, "#phi_{1}", "phi1", 0.2); |
1747 |
> |
make_OFSF_plots("phi2", "met[4]>100", 10, -TMath::Pi(), TMath::Pi(), false, "#phi_{2}", "phi2", 0.2); |
1748 |
> |
make_OFSF_plots("pfJetGoodPt[0]/pfJetGoodPt[1]", "met[4]>100", 20, 1, 10, true, "pt_{j}^{1}/pt_{j}^{2}", "jpt1pt2", 0.2); |
1749 |
> |
make_OFSF_plots("TMath::Abs(pfJetDphiMet[0])", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(jet1,MET)|", "dphij1met", 0.2); |
1750 |
> |
make_OFSF_plots("TMath::Abs(dphi)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l1,l2)|", "dphi", 0.2); |
1751 |
> |
make_OFSF_plots("TMath::Abs(dphiMet1)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l1,MET)|", "dphiMet1", 0.2); |
1752 |
> |
make_OFSF_plots("TMath::Abs(dphiMet2)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l2,MET)|", "dphiMet2", 0.2); |
1753 |
> |
make_OFSF_plots("TMath::Min(TMath::Abs(dphiMet1), TMath::Abs(dphiMet2))", "met[4]>100", 16, 0, 3.2, false, "Min(|#Delta#phi(l,MET)|)", "dphilc"); |
1754 |
> |
make_OFSF_plots("TMath::Min(TMath::Abs(pfJetDphiMet[0]), TMath::Min(TMath::Abs(pfJetDphiMet[1]), TMath::Abs(pfJetDphiMet[2])))", "met[4]>100", 16, 0, 3.2, false, "Min(|#Delta#phi(jet,MET)|)", "dphijc"); |
1755 |
> |
make_OFSF_plots("TMath::Min((TMath::Pi()-TMath::Abs(dphiMet1)), (TMath::Pi() - TMath::Abs(dphiMet2)))", "met[4]>100", 16, 0, 3.2, false, "Min(#pi - |#Delta#phi(l,MET)|)", "dphilco"); |
1756 |
> |
make_OFSF_plots("TMath::Min((TMath::Pi()-TMath::Abs(pfJetDphiMet[0])), TMath::Min( (TMath::Pi()-TMath::Abs(pfJetDphiMet[1])), (TMath::Pi() - TMath::Abs(pfJetDphiMet[2]))))", "met[4]>100", 16, 0, 3.2, false, "Min(#pi - |#Delta#phi(jet,MET)|)", "dphijco"); |
1757 |
> |
} |
1758 |
> |
|
1759 |
> |
if ( doDataComp) { |
1760 |
> |
TCut mllCut(""); |
1761 |
> |
float massmin = 15.; |
1762 |
> |
float massmax = 315; |
1763 |
> |
int massnbins = 60; |
1764 |
> |
/* if ( !PlottingSetup::openBox ) { |
1765 |
> |
mllCut = "mll>70"; |
1766 |
> |
massmin = 120; |
1767 |
> |
massmax = 360; |
1768 |
> |
massnbins = 14; |
1769 |
> |
}*/ |
1770 |
> |
|
1771 |
> |
TCut cutSignal = cutmass&&cutnJets&&"met[4]>100"; |
1772 |
> |
|
1773 |
> |
make_data_comparison_plot("numVtx", "",40, -0.5, 39.5,-1., true, "N(Vertices)", "numVtx"); |
1774 |
> |
make_data_comparison_plot("pfJetGoodEta[0]", "",50, -3.0, 3.0,-1., true, "N(Jets)", "pfJetGoodEta0"); |
1775 |
> |
|
1776 |
> |
|
1777 |
> |
make_data_comparison_plot("pfJetGoodNum40", cutOSOF,10, -0.5, 9.5,-1., true, "N(Jets)", "njets_OF"); |
1778 |
> |
make_data_comparison_plot("met[4]", cutOSSF,60, 0., 300.,-1., true, "pfMET", "met_SF_inclusive"); |
1779 |
> |
make_data_comparison_plot("met[1]", cutOSSF,60, 0., 300.,-1., true, "type 1 corrected pfMET", "mett1_SF_inclusive"); |
1780 |
> |
make_data_comparison_plot("met[4]", cutOSOF,60, 0., 300.,-1., true, "pfMET", "met_OF_inclusive"); |
1781 |
> |
make_data_comparison_plot("met[1]", cutOSOF,60, 0., 300.,-1., true, "type 1 corrected pfMET", "mett1_OF_inclusive"); |
1782 |
> |
|
1783 |
> |
make_data_comparison_plot("met[4]", cutnJets&&cutOSSF,60, 0., 300.,-1., true, "pfMET", "met_SF_exclusive"); |
1784 |
> |
make_data_comparison_plot("met[1]", cutnJets&&cutOSSF,60, 0., 300.,-1., true, "type 1 corrected pfMET", "mett1_SF_exclusive"); |
1785 |
> |
make_data_comparison_plot("met[4]", cutnJets&&cutOSOF,60, 0., 300.,-1., true, "pfMET", "met_OF_exclusive"); |
1786 |
> |
make_data_comparison_plot("met[1]", cutnJets&&cutOSOF,60, 0., 300.,-1., true, "type 1 corrected pfMET", "mett1_OF_exclusive"); |
1787 |
> |
|
1788 |
> |
|
1789 |
> |
string basiccutsaved = (const char*)basiccut; |
1790 |
> |
|
1791 |
> |
string newbasiccut=basiccutsaved; |
1792 |
> |
|
1793 |
> |
size_t found; |
1794 |
> |
found = newbasiccut.find( "pt2>20" ); |
1795 |
> |
while (found!=string::npos){ |
1796 |
> |
newbasiccut.replace( found, string( "pt2>20" ).length(), "pt2>10" ); |
1797 |
> |
found = newbasiccut.find( "pt2>20" ); |
1798 |
> |
} |
1799 |
> |
basiccut=TCut(newbasiccut.c_str()); |
1800 |
> |
make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=2&&met[4]>150")&&cutOSSF,60, 0., 300.,-1., false, "mll", "mll_SF_Aachen_pt2010_met"); |
1801 |
> |
make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=2&&met[4]>150")&&cutOSOF,60, 0., 300.,-1., false, "mll", "mll_OF_Aachen_pt2010_met"); |
1802 |
> |
make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=2&&met[1]>150")&&cutOSSF,60, 0., 300.,-1., true, "mll", "mll_SF_Aachen_pt2010_t1cpfmet"); |
1803 |
> |
make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=2&&met[1]>150")&&cutOSOF,60, 0., 300.,-1., true, "mll", "mll_OF_Aachen_pt2010_t1cpfmet"); |
1804 |
> |
basiccut=TCut(basiccutsaved.c_str()); |
1805 |
> |
|
1806 |
> |
make_data_comparison_plot("pfJetGoodNum40", cutOSSF, 8, 0., 8.,-1., true, "#(jets)", "njets_SF"); |
1807 |
> |
make_data_comparison_plot("pfJetGoodNum40", cutOSOF, 8, 0., 8.,-1., true, "#(jets)", "njets_OF"); |
1808 |
> |
|
1809 |
> |
make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=3&&met[4]>100")&&cutOSSF,60, 0., 300.,-1., true, "mll", "mll_SF_ETH_met"); |
1810 |
> |
make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=3&&met[4]>100")&&cutOSOF,60, 0., 300.,-1., true, "mll", "mll_OF_ETH_met"); |
1811 |
> |
make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=3&&met[1]>100")&&cutOSSF,60, 0., 300.,-1., true, "mll", "mll_SF_ETH_t1cpfmet"); |
1812 |
> |
make_data_comparison_plot("mll", TCut("pfJetGoodNum40>=3&&met[1]>100")&&cutOSOF,60, 0., 300.,-1., true, "mll", "mll_OF_ETH_t1cpfmet"); |
1813 |
> |
|
1814 |
> |
|
1815 |
> |
make_data_comparison_plot("mll", cutOSSF,60, 15., 315.,-1., true, "m_{ll}", "mll_SF_inclusive"); |
1816 |
> |
make_data_comparison_plot("mll", cutOSSF&&TCut("id1==0"),60, 15., 315.,-1., true, "m_{ll}", "mll_SF_inclusive_ee"); |
1817 |
> |
make_data_comparison_plot("mll", cutOSSF&&TCut("id1==1"),60, 15., 315.,-1., true, "m_{ll}", "mll_SF_inclusive_mm"); |
1818 |
> |
make_data_comparison_plot("mll", cutOSOF,60, 15., 315.,-1., true, "m_{ll}", "mll_OF_inclusive"); |
1819 |
> |
make_data_comparison_plot("mll", cutnJets&&cutOSSF&&TCut("id1==0"),60, 15., 315.,-1., true, "m_{ll}", "mll_SF_exclusive_ee"); |
1820 |
> |
make_data_comparison_plot("mll", cutnJets&&cutOSSF&&TCut("id1==1"),60, 15., 315.,-1., true, "m_{ll}", "mll_SF_exclusive_mm"); |
1821 |
> |
make_data_comparison_plot("mll", cutnJets&&cutOSSF,60, 15., 315.,-1., true, "m_{ll}", "mll_SF_exclusive"); |
1822 |
> |
make_data_comparison_plot("mll", cutnJets&&cutOSOF,60, 15., 315.,-1., true, "m_{ll}", "mll_OF_exclusive"); |
1823 |
> |
|
1824 |
> |
make_data_comparison_plot("mll", cutOSSF&&cutSignal&&mllCut, massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_sig"); |
1825 |
> |
make_data_comparison_plot("mll", cutOSOF&&cutSignal&&mllCut, massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig"); |
1826 |
> |
|
1827 |
> |
make_data_comparison_plot("mll", TCut("abs(eta1)<1.4&&abs(eta2)<1.4") && cutOSSF&&cutSignal&&mllCut, massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_sig_central"); |
1828 |
> |
make_data_comparison_plot("mll", TCut("abs(eta1)<1.4&&abs(eta2)<1.4") && cutOSOF&&cutSignal&&mllCut, massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig_central"); |
1829 |
> |
|
1830 |
> |
make_data_comparison_plot("mll", cutOSSF&&cutSignal&&mllCut&&"pfJetGoodNumBtag30==0", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_sig_btagVeto"); |
1831 |
> |
make_data_comparison_plot("mll", cutOSOF&&cutSignal&&mllCut&&"pfJetGoodNumBtag30==0", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig_btagVeto"); |
1832 |
> |
|
1833 |
> |
make_data_comparison_plot("mll", cutOSSF&&cutSignal&&mllCut&&"pfJetGoodNumBtag30>0", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_sig_AtLeastOneBJet"); |
1834 |
> |
make_data_comparison_plot("mll", cutOSOF&&cutSignal&&mllCut&&"pfJetGoodNumBtag30>0", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig_AtLeastOneBJet"); |
1835 |
> |
|
1836 |
> |
|
1837 |
> |
make_data_comparison_plot("mll", mllCut&&cutOSOF&&cutSignal, massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_sig"); |
1838 |
> |
make_data_comparison_plot("mll", cutmass&&cutOSSF&&"met[4]>100&&met[4]<150&&pfJetGoodNum40==2", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_SF_CR"); |
1839 |
> |
make_data_comparison_plot("mll", cutmass&&cutOSOF&&"met[4]>100&&met[4]<150&&pfJetGoodNum40==2", massnbins, 15., 315.,-1., false, "m_{ll}", "mll_OF_CR"); |
1840 |
> |
|
1841 |
> |
make_data_comparison_plot("pfJetGoodNum40", cutOSSF&&cutSignal&&mllCut, 8, 0., 8.,-1., false, "#(jets)", "njets_SF_sig"); |
1842 |
> |
make_data_comparison_plot("pfJetGoodNum40", cutOSOF&&cutSignal&&mllCut, 8, 0., 8.,-1., false, "#(jets)", "njets_OF_sig"); |
1843 |
> |
make_data_comparison_plot("pfJetGoodNumBtag30", cutOSSF&&cutSignal&&mllCut, 8, 0., 8.,-1., false, "#(b-jets)", "nbjets_SF_sig"); |
1844 |
> |
make_data_comparison_plot("pfJetGoodNumBtag30", cutOSOF&&cutSignal&&mllCut, 8, 0., 8.,-1., false, "#(b-jets)", "nbjets_OF_sig"); |
1845 |
> |
|
1846 |
> |
} |
1847 |
> |
|
1848 |
> |
|
1849 |
> |
if ( doKin ) { |
1850 |
> |
string mllCut(""); |
1851 |
> |
|
1852 |
> |
|
1853 |
> |
|
1854 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==0")),40,0,400,dolog,"PFMET","Debunking/MET_OF_30to70_0j",doPF,true); |
1855 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==1")),40,0,400,dolog,"PFMET","Debunking/MET_OF_30to70_1j",doPF,true); |
1856 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==2")),40,0,400,dolog,"PFMET","Debunking/MET_OF_30to70_2j",doPF,true); |
1857 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==3")),40,0,400,dolog,"PFMET","Debunking/MET_OF_30to70_3j",doPF,true); |
1858 |
> |
|
1859 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==0")),40,0,400,dolog,"PFMET","Debunking/MET_OF_Z_0j",doPF,true); |
1860 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==1")),40,0,400,dolog,"PFMET","Debunking/MET_OF_Z_1j",doPF,true); |
1861 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==2")),40,0,400,dolog,"PFMET","Debunking/MET_OF_Z_2j",doPF,true); |
1862 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==3")),40,0,400,dolog,"PFMET","Debunking/MET_OF_Z_3j",doPF,true); |
1863 |
> |
|
1864 |
> |
|
1865 |
> |
make_plain_kin_plot("pfTightHT",Cut2Str(cutOSOF&&cutnJets),120,0,1200,dolog,"H_{T}","HT_3jets_OF",doPF,true); |
1866 |
> |
make_plain_kin_plot("pfTightHT",Cut2Str(cutOSSF&&cutnJets) ,120,0,1200,dolog,"H_{T}","HT_3jets_SF",doPF,true); |
1867 |
> |
make_plain_kin_plot("pfTightHT",Cut2Str(cutOSOF&&cutnJets&&TCut("met[4]>100")),120,0,1200,dolog,"H_{T}","HT_3jets_OF_MET100",doPF,true); |
1868 |
> |
make_plain_kin_plot("pfTightHT",Cut2Str(cutOSSF&&cutnJets&&TCut("met[4]>100")) ,120,0,1200,dolog,"H_{T}","HT_3jets_SF_MET100",doPF,true); |
1869 |
> |
|
1870 |
> |
|
1871 |
> |
make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==0")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_30to70_0j",doPF,true); |
1872 |
> |
make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==1")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_30to70_1j",doPF,true); |
1873 |
> |
make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==2")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_30to70_2j",doPF,true); |
1874 |
> |
make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==3")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_30to70_3j",doPF,true); |
1875 |
> |
|
1876 |
> |
make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==0")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_Z_0j",doPF,true); |
1877 |
> |
make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==1")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_Z_1j",doPF,true); |
1878 |
> |
make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==2")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_Z_2j",doPF,true); |
1879 |
> |
make_plain_kin_plot("met[1]",Cut2Str(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==3")),40,0,400,dolog,"PFMET","Debunking/T1MET_OF_Z_3j",doPF,true); |
1880 |
> |
|
1881 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSSF&&cutnJets&&TCut("mll>20&&mll<70")),50,0,300,dolog,"PFMET","MET_SF_20to70",doPF,true); |
1882 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&cutnJets&&TCut("mll>20&&mll<70")),50,0,300,dolog,"PFMET","MET_OF_20to70",doPF,true); |
1883 |
> |
|
1884 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSSF&&cutnJets&&TCut("mll>120")),50,0,300,dolog,"PFMET","MET_SF_above120",doPF,true); |
1885 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&cutnJets&&TCut("mll>120")),50,0,300,dolog,"PFMET","MET_OF_above120",doPF,true); |
1886 |
> |
|
1887 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSSF&&TCut("pfJetGoodNum40==2")&&TCut("mll>20&&mll<70")),50,0,300,dolog,"PFMET","MET_SF_20to70___2jetsonly",doPF,true); |
1888 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("pfJetGoodNum40==2")&&TCut("mll>20&&mll<70")),50,0,300,dolog,"PFMET","MET_OF_20to70___2jetsonly",doPF,true); |
1889 |
> |
|
1890 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSSF&&TCut("pfJetGoodNum40==2")&&TCut("mll>120")),50,0,300,dolog,"PFMET","MET_SF_above120___2jetsonly",doPF,true); |
1891 |
> |
make_plain_kin_plot("met[4]",Cut2Str(cutOSOF&&TCut("pfJetGoodNum40==2")&&TCut("mll>120")),50,0,300,dolog,"PFMET","MET_OF_above120___2jetsonly",doPF,true); |
1892 |
> |
|
1893 |
> |
|
1894 |
> |
make_kin_plot("pfJetGoodPt[0]/pfJetGoodPt[1]","",45,1,10,dolog,"pt_{j}^{1}/pt_{j}^{2}","j1j2ratio",doPF,true); |
1895 |
> |
make_kin_plot("TMath::Abs(pfJetDphiMet[0])","",32,0,3.2,nolog,"|#Delta#phi(jet1,MET)|","dphiJ1MET",doPF,true); |
1896 |
> |
// Plots in signal region |
1897 |
> |
make_kin_plot("met[4]","",70,0,350,dolog,"MET [GeV]","met",doPF,true); |
1898 |
> |
|
1899 |
> |
|
1900 |
> |
make_kin_plot("MetFactor","",20,0,2,nolog,"MetFactor","MetFactor",doPF,true); |
1901 |
> |
|
1902 |
> |
make_ttbar_comparison("met[4]",40,0,400,(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==2")),dolog,"PFMET","Debunking/MET_OF_30to70_2j__ALLMCSAMPLES"); |
1903 |
> |
/* |
1904 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==0")),dolog,"PFMET","Debunking/MET_OF_30to70_0j"); |
1905 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSOF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==1")),dolog,"PFMET","Debunking/MET_OF_30to70_1j"); |
1906 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==2")),dolog,"PFMET","Debunking/MET_OF_30to70_2j"); |
1907 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSOF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==3")),dolog,"PFMET","Debunking/MET_OF_30to70_3j"); |
1908 |
> |
|
1909 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSSF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==0")),dolog,"PFMET","Debunking/MET_SF_30to70_0j"); |
1910 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSSF&&TCut("mll>30&&mll<70&&pfJetGoodNum40==1")),dolog,"PFMET","Debunking/MET_SF_30to70_1j"); |
1911 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSSF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==2")),dolog,"PFMET","Debunking/MET_SF_30to70_2j"); |
1912 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSSF&&TCut("mll>30&&mll<70&&pfTightHT>100&&pfJetGoodNum40==3")),dolog,"PFMET","Debunking/MET_SF_30to70_3j"); |
1913 |
> |
|
1914 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==0")),dolog,"PFMET","Debunking/MET_OF_Z_0j"); |
1915 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSOF&&TCut("mll>80&&mll<100&&pfJetGoodNum40==1")),dolog,"PFMET","Debunking/MET_OF_Z_1j"); |
1916 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==2")),dolog,"PFMET","Debunking/MET_OF_Z_2j"); |
1917 |
> |
DoMCSystPlot("met[4]",40,0,400,(cutOSOF&&TCut("mll>80&&mll<100&&pfTightHT>100&&pfJetGoodNum40==3")),dolog,"PFMET","Debunking/MET_OF_Z_3j"); |
1918 |
> |
|
1919 |
> |
|
1920 |
> |
DoMCSystPlot("mll", (int)((mll_hi-mll_low)/5),mll_low,mll_hi,cutnJets&&cutOSSF,dolog,"m_{ll} [GeV]","kinSys/mll"); |
1921 |
> |
DoMCSystPlot("mll", (int)((mll_hi-mll_low)/5),mll_low,mll_hi,cutnJets&&cutOSSF&&TCut("id1==0"),dolog,"m_{ll} [GeV]","kinSys/mll_ee"); |
1922 |
> |
DoMCSystPlot("mll", (int)((mll_hi-mll_low)/5),mll_low,mll_hi,cutnJets&&cutOSSF&&TCut("id1==1"),dolog,"m_{ll} [GeV]","kinSys/mll_mm"); |
1923 |
> |
DoMCSystPlot("mll", (int)((mll_hi-mll_low)/5),mll_low,mll_hi,cutnJets&&cutOSOF,dolog,"m_{ll} [GeV]","kinSys/mll_osof"); |
1924 |
> |
|
1925 |
> |
DoMCSystPlot("mll", (int)((mll_hi-mll_low)/5),mll_low,mll_hi,cutOSSF,dolog,"m_{ll} [GeV]","kinSys/mll_inclusive"); |
1926 |
> |
DoMCSystPlot("mll", (int)((mll_hi-mll_low)/5),mll_low,mll_hi,cutOSOF,dolog,"m_{ll} [GeV]","kinSys/mll_inclusive_osof"); |
1927 |
> |
|
1928 |
> |
DoMCSystPlot("pfJetGoodNum40", 9,-0.5,8.5,cutOSSF,dolog,"nJets","kinSys/nJets_ossf"); |
1929 |
> |
DoMCSystPlot("pfJetGoodNum40", 9,-0.5,8.5,cutOSOF,dolog,"nJets","kinSys/nJets_osof"); |
1930 |
> |
|
1931 |
> |
DoMCSystPlot("pfJetGoodPt[0]/pfJetGoodPt[1]",45,1,10,cutnJets&&cutOSSF,dolog,"p_{T}^{J1} / p_{T}^{J2}","kinSys/j1j2ratio"); |
1932 |
> |
DoMCSystPlot("TMath::Abs(pfJetDphiMet[0])",32,0,3.2,cutnJets&&cutOSSF,dolog,"|#Delta#phi(jet1,MET)|","kinSys/dphiJ1MET"); |
1933 |
> |
DoMCSystPlot(datajzb,mcjzb, (int)((PlottingSetup::jzbHigh+110)/10),-110,PlottingSetup::jzbHigh,cutnJets&&cutOSSF&&Restrmasscut,dolog,"m_{ll} [GeV]","kinSys/jzb_OS_SFZP"); |
1934 |
> |
DoMCSystPlot(datajzb,mcjzb, (int)((PlottingSetup::jzbHigh+110)/10),-110,PlottingSetup::jzbHigh,cutnJets&&cutOSOF&&Restrmasscut,dolog,"m_{ll} [GeV]","kinSys/jzb_OS_OFZP"); |
1935 |
> |
|
1936 |
> |
make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll",doPF,true); |
1937 |
> |
make_kin_plot("mll","mll>20",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof",doPF,true,true); |
1938 |
> |
make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee",doPF,true); |
1939 |
> |
make_kin_plot("mll","mll>20"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_mm",doPF,true); |
1940 |
> |
|
1941 |
> |
make_kin_plot("pfJetGoodNum40",mllCut,9,-0.5,8.5,dolog,"nJets","nJets",doPF); |
1942 |
> |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_osof",doPF); |
1943 |
> |
|
1944 |
> |
make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_met100",doPF,true); |
1945 |
> |
make_kin_plot("mll","mll>20&&met[4]>100",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_met100",doPF,true,true); |
1946 |
> |
make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee_met100",doPF,true); |
1947 |
> |
make_kin_plot("mll","mll>20&&met[4]>100"+mllCut,(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_mm_met100",doPF,true); |
1948 |
> |
|
1949 |
> |
|
1950 |
> |
make_kin_plot("pfJetGoodNum40","met[4]>100"+mllCut,9,-0.5,8.5,dolog,"nJets","nJets_met100",doPF); |
1951 |
> |
make_kin_plot("pfJetGoodNum40","met[4]>100",9,-0.5,8.5,dolog,"nJets","nJets_osof_met100",doPF); |
1952 |
> |
|
1953 |
> |
// Further inclusive invariant mass plots |
1954 |
> |
make_kin_plot("mll",mllCut,(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive",doPF,true); |
1955 |
> |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_ee",doPF,true); |
1956 |
> |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_mm",doPF,true); |
1957 |
> |
make_kin_plot("mll",mllCut,(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true); |
1958 |
> |
|
1959 |
> |
make_kin_plot("mll","",(int)((350-mll_low))/5,mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF); |
1960 |
> |
//if(!doPF) make_special_mll_plot((int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]"); |
1961 |
> |
|
1962 |
> |
|
1963 |
> |
// Number of jets |
1964 |
> |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_inclusive",doPF); |
1965 |
> |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_osof_inclusive",doPF); |
1966 |
> |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_nocuts_except_mll_ossf",doPF); |
1967 |
> |
|
1968 |
> |
// Others |
1969 |
> |
make_kin_plot("numVtx","",(int)(30.5-(-0.5)),-0.5,30.5,nolog,"N(Vtx)","numVtx",doPF); |
1970 |
> |
// make_kin_plot("jetpt[0]","",40,0,200,dolog,"leading jet p_{T} [GeV]","pfJetGoodPt_0",doPF); |
1971 |
> |
// make_kin_plot("jeteta[0]","",40,-5,5,nolog,"leading jet #eta","pfJetGoodEta_0",doPF); |
1972 |
> |
make_kin_plot("pt","",50,0,500,dolog,"Z p_{T} [GeV]","Zpt",doPF); |
1973 |
> |
make_kin_plot("pt1","",50,0,200,nolog,"p_{T} [GeV]","pt1",doPF); |
1974 |
> |
make_kin_plot("pt2","",50,0,200,nolog,"p_{T} [GeV]","pt2",doPF); |
1975 |
> |
make_kin_plot("eta1","",40,-3,3,nolog,"#eta_{l}","eta",doPF); |
1976 |
> |
make_kin_plot("jzb[1]","",100,-150,200,dolog,"JZB [GeV]","jzb_ossf",doPF); |
1977 |
> |
// stringstream jzbcut; |
1978 |
> |
// jzbcut << "((is_data&&("<<datajzb<<")>100)||(!is_data&&("<<mcjzb<<")>100))"; |
1979 |
> |
// make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_aboveJZB100",doPF,true); |
1980 |
> |
// make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_osof_aboveJZB100",doPF,true); |
1981 |
> |
// make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_ee_aboveJZB100",doPF,true); |
1982 |
> |
// make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_mm_aboveJZB100",doPF,true); |
1983 |
> |
// stringstream jzbcut2; |
1984 |
> |
// jzbcut2 << "((is_data&&("<<datajzb<<")>150)||(!is_data&&("<<mcjzb<<")>150))"; |
1985 |
> |
// make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_aboveJZB150",doPF,true); |
1986 |
> |
// make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_osof_aboveJZB150",doPF,true); |
1987 |
> |
// make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_ee_aboveJZB150",doPF,true); |
1988 |
> |
// make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_mm_aboveJZB150",doPF,true); |
1989 |
> |
// stringstream jzbcut3; |
1990 |
> |
// jzbcut3 << "((is_data&&("<<datajzb<<")>50)||(!is_data&&("<<mcjzb<<")>50))"; |
1991 |
> |
// make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_aboveJZB50",doPF,true); |
1992 |
> |
// make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_osof_aboveJZB50",doPF,true,true); |
1993 |
> |
// make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_ee_aboveJZB50",doPF,true); |
1994 |
> |
// make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_mm_aboveJZB50",doPF,true); |
1995 |
> |
|
1996 |
> |
// make_kin_plot("mll","met[4]>100",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV] (MET>100GeV)","mll_met100_ll",doPF,true); |
1997 |
> |
//make_kin_plot("mll","met[4]>150&&id1==0",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ee} [GeV] (MET>150GeV)","mll_met150_ee",doPF,true); |
1998 |
> |
//make_kin_plot("mll","met[4]>150&&id1==1",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{#mu#mu} [GeV] (MET>150GeV)","mll_met150_mm",doPF,true);*/ |
1999 |
> |
} |
2000 |
> |
/* |
2001 |
> |
make_special_obs_pred_mll_plot(datajzb,mcjzb,0); |
2002 |
> |
make_special_obs_pred_mll_plot(datajzb,mcjzb,50); |
2003 |
> |
make_special_obs_pred_mll_plot(datajzb,mcjzb,80); |
2004 |
> |
make_special_obs_pred_mll_plot(datajzb,mcjzb,100); |
2005 |
> |
make_special_obs_pred_mll_plot(datajzb,mcjzb,150); |
2006 |
> |
make_special_obs_pred_mll_plot(datajzb,mcjzb,200); |
2007 |
> |
make_special_obs_pred_mll_plot(datajzb,mcjzb,250); |
2008 |
|
|
2009 |
+ |
make_JES_plot(cutmass&&cutOSSF&&basiccut,"_ossf"); |
2010 |
+ |
make_JES_plot(cutmass&&cutOSOF&&basiccut,"_osof"); |
2011 |
+ |
*/ |
2012 |
+ |
switch_overunderflow(false); |
2013 |
|
} |
2014 |
|
|
2015 |
|
void make_comp_plot( string var, string xlabel, string filename, float jzbcut, string mcjzb, string datajzb, |
2025 |
|
|
2026 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- below: the next ~20 lines changed! |
2027 |
|
int nRegions=4; |
2028 |
< |
if(!PlottingSetup::RestrictToMassPeak) { |
2028 |
> |
if(!PlottingSetup::RestrictToMassPeak||!PlottingSetup::UseSidebandsForcJZB) { |
2029 |
|
nRegions=2; |
2030 |
|
} |
2031 |
|
|
2049 |
|
if (ymax>ymin) datahisto->SetMaximum(ymax); |
2050 |
|
lm3histo->SetLineStyle(2); |
2051 |
|
datahisto->Draw("e1"); |
2052 |
< |
mcstack.Draw("same"); |
2052 |
> |
mcstack.Draw("histo,same"); |
2053 |
|
datahisto->Draw("same,e1"); |
2054 |
|
lm3histo->Draw("hist,same"); |
2055 |
|
TLegend *kinleg = allsamples.allbglegend((sRegions[iregion]+(ijzb?"neg":"pos")).c_str()); |
2079 |
|
|
2080 |
|
// switch_overunderflow(true); // switching overflow/underflow bins on |
2081 |
|
|
2082 |
< |
|
2082 |
> |
switch_overunderflow(true); |
2083 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- the arguments changed |
2084 |
|
for(int ijzb=0;ijzb<(int)jzb_cuts.size();ijzb++) { |
2085 |
|
float jzbcut=jzb_cuts[ijzb]; // Comparison plots are done for this JZB cut |
2299 |
|
// the line above is not necessary anymore as we're now looking at a prediction without Z+Jets, and not multiplied with (1.0/3) |
2300 |
|
TF1 *ttbarlogpar = do_logpar_fit_to_plot(Tprediction); |
2301 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
2302 |
< |
if(PlottingSetup::RestrictToMassPeak) ttbarlogpar->SetParameter(0,1.0/3*ttbarlogpar->GetParameter(0));//correcting for the fact that we didn't multiply with (1.0/3); |
2302 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) ttbarlogpar->SetParameter(0,1.0/3*ttbarlogpar->GetParameter(0));//correcting for the fact that we didn't multiply with (1.0/3); |
2303 |
|
|
2304 |
|
|
2305 |
|
TF1 *ttbarlogparP = new TF1("ttbarlogparP",LogParabolaP,0,(prediction->GetXaxis()->GetBinLowEdge(prediction->GetNbinsX())+prediction->GetXaxis()->GetBinWidth(prediction->GetNbinsX())),8); |
2396 |
|
|
2397 |
|
void do_prediction_plot(string jzb, TCanvas *globalcanvas, float high, int use_data, bool overlay_signal = false,string subdir="" ) |
2398 |
|
{ |
2399 |
< |
// switch_overunderflow(true); |
2399 |
> |
|
2400 |
|
bool is_data=false; |
2401 |
|
bool use_signal=false; |
2402 |
|
if(use_data==1) is_data=true; |
2403 |
|
if(use_data==2) use_signal=true; |
2404 |
< |
int nbins=50;//100; |
2405 |
< |
if(is_data) nbins=50; |
2404 |
> |
int nbins=int(high/10);//100; |
2405 |
> |
if(is_data) nbins=int(high/10); |
2406 |
|
float low=0; |
2407 |
< |
float hi=500; |
2407 |
> |
float hi=high; |
2408 |
> |
|
2409 |
> |
stringstream cutpositiveS; |
2410 |
> |
cutpositiveS << "(" << jzb << ">0)"; |
2411 |
> |
TCut cutpositive(cutpositiveS.str().c_str()); |
2412 |
> |
stringstream cutnegativeS; |
2413 |
> |
cutnegativeS << "(" << jzb << "<0)"; |
2414 |
> |
TCut cutnegative(cutnegativeS.str().c_str()); |
2415 |
> |
|
2416 |
|
|
2417 |
|
TH1F *blankback = new TH1F("blankback","blankback",int(high/10),0,high); |
2418 |
< |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2419 |
< |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2420 |
< |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2421 |
< |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2418 |
> |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2419 |
> |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutnegative&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2420 |
> |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2421 |
> |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutnegative&&cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2422 |
|
|
2423 |
|
blankback->GetXaxis()->SetTitle(RcorrJZBeemm->GetXaxis()->GetTitle()); |
2424 |
|
blankback->GetYaxis()->SetTitle(RcorrJZBeemm->GetYaxis()->GetTitle()); |
2433 |
|
|
2434 |
|
TH1F *RcorrJZBeemmNoS; |
2435 |
|
|
2436 |
< |
//these are for the ratio |
2437 |
< |
|
2438 |
< |
TH1F *JRcorrJZBeemm = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2439 |
< |
TH1F *JLcorrJZBeemm = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2440 |
< |
TH1F *JRcorrJZBem = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
1166 |
< |
TH1F *JLcorrJZBem = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2436 |
> |
//these are for the ratio |
2437 |
> |
TH1F *JRcorrJZBeemm = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2438 |
> |
TH1F *JLcorrJZBeemm = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutnegative&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2439 |
> |
TH1F *JRcorrJZBem = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2440 |
> |
TH1F *JLcorrJZBem = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutnegative&&cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2441 |
|
|
2442 |
|
TH1F *JRcorrJZBSBem; |
2443 |
|
TH1F *JLcorrJZBSBem; |
2444 |
|
TH1F *JRcorrJZBSBeemm; |
2445 |
|
TH1F *JLcorrJZBSBeemm; |
2446 |
|
|
2447 |
< |
if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,false); |
2447 |
> |
if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,false); |
2448 |
|
|
2449 |
|
|
2450 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2451 |
< |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2452 |
< |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2453 |
< |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2454 |
< |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2450 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2451 |
> |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2452 |
> |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutnegative&&sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2453 |
> |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2454 |
> |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutnegative&&sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2455 |
|
|
2456 |
|
//these are for the ratio |
2457 |
< |
JRcorrJZBSBem = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2458 |
< |
JLcorrJZBSBem = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2459 |
< |
JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2460 |
< |
JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2457 |
> |
JRcorrJZBSBem = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutpositive&&sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2458 |
> |
JLcorrJZBSBem = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutnegative&&sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
2459 |
> |
JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutpositive&&sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2460 |
> |
JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutnegative&&sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
2461 |
|
} |
2462 |
|
|
2463 |
|
TH1F *lm4RcorrJZBeemm; |
2464 |
< |
if(overlay_signal || use_data == 2 || use_data == 1) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,allsamples.FindSample("LM")); |
2464 |
> |
if(overlay_signal || use_data == 2 || use_data == 1) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutpositive&&cutmass&&cutOSSF&&cutnJets,is_data, luminosity,allsamples.FindSample("LM")); |
2465 |
|
|
2466 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed. |
2467 |
|
|
2474 |
|
TH1F *BpredSys = new TH1F("Bpredsys","Bpredsys",PlottingSetup::global_ratio_binning.size()-1,&PlottingSetup::global_ratio_binning[0]); |
2475 |
|
ClearHisto(BpredSys); |
2476 |
|
|
2477 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2477 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2478 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
2479 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
2480 |
|
Bpred->Add(RcorrJZBSBem,1.0/3.); |
2525 |
|
SQRT(BpredSys); |
2526 |
|
BpredSys->Divide(JBpred); |
2527 |
|
|
1254 |
– |
|
2528 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed |
2529 |
|
TH1F *Tpred = (TH1F*)RcorrJZBem->Clone("Bpred"); |
2530 |
|
Tpred->Add(LcorrJZBem,-1.0); |
2531 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2531 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2532 |
|
Tpred->Add(RcorrJZBSBem,1.0); |
2533 |
|
Tpred->Add(LcorrJZBSBem,-1.0); |
2534 |
|
Tpred->Add(RcorrJZBSBeemm,1.0); |
2577 |
|
Bpred->Draw("hist,same"); |
2578 |
|
//analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
2579 |
|
RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP! |
2580 |
< |
lm4RcorrJZBeemm->Draw("hist,same"); |
2580 |
> |
//lm4RcorrJZBeemm->Draw("hist,same"); |
2581 |
|
legBpred->AddEntry(RcorrJZBeemm,"observed","p"); |
2582 |
|
legBpred->AddEntry(Bpred,"predicted","l"); |
2583 |
|
// legBpred->AddEntry(analytical_function[1],"predicted fit","l"); |
2584 |
|
// legBpred->AddEntry(analytical_function[2],"stat. uncert.","l"); |
2585 |
< |
legBpred->AddEntry(lm4RcorrJZBeemm,(allsamples.collection[allsamples.FindSample("LM")[0]].samplename).c_str(),"l"); |
2585 |
> |
// legBpred->AddEntry(lm4RcorrJZBeemm,(allsamples.collection[allsamples.FindSample("LM")[0]].samplename).c_str(),"l"); |
2586 |
|
legBpred->Draw(); |
2587 |
|
DrawPrelim(); |
2588 |
|
|
2592 |
|
Bpred->SetLineWidth(2); |
2593 |
|
predcomppad->cd(); |
2594 |
|
predcomppad->SetLogy(1); |
1322 |
– |
|
2595 |
|
TH1F *jzbnegative = (TH1F*)LcorrJZBeemm->Clone("jzbnegative"); |
2596 |
|
TH1F *sidebandsemu = (TH1F*)Bpred->Clone("sidebandsemu"); |
2597 |
|
sidebandsemu->Add(jzbnegative,-1); |
2613 |
|
// lm4RcorrJZBeemm->SetLineColor(kOrange+1); |
2614 |
|
lm4RcorrJZBeemm->SetLineWidth(2); |
2615 |
|
//lm4RcorrJZBeemm->SetLineWidth(2); // paper style. overruled. |
2616 |
< |
lm4RcorrJZBeemm->Draw("histo,same"); |
2616 |
> |
// lm4RcorrJZBeemm->Draw("histo,same"); |
2617 |
|
DrawPrelim(); |
2618 |
|
TLegend *speciallegBpred = make_legend("",0.45,0.55); |
2619 |
|
//TLegend *speciallegBpred = make_legend("",0.35,0.55); // paper style. overruled. |
2620 |
|
speciallegBpred->AddEntry(RcorrJZBeemm,"Data","pl"); |
2621 |
|
speciallegBpred->AddEntry(Bpred,"Total background","l"); |
2622 |
|
speciallegBpred->AddEntry(jzbnegative,"JZB<0 (data)","f"); |
2623 |
< |
if(PlottingSetup::RestrictToMassPeak) speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f"); |
2623 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f"); |
2624 |
|
else speciallegBpred->AddEntry(sidebandsemu,"e#mu (data)","f"); |
2625 |
|
// speciallegBpred->AddEntry(lm4RcorrJZBeemmC,"LM4","l"); |
2626 |
< |
speciallegBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
2626 |
> |
// speciallegBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
2627 |
|
speciallegBpred->Draw(); |
2628 |
< |
save_with_ratio(JRcorrJZBeemm,JBpred,predcomppad,subdir+"Bpred_Data_____PredictionComposition",true,true,"data/pred",BpredSys); |
2628 |
> |
Save_With_Ratio(JRcorrJZBeemm,JBpred,predcomppad,subdir+"Bpred_Data_____PredictionComposition",true,true,"data/pred",BpredSys); |
2629 |
> |
delete predcomppad; |
2630 |
|
|
2631 |
|
TCanvas *specialcanv = new TCanvas("specialcanv","specialcanv"); |
2632 |
|
specialcanv->SetLogy(1); |
2633 |
|
// THStack kostack = allsamples.DrawStack("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,!is_data, luminosity,use_signal); |
2634 |
|
blankback->Draw(); |
2635 |
|
// kostack.Draw("same"); |
2636 |
< |
predcomposition.Draw(); |
2636 |
> |
predcomposition.Draw("hist"); |
2637 |
|
Bpred->Draw("hist,same"); |
2638 |
|
//analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
2639 |
|
RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP! |
2660 |
|
legBpred->AddEntry(Bpred,"MC predicted","l"); |
2661 |
|
if(versok) legBpred->AddEntry((TObject*)0,"",""); // Just for alignment // causes seg fault on root v5.18 |
2662 |
|
if(versok) legBpred->AddEntry((TObject*)0,"",""); // causes seg fault on root v5.18 |
2663 |
< |
if ( overlay_signal ) legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
2663 |
> |
// if ( overlay_signal ) legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
2664 |
|
legBpred->Draw(); |
2665 |
|
DrawMCPrelim(); |
2666 |
|
Bpredsaveas="Bpred_MC"; |
2692 |
|
|
2693 |
|
RcorrJZBeemmNoS->SetLineStyle(2); |
2694 |
|
legBpred2->AddEntry(RcorrJZBeemmNoS,"MC B","l"); |
2695 |
< |
legBpred2->AddEntry(lm4RcorrJZBeemm,"MC S","l"); |
2695 |
> |
// legBpred2->AddEntry(lm4RcorrJZBeemm,"MC S","l"); |
2696 |
|
legBpred2->Draw(); |
2697 |
|
RcorrJZBeemmNoS->SetLineColor(TColor::GetColor("#61210B")); |
2698 |
|
RcorrJZBeemmNoS->Draw("histo,same"); |
2709 |
|
string ytitle("ratio"); |
2710 |
|
if ( use_data==1 ) ytitle = "data/pred"; |
2711 |
|
//save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle); |
2712 |
< |
save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,false,ytitle,BpredSys);//not extending the y range anymore up to 4 |
2712 |
> |
Save_With_Ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,false,ytitle,BpredSys);//not extending the y range anymore up to 4 |
2713 |
> |
|
2714 |
> |
delete kinpad; |
2715 |
> |
|
2716 |
|
|
2717 |
|
|
2718 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
2719 |
|
// The part below is meaningless for the offpeak analysis (it's a comparison of the different estimates but there is but one estimate!) |
2720 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2720 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2721 |
|
TH1F *Bpredem = (TH1F*)LcorrJZBeemm->Clone("Bpredem"); |
2722 |
|
Bpredem->Add(RcorrJZBem); |
2723 |
|
Bpredem->Add(LcorrJZBem,-1); |
2772 |
|
legBpredc->AddEntry(Bpredem,"MC OFZP","l"); |
2773 |
|
legBpredc->AddEntry(BpredSBem,"MC OFSB","l"); |
2774 |
|
legBpredc->AddEntry(BpredSBeemm,"MC SFSB","l"); |
2775 |
< |
if ( overlay_signal ) legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
2775 |
> |
// if ( overlay_signal ) legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
2776 |
|
legBpredc->Draw(); |
2777 |
|
CompleteSave(globalcanvas,subdir+"Bpred_MCwithS_comparison"); |
2778 |
|
} |
2796 |
|
delete blankback; |
2797 |
|
|
2798 |
|
delete BpredSys; |
2799 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2799 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2800 |
|
delete RcorrJZBSBem; |
2801 |
|
delete LcorrJZBSBem; |
2802 |
|
delete RcorrJZBSBeemm; |
2808 |
|
delete JLcorrJZBSBeemm; |
2809 |
|
} |
2810 |
|
if(overlay_signal || use_data==2) delete lm4RcorrJZBeemm; |
1535 |
– |
switch_overunderflow(false); |
2811 |
|
} |
2812 |
|
|
2813 |
|
void do_prediction_plots(string mcjzb, string datajzb, float DataSigma, float MCSigma, bool overlay_signal ) { |
2814 |
+ |
switch_overunderflow(true); |
2815 |
|
TCanvas *globalcanvas = new TCanvas("globalcanvas","Prediction Canvas"); |
2816 |
|
do_prediction_plot(datajzb,globalcanvas,jzbHigh ,data,overlay_signal); |
2817 |
|
if ( !PlottingSetup::Approved ) { |
2820 |
|
} else { |
2821 |
|
write_info(__FUNCTION__,"You set approved to true, therefore not producing prediction/observation plots for MC with and without signal."); |
2822 |
|
} |
2823 |
< |
} |
2824 |
< |
|
1549 |
< |
void do_ratio_plot(int is_data,vector<float> binning, string jzb, TCanvas *can, float high=-9999) { |
1550 |
< |
bool do_data=0; |
1551 |
< |
bool dosignal=0; |
1552 |
< |
if(is_data==1) do_data=1; |
1553 |
< |
if(is_data==2) dosignal=1; |
1554 |
< |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,do_data, luminosity,dosignal); |
1555 |
< |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,do_data, luminosity,dosignal); |
1556 |
< |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem",jzb.c_str(),binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,do_data, luminosity,dosignal); |
1557 |
< |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,do_data, luminosity,dosignal); |
1558 |
< |
|
1559 |
< |
TH1F *RcorrJZBSBem; |
1560 |
< |
TH1F *LcorrJZBSBem; |
1561 |
< |
TH1F *RcorrJZBSBeemm; |
1562 |
< |
TH1F *LcorrJZBSbeemm; |
1563 |
< |
|
1564 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1565 |
< |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSbem",jzb.c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,do_data, luminosity,dosignal); |
1566 |
< |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSbem",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,do_data, luminosity,dosignal); |
1567 |
< |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSbeemm",jzb.c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,do_data, luminosity,dosignal); |
1568 |
< |
LcorrJZBSbeemm = allsamples.Draw("LcorrJZBSbeemm",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,do_data, luminosity,dosignal); |
1569 |
< |
} |
1570 |
< |
|
1571 |
< |
|
1572 |
< |
|
1573 |
< |
|
1574 |
< |
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1575 |
< |
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
1576 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1577 |
< |
Bpred->Add(RcorrJZBem,1.0/3); |
1578 |
< |
Bpred->Add(LcorrJZBem,-1.0/3); |
1579 |
< |
Bpred->Add(RcorrJZBSBem,1.0/3); |
1580 |
< |
Bpred->Add(LcorrJZBSBem,-1.0/3); |
1581 |
< |
Bpred->Add(RcorrJZBSBeemm,1.0/3); |
1582 |
< |
Bpred->Add(LcorrJZBSbeemm,-1.0/3); |
1583 |
< |
} else { |
1584 |
< |
Bpred->Add(RcorrJZBem,1.0); |
1585 |
< |
Bpred->Add(LcorrJZBem,-1.0); |
1586 |
< |
} |
1587 |
< |
|
1588 |
< |
can->cd(); |
1589 |
< |
can->SetLogy(0); |
1590 |
< |
Bpred->SetLineColor(kRed); |
1591 |
< |
Bpred->SetStats(0); |
1592 |
< |
if(high>0) Bpred->GetXaxis()->SetRangeUser(0,high); |
1593 |
< |
TH1F *JZBratioforfitting=(TH1F*)RcorrJZBeemm->Clone("JZBratioforfitting"); |
1594 |
< |
JZBratioforfitting->Divide(Bpred); |
1595 |
< |
TGraphAsymmErrors *JZBratio = histRatio(RcorrJZBeemm,Bpred,is_data,binning,false); |
1596 |
< |
|
1597 |
< |
|
1598 |
< |
JZBratio->SetTitle(""); |
1599 |
< |
JZBratio->GetYaxis()->SetRangeUser(0.0,9.0); |
1600 |
< |
// if(is_data==1) JZBratio->GetXaxis()->SetRangeUser(0,jzbHigh ); |
1601 |
< |
|
1602 |
< |
TF1 *pol0 = new TF1("pol0","[0]",0,1000); |
1603 |
< |
TF1 *pol0d = new TF1("pol0","[0]",0,1000); |
1604 |
< |
// straightline_fit->SetParameter(0,1); |
1605 |
< |
JZBratioforfitting->Fit(pol0,"Q0R","",0,30); |
1606 |
< |
pol0d->SetParameter(0,pol0->GetParameter(0)); |
1607 |
< |
|
1608 |
< |
JZBratio->GetYaxis()->SetTitle("Observed/Predicted"); |
1609 |
< |
JZBratio->GetXaxis()->SetTitle("JZB [GeV]"); |
1610 |
< |
if ( high>0 ) JZBratio->GetXaxis()->SetRangeUser(0.0,high); |
1611 |
< |
JZBratio->GetYaxis()->SetNdivisions(519); |
1612 |
< |
JZBratio->GetYaxis()->SetRangeUser(0.0,4.0); |
1613 |
< |
JZBratio->GetYaxis()->CenterTitle(); |
1614 |
< |
JZBratio->GetXaxis()->CenterTitle(); |
1615 |
< |
JZBratio->SetMarkerSize(DataMarkerSize); |
1616 |
< |
JZBratio->Draw("AP"); |
1617 |
< |
/////---------------------------- |
1618 |
< |
TPaveText *writeresult = new TPaveText(0.15,0.78,0.49,0.91,"blNDC"); |
1619 |
< |
writeresult->SetFillStyle(4000); |
1620 |
< |
writeresult->SetFillColor(kWhite); |
1621 |
< |
writeresult->SetTextFont(42); |
1622 |
< |
writeresult->SetTextSize(0.03); |
1623 |
< |
writeresult->SetTextAlign(12); |
1624 |
< |
ostringstream jzb_agreement_data_text; |
1625 |
< |
jzb_agreement_data_text<< setprecision(2) << "mean =" << pol0->GetParameter(0) << " #pm " << setprecision(1) << pol0->GetParError(0); |
1626 |
< |
if(is_data==1) fitresultconstdata=pol0->GetParameter(0);// data |
1627 |
< |
if(is_data==0) fitresultconstmc=pol0->GetParameter(0); // monte carlo, no signal |
1628 |
< |
/* if(is_data) writeresult->AddText("Data closure test"); |
1629 |
< |
else writeresult->AddText("MC closure test"); |
1630 |
< |
*/ |
1631 |
< |
writeresult->AddText(jzb_agreement_data_text.str().c_str()); |
1632 |
< |
// writeresult->Draw("same"); |
1633 |
< |
// pol0d->Draw("same"); |
1634 |
< |
TF1 *topline = new TF1("","1.5",0,1000); |
1635 |
< |
TF1 *bottomline = new TF1("","0.5",0,1000); |
1636 |
< |
topline->SetLineColor(kBlue); |
1637 |
< |
topline->SetLineStyle(2); |
1638 |
< |
bottomline->SetLineColor(kBlue); |
1639 |
< |
bottomline->SetLineStyle(2); |
1640 |
< |
// topline->Draw("same"); |
1641 |
< |
// bottomline->Draw("same"); |
1642 |
< |
TF1 *oneline = new TF1("","1.0",0,1000); |
1643 |
< |
oneline->SetLineColor(kBlue); |
1644 |
< |
oneline->SetLineStyle(1); |
1645 |
< |
oneline->Draw("same"); |
1646 |
< |
TLegend *phony_leg = make_legend("ratio",0.6,0.55,false);//this line is just to have the default CMS Preliminary (...) on the canvas as well. |
1647 |
< |
if(is_data==1) DrawPrelim(); |
1648 |
< |
else DrawMCPrelim(); |
1649 |
< |
TLegend *leg = new TLegend(0.55,0.75,0.89,0.89); |
1650 |
< |
leg->SetTextFont(42); |
1651 |
< |
leg->SetTextSize(0.04); |
1652 |
< |
// if(is_data==1) leg->SetHeader("Ratio (data)"); |
1653 |
< |
// else leg->SetHeader("Ratio (MC)"); |
1654 |
< |
|
1655 |
< |
TString MCtitle("MC "); |
1656 |
< |
if (is_data==1) MCtitle = ""; |
1657 |
< |
|
1658 |
< |
leg->SetFillStyle(4000); |
1659 |
< |
leg->SetFillColor(kWhite); |
1660 |
< |
leg->SetTextFont(42); |
1661 |
< |
// leg->AddEntry(topline,"+20\% sys envelope","l"); |
1662 |
< |
leg->AddEntry(JZBratio,MCtitle+"obs / "+MCtitle+"pred","p"); |
1663 |
< |
leg->AddEntry(oneline,"ratio = 1","l"); |
1664 |
< |
// leg->AddEntry(pol0d,"fit in [0,30] GeV","l"); |
1665 |
< |
// leg->AddEntry(bottomline,"#pm50% envelope","l"); |
1666 |
< |
|
1667 |
< |
|
1668 |
< |
//leg->Draw("same"); // no longer drawing legend |
1669 |
< |
|
1670 |
< |
if(is_data==1) CompleteSave(can, "jzb_ratio_data"); |
1671 |
< |
if(is_data==0) CompleteSave(can, "jzb_ratio_mc"); |
1672 |
< |
if(is_data==2) CompleteSave(can, "jzb_ratio_mc_BandS");//special case, MC with signal! |
1673 |
< |
|
1674 |
< |
delete RcorrJZBeemm; |
1675 |
< |
delete LcorrJZBeemm; |
1676 |
< |
delete RcorrJZBem; |
1677 |
< |
delete LcorrJZBem; |
1678 |
< |
|
1679 |
< |
delete RcorrJZBSBem; |
1680 |
< |
delete LcorrJZBSBem; |
1681 |
< |
delete RcorrJZBSBeemm; |
1682 |
< |
delete LcorrJZBSbeemm; |
1683 |
< |
} |
1684 |
< |
|
1685 |
< |
void do_ratio_plots(string mcjzb,string datajzb,vector<float> ratio_binning) { |
1686 |
< |
TCanvas *globalc = new TCanvas("globalc","Ratio Plot Canvas"); |
1687 |
< |
globalc->SetLogy(0); |
1688 |
< |
|
1689 |
< |
do_ratio_plot(mc,ratio_binning,mcjzb,globalc, jzbHigh ); |
1690 |
< |
do_ratio_plot(data,ratio_binning,datajzb,globalc, jzbHigh ); |
1691 |
< |
do_ratio_plot(mcwithsignal,ratio_binning,mcjzb,globalc, jzbHigh ); |
2823 |
> |
delete globalcanvas; |
2824 |
> |
switch_overunderflow(false); |
2825 |
|
} |
2826 |
|
|
2827 |
|
string give_jzb_expression(float peak, int type) { |
2908 |
|
eemmlegend->AddEntry(jmmd,"#mu#mu","l"); |
2909 |
|
eemmlegend->Draw(); |
2910 |
|
DrawPrelim(); |
2911 |
< |
save_with_ratio(jeed,jmmd,eemmpad->cd(),"lepton_comparison/jzb_Comparing_ee_mm_data"); |
2911 |
> |
Save_With_Ratio(jeed,jmmd,eemmpad->cd(),"lepton_comparison/jzb_Comparing_ee_mm_data"); |
2912 |
|
|
2913 |
|
TH1F *zjeed = allsamples.Draw("zjeed",jzbvariablemc, int((jzbHigh+150)/5),-150,jzbHigh , "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&"(id1==0)",mc, luminosity,allsamples.FindSample("/DY")); |
2914 |
|
TH1F *zjmmd = allsamples.Draw("zjmmd",jzbvariablemc, int((jzbHigh+150)/5),-150,jzbHigh , "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&"(id1==1)",mc, luminosity,allsamples.FindSample("/DY")); |
3009 |
|
datahisto->SetMinimum(0.1); |
3010 |
|
datahisto->SetMarkerSize(DataMarkerSize); |
3011 |
|
datahisto->Draw("e1"); |
3012 |
< |
mcstack.Draw("same"); |
3012 |
> |
mcstack.Draw("histo,same"); |
3013 |
|
datahisto->Draw("same,e1"); |
3014 |
|
|
3015 |
|
TLegend *leg; |
3016 |
< |
if (!PlottingSetup::RestrictToMassPeak) { |
3016 |
> |
if (!PlottingSetup::RestrictToMassPeak||!PlottingSetup::UseSidebandsForcJZB) { |
3017 |
|
if(is_OF(cut)) leg = allsamples.allbglegend("Opposite flavor",datahisto); |
3018 |
|
else leg = allsamples.allbglegend("Same flavor",datahisto); |
3019 |
|
} else { |
3031 |
|
TText *writeline1 = write_cut_on_canvas(write_cut.c_str()); |
3032 |
|
writeline1->SetTextSize(0.035); |
3033 |
|
writeline1->Draw(); |
3034 |
< |
if(!Contains(savename,"Dibosons")) save_with_ratio(datahisto,mcstack,jzbpad->cd(),("jzb/"+savename)); |
3035 |
< |
else save_with_ratio(datahisto,mcstack,jzbpad->cd(),savename); |
3034 |
> |
if(!Contains(savename,"Dibosons")) Save_With_Ratio(datahisto,mcstack,jzbpad->cd(),("jzb/"+savename)); |
3035 |
> |
else Save_With_Ratio(datahisto,mcstack,jzbpad->cd(),savename); |
3036 |
|
TPad *jzbpad2 = new TPad("jzbpad2","jzbpad2",0,0,1,1); |
3037 |
|
jzbpad2->cd(); |
3038 |
|
jzbpad2->SetLogy(1); |
3040 |
|
datahisto->SetMinimum(0.1); |
3041 |
|
datahisto->SetMarkerSize(DataMarkerSize); |
3042 |
|
datahisto->Draw("e1"); |
3043 |
< |
mcstack.Draw("same"); |
3043 |
> |
mcstack.Draw("histo,same"); |
3044 |
|
datahisto->Draw("same,e1"); |
3045 |
|
leg->SetHeader(""); |
3046 |
|
leg->Draw(); |
3047 |
|
writeline1->SetTextSize(0.035); |
3048 |
|
writeline1->Draw(); |
3049 |
|
DrawPrelim(); |
3050 |
< |
if(!Contains(savename,"Dibosons")) save_with_ratio(datahisto,mcstack,jzbpad2->cd(),("jzb/PositiveSideOnly/"+savename+"")); |
3051 |
< |
else save_with_ratio(datahisto,mcstack,jzbpad2->cd(),(savename+"__PosOnly")); |
3050 |
> |
if(!Contains(savename,"Dibosons")) Save_With_Ratio(datahisto,mcstack,jzbpad2->cd(),("jzb/PositiveSideOnly/"+savename+"")); |
3051 |
> |
else Save_With_Ratio(datahisto,mcstack,jzbpad2->cd(),(savename+"__PosOnly")); |
3052 |
|
datahisto->Delete(); |
3053 |
|
mcstack.Delete(); |
3054 |
|
} |
3076 |
|
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"Dibosons/mm/jzb_OS_SFZP",dican,binning); |
3077 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"Dibosons/ee/jzb_OS_OFZP",dican,binning); |
3078 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"Dibosons/mm/jzb_OS_OFZP",dican,binning); |
3079 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB",dican,binning); |
3080 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB",dican,binning); |
3079 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB",dican,binning); |
3080 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB",dican,binning); |
3081 |
|
|
3082 |
|
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"Dibosons/jzb_OS_SFZP_coarse",dican,coarse_binning); |
3083 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"Dibosons/jzb_OS_OFZP_coarse",dican,coarse_binning); |
3084 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB_coarse",dican,coarse_binning); |
3085 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB_coarse",dican,coarse_binning); |
3084 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB_coarse",dican,coarse_binning); |
3085 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB_coarse",dican,coarse_binning); |
3086 |
|
|
3087 |
|
delete dican; |
3088 |
|
} |
3089 |
|
|
3090 |
|
|
3091 |
|
void diboson_plots(string mcjzb, string datajzb,vector<float> ratio_binning) { |
3092 |
+ |
switch_overunderflow(true); |
3093 |
|
vector<int> SamplesToBeModified = allsamples.FindSampleBySampleName("WW/WZ/ZZ"); |
3094 |
|
|
3095 |
|
if(SamplesToBeModified.size()==0 || SamplesToBeModified[0]==-1) { |
3129 |
|
dout << " Reset xs for sample " << (allsamples.collection)[SamplesToBeModified[i]].samplename << " from " << Upxs << " to " << (allsamples.collection)[SamplesToBeModified[i]].xs << " (by a factor of " << stretchfactor << ") and reset the correct name (from " << Upname << ")" << endl; |
3130 |
|
|
3131 |
|
} |
3132 |
< |
|
3132 |
> |
// switch_overunderflow(false); |
3133 |
|
} |
3134 |
|
|
3135 |
|
|
3156 |
|
leg->AddEntry(datahisto2,legentry2.c_str()); |
3157 |
|
leg->Draw(); |
3158 |
|
|
3159 |
< |
save_with_ratio(datahisto1,datahisto2,jzbpad->cd(),("jzb/"+savename)); |
3159 |
> |
Save_With_Ratio(datahisto1,datahisto2,jzbpad->cd(),("jzb/"+savename)); |
3160 |
|
|
3161 |
|
datahisto1->Delete(); |
3162 |
|
datahisto2->Delete(); |
3164 |
|
|
3165 |
|
|
3166 |
|
void jzb_plots(string mcjzb, string datajzb,vector<float> ratio_binning) { |
3167 |
+ |
switch_overunderflow(true); |
3168 |
|
TCanvas *can = new TCanvas("can","JZB Plots Canvas"); |
3169 |
|
float max=jzbHigh ; |
3170 |
|
float min=-120; |
3185 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_OFZP",can,binning); |
3186 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_OFZP",can,binning); |
3187 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
3188 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning); |
3189 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning); |
3188 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning); |
3189 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning); |
3190 |
|
draw_normalized_data_vs_data_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,"ee","mm","jzb_ee_vs_mm",can,binning); |
3191 |
|
draw_normalized_data_vs_data_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,"ee","mm","jzb_ee_vs_mm_coarse",can,coarse_binning); |
3192 |
|
draw_normalized_data_vs_data_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,"ee","mm","jzb_ee_vs_mm_coarsest",can,coarsest_binning); |
3197 |
|
if ( !PlottingSetup::Approved ) { |
3198 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarse",can,coarse_binning); |
3199 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
3200 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning); |
3201 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning); |
3200 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning); |
3201 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning); |
3202 |
|
} |
3203 |
|
delete can; |
3204 |
+ |
switch_overunderflow(false); |
3205 |
|
} |
3206 |
|
|
3207 |
|
|
3251 |
|
TCanvas *yica = new TCanvas("yica","yield canvas"); |
3252 |
|
|
3253 |
|
int nRegions=4; |
3254 |
< |
if(!PlottingSetup::RestrictToMassPeak) nRegions=2; |
3254 |
> |
if(!PlottingSetup::RestrictToMassPeak||!PlottingSetup::UseSidebandsForcJZB) nRegions=2; |
3255 |
|
string tsRegions[] = {"SFZP","OFZP","SFSB","OFSB"}; |
3256 |
|
string posneg[] = {"pos","neg"}; |
3257 |
|
TCut tkRegions[] = {cutOSSF&&cutnJets&&cutmass,cutOSOF&&cutnJets&&cutmass,cutOSSF&&cutnJets&&sidebandcut,cutOSOF&&cutnJets&&sidebandcut}; |
3650 |
|
|
3651 |
|
} |
3652 |
|
|
3653 |
< |
void pick_up_events(string cut) { |
3654 |
< |
dout << "Picking up events with cut " << cut << endl; |
2519 |
< |
allsamples.PickUpEvents(cut); |
3653 |
> |
void pick_up_events(string cut, string filename) { |
3654 |
> |
allsamples.PickUpEvents(cut,filename); |
3655 |
|
} |
3656 |
|
|
3657 |
|
void save_template(string mcjzb, string datajzb,vector<float> jzb_cuts,float MCPeakError,float DataPeakError, vector<float> jzb_shape_limit_bins) { |
3698 |
|
configfile<<"\n\n"; |
3699 |
|
configfile<<"luminosity="<<luminosity<<";\n"; |
3700 |
|
configfile<<"RestrictToMassPeak="<<RestrictToMassPeak<<";//defines the type of analysis we're running\n"; |
3701 |
+ |
configfile<<"UseSidebandsForcJZB="<<UseSidebandsForcJZB<<";//tells us whether to use the sidebands or not\n"; |
3702 |
|
|
3703 |
|
configfile<<"\n\ncout << \"Configuration successfully loaded!\" << endl; \n \n } \n \n"; |
3704 |
|
|
3741 |
|
//in the case of the on peak analysis, we compare the 3 control regions to the real value |
3742 |
|
//in the case of the OFF peak analysis, we compare our control region to the real value |
3743 |
|
TCut weightbackup=cutWeight; |
3744 |
+ |
switch_overunderflow(true); |
3745 |
|
|
3746 |
|
bool doPURW=false; |
3747 |
|
|
3763 |
|
|
3764 |
|
float simulatedlumi = luminosity; //in pb please - adjust to your likings |
3765 |
|
|
3766 |
< |
TH1F *TZem = systsamples.Draw("TZem", mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
3767 |
< |
TH1F *nTZem = systsamples.Draw("nTZem","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
3766 |
> |
TH1F *TZem = allsamples.Draw("TZem", mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/TT")); |
3767 |
> |
TH1F *nTZem = allsamples.Draw("nTZem","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/TT")); |
3768 |
|
TH1F *TSem; |
3769 |
|
TH1F *nTSem; |
3770 |
< |
TH1F *TZeemm = systsamples.Draw("TZeemm", mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
3771 |
< |
TH1F *nTZeemm = systsamples.Draw("nTZeemm","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
3770 |
> |
TH1F *TZeemm = allsamples.Draw("TZeemm", mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/TT")); |
3771 |
> |
TH1F *nTZeemm = allsamples.Draw("nTZeemm","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/TT")); |
3772 |
|
TH1F *TSeemm; |
3773 |
|
TH1F *nTSeemm; |
3774 |
|
|
3775 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3776 |
< |
TSem = systsamples.Draw("TSem", mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
3777 |
< |
nTSem = systsamples.Draw("nTSem", "-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
3778 |
< |
TSeemm = systsamples.Draw("TSeemm", mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
3779 |
< |
nTSeemm = systsamples.Draw("nTSeemm","-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
3775 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3776 |
> |
TSem = allsamples.Draw("TSem", mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/TT")); |
3777 |
> |
nTSem = allsamples.Draw("nTSem", "-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/TT")); |
3778 |
> |
TSeemm = allsamples.Draw("TSeemm", mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/TT")); |
3779 |
> |
nTSeemm = allsamples.Draw("nTSeemm","-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,allsamples.FindSample("/TT")); |
3780 |
|
} |
3781 |
|
|
3782 |
|
TCanvas *tcan = new TCanvas("tcan","tcan"); |
3788 |
|
TZem->SetMarkerColor(kRed); |
3789 |
|
|
3790 |
|
|
3791 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3791 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3792 |
|
TSem->SetLineColor(TColor::GetColor("#00A616")); |
3793 |
|
TSeemm->SetLineColor(kMagenta+2); |
3794 |
|
TSem->SetMarkerColor(TColor::GetColor("#00A616")); |
3802 |
|
TZeemm->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
3803 |
|
histos.push_back(TZem); |
3804 |
|
histos.push_back(TZeemm); |
3805 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3805 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3806 |
|
TSeemm->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
3807 |
|
TSem->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
3808 |
|
histos.push_back(TSem); |
3809 |
|
histos.push_back(TSeemm); |
3810 |
|
} |
3811 |
< |
draw_all_ttbar_histos(tcan,histos,"histo",1); |
3811 |
> |
draw_all_ttbar_histos(tcan,histos,"histo",8); |
3812 |
|
|
3813 |
|
TLegend *leg = make_legend("MC t#bar{t}",0.6,0.65,false); |
3814 |
|
leg->AddEntry(TZeemm,"SFZP","l"); |
3815 |
|
leg->AddEntry(TZem,"OFZP","l"); |
3816 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3816 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3817 |
|
leg->AddEntry(TSeemm,"SFSB","l"); |
3818 |
|
leg->AddEntry(TSem,"OFSB","l"); |
3819 |
|
} |
3820 |
|
leg->Draw("same"); |
3821 |
|
DrawMCPrelim(simulatedlumi); |
3822 |
|
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_shape_comparison"); |
3823 |
+ |
|
3824 |
|
TH1F *TZemcopy = (TH1F*)TZem->Clone("TZemcopy"); |
3825 |
|
TH1F *TZeemmcopy = (TH1F*)TZeemm->Clone("TZeemmcopy"); |
3826 |
|
TH1F *TSeemmcopy; |
3827 |
|
TH1F *TSemcopy; |
3828 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3828 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3829 |
|
TSeemmcopy = (TH1F*)TSeemm->Clone("TSeemmcopy"); |
3830 |
|
TSemcopy = (TH1F*)TSem->Clone("TSemcopy"); |
3831 |
|
} |
3832 |
|
|
3833 |
|
TZem->Divide(TZeemm); |
3834 |
|
TZem->SetMarkerStyle(21); |
3835 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3835 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3836 |
|
TSem->Divide(TZeemm); |
3837 |
|
TSeemm->Divide(TZeemm); |
3838 |
|
TSem->SetMarkerStyle(24); |
3843 |
|
TZem->GetYaxis()->SetRangeUser(0,2.5); |
3844 |
|
TZem->GetYaxis()->SetTitle("ratio"); |
3845 |
|
TZem->Draw(); |
3846 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3846 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3847 |
|
TSem->Draw("same"); |
3848 |
|
TSeemm->Draw("same"); |
3849 |
|
} |
3873 |
|
|
3874 |
|
TLegend *leg2 = make_legend("MC t#bar{t}",0.55,0.75,false); |
3875 |
|
leg2->AddEntry(TZem,"OFZP / SFZP","ple"); |
3876 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3876 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3877 |
|
leg2->AddEntry(TSeemm,"SFSB / SFZP","ple"); |
3878 |
|
leg2->AddEntry(TSem,"OFSB / SFZP","ple"); |
3879 |
|
} |
3886 |
|
DrawMCPrelim(simulatedlumi); |
3887 |
|
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_shape_comparison_ratio"); |
3888 |
|
|
3889 |
+ |
|
3890 |
|
if (0) { // Turn this off: we don't need this |
3891 |
|
|
3892 |
|
///-------------- second part: only look at the quantity we actually care about! |
3900 |
|
TH1F *rightofsb; |
3901 |
|
TH1F *leftsfsb; |
3902 |
|
TH1F *rightsfsb; |
3903 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3903 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3904 |
|
leftofsb = (TH1F*)nTSem->Clone("leftofsb"); |
3905 |
|
rightofsb = (TH1F*)TSemcopy->Clone("rightofsb"); |
3906 |
|
rightofsb->Add(leftofsb,-1); |
3914 |
|
rightsfzp->GetYaxis()->SetTitle("#deltaJZB / 25 GeV"); |
3915 |
|
rightsfzp->Draw("histo"); |
3916 |
|
rightofzp->Draw("histo,same"); |
3917 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3917 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3918 |
|
rightofsb->Draw("histo,same"); |
3919 |
|
rightsfsb->Draw("histo,same"); |
3920 |
|
} |
3923 |
|
TLegend *legA = make_legend("MC t#bar{t}",0.6,0.65,false); |
3924 |
|
legA->AddEntry(rightsfzp,"SFZP","l"); |
3925 |
|
legA->AddEntry(rightofzp,"OFZP","l"); |
3926 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3926 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3927 |
|
legA->AddEntry(rightofsb,"SFSB","l"); |
3928 |
|
legA->AddEntry(rightsfsb,"OFSB","l"); |
3929 |
|
} |
3937 |
|
rightofzp->GetYaxis()->SetRangeUser(0.0,2.5); |
3938 |
|
rightofzp->GetYaxis()->SetTitle("#deltaJZB ratio"); |
3939 |
|
rightofzp->Draw(); |
3940 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3940 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3941 |
|
rightofsb->Divide(rightsfzp); |
3942 |
|
rightsfsb->Divide(rightsfzp); |
3943 |
|
rightofsb->Draw("same"); |
3957 |
|
bottom2->Draw("same"); |
3958 |
|
|
3959 |
|
rightofzp->SetMarkerStyle(21); |
3960 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3960 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3961 |
|
rightofsb->SetMarkerStyle(24); |
3962 |
|
rightsfsb->SetMarkerStyle(32); |
3963 |
|
} |
3964 |
|
|
3965 |
|
TLegend *leg3 = make_legend("MC t#bar{t}",0.55,0.75,false); |
3966 |
|
leg3->AddEntry(rightofzp,"OFZP / SFZP","ple"); |
3967 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3967 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3968 |
|
leg3->AddEntry(rightsfsb,"SFSB / SFZP","ple"); |
3969 |
|
leg3->AddEntry(rightofsb,"OFSB / SFZP","ple"); |
3970 |
|
} |
3983 |
|
delete nTZem; |
3984 |
|
delete TZeemm; |
3985 |
|
delete nTZeemm; |
3986 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3986 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3987 |
|
delete TSem; |
3988 |
|
delete nTSem; |
3989 |
|
delete TSeemm; |
3992 |
|
|
3993 |
|
delete tcan; |
3994 |
|
cutWeight=weightbackup; |
3995 |
+ |
switch_overunderflow(false); |
3996 |
|
} |
3997 |
|
|
3998 |
|
void ttbar_sidebands_comparison(string mcjzb, vector<float> jzb_binning) { |
4027 |
|
nicer_binning.push_back(150); |
4028 |
|
//nicer_binning.push_back(175); |
4029 |
|
nicer_binning.push_back(200); |
4030 |
< |
nicer_binning.push_back(250); |
4031 |
< |
nicer_binning.push_back(300); |
4032 |
< |
nicer_binning.push_back(400); |
4030 |
> |
// nicer_binning.push_back(250); |
4031 |
> |
// nicer_binning.push_back(300); |
4032 |
> |
// nicer_binning.push_back(400); |
4033 |
|
|
4034 |
|
ttbar_sidebands_comparison(mcjzb,nicer_binning, "ttbar/"); |
4035 |
|
} |
4036 |
|
|
4037 |
|
|
4038 |
< |
void zjets_prediction_comparison(string mcjzbWithPUa) { |
4038 |
> |
void zjets_prediction_comparison(string mcjzbWithPUa, TCut massregioncut, string massregionname) { |
4039 |
> |
cout << "****************************************************************************************************************************************************************" << endl; |
4040 |
|
TCanvas *zcan = new TCanvas("zcan","zcan"); |
4041 |
|
// zcan->SetLogy(1); |
4042 |
|
TCut weightbackup=cutWeight; |
4043 |
|
|
4044 |
< |
bool UsePURW=false; |
4044 |
> |
bool UsePURW=true; |
4045 |
|
|
4046 |
|
|
4047 |
|
string mcjzb; |
4048 |
|
if(UsePURW) { |
4049 |
|
mcjzb=mcjzbWithPUa; |
4050 |
+ |
cout << "Using PURW peak positions" << endl; |
4051 |
|
} else { |
4052 |
|
// Do it without PU re-weighting |
4053 |
+ |
cutWeight="1.0"; |
4054 |
|
float MCPeakNoPU=0,MCPeakErrorNoPU=0,DataPeakNoPU=0,DataPeakErrorNoPU=0,MCSigma=0,DataSigma=0; |
4055 |
|
stringstream resultsNoPU; |
4056 |
|
stringstream noPUdatajzb; |
4061 |
|
|
4062 |
|
mcjzb = noPUmcjzb.str(); |
4063 |
|
|
2921 |
– |
cutWeight="1.0"; |
4064 |
|
} |
4065 |
|
|
4066 |
|
|
4084 |
|
string var( "abs("+mcjzb+")" ); |
4085 |
|
|
4086 |
|
TCut notTau("abs(genMID1)!=15"); |
4087 |
< |
TCut ONLYTau("mll>20"); |
4087 |
> |
TCut ee_mm_tautau("mll>0"); |
4088 |
|
|
4089 |
|
|
4090 |
< |
TH1F *hJZBpos = systsamples.Draw("hJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&¬Tau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4091 |
< |
TH1F *hJZBneg = systsamples.Draw("hJZBneg",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&¬Tau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4090 |
> |
TH1F *hJZBpos = systsamples.Draw("hJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&¬Tau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4091 |
> |
TH1F *hJZBneg = systsamples.Draw("hJZBneg",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&¬Tau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4092 |
|
|
4093 |
|
hJZBpos->SetLineColor(kBlack); |
4094 |
|
hJZBneg->SetLineColor(kRed); |
4103 |
|
leg->AddEntry(hJZBneg,"Predicted","l"); |
4104 |
|
leg->Draw("same"); |
4105 |
|
DrawMCPrelim(simulatedlumi); |
4106 |
< |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction"); |
4106 |
> |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction"+any2string(massregionname)); |
4107 |
|
|
4108 |
|
TH1F* hratio = (TH1F*)hJZBpos->Clone("hratio"); |
4109 |
|
hratio->Divide(hJZBneg); |
4112 |
|
cout << "Positive: " << hJZBpos->GetBinContent(i) << " vs Negative : " << hJZBneg->GetBinContent(i) << " (ratio : " << hJZBpos->GetBinContent(i) / hJZBneg->GetBinContent(i) << endl; |
4113 |
|
} |
4114 |
|
|
4115 |
< |
zcan->SetLogy(0); |
4116 |
< |
hratio->GetYaxis()->SetRangeUser(0,2.0); |
4115 |
> |
// zcan->SetLogy(0); |
4116 |
> |
hratio->GetYaxis()->SetRangeUser(0,2.5); |
4117 |
|
hratio->GetYaxis()->SetTitle("Observed/Predicted"); |
4118 |
|
hratio->Draw("e1"); |
4119 |
|
|
4135 |
|
leg2->AddEntry(bottom,"syst. envelope","l"); |
4136 |
|
leg2->Draw("same"); |
4137 |
|
DrawMCPrelim(simulatedlumi); |
4138 |
< |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction_ratio"); |
4138 |
> |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction_ratio"+any2string(massregionname)); |
4139 |
|
|
4140 |
|
TCut reducedNJets(cutnJets); |
4141 |
|
|
4142 |
< |
TH1F *TAUhJZBpos = systsamples.Draw("TAUhJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4143 |
< |
TH1F *LcorrJZBeemm = systsamples.Draw("LcorrJZBeemm",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4144 |
< |
TH1F *RcorrJZBem = systsamples.Draw("RcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4145 |
< |
TH1F *LcorrJZBem = systsamples.Draw("LcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4142 |
> |
TH1F *TAUhJZBpos = systsamples.Draw("TAUhJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4143 |
> |
TH1F *LcorrJZBeemm = systsamples.Draw("LcorrJZBeemm",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4144 |
> |
TH1F *RcorrJZBem = systsamples.Draw("RcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4145 |
> |
TH1F *LcorrJZBem = systsamples.Draw("LcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4146 |
|
|
4147 |
|
TH1F *RcorrJZBSBem; |
4148 |
|
TH1F *LcorrJZBSBem; |
4149 |
|
TH1F *RcorrJZBSBeemm; |
4150 |
|
TH1F *LcorrJZBSBeemm; |
4151 |
|
|
4152 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4153 |
< |
RcorrJZBSBem = systsamples.Draw("RcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4154 |
< |
LcorrJZBSBem = systsamples.Draw("LcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4155 |
< |
RcorrJZBSBeemm = systsamples.Draw("RcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4156 |
< |
LcorrJZBSBeemm = systsamples.Draw("LcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4152 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4153 |
> |
RcorrJZBSBem = systsamples.Draw("RcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4154 |
> |
LcorrJZBSBem = systsamples.Draw("LcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ee_mm_tautau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4155 |
> |
RcorrJZBSBeemm = systsamples.Draw("RcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kPos&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4156 |
> |
LcorrJZBSBeemm = systsamples.Draw("LcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ee_mm_tautau&&kNeg&&massregioncut,mc,simulatedlumi,systsamples.FindSample("/DY")); |
4157 |
|
} |
4158 |
|
|
4159 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
4160 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4160 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4161 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
4162 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
4163 |
|
Bpred->Add(RcorrJZBSBem,1.0/3.); |
4184 |
|
TAUleg->AddEntry(Bpred,"Predicted","l"); |
4185 |
|
TAUleg->Draw("same"); |
4186 |
|
DrawMCPrelim(simulatedlumi); |
4187 |
< |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction"); |
4187 |
> |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction__"+any2string(massregionname)); |
4188 |
|
|
4189 |
|
TH1F* TAUhratio = (TH1F*)TAUhJZBpos->Clone("TAUhratio"); |
4190 |
|
TAUhratio->Divide(Bpred); |
4202 |
|
center->Draw("same"); |
4203 |
|
bottom->Draw("same"); |
4204 |
|
|
4205 |
< |
TLegend *TAUleg2 = make_legend("MC Z+jets #rightarrow #tau#tau",0.25,0.75,false); |
4205 |
> |
TLegend *TAUleg2 = make_legend("MC Z+jets #rightarrow ee,#mu#mu",0.25,0.75,false); |
4206 |
|
TAUleg2->AddEntry(TAUhratio,"obs / pred","pe"); |
4207 |
|
TAUleg2->AddEntry(bottom,"syst. envelope","l"); |
4208 |
|
TAUleg2->Draw("same"); |
4209 |
|
DrawMCPrelim(simulatedlumi); |
4210 |
< |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction_ratio"); |
4210 |
> |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction_ratio"+any2string(massregionname)); |
4211 |
|
|
4212 |
|
delete Bpred; |
4213 |
|
delete TAUhJZBpos; |
4214 |
|
delete LcorrJZBeemm; |
4215 |
|
delete RcorrJZBem; |
4216 |
|
delete LcorrJZBem; |
4217 |
+ |
delete hJZBpos; |
4218 |
+ |
delete hJZBneg; |
4219 |
|
|
4220 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4220 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4221 |
|
delete RcorrJZBSBem; |
4222 |
|
delete LcorrJZBSBem; |
4223 |
|
delete RcorrJZBSBeemm; |
4227 |
|
|
4228 |
|
delete zcan; |
4229 |
|
cutWeight=weightbackup; |
3086 |
– |
|
4230 |
|
} |
4231 |
|
|
4232 |
|
|
4233 |
< |
|
4233 |
> |
void zjets_prediction_comparison(string mcjzbWithPUa) { |
4234 |
> |
zjets_prediction_comparison(mcjzbWithPUa, TCut(""), "nomasscut"); |
4235 |
> |
zjets_prediction_comparison(mcjzbWithPUa, TCut("abs(mll-91)<20"), "Zwindow_20"); |
4236 |
> |
zjets_prediction_comparison(mcjzbWithPUa, TCut("mll>20&&mll<70"), "LowMassRegion2070"); |
4237 |
> |
zjets_prediction_comparison(mcjzbWithPUa, TCut("mll>110"), "HighMassRegion110"); |
4238 |
> |
} |
4239 |
> |
|
4240 |
|
void sideband_assessment(string datajzb, float min=30.0, float max=50.0) { |
4241 |
|
tout << endl << endl; |
4242 |
|
stringstream bordercut; |
4287 |
|
TH1F *RcorrJZBSBeemm; |
4288 |
|
TH1F *LcorrJZBSBeemm; |
4289 |
|
|
4290 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4290 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4291 |
|
RcorrJZBSBem = coll.Draw("RcorrJZBSBem",jzbexpr.c_str(),nbins,low,14000, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity, mysample); |
4292 |
|
LcorrJZBSBem = coll.Draw("LcorrJZBSBem",("-("+jzbexpr+")").c_str(),nbins,low,14000, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity, mysample); |
4293 |
|
RcorrJZBSBeemm = coll.Draw("RcorrJZBSBeemm",jzbexpr.c_str(),nbins,low,14000, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity, mysample); |
4295 |
|
} |
4296 |
|
|
4297 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
4298 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4298 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4299 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
4300 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
4301 |
|
Bpred->Add(RcorrJZBSBem,1.0/3.); |
4344 |
|
} |
4345 |
|
|
4346 |
|
void met_jzb_cut(string datajzb, string mcjzb, vector<float> jzb_cut) { |
4347 |
+ |
cout << "You probably don't want --met, you want --metplots ... " << endl; |
4348 |
+ |
assert(0); |
4349 |
|
/*we want a table like this: |
4350 |
|
__________________ 50 | 100 | ... |
4351 |
|
| Data prediction | a vs b | a vs b | ... |
4508 |
|
TH1F *JRcorrJZBSBeemm; |
4509 |
|
TH1F *JLcorrJZBSBeemm; |
4510 |
|
|
4511 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4511 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4512 |
|
RcorrJZBSBem = qcdsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
4513 |
|
LcorrJZBSBem = qcdsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
4514 |
|
RcorrJZBSBeemm = qcdsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
4529 |
|
|
4530 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
4531 |
|
TH1F *JBpred = (TH1F*)JLcorrJZBeemm->Clone("Bpred"); |
4532 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4532 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4533 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
4534 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
4535 |
|
Bpred->Add(RcorrJZBSBem,1.0/3.); |
4579 |
|
//3rd last argument: do special bpred ratio, 2nd last argument: extended range!, last: y-axis title |
4580 |
|
string ytitle("ratio"); |
4581 |
|
if ( use_data==1 ) ytitle = "data/pred"; |
4582 |
< |
save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,"QCD/Bpred",true,false,ytitle); |
4582 |
> |
Save_With_Ratio(JRcorrJZBeemm,JBpred,kinpad,"QCD/Bpred",true,false,ytitle); |
4583 |
> |
delete kinpad; |
4584 |
|
|
4585 |
|
TH1F *allevents = qcdsamples.Draw("allevents","pfJetGoodNum",1,0,100, "internal code", "events", "" ,mc, luminosity); |
4586 |
|
TH1F *ossf = qcdsamples.Draw("ossf","pfJetGoodNum",1,0,100, "internal code", "events", cutOSSF ,mc, luminosity); |
4600 |
|
dout << "______________________________________________" << endl; |
4601 |
|
dout << "How QCD shows up in the different regions: " << endl; |
4602 |
|
dout << "OSSF: " << endl; |
4603 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4603 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4604 |
|
dout << " Z window: \t" << RcorrJZBeemm->Integral() << " (JZB>0) , " << LcorrJZBeemm->Integral() << " (JZB<0) --> total: " << RcorrJZBeemm->Integral() + LcorrJZBeemm->Integral() << endl; |
4605 |
|
dout << " sideband: \t" << RcorrJZBSBeemm->Integral() << " (JZB>0) , " << LcorrJZBSBeemm->Integral() << " (JZB<0) --> total: " << RcorrJZBSBeemm->Integral() + LcorrJZBSBeemm->Integral() << endl; |
4606 |
|
} else { |
4607 |
|
dout << " " << RcorrJZBeemm->Integral() << " (JZB>0) , " << LcorrJZBeemm->Integral() << " (JZB<0) --> total: " << RcorrJZBeemm->Integral() + LcorrJZBeemm->Integral() << endl; |
4608 |
|
} |
4609 |
|
dout << "OSOF: " << endl; |
4610 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4610 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4611 |
|
dout << " Z window: \t" << RcorrJZBem->Integral() << " (JZB>0) , " << LcorrJZBem->Integral() << " (JZB<0) --> total: " << RcorrJZBem->Integral() + LcorrJZBem->Integral() << endl; |
4612 |
|
dout << " sideband: \t" << RcorrJZBSBem->Integral() << " (JZB>0) , " << LcorrJZBSBem->Integral() << " (JZB<0) --> total: " << RcorrJZBSBem->Integral() + LcorrJZBSBem->Integral() << endl; |
4613 |
|
} else { |
4614 |
|
dout << " Z window: \t" << RcorrJZBem->Integral() << " (JZB>0) , " << LcorrJZBem->Integral() << " (JZB<0) --> total: " << RcorrJZBem->Integral() + LcorrJZBem->Integral() << endl; |
4615 |
|
} |
4616 |
|
dout << "Therefore: " << endl; |
4617 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4617 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4618 |
|
dout << " Prediction increases by : " << LcorrJZBeemm->Integral() << " + (1.0/3)*(" << RcorrJZBSBeemm->Integral() <<"-"<< LcorrJZBSBeemm->Integral() << ") (SFSB) "; |
4619 |
|
dout << " + (1.0/3)*(" << RcorrJZBem->Integral() <<"-"<< LcorrJZBem->Integral() << ") (OFZP) "; |
4620 |
|
dout << " + (1.0/3)*(" << RcorrJZBSBem->Integral() <<"-"<< LcorrJZBSBem->Integral() << ") (OFSB) "; |
4630 |
|
for(int i=0;i<(int)bins.size();i++) { |
4631 |
|
dout << " JZB > " << bins[i] << " : " << endl; |
4632 |
|
dout << " Observation increases by : " << RcorrJZBeemm->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) << endl; |
4633 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
4633 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
4634 |
|
dout << " Prediction increases by : " << LcorrJZBeemm->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) + (1.0/3)*(RcorrJZBSBeemm->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) - LcorrJZBSBeemm->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) + RcorrJZBem->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) - LcorrJZBem->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) + RcorrJZBSBem->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) - LcorrJZBSBem->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX())) << endl; |
4635 |
|
} else { |
4636 |
|
dout << " Prediction increases by : " << LcorrJZBeemm->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) + RcorrJZBem->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) - LcorrJZBem->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) << endl; |
4644 |
|
if(LcorrJZBem) delete LcorrJZBem; |
4645 |
|
if(RcorrJZBeemm) delete RcorrJZBeemm; |
4646 |
|
if(LcorrJZBeemm) delete LcorrJZBeemm; |
4647 |
< |
if(PlottingSetup::RestrictToMassPeak&&RcorrJZBSBem) delete RcorrJZBSBem; |
4648 |
< |
if(PlottingSetup::RestrictToMassPeak&&LcorrJZBSBem) delete LcorrJZBSBem; |
4649 |
< |
if(PlottingSetup::RestrictToMassPeak&&RcorrJZBSBeemm) delete RcorrJZBSBeemm; |
4650 |
< |
if(PlottingSetup::RestrictToMassPeak&&LcorrJZBSBeemm) delete LcorrJZBSBeemm; |
4647 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB&&RcorrJZBSBem) delete RcorrJZBSBem; |
4648 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB&&LcorrJZBSBem) delete LcorrJZBSBem; |
4649 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB&&RcorrJZBSBeemm) delete RcorrJZBSBeemm; |
4650 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB&&LcorrJZBSBeemm) delete LcorrJZBSBeemm; |
4651 |
|
} |
4652 |
|
|
4653 |
|
void check_ptsanity() { |
4753 |
|
findme.push_back("DY"); |
4754 |
|
findme.push_back("TTJets"); |
4755 |
|
findme.push_back("LM"); |
4756 |
< |
|
4756 |
> |
/* |
4757 |
|
for(int ifind=0;ifind<(int)findme.size();ifind++) { |
4758 |
|
vector<int> selsamples = allsamples.FindSample(findme[ifind]); |
4759 |
|
TH2F *metvsjzb = new TH2F("metvsjzb","metvsjzb",200,0,100,400,-100,100); |
4773 |
|
title->Draw(); |
4774 |
|
CompleteSave(canmetjzb,(string)"METvsJZBplots/"+findme[ifind]); |
4775 |
|
} |
4776 |
< |
|
4776 |
> |
*/ |
4777 |
|
|
4778 |
|
dout << "About to produce MET plot for DY split up by JZB" << endl; |
4779 |
|
|
4793 |
|
TH1F *metright = allsamples.Draw("metright","met[4]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&RIGHT,mc, luminosity, allsamples.FindSample("DYJets")); |
4794 |
|
TH1F *metrightO = allsamples.Draw("metrightO","met[4]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&RIGHT,mc, luminosity, allsamples.FindSample("DYJets")); |
4795 |
|
|
4796 |
+ |
|
4797 |
+ |
TH1F *Bpred = (TH1F*)metleft->Clone("Bpred"); |
4798 |
+ |
Bpred->Add(metleftO,-1); |
4799 |
+ |
Bpred->Add(metrightO); |
4800 |
+ |
TH1F *obs = (TH1F*)metright->Clone("obs"); |
4801 |
+ |
|
4802 |
|
metleft->Add(metleftO,-1); |
4803 |
|
metright->Add(metrightO,-1); |
4804 |
|
|
4811 |
|
metright->Draw("same"); |
4812 |
|
TLegend *lg = make_legend(); |
4813 |
|
lg->SetX1(0.5); |
4814 |
+ |
lg->SetY1(0.7); |
4815 |
|
lg->AddEntry(metright,"JZB>0 (OSOF corrected)","P"); |
4816 |
|
lg->AddEntry(metleft,"JZB<0 (OSOF corrected)","L"); |
4817 |
+ |
lg->SetHeader("DY"); |
4818 |
+ |
|
4819 |
|
lg->Draw(); |
4820 |
< |
save_with_ratio(metright,metleft,metpad->cd(),"METvsJZBplots/ComparingLeftToRightinMETspectrum"); |
4820 |
> |
Save_With_Ratio(metright,metleft,metpad->cd(),"METvsJZBplots/ComparingLeftToRightinMETspectrum"); |
4821 |
> |
|
4822 |
> |
TPad *metpad3 = new TPad("metpad3","metpad3",0,0,1,1); |
4823 |
> |
metpad3->cd(); |
4824 |
> |
metpad3->SetLogy(1); |
4825 |
> |
Bpred->SetLineColor(kRed); |
4826 |
> |
Bpred->Draw("histo"); |
4827 |
> |
obs->SetLineColor(kBlack); |
4828 |
> |
obs->Draw("same"); |
4829 |
> |
TLegend *lg2 = make_legend(); |
4830 |
> |
lg2->SetX1(0.5); |
4831 |
> |
lg2->SetY1(0.7); |
4832 |
> |
lg2->AddEntry(obs,"observed","P"); |
4833 |
> |
lg2->AddEntry(Bpred,"predicted","L"); |
4834 |
> |
lg2->SetHeader("DY"); |
4835 |
> |
|
4836 |
> |
lg2->Draw(); |
4837 |
> |
|
4838 |
> |
Save_With_Ratio(obs,Bpred,metpad3->cd(),"METvsJZBplots/ComparingPredObsinMET"); |
4839 |
> |
|
4840 |
|
TPad *metpad2 = new TPad("metpad2","metpad2",0,0,1,1); |
4841 |
+ |
metpad2->cd(); |
4842 |
+ |
metpad2->SetLogy(1); |
4843 |
|
|
4844 |
|
TH1F *metlefta = allsamples.Draw("metlefta","met[2]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&LEFT,mc, luminosity, allsamples.FindSample("DYJets")); |
4845 |
|
TH1F *metleftOa = allsamples.Draw("metleftOa","met[2]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&LEFT,mc, luminosity, allsamples.FindSample("DYJets")); |
4846 |
|
TH1F *metrighta = allsamples.Draw("metrighta","met[2]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&RIGHT,mc, luminosity, allsamples.FindSample("DYJets")); |
4847 |
|
TH1F *metrightOa = allsamples.Draw("metrightOa","met[2]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&RIGHT,mc, luminosity, allsamples.FindSample("DYJets")); |
4848 |
|
|
3667 |
– |
TH1F *Bpred = (TH1F*)metlefta->Clone("Bpred"); |
3668 |
– |
Bpred->Add(metleftOa,-1); |
3669 |
– |
Bpred->Add(metrightOa); |
3670 |
– |
TH1F *obs = (TH1F*)metrighta->Clone("obs"); |
3671 |
– |
|
4849 |
|
metlefta->Add(metleftOa,-1); |
4850 |
|
metrighta->Add(metrightOa,-1); |
4851 |
|
|
4854 |
|
metlefta->Draw("histo"); |
4855 |
|
metrighta->Draw("same"); |
4856 |
|
lg->Draw(); |
4857 |
< |
save_with_ratio(metrighta,metlefta,metpad2->cd(),"METvsJZBplots/ComparingLeftToRightinMET_type1_spectrum"); |
4857 |
> |
Save_With_Ratio(metrighta,metlefta,metpad2->cd(),"METvsJZBplots/ComparingLeftToRightinMET_type1_spectrum"); |
4858 |
> |
|
4859 |
> |
delete Bpred; |
4860 |
> |
delete obs; |
4861 |
> |
|
4862 |
> |
float newhigh=300; |
4863 |
> |
int newNBins=30; |
4864 |
> |
|
4865 |
> |
TPad *metpad4 = new TPad("metpad4","metpad4",0,0,1,1); |
4866 |
> |
TH1F *Ametleft = allsamples.Draw("Ametleft","met[4]",newNBins,low,newhigh, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&LEFT,mc, luminosity); |
4867 |
> |
TH1F *AmetleftO = allsamples.Draw("AmetleftO","met[4]",newNBins,low,newhigh, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&LEFT,mc, luminosity); |
4868 |
> |
TH1F *Ametright = allsamples.Draw("Ametright","met[4]",newNBins,low,newhigh, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&RIGHT,mc, luminosity); |
4869 |
> |
TH1F *AmetrightO = allsamples.Draw("AmetrightO","met[4]",newNBins,low,newhigh, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&RIGHT,mc, luminosity); |
4870 |
> |
|
4871 |
> |
TH1F *aBpred = (TH1F*)Ametleft->Clone("aBpred"); |
4872 |
> |
aBpred->Add(AmetleftO,-1); |
4873 |
> |
aBpred->Add(AmetrightO); |
4874 |
> |
aBpred->SetLineColor(kRed); |
4875 |
> |
|
4876 |
> |
TH1F *aobs = (TH1F*)Ametright->Clone("aobs"); |
4877 |
> |
metpad4->cd(); |
4878 |
> |
metpad4->SetLogy(1); |
4879 |
> |
aobs->Draw(); |
4880 |
> |
aBpred->Draw("histo,same"); |
4881 |
> |
aobs->Draw("same"); |
4882 |
> |
lg->SetHeader("All MC"); |
4883 |
> |
lg->Draw(); |
4884 |
> |
Save_With_Ratio(aobs,aBpred,metpad4->cd(),"METvsJZBplots/ComparingPredObsinMET_ALLSAMPLES"); |
4885 |
|
|
3682 |
– |
TPad *metpad3 = new TPad("metpad3","metpad3",0,0,1,1); |
3683 |
– |
metpad3->cd(); |
3684 |
– |
Bpred->SetLineColor(kRed); |
3685 |
– |
Bpred->Draw("histo"); |
3686 |
– |
obs->SetLineColor(kBlack); |
3687 |
– |
obs->Draw("same"); |
3688 |
– |
TLegend *lg2 = make_legend(); |
3689 |
– |
lg2->SetX1(0.5); |
3690 |
– |
lg2->AddEntry(obs,"observed","P"); |
3691 |
– |
lg2->AddEntry(Bpred,"predicted","L"); |
3692 |
– |
lg2->Draw(); |
4886 |
|
|
3694 |
– |
save_with_ratio(obs,Bpred,metpad3->cd(),"METvsJZBplots/ComparingPredObsinMET_type1_spectrum"); |
4887 |
|
delete lg; |
4888 |
|
delete canmetjzb; |
4889 |
|
delete metleft; |