188 |
|
|
189 |
|
// TH1F *RcorrJZBeemmNoS; |
190 |
|
|
191 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
191 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
192 |
|
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzeroD,data, luminosity); |
193 |
|
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzeroD,data, luminosity); |
194 |
|
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzeroD,data, luminosity); |
199 |
|
TH1F* SFN = (TH1F*)LcorrJZBeemm->Clone("SFN"); |
200 |
|
TH1F* OFP = (TH1F*)RcorrJZBem->Clone("OFP"); |
201 |
|
TH1F* OFN = (TH1F*)LcorrJZBem->Clone("OFN"); |
202 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
202 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
203 |
|
OFP->Scale(1.0/3.0); |
204 |
|
OFP->Add(RcorrJZBSBem,1.0/3.); |
205 |
|
OFP->Add(RcorrJZBSBeemm,1.0/3.); |
264 |
|
delete LcorrJZBeemm; |
265 |
|
delete RcorrJZBem; |
266 |
|
delete LcorrJZBem; |
267 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
267 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
268 |
|
delete RcorrJZBSBeemm; |
269 |
|
delete LcorrJZBSBeemm; |
270 |
|
delete RcorrJZBSBem; |
357 |
|
oneline->SetLineWidth(1); |
358 |
|
oneline->Draw("same"); |
359 |
|
} |
360 |
< |
|
361 |
< |
void make_OFSF_plot(string variable, string addcut, string legendTitle, int nbins, float min, float max, bool logscale, |
362 |
< |
string xlabel, string filename, bool isPF=true, bool plotratio=true, bool loadlastminmax=false, float legendPosition=0.3) { |
360 |
> |
float make_one_OFSF_plot(string variable, string addcut, string legendTitle, int nbins, float min, float max, float ymax, bool logscale, |
361 |
> |
string xlabel, string filename, bool plotratio=true, bool loadlastminmax=false, float legendPosition=0.55) { |
362 |
|
|
363 |
|
TCut ibasiccut=basiccut; |
364 |
|
bool draw_separation_lines=false; |
365 |
|
|
367 |
– |
if(isPF) ibasiccut=basiccut&&"pfjzb[0]>-998"; |
368 |
– |
|
366 |
|
if(addcut != "") ibasiccut = ibasiccut && addcut.c_str(); |
367 |
|
|
368 |
|
TCut cutSF; |
369 |
|
TCut cutOF; |
370 |
|
|
371 |
< |
cutOF=cutOSOF&&cutnJets&&ibasiccut; |
372 |
< |
cutSF=cutOSSF&&cutnJets&&ibasiccut; |
376 |
< |
|
371 |
> |
cutOF = cutOSOF&&cutnJets&&ibasiccut; |
372 |
> |
cutSF = cutOSSF&&cutnJets&&ibasiccut; |
373 |
|
|
374 |
|
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
375 |
|
ckin->SetLogy(logscale); |
381 |
|
(signalsamples.collection)[idx].events->Project("signalhisto",variable.c_str(),cutSF); |
382 |
|
signalhisto->Scale((signalsamples.collection)[idx].weight*luminosity); |
383 |
|
signalhisto->SetLineColor((signalsamples.collection)[idx].samplecolor); |
384 |
+ |
signalhisto->SetLineStyle(2); |
385 |
|
datahistoSF->SetMarkerSize(DataMarkerSize); |
386 |
|
datahistoOF->SetLineColor(kRed); |
387 |
|
|
388 |
|
if ( !logscale ) { |
389 |
|
datahistoSF->SetMinimum(0); // Defaults |
393 |
– |
datahistoOF->SetMinimum(0); // Defaults |
390 |
|
} else { |
391 |
|
datahistoSF->SetMinimum(0.5); |
396 |
– |
datahistoOF->SetMinimum(0.5); |
392 |
|
} |
393 |
< |
if (logscale) { |
394 |
< |
datahistoSF->SetMaximum(5.3*datahistoSF->GetMaximum()); |
395 |
< |
datahistoOF->SetMaximum(5.3*datahistoSF->GetMaximum()); |
393 |
> |
if (ymax<0) { |
394 |
> |
if ( logscale ) datahistoSF->SetMaximum(5.3*datahistoSF->GetMaximum()); |
395 |
> |
else datahistoSF->SetMaximum(1.5*datahistoSF->GetMaximum()); |
396 |
|
} else { |
397 |
< |
datahistoSF->SetMaximum(2.0*datahistoSF->GetMaximum()); |
403 |
< |
datahistoOF->SetMaximum(2.0*datahistoOF->GetMaximum()); |
397 |
> |
datahistoSF->SetMaximum(ymax); |
398 |
|
} |
399 |
|
|
400 |
+ |
float ymaxSet = datahistoSF->GetMaximum(); |
401 |
+ |
|
402 |
|
datahistoSF->GetXaxis()->SetTitle(xlabel.c_str()); |
403 |
< |
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"); |
403 |
> |
datahistoSF->GetYaxis()->SetTitle("Events"); |
404 |
|
datahistoSF->GetXaxis()->CenterTitle(); |
413 |
– |
datahistoOF->GetXaxis()->CenterTitle(); |
414 |
– |
signalhisto->GetXaxis()->CenterTitle(); |
405 |
|
datahistoSF->GetYaxis()->CenterTitle(); |
416 |
– |
datahistoOF->GetYaxis()->CenterTitle(); |
417 |
– |
signalhisto->GetYaxis()->CenterTitle(); |
406 |
|
|
407 |
< |
TLegend *mleg = new TLegend(0.2+legendPosition, 0.72, 0.55+legendPosition, 0.87, legendTitle.c_str()); |
408 |
< |
mleg->SetFillColor(kWhite); |
409 |
< |
mleg->SetTextFont(42); |
410 |
< |
mleg->SetTextSize(0.048); |
411 |
< |
mleg->SetLineWidth(0); |
412 |
< |
mleg->SetBorderSize(0); |
413 |
< |
mleg->AddEntry(datahistoSF, "S. Flavor", "PL"); |
426 |
< |
mleg->AddEntry(datahistoOF, "O. Flavor", "L"); |
407 |
> |
TLegend *mleg = make_legend(legendTitle.c_str(),legendPosition,0.7,false,legendPosition+0.2); |
408 |
> |
mleg->AddEntry(datahistoSF, "Same-flavor", "PL"); |
409 |
> |
if (datahistoOF->Integral()>0) { |
410 |
> |
mleg->AddEntry(datahistoOF, "Opposite-flavor", "L"); |
411 |
> |
} else { |
412 |
> |
mleg->AddEntry((TObject*)0, "", ""); |
413 |
> |
} |
414 |
|
mleg->AddEntry(signalhisto, "LM3", "L"); |
415 |
|
|
416 |
|
datahistoSF->Draw("E1"); |
417 |
< |
datahistoOF->Draw("HIST,SAMES"); |
417 |
> |
if (datahistoOF->Integral()>0) datahistoOF->Draw("HIST,SAMES"); |
418 |
|
signalhisto->Draw("HIST,SAMES"); |
419 |
|
mleg->Draw(); |
420 |
|
DrawPrelim(); |
421 |
< |
CompleteSave(ckin, "./SFOF/" + filename); |
421 |
> |
CompleteSave(ckin, "SFOF/" + filename); |
422 |
|
|
423 |
|
datahistoSF->Delete(); |
424 |
|
datahistoOF->Delete(); |
426 |
|
delete mleg; |
427 |
|
delete ckin; |
428 |
|
|
429 |
+ |
return ymaxSet; |
430 |
+ |
|
431 |
|
} |
432 |
|
|
433 |
+ |
void make_OFSF_plots(string variable, string addcut, int nbins, float min, float max, bool logscale, string xlabel, string filename, |
434 |
+ |
bool plotratio=true, bool loadlastminmax=false, float legendPosition=0.55) { |
435 |
+ |
|
436 |
+ |
string mllcuts[] = { "mll>20","mll>20&&mll<70", "mll>70&&mll<110", "mll>110" }; |
437 |
+ |
string mllcutname[] = { "m_{ll} > 20 GeV", "20 < m_{ll} < 70 GeV", "70 < m_{ll} < 110 GeV", "m_{ll} > 110 GeV" }; |
438 |
+ |
string plotname[] = {"_all","_low","_peak","_high"}; |
439 |
+ |
float ymax; |
440 |
+ |
for ( int i=0; i<4; ++i ) { |
441 |
+ |
if ( addcut != "" ) mllcuts[i] += "&&"+addcut; |
442 |
+ |
if ( i==0 ) { |
443 |
+ |
ymax = make_one_OFSF_plot(variable, mllcuts[i], mllcutname[i], nbins, min, max, -1, logscale, xlabel, |
444 |
+ |
filename+plotname[i], plotratio, loadlastminmax, legendPosition ); |
445 |
+ |
} else { |
446 |
+ |
make_one_OFSF_plot(variable, mllcuts[i], mllcutname[i], nbins, min, max, ymax, logscale, xlabel, |
447 |
+ |
filename+plotname[i], plotratio, loadlastminmax, legendPosition ); |
448 |
+ |
} |
449 |
+ |
make_one_OFSF_plot(variable, "id1==1&&id1==id2&&"+mllcuts[i], mllcutname[i], nbins, min, max, ymax, logscale, xlabel, |
450 |
+ |
filename+plotname[i]+"_mm", plotratio, loadlastminmax, legendPosition ); |
451 |
+ |
make_one_OFSF_plot(variable, "id1==0&&id1==id2&&"+mllcuts[i], mllcutname[i], nbins, min, max, ymax, logscale, xlabel, |
452 |
+ |
filename+plotname[i]+"_ee", plotratio, loadlastminmax, legendPosition ); |
453 |
+ |
} |
454 |
+ |
|
455 |
+ |
} |
456 |
|
|
457 |
|
|
458 |
|
float lastrange_min=0; |
524 |
|
if (logscale) datahisto->SetMaximum(5.3*datahisto->GetMaximum()); |
525 |
|
else datahisto->SetMaximum(1.3*datahisto->GetMaximum()); |
526 |
|
|
527 |
+ |
cout << "******** Cut used : " << (const char*) cut << endl; |
528 |
|
if(loadlastminmax) { |
529 |
|
datahisto->SetMinimum(lastrange_min); |
530 |
|
datahisto->SetMaximum(lastrange_max); |
671 |
|
mll_low=20; |
672 |
|
mll_hi=300; |
673 |
|
} |
674 |
< |
|
675 |
< |
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); |
676 |
< |
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); |
677 |
< |
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); |
678 |
< |
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); |
679 |
< |
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); |
680 |
< |
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); |
681 |
< |
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); |
682 |
< |
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); |
683 |
< |
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); |
684 |
< |
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); |
685 |
< |
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); |
686 |
< |
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); |
687 |
< |
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); |
688 |
< |
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); |
689 |
< |
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); |
690 |
< |
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); |
691 |
< |
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); |
679 |
< |
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); |
680 |
< |
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); |
681 |
< |
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); |
682 |
< |
|
683 |
< |
|
674 |
> |
/* |
675 |
> |
make_OFSF_plots("mll", "met[4]>100", 60, 20., 320., false, "m_{ll}", "mll", false, false); |
676 |
> |
make_OFSF_plots("pfJetGoodNum40", "met[4]>100", 7, 3, 10, true, "#(jets)", "njets", false, false); |
677 |
> |
make_OFSF_plots("pt1", "met[4]>100", 30, 0., 300., true, "p_{T,1}", "pt1", false, false); |
678 |
> |
make_OFSF_plots("pt2", "met[4]>100", 22, 0., 220., true, "p_{T,2}", "pt2", false, false); |
679 |
> |
make_OFSF_plots("eta1", "met[4]>100", 10, -2.5, 2.5, false, "#eta_{1}", "eta1", false, false, 0.15); |
680 |
> |
make_OFSF_plots("eta2", "met[4]>100", 10, -2.5, 2.5, false, "#eta_{2}", "eta2", false, false, 0.15); |
681 |
> |
make_OFSF_plots("phi1", "met[4]>100", 10, -TMath::Pi(), TMath::Pi(), false, "#phi_{1}", "phi1", false, false, 0.2); |
682 |
> |
make_OFSF_plots("phi2", "met[4]>100", 10, -TMath::Pi(), TMath::Pi(), false, "#phi_{2}", "phi2", false, false, 0.2); |
683 |
> |
make_OFSF_plots("pfJetGoodPt[0]/pfJetGoodPt[1]", "met[4]>100", 20, 1, 10, true, "pt_{j}^{1}/pt_{j}^{2}", "jpt1pt2", false, false, 0.2); |
684 |
> |
make_OFSF_plots("TMath::Abs(pfJetDphiMet[0])", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(jet1,MET)|", "dphij1met", false, false, 0.0); |
685 |
> |
make_OFSF_plots("TMath::Abs(dphi)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l1,l2)|", "dphi", false, false, 0.2); |
686 |
> |
make_OFSF_plots("TMath::Abs(dphiMet1)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l1,MET)|", "dphiMet1", false, false, 0.2); |
687 |
> |
make_OFSF_plots("TMath::Abs(dphiMet2)", "met[4]>100", 16, 0, 3.2, false, "|#Delta#phi(l2,MET)|", "dphiMet2", false, false, 0.2); |
688 |
> |
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", false, false, 0.2); |
689 |
> |
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", false, false, 0.2); |
690 |
> |
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", false, false, 0.2); |
691 |
> |
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", false, false, 0.2); |
692 |
|
|
693 |
|
make_kin_plot("met[4]","",70,0,350,dolog,"MET [GeV]","met",doPF,true); |
686 |
– |
|
694 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll",doPF,true); |
695 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof",doPF,true,true); |
696 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee",doPF,true); |
712 |
|
make_kin_plot("numVtx","",(int)(30.5-(-0.5)),-0.5,30.5,nolog,"N(Vtx)","numVtx",doPF); |
713 |
|
// make_kin_plot("jetpt[0]","",40,0,200,dolog,"leading jet p_{T} [GeV]","pfJetGoodPt_0",doPF); |
714 |
|
// make_kin_plot("jeteta[0]","",40,-5,5,nolog,"leading jet #eta","pfJetGoodEta_0",doPF); |
715 |
+ |
*/ |
716 |
|
make_kin_plot("pt","",50,0,500,dolog,"Z p_{T} [GeV]","Zpt",doPF); |
717 |
|
make_kin_plot("pt1","",50,0,200,nolog,"p_{T} [GeV]","pt1",doPF); |
718 |
|
make_kin_plot("pt2","",50,0,200,nolog,"p_{T} [GeV]","pt2",doPF); |
737 |
|
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); |
738 |
|
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); |
739 |
|
|
740 |
< |
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); |
740 |
> |
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); |
741 |
> |
//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); |
742 |
> |
//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); |
743 |
|
|
744 |
|
make_special_obs_pred_mll_plot(datajzb,mcjzb,0); |
745 |
|
make_special_obs_pred_mll_plot(datajzb,mcjzb,50); |
752 |
|
make_JES_plot(cutmass&&cutOSSF&&basiccut,"_ossf"); |
753 |
|
make_JES_plot(cutmass&&cutOSOF&&basiccut,"_osof"); |
754 |
|
|
755 |
+ |
string regioncut[4] = {"mll>0&&","mll>20&&mll<70&&","mll>70&&mll<110&&","mll>110&&"}; |
756 |
+ |
string regionname[4] = {"global","lowmass","Zregion","highmass"}; |
757 |
+ |
bool StoreRatioPlots=false; |
758 |
+ |
for(int iregion=0;iregion<4;iregion++) { |
759 |
+ |
cout << regionname[iregion] << " : " << regioncut[iregion] << endl; |
760 |
+ |
|
761 |
+ |
//Z properties |
762 |
+ |
make_kin_plot("pt","met[4]>100&&id1==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutOSSF&&cutnJets),40,0,200,dolog,"p_{T}^{ee} [GeV] (MET>100GeV)","Z/ZPT_ee_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
763 |
+ |
make_kin_plot("pt","met[4]>100&&id1==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutOSSF&&cutnJets),40,0,200,dolog,"p_{T}^{#mu#mu} [GeV] (MET>100GeV)","Z/ZPT_mm_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
764 |
+ |
|
765 |
+ |
make_kin_plot("phi","met[4]>100&&id1==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutOSSF&&cutnJets),32,-3.2,3.2,nolog,"#phi^{ee} (MET>100GeV)","Z/ZPhi_ee_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
766 |
+ |
make_kin_plot("phi","met[4]>100&&id1==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutOSSF&&cutnJets),32,-3.2,3.2,nolog,"#phi^{#mu#mu} (MET>100GeV)","Z/ZPhi_mm_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
767 |
+ |
|
768 |
+ |
make_kin_plot("eta","met[4]>100&&id1==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutOSSF&&cutnJets),30,-3.0,3.0,nolog,"#eta^{ee} (MET>100GeV)","Z/ZEta_ee_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
769 |
+ |
make_kin_plot("eta","met[4]>100&&id1==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutOSSF&&cutnJets),30,-3.0,3.0,nolog,"#eta^{#mu#mu} (MET>100GeV)","Z/ZEta_mm_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
770 |
+ |
|
771 |
+ |
// lepton properties |
772 |
+ |
make_kin_plot("pt1","met[4]>100&&id1==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),40,0,200,dolog,"p_{T}^{e1} [GeV] (MET>100GeV)","Lepton/LeadingElectronPt_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
773 |
+ |
make_kin_plot("pt1","met[4]>100&&id1==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),40,0,200,dolog,"p_{T}^{#mu1} [GeV] (MET>100GeV)","Lepton/LeadingMuonPt_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
774 |
+ |
make_kin_plot("pt2","met[4]>100&&id2==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),40,0,200,dolog,"p_{T}^{e2} [GeV] (MET>100GeV)","Lepton/SubLeadingElectronPt_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
775 |
+ |
make_kin_plot("pt2","met[4]>100&&id2==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),40,0,200,dolog,"p_{T}^{#mu2} [GeV] (MET>100GeV)","Lepton/SubLeadingMuonPt_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
776 |
+ |
|
777 |
+ |
make_kin_plot("phi1","met[4]>100&&id1==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),32,-3.2,3.2,nolog,"#phi^{e1} (MET>100GeV)","Lepton/LeadingElectronPhi_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
778 |
+ |
make_kin_plot("phi1","met[4]>100&&id1==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),32,-3.2,3.2,nolog,"#phi^{#mu1} (MET>100GeV)","Lepton/LeadingMuonPhi_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
779 |
+ |
make_kin_plot("phi2","met[4]>100&&id2==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),32,-3.2,3.2,nolog,"#phi^{e2} (MET>100GeV)","Lepton/SubLeadingElectronPhi_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
780 |
+ |
make_kin_plot("phi2","met[4]>100&&id2==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),32,-3.2,3.2,nolog,"#phi^{#mu2} (MET>100GeV)","Lepton/SubLeadingMuonPhi_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
781 |
+ |
|
782 |
+ |
make_kin_plot("eta1","met[4]>100&&id1==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),30,-3.0,3.0,nolog,"#eta^{e1} (MET>100GeV)","Lepton/LeadingElectronEta_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
783 |
+ |
make_kin_plot("eta1","met[4]>100&&id1==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),30,-3.0,3.0,nolog,"#eta^{#mu1} (MET>100GeV)","Lepton/LeadingMuonEta_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
784 |
+ |
make_kin_plot("eta2","met[4]>100&&id2==0&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),30,-3.0,3.0,nolog,"#eta^{e2} (MET>100GeV)","Lepton/SubLeadingElectronEta_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
785 |
+ |
make_kin_plot("eta2","met[4]>100&&id2==1&&"+regioncut[iregion]+(const char*)TCut(cutmass&&cutnJets),30,-3.0,3.0,nolog,"#eta^{#mu2} (MET>100GeV)","Lepton/SubLeadingMuonEta_met100_"+regionname[iregion],doPF,StoreRatioPlots); |
786 |
+ |
|
787 |
+ |
|
788 |
+ |
} |
789 |
|
|
790 |
|
} |
791 |
|
|
802 |
|
|
803 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- below: the next ~20 lines changed! |
804 |
|
int nRegions=4; |
805 |
< |
if(!PlottingSetup::RestrictToMassPeak) { |
805 |
> |
if(!PlottingSetup::RestrictToMassPeak||!PlottingSetup::UseSidebandsForcJZB) { |
806 |
|
nRegions=2; |
807 |
|
} |
808 |
|
|
1076 |
|
// 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) |
1077 |
|
TF1 *ttbarlogpar = do_logpar_fit_to_plot(Tprediction); |
1078 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1079 |
< |
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); |
1079 |
> |
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); |
1080 |
|
|
1081 |
|
|
1082 |
|
TF1 *ttbarlogparP = new TF1("ttbarlogparP",LogParabolaP,0,(prediction->GetXaxis()->GetBinLowEdge(prediction->GetNbinsX())+prediction->GetXaxis()->GetBinWidth(prediction->GetNbinsX())),8); |
1217 |
|
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); |
1218 |
|
|
1219 |
|
|
1220 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1220 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
1221 |
|
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
1222 |
|
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
1223 |
|
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
1244 |
|
TH1F *BpredSys = new TH1F("Bpredsys","Bpredsys",PlottingSetup::global_ratio_binning.size()-1,&PlottingSetup::global_ratio_binning[0]); |
1245 |
|
ClearHisto(BpredSys); |
1246 |
|
|
1247 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1247 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
1248 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
1249 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
1250 |
|
Bpred->Add(RcorrJZBSBem,1.0/3.); |
1299 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed |
1300 |
|
TH1F *Tpred = (TH1F*)RcorrJZBem->Clone("Bpred"); |
1301 |
|
Tpred->Add(LcorrJZBem,-1.0); |
1302 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1302 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
1303 |
|
Tpred->Add(RcorrJZBSBem,1.0); |
1304 |
|
Tpred->Add(LcorrJZBSBem,-1.0); |
1305 |
|
Tpred->Add(RcorrJZBSBeemm,1.0); |
1392 |
|
speciallegBpred->AddEntry(RcorrJZBeemm,"Data","pl"); |
1393 |
|
speciallegBpred->AddEntry(Bpred,"Total background","l"); |
1394 |
|
speciallegBpred->AddEntry(jzbnegative,"JZB<0 (data)","f"); |
1395 |
< |
if(PlottingSetup::RestrictToMassPeak) speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f"); |
1395 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f"); |
1396 |
|
else speciallegBpred->AddEntry(sidebandsemu,"e#mu (data)","f"); |
1397 |
|
// speciallegBpred->AddEntry(lm4RcorrJZBeemmC,"LM4","l"); |
1398 |
|
speciallegBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
1485 |
|
|
1486 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1487 |
|
// The part below is meaningless for the offpeak analysis (it's a comparison of the different estimates but there is but one estimate!) |
1488 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1488 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
1489 |
|
TH1F *Bpredem = (TH1F*)LcorrJZBeemm->Clone("Bpredem"); |
1490 |
|
Bpredem->Add(RcorrJZBem); |
1491 |
|
Bpredem->Add(LcorrJZBem,-1); |
1564 |
|
delete blankback; |
1565 |
|
|
1566 |
|
delete BpredSys; |
1567 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1567 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
1568 |
|
delete RcorrJZBSBem; |
1569 |
|
delete LcorrJZBSBem; |
1570 |
|
delete RcorrJZBSBeemm; |
1605 |
|
TH1F *RcorrJZBSBeemm; |
1606 |
|
TH1F *LcorrJZBSbeemm; |
1607 |
|
|
1608 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1608 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
1609 |
|
RcorrJZBSBem = allsamples.Draw("RcorrJZBSbem",jzb.c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,do_data, luminosity,dosignal); |
1610 |
|
LcorrJZBSBem = allsamples.Draw("LcorrJZBSbem",("-"+jzb).c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,do_data, luminosity,dosignal); |
1611 |
|
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSbeemm",jzb.c_str(),binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,do_data, luminosity,dosignal); |
1617 |
|
|
1618 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1619 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
1620 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
1620 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
1621 |
|
Bpred->Add(RcorrJZBem,1.0/3); |
1622 |
|
Bpred->Add(LcorrJZBem,-1.0/3); |
1623 |
|
Bpred->Add(RcorrJZBSBem,1.0/3); |
1924 |
|
datahisto->Draw("same,e1"); |
1925 |
|
|
1926 |
|
TLegend *leg; |
1927 |
< |
if (!PlottingSetup::RestrictToMassPeak) { |
1927 |
> |
if (!PlottingSetup::RestrictToMassPeak||!PlottingSetup::UseSidebandsForcJZB) { |
1928 |
|
if(is_OF(cut)) leg = allsamples.allbglegend("Opposite flavor",datahisto); |
1929 |
|
else leg = allsamples.allbglegend("Same flavor",datahisto); |
1930 |
|
} else { |
1987 |
|
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"Dibosons/mm/jzb_OS_SFZP",dican,binning); |
1988 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"Dibosons/ee/jzb_OS_OFZP",dican,binning); |
1989 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"Dibosons/mm/jzb_OS_OFZP",dican,binning); |
1990 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB",dican,binning); |
1991 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB",dican,binning); |
1990 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB",dican,binning); |
1991 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB",dican,binning); |
1992 |
|
|
1993 |
|
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"Dibosons/jzb_OS_SFZP_coarse",dican,coarse_binning); |
1994 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"Dibosons/jzb_OS_OFZP_coarse",dican,coarse_binning); |
1995 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB_coarse",dican,coarse_binning); |
1996 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB_coarse",dican,coarse_binning); |
1995 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_SFSB_coarse",dican,coarse_binning); |
1996 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"Dibosons/jzb_OS_OFSB_coarse",dican,coarse_binning); |
1997 |
|
|
1998 |
|
delete dican; |
1999 |
|
} |
2094 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_OFZP",can,binning); |
2095 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_OFZP",can,binning); |
2096 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
2097 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning); |
2098 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning); |
2097 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning); |
2098 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning); |
2099 |
|
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); |
2100 |
|
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); |
2101 |
|
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); |
2106 |
|
if ( !PlottingSetup::Approved ) { |
2107 |
|
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarse",can,coarse_binning); |
2108 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
2109 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning); |
2110 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning); |
2109 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning); |
2110 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning); |
2111 |
|
} |
2112 |
|
delete can; |
2113 |
|
} |
2159 |
|
TCanvas *yica = new TCanvas("yica","yield canvas"); |
2160 |
|
|
2161 |
|
int nRegions=4; |
2162 |
< |
if(!PlottingSetup::RestrictToMassPeak) nRegions=2; |
2162 |
> |
if(!PlottingSetup::RestrictToMassPeak||!PlottingSetup::UseSidebandsForcJZB) nRegions=2; |
2163 |
|
string tsRegions[] = {"SFZP","OFZP","SFSB","OFSB"}; |
2164 |
|
string posneg[] = {"pos","neg"}; |
2165 |
|
TCut tkRegions[] = {cutOSSF&&cutnJets&&cutmass,cutOSOF&&cutnJets&&cutmass,cutOSSF&&cutnJets&&sidebandcut,cutOSOF&&cutnJets&&sidebandcut}; |
2607 |
|
configfile<<"\n\n"; |
2608 |
|
configfile<<"luminosity="<<luminosity<<";\n"; |
2609 |
|
configfile<<"RestrictToMassPeak="<<RestrictToMassPeak<<";//defines the type of analysis we're running\n"; |
2610 |
+ |
configfile<<"UseSidebandsForcJZB="<<UseSidebandsForcJZB<<";//tells us whether to use the sidebands or not\n"; |
2611 |
|
|
2612 |
|
configfile<<"\n\ncout << \"Configuration successfully loaded!\" << endl; \n \n } \n \n"; |
2613 |
|
|
2680 |
|
TH1F *TSeemm; |
2681 |
|
TH1F *nTSeemm; |
2682 |
|
|
2683 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2683 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2684 |
|
TSem = systsamples.Draw("TSem", mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2685 |
|
nTSem = systsamples.Draw("nTSem", "-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2686 |
|
TSeemm = systsamples.Draw("TSeemm", mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2696 |
|
TZem->SetMarkerColor(kRed); |
2697 |
|
|
2698 |
|
|
2699 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2699 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2700 |
|
TSem->SetLineColor(TColor::GetColor("#00A616")); |
2701 |
|
TSeemm->SetLineColor(kMagenta+2); |
2702 |
|
TSem->SetMarkerColor(TColor::GetColor("#00A616")); |
2710 |
|
TZeemm->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
2711 |
|
histos.push_back(TZem); |
2712 |
|
histos.push_back(TZeemm); |
2713 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2713 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2714 |
|
TSeemm->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
2715 |
|
TSem->GetXaxis()->SetRangeUser(-100,binning[binning.size()-1]); |
2716 |
|
histos.push_back(TSem); |
2721 |
|
TLegend *leg = make_legend("MC t#bar{t}",0.6,0.65,false); |
2722 |
|
leg->AddEntry(TZeemm,"SFZP","l"); |
2723 |
|
leg->AddEntry(TZem,"OFZP","l"); |
2724 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2724 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2725 |
|
leg->AddEntry(TSeemm,"SFSB","l"); |
2726 |
|
leg->AddEntry(TSem,"OFSB","l"); |
2727 |
|
} |
2732 |
|
TH1F *TZeemmcopy = (TH1F*)TZeemm->Clone("TZeemmcopy"); |
2733 |
|
TH1F *TSeemmcopy; |
2734 |
|
TH1F *TSemcopy; |
2735 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2735 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2736 |
|
TSeemmcopy = (TH1F*)TSeemm->Clone("TSeemmcopy"); |
2737 |
|
TSemcopy = (TH1F*)TSem->Clone("TSemcopy"); |
2738 |
|
} |
2739 |
|
|
2740 |
|
TZem->Divide(TZeemm); |
2741 |
|
TZem->SetMarkerStyle(21); |
2742 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2742 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2743 |
|
TSem->Divide(TZeemm); |
2744 |
|
TSeemm->Divide(TZeemm); |
2745 |
|
TSem->SetMarkerStyle(24); |
2750 |
|
TZem->GetYaxis()->SetRangeUser(0,2.5); |
2751 |
|
TZem->GetYaxis()->SetTitle("ratio"); |
2752 |
|
TZem->Draw(); |
2753 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2753 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2754 |
|
TSem->Draw("same"); |
2755 |
|
TSeemm->Draw("same"); |
2756 |
|
} |
2780 |
|
|
2781 |
|
TLegend *leg2 = make_legend("MC t#bar{t}",0.55,0.75,false); |
2782 |
|
leg2->AddEntry(TZem,"OFZP / SFZP","ple"); |
2783 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2783 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2784 |
|
leg2->AddEntry(TSeemm,"SFSB / SFZP","ple"); |
2785 |
|
leg2->AddEntry(TSem,"OFSB / SFZP","ple"); |
2786 |
|
} |
2806 |
|
TH1F *rightofsb; |
2807 |
|
TH1F *leftsfsb; |
2808 |
|
TH1F *rightsfsb; |
2809 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2809 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2810 |
|
leftofsb = (TH1F*)nTSem->Clone("leftofsb"); |
2811 |
|
rightofsb = (TH1F*)TSemcopy->Clone("rightofsb"); |
2812 |
|
rightofsb->Add(leftofsb,-1); |
2820 |
|
rightsfzp->GetYaxis()->SetTitle("#deltaJZB / 25 GeV"); |
2821 |
|
rightsfzp->Draw("histo"); |
2822 |
|
rightofzp->Draw("histo,same"); |
2823 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2823 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2824 |
|
rightofsb->Draw("histo,same"); |
2825 |
|
rightsfsb->Draw("histo,same"); |
2826 |
|
} |
2829 |
|
TLegend *legA = make_legend("MC t#bar{t}",0.6,0.65,false); |
2830 |
|
legA->AddEntry(rightsfzp,"SFZP","l"); |
2831 |
|
legA->AddEntry(rightofzp,"OFZP","l"); |
2832 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2832 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2833 |
|
legA->AddEntry(rightofsb,"SFSB","l"); |
2834 |
|
legA->AddEntry(rightsfsb,"OFSB","l"); |
2835 |
|
} |
2843 |
|
rightofzp->GetYaxis()->SetRangeUser(0.0,2.5); |
2844 |
|
rightofzp->GetYaxis()->SetTitle("#deltaJZB ratio"); |
2845 |
|
rightofzp->Draw(); |
2846 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2846 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2847 |
|
rightofsb->Divide(rightsfzp); |
2848 |
|
rightsfsb->Divide(rightsfzp); |
2849 |
|
rightofsb->Draw("same"); |
2863 |
|
bottom2->Draw("same"); |
2864 |
|
|
2865 |
|
rightofzp->SetMarkerStyle(21); |
2866 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2866 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2867 |
|
rightofsb->SetMarkerStyle(24); |
2868 |
|
rightsfsb->SetMarkerStyle(32); |
2869 |
|
} |
2870 |
|
|
2871 |
|
TLegend *leg3 = make_legend("MC t#bar{t}",0.55,0.75,false); |
2872 |
|
leg3->AddEntry(rightofzp,"OFZP / SFZP","ple"); |
2873 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2873 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2874 |
|
leg3->AddEntry(rightsfsb,"SFSB / SFZP","ple"); |
2875 |
|
leg3->AddEntry(rightofsb,"OFSB / SFZP","ple"); |
2876 |
|
} |
2889 |
|
delete nTZem; |
2890 |
|
delete TZeemm; |
2891 |
|
delete nTZeemm; |
2892 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2892 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
2893 |
|
delete TSem; |
2894 |
|
delete nTSem; |
2895 |
|
delete TSeemm; |
3052 |
|
TH1F *RcorrJZBSBeemm; |
3053 |
|
TH1F *LcorrJZBSBeemm; |
3054 |
|
|
3055 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3055 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3056 |
|
RcorrJZBSBem = systsamples.Draw("RcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
3057 |
|
LcorrJZBSBem = systsamples.Draw("LcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
3058 |
|
RcorrJZBSBeemm = systsamples.Draw("RcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
3060 |
|
} |
3061 |
|
|
3062 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
3063 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3063 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3064 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
3065 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
3066 |
|
Bpred->Add(RcorrJZBSBem,1.0/3.); |
3118 |
|
delete RcorrJZBem; |
3119 |
|
delete LcorrJZBem; |
3120 |
|
|
3121 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3121 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3122 |
|
delete RcorrJZBSBem; |
3123 |
|
delete LcorrJZBSBem; |
3124 |
|
delete RcorrJZBSBeemm; |
3183 |
|
TH1F *RcorrJZBSBeemm; |
3184 |
|
TH1F *LcorrJZBSBeemm; |
3185 |
|
|
3186 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3186 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3187 |
|
RcorrJZBSBem = coll.Draw("RcorrJZBSBem",jzbexpr.c_str(),nbins,low,14000, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity, mysample); |
3188 |
|
LcorrJZBSBem = coll.Draw("LcorrJZBSBem",("-("+jzbexpr+")").c_str(),nbins,low,14000, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity, mysample); |
3189 |
|
RcorrJZBSBeemm = coll.Draw("RcorrJZBSBeemm",jzbexpr.c_str(),nbins,low,14000, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity, mysample); |
3191 |
|
} |
3192 |
|
|
3193 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
3194 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3194 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3195 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
3196 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
3197 |
|
Bpred->Add(RcorrJZBSBem,1.0/3.); |
3402 |
|
TH1F *JRcorrJZBSBeemm; |
3403 |
|
TH1F *JLcorrJZBSBeemm; |
3404 |
|
|
3405 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3405 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3406 |
|
RcorrJZBSBem = qcdsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
3407 |
|
LcorrJZBSBem = qcdsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
3408 |
|
RcorrJZBSBeemm = qcdsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
3423 |
|
|
3424 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
3425 |
|
TH1F *JBpred = (TH1F*)JLcorrJZBeemm->Clone("Bpred"); |
3426 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3426 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3427 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
3428 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
3429 |
|
Bpred->Add(RcorrJZBSBem,1.0/3.); |
3493 |
|
dout << "______________________________________________" << endl; |
3494 |
|
dout << "How QCD shows up in the different regions: " << endl; |
3495 |
|
dout << "OSSF: " << endl; |
3496 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3496 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3497 |
|
dout << " Z window: \t" << RcorrJZBeemm->Integral() << " (JZB>0) , " << LcorrJZBeemm->Integral() << " (JZB<0) --> total: " << RcorrJZBeemm->Integral() + LcorrJZBeemm->Integral() << endl; |
3498 |
|
dout << " sideband: \t" << RcorrJZBSBeemm->Integral() << " (JZB>0) , " << LcorrJZBSBeemm->Integral() << " (JZB<0) --> total: " << RcorrJZBSBeemm->Integral() + LcorrJZBSBeemm->Integral() << endl; |
3499 |
|
} else { |
3500 |
|
dout << " " << RcorrJZBeemm->Integral() << " (JZB>0) , " << LcorrJZBeemm->Integral() << " (JZB<0) --> total: " << RcorrJZBeemm->Integral() + LcorrJZBeemm->Integral() << endl; |
3501 |
|
} |
3502 |
|
dout << "OSOF: " << endl; |
3503 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3503 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3504 |
|
dout << " Z window: \t" << RcorrJZBem->Integral() << " (JZB>0) , " << LcorrJZBem->Integral() << " (JZB<0) --> total: " << RcorrJZBem->Integral() + LcorrJZBem->Integral() << endl; |
3505 |
|
dout << " sideband: \t" << RcorrJZBSBem->Integral() << " (JZB>0) , " << LcorrJZBSBem->Integral() << " (JZB<0) --> total: " << RcorrJZBSBem->Integral() + LcorrJZBSBem->Integral() << endl; |
3506 |
|
} else { |
3507 |
|
dout << " Z window: \t" << RcorrJZBem->Integral() << " (JZB>0) , " << LcorrJZBem->Integral() << " (JZB<0) --> total: " << RcorrJZBem->Integral() + LcorrJZBem->Integral() << endl; |
3508 |
|
} |
3509 |
|
dout << "Therefore: " << endl; |
3510 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3510 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3511 |
|
dout << " Prediction increases by : " << LcorrJZBeemm->Integral() << " + (1.0/3)*(" << RcorrJZBSBeemm->Integral() <<"-"<< LcorrJZBSBeemm->Integral() << ") (SFSB) "; |
3512 |
|
dout << " + (1.0/3)*(" << RcorrJZBem->Integral() <<"-"<< LcorrJZBem->Integral() << ") (OFZP) "; |
3513 |
|
dout << " + (1.0/3)*(" << RcorrJZBSBem->Integral() <<"-"<< LcorrJZBSBem->Integral() << ") (OFSB) "; |
3523 |
|
for(int i=0;i<(int)bins.size();i++) { |
3524 |
|
dout << " JZB > " << bins[i] << " : " << endl; |
3525 |
|
dout << " Observation increases by : " << RcorrJZBeemm->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) << endl; |
3526 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
3526 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB) { |
3527 |
|
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; |
3528 |
|
} else { |
3529 |
|
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; |
3537 |
|
if(LcorrJZBem) delete LcorrJZBem; |
3538 |
|
if(RcorrJZBeemm) delete RcorrJZBeemm; |
3539 |
|
if(LcorrJZBeemm) delete LcorrJZBeemm; |
3540 |
< |
if(PlottingSetup::RestrictToMassPeak&&RcorrJZBSBem) delete RcorrJZBSBem; |
3541 |
< |
if(PlottingSetup::RestrictToMassPeak&&LcorrJZBSBem) delete LcorrJZBSBem; |
3542 |
< |
if(PlottingSetup::RestrictToMassPeak&&RcorrJZBSBeemm) delete RcorrJZBSBeemm; |
3543 |
< |
if(PlottingSetup::RestrictToMassPeak&&LcorrJZBSBeemm) delete LcorrJZBSBeemm; |
3540 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB&&RcorrJZBSBem) delete RcorrJZBSBem; |
3541 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB&&LcorrJZBSBem) delete LcorrJZBSBem; |
3542 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB&&RcorrJZBSBeemm) delete RcorrJZBSBeemm; |
3543 |
> |
if(PlottingSetup::RestrictToMassPeak&&PlottingSetup::UseSidebandsForcJZB&&LcorrJZBSBeemm) delete LcorrJZBSBeemm; |
3544 |
|
} |
3545 |
|
|
3546 |
|
void check_ptsanity() { |
3646 |
|
findme.push_back("DY"); |
3647 |
|
findme.push_back("TTJets"); |
3648 |
|
findme.push_back("LM"); |
3649 |
< |
|
3649 |
> |
/* |
3650 |
|
for(int ifind=0;ifind<(int)findme.size();ifind++) { |
3651 |
|
vector<int> selsamples = allsamples.FindSample(findme[ifind]); |
3652 |
|
TH2F *metvsjzb = new TH2F("metvsjzb","metvsjzb",200,0,100,400,-100,100); |
3666 |
|
title->Draw(); |
3667 |
|
CompleteSave(canmetjzb,(string)"METvsJZBplots/"+findme[ifind]); |
3668 |
|
} |
3669 |
< |
|
3669 |
> |
*/ |
3670 |
|
|
3671 |
|
dout << "About to produce MET plot for DY split up by JZB" << endl; |
3672 |
|
|
3686 |
|
TH1F *metright = allsamples.Draw("metright","met[4]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&RIGHT,mc, luminosity, allsamples.FindSample("DYJets")); |
3687 |
|
TH1F *metrightO = allsamples.Draw("metrightO","met[4]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&RIGHT,mc, luminosity, allsamples.FindSample("DYJets")); |
3688 |
|
|
3689 |
+ |
|
3690 |
+ |
TH1F *Bpred = (TH1F*)metleft->Clone("Bpred"); |
3691 |
+ |
Bpred->Add(metleftO,-1); |
3692 |
+ |
Bpred->Add(metrightO); |
3693 |
+ |
TH1F *obs = (TH1F*)metright->Clone("obs"); |
3694 |
+ |
|
3695 |
|
metleft->Add(metleftO,-1); |
3696 |
|
metright->Add(metrightO,-1); |
3697 |
|
|
3704 |
|
metright->Draw("same"); |
3705 |
|
TLegend *lg = make_legend(); |
3706 |
|
lg->SetX1(0.5); |
3707 |
+ |
lg->SetY1(0.7); |
3708 |
|
lg->AddEntry(metright,"JZB>0 (OSOF corrected)","P"); |
3709 |
|
lg->AddEntry(metleft,"JZB<0 (OSOF corrected)","L"); |
3710 |
+ |
lg->SetHeader("DY"); |
3711 |
+ |
|
3712 |
|
lg->Draw(); |
3713 |
|
save_with_ratio(metright,metleft,metpad->cd(),"METvsJZBplots/ComparingLeftToRightinMETspectrum"); |
3714 |
+ |
|
3715 |
+ |
TPad *metpad3 = new TPad("metpad3","metpad3",0,0,1,1); |
3716 |
+ |
metpad3->cd(); |
3717 |
+ |
metpad3->SetLogy(1); |
3718 |
+ |
Bpred->SetLineColor(kRed); |
3719 |
+ |
Bpred->Draw("histo"); |
3720 |
+ |
obs->SetLineColor(kBlack); |
3721 |
+ |
obs->Draw("same"); |
3722 |
+ |
TLegend *lg2 = make_legend(); |
3723 |
+ |
lg2->SetX1(0.5); |
3724 |
+ |
lg2->SetY1(0.7); |
3725 |
+ |
lg2->AddEntry(obs,"observed","P"); |
3726 |
+ |
lg2->AddEntry(Bpred,"predicted","L"); |
3727 |
+ |
lg2->SetHeader("DY"); |
3728 |
+ |
|
3729 |
+ |
lg2->Draw(); |
3730 |
+ |
|
3731 |
+ |
save_with_ratio(obs,Bpred,metpad3->cd(),"METvsJZBplots/ComparingPredObsinMET"); |
3732 |
+ |
|
3733 |
|
TPad *metpad2 = new TPad("metpad2","metpad2",0,0,1,1); |
3734 |
+ |
metpad2->cd(); |
3735 |
+ |
metpad2->SetLogy(1); |
3736 |
|
|
3737 |
|
TH1F *metlefta = allsamples.Draw("metlefta","met[2]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&LEFT,mc, luminosity, allsamples.FindSample("DYJets")); |
3738 |
|
TH1F *metleftOa = allsamples.Draw("metleftOa","met[2]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&LEFT,mc, luminosity, allsamples.FindSample("DYJets")); |
3739 |
|
TH1F *metrighta = allsamples.Draw("metrighta","met[2]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&RIGHT,mc, luminosity, allsamples.FindSample("DYJets")); |
3740 |
|
TH1F *metrightOa = allsamples.Draw("metrightOa","met[2]",nbins,low,high, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&RIGHT,mc, luminosity, allsamples.FindSample("DYJets")); |
3741 |
|
|
3667 |
– |
TH1F *Bpred = (TH1F*)metlefta->Clone("Bpred"); |
3668 |
– |
Bpred->Add(metleftOa,-1); |
3669 |
– |
Bpred->Add(metrightOa); |
3670 |
– |
TH1F *obs = (TH1F*)metrighta->Clone("obs"); |
3671 |
– |
|
3742 |
|
metlefta->Add(metleftOa,-1); |
3743 |
|
metrighta->Add(metrightOa,-1); |
3744 |
|
|
3749 |
|
lg->Draw(); |
3750 |
|
save_with_ratio(metrighta,metlefta,metpad2->cd(),"METvsJZBplots/ComparingLeftToRightinMET_type1_spectrum"); |
3751 |
|
|
3752 |
< |
TPad *metpad3 = new TPad("metpad3","metpad3",0,0,1,1); |
3753 |
< |
metpad3->cd(); |
3754 |
< |
Bpred->SetLineColor(kRed); |
3755 |
< |
Bpred->Draw("histo"); |
3756 |
< |
obs->SetLineColor(kBlack); |
3757 |
< |
obs->Draw("same"); |
3758 |
< |
TLegend *lg2 = make_legend(); |
3759 |
< |
lg2->SetX1(0.5); |
3760 |
< |
lg2->AddEntry(obs,"observed","P"); |
3761 |
< |
lg2->AddEntry(Bpred,"predicted","L"); |
3762 |
< |
lg2->Draw(); |
3752 |
> |
delete Bpred; |
3753 |
> |
delete obs; |
3754 |
> |
|
3755 |
> |
float newhigh=300; |
3756 |
> |
int newNBins=30; |
3757 |
> |
|
3758 |
> |
TPad *metpad4 = new TPad("metpad4","metpad4",0,0,1,1); |
3759 |
> |
TH1F *Ametleft = allsamples.Draw("Ametleft","met[4]",newNBins,low,newhigh, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&LEFT,mc, luminosity); |
3760 |
> |
TH1F *AmetleftO = allsamples.Draw("AmetleftO","met[4]",newNBins,low,newhigh, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&LEFT,mc, luminosity); |
3761 |
> |
TH1F *Ametright = allsamples.Draw("Ametright","met[4]",newNBins,low,newhigh, "MET [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&RIGHT,mc, luminosity); |
3762 |
> |
TH1F *AmetrightO = allsamples.Draw("AmetrightO","met[4]",newNBins,low,newhigh, "MET [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&RIGHT,mc, luminosity); |
3763 |
> |
|
3764 |
> |
TH1F *aBpred = (TH1F*)Ametleft->Clone("aBpred"); |
3765 |
> |
aBpred->Add(AmetleftO,-1); |
3766 |
> |
aBpred->Add(AmetrightO); |
3767 |
> |
aBpred->SetLineColor(kRed); |
3768 |
> |
|
3769 |
> |
TH1F *aobs = (TH1F*)Ametright->Clone("aobs"); |
3770 |
> |
metpad4->cd(); |
3771 |
> |
metpad4->SetLogy(1); |
3772 |
> |
aobs->Draw(); |
3773 |
> |
aBpred->Draw("histo,same"); |
3774 |
> |
aobs->Draw("same"); |
3775 |
> |
lg->SetHeader("All MC"); |
3776 |
> |
lg->Draw(); |
3777 |
> |
save_with_ratio(aobs,aBpred,metpad4->cd(),"METvsJZBplots/ComparingPredObsinMET_ALLSAMPLES"); |
3778 |
> |
|
3779 |
|
|
3694 |
– |
save_with_ratio(obs,Bpred,metpad3->cd(),"METvsJZBplots/ComparingPredObsinMET_type1_spectrum"); |
3780 |
|
delete lg; |
3781 |
|
delete canmetjzb; |
3782 |
|
delete metleft; |