33 |
|
|
34 |
|
|
35 |
|
|
36 |
< |
void find_one_peak_combination(TCut specialcut, float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, float &MCSigma, float &DataSigma, stringstream &result, bool doPUreweighting = true, string saveas="") |
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="") |
37 |
|
{ |
38 |
|
// Temporarily switch off PU reweighting, if asked |
39 |
|
TCut weightbackup=cutWeight; |
52 |
|
if(method==doKM) { |
53 |
|
//we only need this histo for the KM fitting... |
54 |
|
rawttbarjzbeemmMC = allsamples.Draw("rawttbarjzbeemmMC",jzbvariablemc,nbins, -50,50, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&&specialcut,mc,luminosity,allsamples.FindSample("TTJet")); |
55 |
< |
MCPeak=find_peak(rawJZBeemmMC, rawttbarjzbeemmMC, -40, 40, mc, MCPeakError,MCSigma,method,saveas); |
56 |
< |
DataPeak=find_peak(rawJZBeemmData, rawJZBeemmData, -40, 40, data, DataPeakError,DataSigma,method,saveas); |
55 |
> |
MCPeak=find_peak(rawJZBeemmMC, rawttbarjzbeemmMC, -40, 40, mc, MCPeakError,MCSigma,MCSigmaError,method,saveas); |
56 |
> |
DataPeak=find_peak(rawJZBeemmData, rawJZBeemmData, -40, 40, data, DataPeakError,DataSigma,DataSigmaError,method,saveas); |
57 |
|
delete rawttbarjzbeemmMC; |
58 |
|
} |
59 |
|
else { |
62 |
|
reducedMC->Add(rawJZBemMC,-1); |
63 |
|
reducedData->Add(rawJZBemData,-1); |
64 |
|
//this is Kostas' way of doing it - we subtract em to get rid of some of the ttbar contribution (in reality, of flavor-symmetric contribution) |
65 |
< |
MCPeak=find_peak(reducedMC, rawttbarjzbeemmMC, -40, 40, mc, MCPeakError,MCSigma,method,saveas); |
66 |
< |
DataPeak=find_peak(reducedData, rawJZBeemmData, -40, 40, data, DataPeakError,DataSigma,method,saveas); |
65 |
> |
MCPeak=find_peak(reducedMC, rawttbarjzbeemmMC, -40, 40, mc, MCPeakError,MCSigma,MCSigmaError,method,saveas); |
66 |
> |
DataPeak=find_peak(reducedData, rawJZBeemmData, -40, 40, data, DataPeakError,DataSigma,DataSigmaError,method,saveas); |
67 |
|
delete reducedMC; |
68 |
|
delete reducedData; |
69 |
|
} |
73 |
|
|
74 |
|
// MCPeak=find_peak(rawJZBeemmMC, rawttbarjzbeemmMC, -40, 40, mc, MCPeakError,MCSigma,method); |
75 |
|
// DataPeak=find_peak(rawJZBeemmData, rawJZBeemmData, -40, 40, data, DataPeakError,DataSigma,method); |
76 |
< |
dout << " We have found the peak in Data at " << DataPeak << " +/- " << DataPeakError << " with sigma=" << DataSigma << " +/- ?? (not impl.)" << endl; |
77 |
< |
result << " We have found the peak in Data at " << DataPeak << " +/- " << DataPeakError << " with sigma=" << DataSigma << " +/- ?? (not impl.)" << endl; |
78 |
< |
dout << " We have found the peak in MC at " << MCPeak << " +/- " << MCPeakError << " with sigma=" << MCSigma << " +/- ?? (not impl.)" << endl; |
79 |
< |
result << " We have found the peak in MC at " << MCPeak << " +/- " << MCPeakError << " with sigma=" << MCSigma << " +/- ?? (not impl.)" << endl; |
76 |
> |
dout << " We have found the peak in Data at " << DataPeak << " +/- " << DataPeakError << " with sigma=" << DataSigma << " +/- " << DataSigmaError << endl; |
77 |
> |
result << " We have found the peak in Data at " << DataPeak << " +/- " << DataPeakError << " with sigma=" << DataSigma << " +/- " << DataSigmaError << endl; |
78 |
> |
dout << " We have found the peak in MC at " << MCPeak << " +/- " << MCPeakError << " with sigma=" << MCSigma << " +/- " << MCSigmaError << endl; |
79 |
> |
result << " We have found the peak in MC at " << MCPeak << " +/- " << MCPeakError << " with sigma=" << MCSigma << " +/- " << MCSigmaError << endl; |
80 |
|
delete rawJZBeemmData; |
81 |
|
delete rawJZBeemmMC; |
82 |
|
delete rawJZBemData; |
98 |
|
float datammpeak,dataeepeak; |
99 |
|
float datammpeakerr,dataeepeakerr; |
100 |
|
|
101 |
< |
float mcSigma, dataSigma; |
101 |
> |
float mcSigma,mcSigmaError, dataSigma, dataSigmaError; |
102 |
|
|
103 |
|
dout << "Finding global peak : " << endl; |
104 |
< |
find_one_peak_combination(TCut(""),mcpeak,mcpeakerr, datapeak,datapeakerr,mcSigma, dataSigma,result,doPUreweighting,""); |
104 |
> |
find_one_peak_combination(TCut(""),mcpeak,mcpeakerr, datapeak,datapeakerr,mcSigma,mcSigmaError, dataSigma,dataSigmaError,result,doPUreweighting,""); |
105 |
|
|
106 |
|
if(DoInvidualeemmPeaks) { |
107 |
|
dout << "Finding peak for electrons : " << endl; |
108 |
< |
find_one_peak_combination(TCut("id1==0"),mceepeak,mceepeakerr, dataeepeak,dataeepeakerr,mcSigma, dataSigma,result,doPUreweighting,"_ele"); |
108 |
> |
find_one_peak_combination(TCut("id1==0"),mceepeak,mceepeakerr,dataeepeak,dataeepeakerr,mcSigma,mcSigmaError,dataSigma,dataSigmaError,result,doPUreweighting,"_ele"); |
109 |
|
dout << "Finding peak for muons : " << endl; |
110 |
< |
find_one_peak_combination(TCut("id1==1"),mcmmpeak,mcmmpeakerr, datammpeak,datammpeakerr,mcSigma, dataSigma,result,doPUreweighting,"_mu"); |
110 |
> |
find_one_peak_combination(TCut("id1==1"),mcmmpeak,mcmmpeakerr,datammpeak,datammpeakerr,mcSigma,mcSigmaError,dataSigma,dataSigmaError,result,doPUreweighting,"_mu"); |
111 |
|
|
112 |
|
datajzb << "(" << jzbvariabledata; |
113 |
|
mcjzb << "(" << jzbvariablemc; |
147 |
|
|
148 |
|
mcjzb << ")"; |
149 |
|
} |
150 |
< |
|
150 |
> |
|
151 |
|
|
152 |
|
} |
153 |
|
|
154 |
< |
void make_special_obs_pred_mll_plot(string datajzb, string mcjzb, float jzbthreshold) { |
154 |
> |
void make_special_obs_pred_mll_plot(string datajzb, string mcjzb, float jzbthreshold, float binWidth = 5.0) { |
155 |
|
float min=70.0; |
156 |
|
float max=115.0; |
157 |
|
if(!PlottingSetup::RestrictToMassPeak) { |
158 |
|
min=20; |
159 |
< |
max=200; |
159 |
> |
max=300; |
160 |
|
} |
161 |
< |
int nbins=int((max-min)/5); |
161 |
> |
int nbins=int((max-min)/binWidth); |
162 |
|
|
163 |
|
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
164 |
|
|
195 |
|
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzeroD,data, luminosity); |
196 |
|
} |
197 |
|
|
198 |
< |
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
199 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
200 |
< |
Bpred->Add(RcorrJZBem,1.0/3.); |
201 |
< |
Bpred->Add(LcorrJZBem,-1.0/3.); |
202 |
< |
Bpred->Add(RcorrJZBSBem,1.0/3.); |
203 |
< |
Bpred->Add(LcorrJZBSBem,-1.0/3.); |
204 |
< |
Bpred->Add(RcorrJZBSBeemm,1.0/3.); |
205 |
< |
Bpred->Add(LcorrJZBSBeemm,-1.0/3.); |
198 |
> |
// Separate predictions |
199 |
> |
TH1F* Zpred = (TH1F*)LcorrJZBeemm->Clone("Zpred"); |
200 |
> |
TH1F* OSpred = (TH1F*)RcorrJZBem->Clone("OSpred"); |
201 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
202 |
> |
OSpred->Scale(1.0/3.0); |
203 |
> |
OSpred->Add(RcorrJZBSBem,1.0/3.); |
204 |
> |
OSpred->Add(RcorrJZBSBeemm,1.0/3.); |
205 |
> |
Zpred->Add(LcorrJZBem,-1.0/3.); |
206 |
> |
Zpred->Add(LcorrJZBSBem,-1.0/3.); |
207 |
> |
Zpred->Add(LcorrJZBSBeemm,-1.0/3.); |
208 |
|
} else { |
209 |
< |
Bpred->Add(RcorrJZBem,1.0); |
208 |
< |
Bpred->Add(LcorrJZBem,-1.0); |
209 |
> |
Zpred->Add(LcorrJZBem,-1.0); |
210 |
|
} |
211 |
< |
|
211 |
> |
|
212 |
> |
TH1F* Bpred = (TH1F*)Zpred->Clone("Bpred"); |
213 |
> |
Bpred->Add(OSpred); |
214 |
|
Bpred->SetLineColor(kRed); |
215 |
|
|
216 |
+ |
// Problem with negative bins: add contents to OSpred |
217 |
+ |
for ( unsigned int i=0; i<=Zpred->GetNbinsX(); ++i ) { |
218 |
+ |
if ( Zpred->GetBinContent(i)<0 ) { |
219 |
+ |
OSpred->SetBinContent(i,OSpred->GetBinContent(i)+Zpred->GetBinContent(i)); |
220 |
+ |
Zpred->SetBinContent(i,0); |
221 |
+ |
} |
222 |
+ |
} |
223 |
+ |
|
224 |
+ |
RcorrJZBeemm->SetTitleOffset(1.3,"y"); |
225 |
|
RcorrJZBeemm->Draw(); |
226 |
|
mcRcorrJZBeemm.Draw("same"); |
227 |
|
Bpred->Draw("histo,same"); |
237 |
|
saveas << "kin/Mll_After_Cut/Cut_At" << jzbthreshold; |
238 |
|
CompleteSave(ckin,saveas.str()); |
239 |
|
|
240 |
< |
|
240 |
> |
// Draw all predictions overlayed |
241 |
> |
Zpred->SetLineColor(kGreen+1); |
242 |
> |
Zpred->SetLineStyle(2); |
243 |
> |
OSpred->SetLineColor(kBlue-2); |
244 |
> |
OSpred->SetLineStyle(3); |
245 |
|
|
246 |
|
RcorrJZBeemm->Draw(); |
247 |
+ |
OSpred->Draw("histo,same"); |
248 |
+ |
Zpred->Draw("histo,same"); |
249 |
|
Bpred->Draw("histo,same"); |
250 |
|
RcorrJZBeemm->Draw("same"); |
251 |
|
|
252 |
< |
TLegend *leg2 = make_legend(); |
253 |
< |
leg2->SetX1(0.58); |
236 |
< |
leg2->AddEntry(RcorrJZBeemm,"observed (data)","l"); |
252 |
> |
TLegend *leg2 = make_legend("",0.52,0.7); |
253 |
> |
leg2->AddEntry(RcorrJZBeemm,"observed (data)","lp"); |
254 |
|
leg2->AddEntry(Bpred,"predicted (data)","l"); |
255 |
+ |
leg2->AddEntry(Zpred, " bkgd w/Z (data)","l"); |
256 |
+ |
leg2->AddEntry(OSpred," bkgd w/o Z (data)","l"); |
257 |
|
leg2->Draw("same"); |
258 |
|
|
259 |
|
saveas.str(""); |
417 |
|
ckin->SetLogy(logscale); |
418 |
|
TH1F *datahisto = allsamples.Draw("datahisto",variable,nbins,min,max, xlabel, "events",cut,data,luminosity); |
419 |
|
datahisto->SetMarkerSize(DataMarkerSize); |
420 |
< |
THStack mcstack = allsamples.DrawStack("mcstack",variable,nbins,min,max, xlabel, "events",cut,mc,luminosity); |
420 |
> |
if ( !logscale ) datahisto->SetMinimum(0); // Defaults |
421 |
> |
else datahisto->SetMinimum(0.5); |
422 |
> |
// Custom max. |
423 |
> |
if(variable=="TMath::Abs(pfJetDphiMet[0])") datahisto->SetMaximum(1.5*datahisto->GetMaximum()); |
424 |
|
if(variable=="pfJetGoodPt[0]") datahisto->SetMaximum(10*datahisto->GetMaximum()); |
425 |
|
if(variable=="pt") datahisto->SetMaximum(10*datahisto->GetMaximum()); |
426 |
|
if(filename=="mll_inclusive"||filename=="mll_inclusive_mm"||filename=="mll_inclusive_ee") datahisto->SetMinimum(1); |
427 |
|
if(filename=="mll_osof") datahisto->SetMaximum(10*datahisto->GetMaximum()); |
428 |
|
if(filename=="mll_osof") datahisto->SetMinimum(9); |
429 |
< |
datahisto->SetMaximum(5.3*datahisto->GetMaximum()); |
430 |
< |
datahisto->Draw("e1"); |
431 |
< |
ckin->Update(); |
429 |
> |
if (logscale) datahisto->SetMaximum(5.3*datahisto->GetMaximum()); |
430 |
> |
else datahisto->SetMaximum(1.3*datahisto->GetMaximum()); |
431 |
> |
|
432 |
|
if(loadlastminmax) { |
433 |
|
datahisto->SetMinimum(lastrange_min); |
434 |
|
datahisto->SetMaximum(lastrange_max); |
438 |
|
} |
439 |
|
} |
440 |
|
|
441 |
+ |
// Draw signal by hand (for some reason I don't manage to use the sample class: it adds it to the stack!) |
442 |
+ |
string signal("LM3"); |
443 |
+ |
TH1F* signalhisto = new TH1F("signalhisto",signal.c_str(),nbins,min,max); |
444 |
+ |
int idx = signalsamples.FindSample(signal)[0]; |
445 |
+ |
(signalsamples.collection)[idx].events->Project("signalhisto",variable.c_str(),cut); |
446 |
+ |
signalhisto->Scale((signalsamples.collection)[idx].weight*luminosity); |
447 |
+ |
signalhisto->SetLineColor(kOrange); |
448 |
+ |
|
449 |
+ |
THStack mcstack = allsamples.DrawStack("mcstack", variable,nbins,min,max,xlabel,"events",cut,mc,luminosity); |
450 |
+ |
datahisto->Draw("e1"); |
451 |
+ |
ckin->Update(); |
452 |
|
mcstack.Draw("same"); |
453 |
+ |
|
454 |
|
datahisto->Draw("same,e1"); |
455 |
|
TLegend *kinleg = allsamples.allbglegend(); |
456 |
|
kinleg->Draw(); |
493 |
|
kinpad->SetLogy(logscale); |
494 |
|
datahisto->Draw("e1"); |
495 |
|
mcstack.Draw("same"); |
496 |
+ |
signalhisto->Draw("same"); |
497 |
|
datahisto->Draw("same,e1"); |
498 |
|
datahisto->Draw("same,axis"); |
499 |
|
if(RestrictToMassPeak&&draw_separation_lines) { |
501 |
|
upperboundary->Draw("same"); |
502 |
|
} |
503 |
|
|
504 |
+ |
kinleg->AddEntry("signalhisto",signal.c_str(),"l"); |
505 |
|
kinleg->Draw(); |
506 |
|
write_cut->Draw(); |
507 |
|
DrawPrelim(); |
519 |
|
delete ckin; |
520 |
|
} |
521 |
|
|
522 |
< |
void make_JES_plot() { |
522 |
> |
void make_JES_plot(TCut cut, string name) { |
523 |
|
|
524 |
|
int nbins=10; |
525 |
|
float min=-0.5; |
526 |
|
float max = 9.5; |
527 |
|
bool logscale=true; |
528 |
|
string xlabel="nJets"; |
493 |
– |
TCut cut=cutmass&&cutOSSF&&basiccut; |
529 |
|
|
530 |
|
TCanvas *ckin = new TCanvas("ckin","Kinematic Plots (in the making)",600,600); |
531 |
|
ckin->SetLogy(logscale); |
532 |
< |
TH1F *datahisto = allsamples.Draw("datahisto","pfJetGoodNum",nbins,min,max, xlabel, "events",cut,data,luminosity); |
532 |
> |
TH1F *datahisto = allsamples.Draw("datahisto","pfJetGoodNum40",nbins,min,max, xlabel, "events",cut,data,luminosity); |
533 |
|
datahisto->SetMarkerSize(DataMarkerSize); |
534 |
< |
THStack mcstack = allsamples.DrawStack("mcstack","pfJetGoodNum",nbins,min,max, xlabel, "events",cut,mc,luminosity); |
535 |
< |
TH1F *JESup = allsamples.Draw("JESup","pfJetGoodNump1sigma",nbins,min,max, xlabel, "events",cut,mc,luminosity); |
536 |
< |
TH1F *JESdn = allsamples.Draw("JESdn","pfJetGoodNumn1sigma",nbins,min,max, xlabel, "events",cut,mc,luminosity); |
534 |
> |
THStack mcstack = allsamples.DrawStack("mcstack","pfJetGoodNum40",nbins,min,max, xlabel, "events",cut,mc,luminosity); |
535 |
> |
TH1F *JESup = allsamples.Draw("JESup","pfJetGoodNum40p1sigma",nbins,min,max, xlabel, "events",cut,mc,luminosity); |
536 |
> |
TH1F *JESdn = allsamples.Draw("JESdn","pfJetGoodNum40n1sigma",nbins,min,max, xlabel, "events",cut,mc,luminosity); |
537 |
|
|
538 |
|
datahisto->SetMinimum(1); |
539 |
|
datahisto->SetMaximum(5.3*datahisto->GetMaximum()); // in line with kinematic plots style |
558 |
|
TLegend *kinleg = allsamples.allbglegend(); |
559 |
|
kinleg->AddEntry(JESunc,"JES uncertainty","f"); |
560 |
|
kinleg->Draw(); |
561 |
< |
CompleteSave(ckin,"Systematics/JES"); |
561 |
> |
CompleteSave(ckin,"Systematics/JES"+name); |
562 |
|
datahisto->Delete(); |
563 |
|
delete ckin; |
564 |
|
|
573 |
|
float mll_hi=160; |
574 |
|
if(!PlottingSetup::RestrictToMassPeak) { |
575 |
|
mll_low=20; |
576 |
< |
mll_hi=210; |
576 |
> |
mll_hi=300; |
577 |
|
} |
578 |
< |
|
579 |
< |
make_kin_plot("met[4]","",40,0,200,dolog,"MET [GeV]","met",doPF,true); |
578 |
> |
|
579 |
> |
make_kin_plot("met[4]","",70,0,350,dolog,"MET [GeV]","met",doPF,true); |
580 |
> |
|
581 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll",doPF,true); |
582 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof",doPF,true,true); |
583 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee",doPF,true); |
584 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_mm",doPF,true); |
585 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive",doPF,true); |
586 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_ee",doPF,true); |
587 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_mm",doPF,true); |
588 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/2,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true); |
589 |
< |
make_kin_plot("mll","",(int)((350-mll_low)),mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF); |
590 |
< |
make_kin_plot("numVtx","",(int)(30.5-(-0.5)),-0.5,30.5,nolog,"N(Vtx)","numVtx",doPF); |
591 |
< |
// make_kin_plot("jetpt[0]","",40,0,200,dolog,"leading jet p_{T} [GeV]","pfJetGoodPt_0",doPF); |
592 |
< |
// make_kin_plot("jeteta[0]","",40,-5,5,nolog,"leading jet #eta","pfJetGoodEta_0",doPF); |
593 |
< |
make_kin_plot("pt","",50,0,400,dolog,"Z p_{T} [GeV]","Zpt",doPF); |
594 |
< |
make_kin_plot("pt1","",50,0,100,nolog,"p_{T} [GeV]","pt1",doPF); |
559 |
< |
make_kin_plot("pt2","",50,0,100,nolog,"p_{T} [GeV]","pt2",doPF); |
560 |
< |
make_kin_plot("eta1","",40,-5,5,nolog,"#eta_{l}","eta",doPF); |
561 |
< |
make_kin_plot("jzb[1]","",100,-150,150,dolog,"JZB [GeV]","jzb_ossf",doPF); |
585 |
> |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive",doPF,true); |
586 |
> |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_ee",doPF,true); |
587 |
> |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_mm",doPF,true); |
588 |
> |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/5,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true); |
589 |
> |
make_kin_plot("mll","",(int)((350-mll_low))/5,mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF); |
590 |
> |
if(!doPF) make_special_mll_plot((int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]"); |
591 |
> |
|
592 |
> |
make_kin_plot("pfJetGoodPt[0]/pfJetGoodPt[1]","",45,1,10,dolog,"pt_{j}^{1}/pt_{j}^{2}","j1j2ratio",doPF,true); |
593 |
> |
make_kin_plot("TMath::Abs(pfJetDphiMet[0])","",32,0,3.2,nolog,"|#Delta#phi(jet1,MET)|","dphiJ1MET",doPF,true); |
594 |
> |
|
595 |
|
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets",doPF); |
596 |
|
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_osof",doPF); |
597 |
|
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_nocuts_except_mll_ossf",doPF); |
598 |
< |
if(!doPF) make_special_mll_plot((int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]"); |
598 |
> |
|
599 |
> |
make_kin_plot("numVtx","",(int)(30.5-(-0.5)),-0.5,30.5,nolog,"N(Vtx)","numVtx",doPF); |
600 |
> |
// make_kin_plot("jetpt[0]","",40,0,200,dolog,"leading jet p_{T} [GeV]","pfJetGoodPt_0",doPF); |
601 |
> |
// make_kin_plot("jeteta[0]","",40,-5,5,nolog,"leading jet #eta","pfJetGoodEta_0",doPF); |
602 |
> |
make_kin_plot("pt","",50,0,500,dolog,"Z p_{T} [GeV]","Zpt",doPF); |
603 |
> |
make_kin_plot("pt1","",50,0,200,nolog,"p_{T} [GeV]","pt1",doPF); |
604 |
> |
make_kin_plot("pt2","",50,0,200,nolog,"p_{T} [GeV]","pt2",doPF); |
605 |
> |
make_kin_plot("eta1","",40,-3,3,nolog,"#eta_{l}","eta",doPF); |
606 |
> |
make_kin_plot("jzb[1]","",100,-150,200,dolog,"JZB [GeV]","jzb_ossf",doPF); |
607 |
|
stringstream jzbcut; |
608 |
|
jzbcut << "((is_data&&("<<datajzb<<")>100)||(!is_data&&("<<mcjzb<<")>100))"; |
609 |
|
make_kin_plot("mll",jzbcut.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,nolog,"m_{ll} [GeV]","mll_aboveJZB100",doPF,true); |
622 |
|
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); |
623 |
|
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); |
624 |
|
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); |
625 |
< |
|
626 |
< |
|
625 |
> |
|
626 |
> |
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); |
627 |
> |
|
628 |
|
make_special_obs_pred_mll_plot(datajzb,mcjzb,0); |
629 |
|
make_special_obs_pred_mll_plot(datajzb,mcjzb,50); |
630 |
+ |
make_special_obs_pred_mll_plot(datajzb,mcjzb,80); |
631 |
|
make_special_obs_pred_mll_plot(datajzb,mcjzb,100); |
632 |
< |
make_special_obs_pred_mll_plot(datajzb,mcjzb,150); |
633 |
< |
make_special_obs_pred_mll_plot(datajzb,mcjzb,200); |
634 |
< |
make_special_obs_pred_mll_plot(datajzb,mcjzb,250); |
635 |
< |
|
636 |
< |
make_JES_plot(); |
632 |
> |
// make_special_obs_pred_mll_plot(datajzb,mcjzb,150); |
633 |
> |
// make_special_obs_pred_mll_plot(datajzb,mcjzb,200); |
634 |
> |
// make_special_obs_pred_mll_plot(datajzb,mcjzb,250); |
635 |
> |
|
636 |
> |
make_JES_plot(cutmass&&cutOSSF&&basiccut,"_ossf"); |
637 |
> |
make_JES_plot(cutmass&&cutOSOF&&basiccut,"_osof"); |
638 |
> |
|
639 |
> |
|
640 |
|
} |
641 |
|
|
642 |
|
void make_comp_plot( string var, string xlabel, string filename, float jzbcut, string mcjzb, string datajzb, |
643 |
|
int nbins, float xmin, float xmax, bool log, |
644 |
|
float ymin=0, float ymax=0, bool leftJustified=false ) { |
645 |
< |
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- WATCH OUT: the argument in the function changed! |
645 |
> |
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- WATCH OUT: the argument in the function changed! |
646 |
|
|
647 |
|
TCut weightbackup=cutWeight;//backing up the correct weight (restoring below!) |
648 |
|
if(weightbackup==TCut("1.0")||weightbackup==TCut("1")) write_warning(__FUNCTION__,"WATCH OUT THE WEIGHT HAS POSSIBLY NOT BEEN RESET!!!! PLEASE CHANGE LINE "+any2string(__LINE__)); |
649 |
< |
if(var=="numVtx") cutWeight=TCut("1.0"); |
649 |
> |
//if(var=="numVtx") cutWeight=TCut("1.0"); |
650 |
|
TCut jzbData[]= { TCut(TString(datajzb+">"+any2string(jzbcut))),TCut(TString(datajzb+"<-"+any2string(jzbcut))) }; |
651 |
|
TCut jzbMC[] = { TCut(TString(mcjzb+">"+any2string(jzbcut))),TCut(TString(mcjzb+"<-"+any2string(jzbcut))) }; |
652 |
|
|
670 |
|
TCanvas *ccomp = new TCanvas("ccomp","Comparison plot",600,400); |
671 |
|
ccomp->SetLogy(log); |
672 |
|
TH1F *datahisto = allsamples.Draw("datahisto", var,nbins,xmin,xmax,xlabel,"events",kRegions[iregion]&&jzbData[ijzb],data,luminosity); |
673 |
< |
TH1F *lm4histo = signalsamples.Draw("lm4histo", var,nbins,xmin,xmax,xlabel,"events",kRegions[iregion]&&jzbData[ijzb],data,luminosity,signalsamples.FindSample("LM")); |
673 |
> |
TH1F *lm3histo = signalsamples.Draw("lm3histo", var,nbins,xmin,xmax,xlabel,"events",kRegions[iregion]&&jzbMC[ijzb],data,luminosity,signalsamples.FindSample("LM3")); |
674 |
|
THStack mcstack = allsamples.DrawStack("mcstack",var,nbins,xmin,xmax,xlabel,"events",kRegions[iregion]&&jzbMC[ijzb], mc, luminosity); |
675 |
|
datahisto->SetMarkerSize(DataMarkerSize); |
676 |
|
if (ymax>ymin) datahisto->SetMaximum(ymax); |
677 |
< |
lm4histo->SetLineStyle(2); |
677 |
> |
lm3histo->SetLineStyle(2); |
678 |
|
datahisto->Draw("e1"); |
679 |
|
mcstack.Draw("same"); |
680 |
|
datahisto->Draw("same,e1"); |
681 |
< |
// lm4histo->Draw("hist,same"); |
681 |
> |
lm3histo->Draw("hist,same"); |
682 |
|
TLegend *kinleg = allsamples.allbglegend((sRegions[iregion]+(ijzb?"neg":"pos")).c_str()); |
683 |
|
if ( leftJustified ) { |
684 |
|
Float_t w = kinleg->GetX2()-kinleg->GetX1(); |
685 |
|
kinleg->SetX1(0.2); |
686 |
|
kinleg->SetX2(0.2+w); |
687 |
|
} |
688 |
< |
// kinleg->AddEntry(lm4histo,"LM4","l"); |
688 |
> |
kinleg->AddEntry(lm3histo,"LM3","l"); |
689 |
|
kinleg->Draw(); |
690 |
|
TText* write_variable = write_text(0.99,0.01,var); |
691 |
|
write_variable->SetTextAlign(31); |
694 |
|
CompleteSave(ccomp,"compare/JZBcut_at_"+any2string(jzbcut)+"/"+filename+"/"+filename+sRegions[iregion]+(ijzb?"neg":"pos")); |
695 |
|
delete datahisto; |
696 |
|
delete ccomp; |
697 |
< |
delete lm4histo; |
697 |
> |
delete lm3histo; |
698 |
|
} |
699 |
|
cutWeight=weightbackup; |
700 |
|
} |
712 |
|
float jzbcut=jzb_cuts[ijzb]; // Comparison plots are done for this JZB cut |
713 |
|
float mll_low=50;float mll_high=170; |
714 |
|
if(!PlottingSetup::RestrictToMassPeak) { |
715 |
< |
mll_high=200; |
716 |
< |
mll_low=50; |
715 |
> |
mll_high=300; |
716 |
> |
mll_low=20; |
717 |
|
} |
718 |
< |
make_comp_plot("mll","m_{ll} [GeV]","mll",jzbcut,mcjzb,datajzb,30,mll_low,mll_high,false,0,16.); |
718 |
> |
make_comp_plot("pfJetGoodPt[0]/pfJetGoodPt[1]","pt_{j}^{1}/pt_{j}^{2}","j1j2ratio",jzbcut,mcjzb,datajzb,100,0,10,true); |
719 |
> |
make_comp_plot("TMath::Abs(pfJetDphiMet[0])","|#Delta#phi(jet1,MET)|","dphiJ1MET",jzbcut,mcjzb,datajzb,32,0,3.2,false,0,0,true); |
720 |
> |
|
721 |
> |
make_comp_plot("mll","m_{ll} [GeV]","mll",jzbcut,mcjzb,datajzb,56,mll_low,mll_high,false,0,16.); |
722 |
|
make_comp_plot("met[4]","pfMET [GeV]","pfmet",jzbcut,mcjzb,datajzb,18,0,360,false,0,16.); |
723 |
< |
make_comp_plot("pfJetGoodNum","#(jets)","njets",jzbcut,mcjzb,datajzb,10,0,10, false,0,35.); |
723 |
> |
make_comp_plot("pfJetGoodNum40","#(jets)","njets",jzbcut,mcjzb,datajzb,10,0,10, false,0,35.); |
724 |
> |
make_comp_plot("pfJetGoodNumBtag","#(b-jets)","nBjets",jzbcut,mcjzb,datajzb,10,0,10, false,0,35.); |
725 |
|
make_comp_plot("pt","Z p_{T} [GeV]","Zpt",jzbcut,mcjzb,datajzb,26,0,525,false,0.,21.); |
726 |
< |
make_comp_plot("numVtx","#(prim. vertices)","nvtx",jzbcut,mcjzb,datajzb,20,0.,20.,false,0,16.); |
726 |
> |
make_comp_plot("numVtx","#(prim. vertices)","nvtx",jzbcut,mcjzb,datajzb,40,0.,40.,false,0,16.); |
727 |
|
make_comp_plot("TMath::Abs(dphi)","#Delta#phi(leptons)","dphilep",jzbcut,mcjzb,datajzb,10,0.,3.1415,false,0,16.,true); |
728 |
|
make_comp_plot("TMath::Abs(dphi_sumJetVSZ[1])","#Delta#phi(Z,jets)","dphiZjets",jzbcut,mcjzb,datajzb,10,0.,3.1415,false,0,16.,true); |
729 |
+ |
make_comp_plot("eta1","#eta_1","eta1",jzbcut,mcjzb,datajzb,10,0.,2.5,false,0,16.); |
730 |
+ |
make_comp_plot("eta2","#eta_2","eta2",jzbcut,mcjzb,datajzb,10,0.,2.5,false,0,16.); |
731 |
|
} |
732 |
|
|
733 |
|
switch_overunderflow(false); // switching overflow/underflow bins off |
1330 |
|
string ytitle("ratio"); |
1331 |
|
if ( use_data==1 ) ytitle = "data/pred"; |
1332 |
|
//save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle); |
1333 |
< |
save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,true,ytitle,BpredSys);//not extending the y range anymore up to 4 |
1333 |
> |
save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,false,ytitle,BpredSys);//not extending the y range anymore up to 4 |
1334 |
|
|
1335 |
|
|
1336 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1774 |
|
datahisto->Draw("same,e1"); |
1775 |
|
|
1776 |
|
TLegend *leg; |
1777 |
< |
if(is_OF(cut) && is_ZP(cut)) leg = allsamples.allbglegend("OFZP",datahisto); |
1778 |
< |
else if(!is_OF(cut) && is_ZP(cut)) leg = allsamples.allbglegend("SFZP",datahisto); |
1779 |
< |
else if( is_OF(cut) && !is_ZP(cut)) leg = allsamples.allbglegend("OFSB",datahisto); |
1780 |
< |
else if(!is_OF(cut) && !is_ZP(cut)) leg = allsamples.allbglegend("SFSB",datahisto); |
1781 |
< |
else { |
1782 |
< |
std::cerr << "Unable to decode cut: " << cut.GetTitle() << std::endl; |
1783 |
< |
exit(-1); |
1784 |
< |
} |
1777 |
> |
if (!PlottingSetup::RestrictToMassPeak) { |
1778 |
> |
if(is_OF(cut)) leg = allsamples.allbglegend("Opposite flavor",datahisto); |
1779 |
> |
else leg = allsamples.allbglegend("Same flavor",datahisto); |
1780 |
> |
} else { |
1781 |
> |
if(is_OF(cut) && is_ZP(cut)) leg = allsamples.allbglegend("OFZP",datahisto); |
1782 |
> |
else if(!is_OF(cut) && is_ZP(cut)) leg = allsamples.allbglegend("SFZP",datahisto); |
1783 |
> |
else if( is_OF(cut) && !is_ZP(cut)) leg = allsamples.allbglegend("OFSB",datahisto); |
1784 |
> |
else if(!is_OF(cut) && !is_ZP(cut)) leg = allsamples.allbglegend("SFSB",datahisto); |
1785 |
> |
else { |
1786 |
> |
std::cerr << "Unable to decode cut: " << cut.GetTitle() << std::endl; |
1787 |
> |
exit(-1); |
1788 |
> |
} |
1789 |
> |
} |
1790 |
|
leg->Draw(); |
1791 |
|
string write_cut = decipher_cut(cut,""); |
1792 |
|
TText *writeline1 = write_cut_on_canvas(write_cut.c_str()); |
1946 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1947 |
|
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning); |
1948 |
|
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning); |
1892 |
– |
|
1949 |
|
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); |
1950 |
|
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); |
1951 |
+ |
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); |
1952 |
|
|
1953 |
|
} |
1954 |
|
|
2300 |
|
TCanvas *cancorr = new TCanvas("cancorr","Canvas for Response Correction"); |
2301 |
|
cancorr->SetLogz(); |
2302 |
|
cancorr->SetRightMargin(0.13); |
2303 |
< |
TCut zptforresponsepresentation("pt<600"&&cutmass&&cutOSSF&&"((sumJetPt[1]/pt)<5.0)"&&SpecialCut&&passtrig); |
2303 |
> |
TCut zptforresponsepresentation(Restrmasscut&&SpecialCut&&passtrig); |
2304 |
> |
|
2305 |
|
if(PlottingSetup::DoBTag) zptforresponsepresentation=zptforresponsepresentation&&PlottingSetup::bTagRequirement; |
2306 |
|
TH2F *niceresponseplotd = new TH2F("niceresponseplotd","",100,0,600,100,0,5); |
2307 |
+ |
niceresponseplotd->Sumw2(); |
2308 |
+ |
TH2F* emuResponse = (TH2F*)niceresponseplotd->Clone("emuResponse"); |
2309 |
|
vector<int> SampleIndices=allsamples.FindSample(FindKeyword); |
2310 |
|
for(int iSample=0;iSample<(int)SampleIndices.size();iSample++) { |
2311 |
|
if((allsamples.collection)[SampleIndices[iSample]].is_data && !dodata) continue; |
2312 |
|
if((allsamples.collection)[SampleIndices[iSample]].is_data ==false && dodata) continue; |
2313 |
|
|
2314 |
|
dout << " Response correction : Using sample " << (allsamples.collection)[SampleIndices[iSample]].filename << " for " << FindKeyword << endl; |
2315 |
< |
(allsamples.collection)[SampleIndices[iSample]].events->Draw("sumJetPt[1]/pt:pt>>+niceresponseplotd",zptforresponsepresentation*cutWeight); |
2315 |
> |
(allsamples.collection)[SampleIndices[iSample]].events->Draw("sumJetPt[1]/pt:pt>>+niceresponseplotd",(zptforresponsepresentation&&cutOSSF)*cutWeight); |
2316 |
> |
(allsamples.collection)[SampleIndices[iSample]].events->Draw("sumJetPt[1]/pt:pt>>+emuResponse",(zptforresponsepresentation&&cutOSOF)*cutWeight); |
2317 |
|
} |
2318 |
< |
|
2318 |
> |
niceresponseplotd->Add(emuResponse,-1); |
2319 |
> |
|
2320 |
|
niceresponseplotd->SetStats(0); |
2321 |
|
niceresponseplotd->GetXaxis()->SetTitle("Z p_{T} [GeV]"); |
2322 |
|
niceresponseplotd->GetYaxis()->SetTitle("Response"); |
2324 |
|
niceresponseplotd->GetYaxis()->CenterTitle(); |
2325 |
|
niceresponseplotd->Draw("COLZ"); |
2326 |
|
TProfile * profd = (TProfile*)niceresponseplotd->ProfileX(); |
2327 |
+ |
profd->Rebin(2); |
2328 |
|
profd->SetMarkerSize(DataMarkerSize); |
2329 |
|
profd->Fit("pol0","","same,e1",100,400); |
2330 |
|
DrawPrelim(); |
2344 |
|
CompleteSave(cancorr,"ResponseCorrection/Response_Correction_Illustration_New_"+SaveAs); |
2345 |
|
delete cancorr; |
2346 |
|
delete niceresponseplotd; |
2347 |
+ |
delete profd; |
2348 |
|
return correction; |
2349 |
|
} |
2350 |
|
|
2504 |
|
|
2505 |
|
|
2506 |
|
if(!doPURW) { |
2507 |
+ |
dout << "Not doing PU reweighting for ttbar closure test" << endl; |
2508 |
|
cutWeight="1.0"; |
2509 |
|
// Do it without PU re-weighting |
2510 |
|
float MCPeakNoPU=0,MCPeakErrorNoPU=0,DataPeakNoPU=0,DataPeakErrorNoPU=0,MCSigma=0,DataSigma=0; |
2514 |
|
|
2515 |
|
stringstream mcjzbnoPU; |
2516 |
|
find_peaks(MCPeakNoPU,MCPeakErrorNoPU, DataPeakNoPU, DataPeakErrorNoPU,resultsNoPU,true,noPUdatajzb,noPUmcjzb); |
2517 |
< |
if(MCPeakNoPU>0) mcjzbnoPU<<"("<<jzbvariablemc<<"-"<<TMath::Abs(MCPeakNoPU)<<")"; |
2453 |
< |
else mcjzbnoPU<<"("<<jzbvariablemc<<"+"<<TMath::Abs(MCPeakNoPU)<<")"; |
2454 |
< |
dout << "The peak corrected JZB expression for MC without pileup is : " << mcjzbnoPU.str() << endl; |
2455 |
< |
|
2456 |
< |
mcjzb = mcjzbnoPU.str(); |
2457 |
< |
|
2517 |
> |
mcjzb = noPUmcjzb.str(); |
2518 |
|
} |
2519 |
|
|
2520 |
< |
|
2461 |
< |
|
2462 |
< |
|
2463 |
< |
|
2464 |
< |
|
2520 |
> |
|
2521 |
|
float simulatedlumi = luminosity; //in pb please - adjust to your likings |
2522 |
|
|
2523 |
< |
TH1F *TZem = systsamples.Draw("TZem",mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2523 |
> |
TH1F *TZem = systsamples.Draw("TZem", mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2524 |
|
TH1F *nTZem = systsamples.Draw("nTZem","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2525 |
|
TH1F *TSem; |
2526 |
|
TH1F *nTSem; |
2527 |
< |
TH1F *TZeemm = systsamples.Draw("TZeemm",mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2527 |
> |
TH1F *TZeemm = systsamples.Draw("TZeemm", mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2528 |
|
TH1F *nTZeemm = systsamples.Draw("nTZeemm","-"+mcjzb,binning,"JZB [GeV]","events",cutmass&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2529 |
|
TH1F *TSeemm; |
2530 |
|
TH1F *nTSeemm; |
2531 |
|
|
2532 |
|
if(PlottingSetup::RestrictToMassPeak) { |
2533 |
< |
TSem = systsamples.Draw("TSem",mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2534 |
< |
nTSem = systsamples.Draw("nTSem","-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2535 |
< |
TSeemm = systsamples.Draw("TSeemm",mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2533 |
> |
TSem = systsamples.Draw("TSem", mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2534 |
> |
nTSem = systsamples.Draw("nTSem", "-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSOF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2535 |
> |
TSeemm = systsamples.Draw("TSeemm", mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2536 |
|
nTSeemm = systsamples.Draw("nTSeemm","-"+mcjzb,binning,"JZB [GeV]","events",sidebandcut&&cutOSSF&&cutnJets,mc,simulatedlumi,systsamples.FindSample("TTJets")); |
2537 |
|
} |
2538 |
|
|
2539 |
|
TCanvas *tcan = new TCanvas("tcan","tcan"); |
2484 |
– |
|
2540 |
|
tcan->SetLogy(1); |
2541 |
|
|
2542 |
|
TZeemm->SetLineColor(kBlack); |
2565 |
|
histos.push_back(TSem); |
2566 |
|
histos.push_back(TSeemm); |
2567 |
|
} |
2568 |
< |
draw_all_ttbar_histos(tcan,histos,"histo",0.04); |
2568 |
> |
draw_all_ttbar_histos(tcan,histos,"histo",1); |
2569 |
|
|
2570 |
|
TLegend *leg = make_legend("MC t#bar{t}",0.6,0.65,false); |
2571 |
|
leg->AddEntry(TZeemm,"SFZP","l"); |
2593 |
|
TSeemm->Divide(TZeemm); |
2594 |
|
TSem->SetMarkerStyle(24); |
2595 |
|
TSeemm->SetMarkerStyle(32); |
2596 |
< |
} |
2596 |
> |
} |
2597 |
|
|
2598 |
|
tcan->SetLogy(0); |
2599 |
|
TZem->GetYaxis()->SetRangeUser(0,2.5); |
2642 |
|
DrawMCPrelim(simulatedlumi); |
2643 |
|
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_shape_comparison_ratio"); |
2644 |
|
|
2645 |
+ |
if (0) { // Turn this off: we don't need this |
2646 |
|
|
2647 |
< |
///-------------- second part: only look at the quantity we actually care about! |
2648 |
< |
TH1F *leftsfzp = (TH1F*)nTZeemm->Clone("leftsfzp"); |
2649 |
< |
TH1F *rightsfzp = (TH1F*)TZeemmcopy->Clone("rightsfzp"); |
2650 |
< |
rightsfzp->Add(leftsfzp,-1); |
2651 |
< |
TH1F *leftofzp = (TH1F*)nTZem->Clone("leftofzp"); |
2652 |
< |
TH1F *rightofzp = (TH1F*)TZemcopy->Clone("rightofzp"); |
2653 |
< |
rightofzp->Add(leftofzp,-1); |
2654 |
< |
TH1F *leftofsb; |
2655 |
< |
TH1F *rightofsb; |
2656 |
< |
TH1F *leftsfsb; |
2657 |
< |
TH1F *rightsfsb; |
2658 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2659 |
< |
leftofsb = (TH1F*)nTSem->Clone("leftofsb"); |
2660 |
< |
rightofsb = (TH1F*)TSemcopy->Clone("rightofsb"); |
2661 |
< |
rightofsb->Add(leftofsb,-1); |
2662 |
< |
leftsfsb = (TH1F*)nTSeemm->Clone("leftsfsb"); |
2663 |
< |
rightsfsb = (TH1F*)TSeemmcopy->Clone("rightsfsb"); |
2664 |
< |
rightsfsb->Add(leftsfsb,-1); |
2665 |
< |
} |
2647 |
> |
///-------------- second part: only look at the quantity we actually care about! |
2648 |
> |
TH1F *leftsfzp = (TH1F*)nTZeemm->Clone("leftsfzp"); |
2649 |
> |
TH1F *rightsfzp = (TH1F*)TZeemmcopy->Clone("rightsfzp"); |
2650 |
> |
rightsfzp->Add(leftsfzp,-1); |
2651 |
> |
TH1F *leftofzp = (TH1F*)nTZem->Clone("leftofzp"); |
2652 |
> |
TH1F *rightofzp = (TH1F*)TZemcopy->Clone("rightofzp"); |
2653 |
> |
rightofzp->Add(leftofzp,-1); |
2654 |
> |
TH1F *leftofsb; |
2655 |
> |
TH1F *rightofsb; |
2656 |
> |
TH1F *leftsfsb; |
2657 |
> |
TH1F *rightsfsb; |
2658 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2659 |
> |
leftofsb = (TH1F*)nTSem->Clone("leftofsb"); |
2660 |
> |
rightofsb = (TH1F*)TSemcopy->Clone("rightofsb"); |
2661 |
> |
rightofsb->Add(leftofsb,-1); |
2662 |
> |
leftsfsb = (TH1F*)nTSeemm->Clone("leftsfsb"); |
2663 |
> |
rightsfsb = (TH1F*)TSeemmcopy->Clone("rightsfsb"); |
2664 |
> |
rightsfsb->Add(leftsfsb,-1); |
2665 |
> |
} |
2666 |
|
|
2667 |
< |
tcan->SetLogy(1); |
2668 |
< |
rightsfzp->GetXaxis()->SetRangeUser(0,binning[binning.size()-1]); |
2669 |
< |
rightsfzp->GetYaxis()->SetTitle("#deltaJZB / 25 GeV"); |
2670 |
< |
rightsfzp->Draw("histo"); |
2671 |
< |
rightofzp->Draw("histo,same"); |
2672 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2673 |
< |
rightofsb->Draw("histo,same"); |
2674 |
< |
rightsfsb->Draw("histo,same"); |
2675 |
< |
} |
2676 |
< |
DrawMCPrelim(simulatedlumi); |
2667 |
> |
tcan->SetLogy(1); |
2668 |
> |
rightsfzp->GetXaxis()->SetRangeUser(0,binning[binning.size()-1]); |
2669 |
> |
rightsfzp->GetYaxis()->SetTitle("#deltaJZB / 25 GeV"); |
2670 |
> |
rightsfzp->Draw("histo"); |
2671 |
> |
rightofzp->Draw("histo,same"); |
2672 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2673 |
> |
rightofsb->Draw("histo,same"); |
2674 |
> |
rightsfsb->Draw("histo,same"); |
2675 |
> |
} |
2676 |
> |
DrawMCPrelim(simulatedlumi); |
2677 |
|
|
2678 |
< |
TLegend *legA = make_legend("MC t#bar{t}",0.6,0.65,false); |
2679 |
< |
legA->AddEntry(rightsfzp,"SFZP","l"); |
2680 |
< |
legA->AddEntry(rightofzp,"OFZP","l"); |
2681 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2682 |
< |
legA->AddEntry(rightofsb,"SFSB","l"); |
2683 |
< |
legA->AddEntry(rightsfsb,"OFSB","l"); |
2684 |
< |
} |
2685 |
< |
legA->Draw(); |
2678 |
> |
TLegend *legA = make_legend("MC t#bar{t}",0.6,0.65,false); |
2679 |
> |
legA->AddEntry(rightsfzp,"SFZP","l"); |
2680 |
> |
legA->AddEntry(rightofzp,"OFZP","l"); |
2681 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2682 |
> |
legA->AddEntry(rightofsb,"SFSB","l"); |
2683 |
> |
legA->AddEntry(rightsfsb,"OFSB","l"); |
2684 |
> |
} |
2685 |
> |
legA->Draw(); |
2686 |
|
|
2687 |
< |
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_deltajzb_comparison"); |
2687 |
> |
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_deltajzb_comparison"); |
2688 |
|
|
2689 |
< |
tcan->SetLogy(0); |
2690 |
< |
rightofzp->Divide(rightsfzp); |
2691 |
< |
rightofzp->GetXaxis()->SetRangeUser(0.0,binning[binning.size()-1]); |
2692 |
< |
rightofzp->GetYaxis()->SetRangeUser(0.0,2.5); |
2693 |
< |
rightofzp->GetYaxis()->SetTitle("#deltaJZB ratio"); |
2694 |
< |
rightofzp->Draw(); |
2695 |
< |
if(PlottingSetup::RestrictToMassPeak) { |
2696 |
< |
rightofsb->Divide(rightsfzp); |
2697 |
< |
rightsfsb->Divide(rightsfzp); |
2698 |
< |
rightofsb->Draw("same"); |
2699 |
< |
rightsfsb->Draw("same"); |
2700 |
< |
} |
2689 |
> |
tcan->SetLogy(0); |
2690 |
> |
rightofzp->Divide(rightsfzp); |
2691 |
> |
rightofzp->GetXaxis()->SetRangeUser(0.0,binning[binning.size()-1]); |
2692 |
> |
rightofzp->GetYaxis()->SetRangeUser(0.0,2.5); |
2693 |
> |
rightofzp->GetYaxis()->SetTitle("#deltaJZB ratio"); |
2694 |
> |
rightofzp->Draw(); |
2695 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2696 |
> |
rightofsb->Divide(rightsfzp); |
2697 |
> |
rightsfsb->Divide(rightsfzp); |
2698 |
> |
rightofsb->Draw("same"); |
2699 |
> |
rightsfsb->Draw("same"); |
2700 |
> |
} |
2701 |
> |
|
2702 |
> |
TLine *top2 = new TLine(0.0,1.0+linepos,binning[binning.size()-1],1.0+linepos); |
2703 |
> |
TLine *center2 = new TLine(0.0,1.0,binning[binning.size()-1],1.0); |
2704 |
> |
TLine *bottom2 = new TLine(0.0,1.0-linepos,binning[binning.size()-1],1.0-linepos); |
2705 |
> |
|
2706 |
> |
top2->SetLineColor(kBlue);top2->SetLineStyle(2); |
2707 |
> |
bottom2->SetLineColor(kBlue);bottom2->SetLineStyle(2); |
2708 |
> |
center2->SetLineColor(kBlue); |
2709 |
> |
|
2710 |
> |
top2->Draw("same"); |
2711 |
> |
center2->Draw("same"); |
2712 |
> |
bottom2->Draw("same"); |
2713 |
> |
|
2714 |
> |
rightofzp->SetMarkerStyle(21); |
2715 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2716 |
> |
rightofsb->SetMarkerStyle(24); |
2717 |
> |
rightsfsb->SetMarkerStyle(32); |
2718 |
> |
} |
2719 |
|
|
2720 |
< |
TLine *top2 = new TLine(0.0,1.0+linepos,binning[binning.size()-1],1.0+linepos); |
2721 |
< |
TLine *center2 = new TLine(0.0,1.0,binning[binning.size()-1],1.0); |
2722 |
< |
TLine *bottom2 = new TLine(0.0,1.0-linepos,binning[binning.size()-1],1.0-linepos); |
2720 |
> |
TLegend *leg3 = make_legend("MC t#bar{t}",0.55,0.75,false); |
2721 |
> |
leg3->AddEntry(rightofzp,"OFZP / SFZP","ple"); |
2722 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2723 |
> |
leg3->AddEntry(rightsfsb,"SFSB / SFZP","ple"); |
2724 |
> |
leg3->AddEntry(rightofsb,"OFSB / SFZP","ple"); |
2725 |
> |
} |
2726 |
> |
leg3->AddEntry(bottom,"syst. envelope","l"); |
2727 |
> |
leg3->SetX1(0.25);leg3->SetX2(0.6); |
2728 |
> |
leg3->SetY1(0.65); |
2729 |
|
|
2730 |
< |
top2->SetLineColor(kBlue);top2->SetLineStyle(2); |
2651 |
< |
bottom2->SetLineColor(kBlue);bottom2->SetLineStyle(2); |
2652 |
< |
center2->SetLineColor(kBlue); |
2730 |
> |
leg3->Draw("same"); |
2731 |
|
|
2732 |
< |
top2->Draw("same"); |
2733 |
< |
center2->Draw("same"); |
2656 |
< |
bottom2->Draw("same"); |
2732 |
> |
DrawMCPrelim(simulatedlumi); |
2733 |
> |
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_deltajzb_comparison_ratio"); |
2734 |
|
|
2658 |
– |
rightofzp->SetMarkerStyle(21); |
2659 |
– |
if(PlottingSetup::RestrictToMassPeak) { |
2660 |
– |
rightofsb->SetMarkerStyle(24); |
2661 |
– |
rightsfsb->SetMarkerStyle(32); |
2735 |
|
} |
2736 |
|
|
2664 |
– |
TLegend *leg3 = make_legend("MC t#bar{t}",0.55,0.75,false); |
2665 |
– |
leg3->AddEntry(rightofzp,"OFZP / SFZP","ple"); |
2666 |
– |
if(PlottingSetup::RestrictToMassPeak) { |
2667 |
– |
leg3->AddEntry(rightsfsb,"SFSB / SFZP","ple"); |
2668 |
– |
leg3->AddEntry(rightofsb,"OFSB / SFZP","ple"); |
2669 |
– |
} |
2670 |
– |
leg3->AddEntry(bottom,"syst. envelope","l"); |
2671 |
– |
leg3->SetX1(0.25);leg3->SetX2(0.6); |
2672 |
– |
leg3->SetY1(0.65); |
2673 |
– |
|
2674 |
– |
leg3->Draw("same"); |
2675 |
– |
|
2676 |
– |
DrawMCPrelim(simulatedlumi); |
2677 |
– |
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_deltajzb_comparison_ratio"); |
2678 |
– |
|
2737 |
|
delete TZem; |
2738 |
|
delete nTZem; |
2739 |
|
delete TZeemm; |
2779 |
|
nicer_binning.push_back(100); |
2780 |
|
nicer_binning.push_back(125); |
2781 |
|
nicer_binning.push_back(150); |
2782 |
< |
nicer_binning.push_back(175); |
2782 |
> |
//nicer_binning.push_back(175); |
2783 |
|
nicer_binning.push_back(200); |
2784 |
< |
nicer_binning.push_back(230); |
2785 |
< |
nicer_binning.push_back(280); |
2784 |
> |
nicer_binning.push_back(250); |
2785 |
> |
nicer_binning.push_back(300); |
2786 |
|
nicer_binning.push_back(400); |
2787 |
|
|
2788 |
|
ttbar_sidebands_comparison(mcjzb,nicer_binning, "ttbar/"); |
2791 |
|
|
2792 |
|
void zjets_prediction_comparison(string mcjzbWithPUa) { |
2793 |
|
TCanvas *zcan = new TCanvas("zcan","zcan"); |
2794 |
< |
zcan->SetLogy(1); |
2794 |
> |
// zcan->SetLogy(1); |
2795 |
|
TCut weightbackup=cutWeight; |
2796 |
< |
|
2797 |
< |
|
2798 |
< |
// Do it without PU re-weighting |
2799 |
< |
float MCPeakNoPU=0,MCPeakErrorNoPU=0,DataPeakNoPU=0,DataPeakErrorNoPU=0,MCSigma=0,DataSigma=0; |
2800 |
< |
stringstream resultsNoPU; |
2801 |
< |
stringstream noPUdatajzb; |
2802 |
< |
stringstream noPUmcjzb; |
2803 |
< |
|
2804 |
< |
stringstream mcjzbnoPU; |
2805 |
< |
// void find_peaks(float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, stringstream &result, bool doPUreweighting, stringstream &datajzb, stringstream &mcjzb) |
2806 |
< |
find_peaks(MCPeakNoPU,MCPeakErrorNoPU, DataPeakNoPU, DataPeakErrorNoPU,resultsNoPU,true,noPUdatajzb,noPUmcjzb); |
2807 |
< |
if(MCPeakNoPU>0) mcjzbnoPU<<"("<<jzbvariablemc<<"-"<<TMath::Abs(MCPeakNoPU)<<")"; |
2808 |
< |
else mcjzbnoPU<<"("<<jzbvariablemc<<"+"<<TMath::Abs(MCPeakNoPU)<<")"; |
2809 |
< |
dout << "The peak corrected JZB expression for MC without pileup is : " << mcjzbnoPU.str() << endl; |
2810 |
< |
|
2811 |
< |
string mcjzb = mcjzbnoPU.str(); |
2812 |
< |
|
2813 |
< |
cutWeight="1.0"; |
2796 |
> |
|
2797 |
> |
bool UsePURW=false; |
2798 |
> |
|
2799 |
> |
|
2800 |
> |
string mcjzb; |
2801 |
> |
if(UsePURW) { |
2802 |
> |
mcjzb=mcjzbWithPUa; |
2803 |
> |
} else { |
2804 |
> |
// Do it without PU re-weighting |
2805 |
> |
float MCPeakNoPU=0,MCPeakErrorNoPU=0,DataPeakNoPU=0,DataPeakErrorNoPU=0,MCSigma=0,DataSigma=0; |
2806 |
> |
stringstream resultsNoPU; |
2807 |
> |
stringstream noPUdatajzb; |
2808 |
> |
stringstream noPUmcjzb; |
2809 |
> |
|
2810 |
> |
find_peaks(MCPeakNoPU,MCPeakErrorNoPU, DataPeakNoPU, DataPeakErrorNoPU,resultsNoPU,false,noPUdatajzb,noPUmcjzb); |
2811 |
> |
dout << "The peak corrected JZB expression for MC without pileup is : " << noPUmcjzb.str() << endl; |
2812 |
> |
|
2813 |
> |
mcjzb = noPUmcjzb.str(); |
2814 |
> |
|
2815 |
> |
cutWeight="1.0"; |
2816 |
> |
} |
2817 |
|
|
2818 |
|
|
2819 |
|
vector<float> binning; |
2821 |
|
binning.push_back(10); |
2822 |
|
binning.push_back(20); |
2823 |
|
binning.push_back(40); |
2824 |
< |
// binning.push_back(80); |
2824 |
> |
binning.push_back(60); |
2825 |
> |
// binning.push_back(50); |
2826 |
> |
// binning.push_back(60); |
2827 |
> |
// binning.push_back(70); |
2828 |
> |
// binning.push_back(80); |
2829 |
> |
// binning.push_back(90); |
2830 |
|
binning.push_back(100); |
2831 |
< |
// float sbg_min=0.; |
2766 |
< |
// float sbg_max=100.; |
2767 |
< |
// int sbg_nbins=5; |
2831 |
> |
|
2832 |
|
float simulatedlumi = luminosity;//in pb please - adjust to your likings |
2833 |
|
|
2834 |
|
TCut kPos((mcjzb+">0").c_str()); |
2835 |
|
TCut kNeg((mcjzb+"<0").c_str()); |
2836 |
|
string var( "abs("+mcjzb+")" ); |
2837 |
+ |
|
2838 |
+ |
TCut notTau("abs(genMID1)!=15"); |
2839 |
+ |
TCut ONLYTau("mll>20"); |
2840 |
+ |
|
2841 |
|
|
2842 |
< |
TCut kcut(cutmass&&cutOSSF&&cutnJets); |
2843 |
< |
TH1F *hJZBpos = systsamples.Draw("hJZBpos",var,binning, "JZB [GeV]", "events",kcut&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2844 |
< |
TH1F *hJZBneg = systsamples.Draw("hJZBneg",var,binning, "JZB [GeV]", "events",kcut&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2842 |
> |
TH1F *hJZBpos = systsamples.Draw("hJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&¬Tau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2843 |
> |
TH1F *hJZBneg = systsamples.Draw("hJZBneg",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets&¬Tau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2844 |
> |
|
2845 |
|
hJZBpos->SetLineColor(kBlack); |
2846 |
|
hJZBneg->SetLineColor(kRed); |
2847 |
|
|
2850 |
|
hJZBneg->Draw("same,hist"); |
2851 |
|
hJZBpos->Draw("same,e1"); // So it's on top... |
2852 |
|
|
2853 |
< |
TLegend *leg = make_legend("MC Z+jets",0.55,0.75,false); |
2853 |
> |
TLegend *leg = make_legend("MC Z+jets #rightarrow ee,#mu#mu",0.55,0.75,false); |
2854 |
|
leg->AddEntry(hJZBpos,"Observed","pe"); |
2855 |
|
leg->AddEntry(hJZBneg,"Predicted","l"); |
2856 |
|
leg->Draw("same"); |
2857 |
|
DrawMCPrelim(simulatedlumi); |
2858 |
< |
CompleteSave(zcan,"Systematics/zjets_prediction"); |
2858 |
> |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction"); |
2859 |
|
|
2860 |
|
TH1F* hratio = (TH1F*)hJZBpos->Clone("hratio"); |
2861 |
|
hratio->Divide(hJZBneg); |
2862 |
|
|
2863 |
|
for(int i=1;i<=hJZBpos->GetNbinsX();i++) { |
2864 |
< |
cout << "Positive: " << hJZBpos->GetBinContent(i) << " vs Negative : " << hJZBneg->GetBinContent(i) << endl; |
2864 |
> |
cout << "Positive: " << hJZBpos->GetBinContent(i) << " vs Negative : " << hJZBneg->GetBinContent(i) << " (ratio : " << hJZBpos->GetBinContent(i) / hJZBneg->GetBinContent(i) << endl; |
2865 |
|
} |
2866 |
|
|
2867 |
|
zcan->SetLogy(0); |
2868 |
< |
hratio->GetYaxis()->SetRangeUser(0,2.5); |
2868 |
> |
hratio->GetYaxis()->SetRangeUser(0,2.0); |
2869 |
|
hratio->GetYaxis()->SetTitle("Observed/Predicted"); |
2870 |
|
hratio->Draw("e1"); |
2871 |
|
|
2882 |
|
center->Draw("same"); |
2883 |
|
bottom->Draw("same"); |
2884 |
|
|
2885 |
< |
TLegend *leg2 = make_legend("MC Z+jets",0.25,0.75,false); |
2885 |
> |
TLegend *leg2 = make_legend("MC Z+jets #rightarrow ee,#mu#mu",0.25,0.75,false); |
2886 |
|
leg2->AddEntry(hratio,"obs / pred","pe"); |
2887 |
|
leg2->AddEntry(bottom,"syst. envelope","l"); |
2888 |
|
leg2->Draw("same"); |
2889 |
|
DrawMCPrelim(simulatedlumi); |
2890 |
< |
CompleteSave(zcan,"Systematics/zjets_prediction_ratio"); |
2890 |
> |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemm_prediction_ratio"); |
2891 |
> |
|
2892 |
> |
TCut reducedNJets(cutnJets); |
2893 |
> |
|
2894 |
> |
TH1F *TAUhJZBpos = systsamples.Draw("TAUhJZBpos",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2895 |
> |
TH1F *LcorrJZBeemm = systsamples.Draw("LcorrJZBeemm",var,binning, "JZB [GeV]", "events",cutmass&&cutOSSF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2896 |
> |
TH1F *RcorrJZBem = systsamples.Draw("RcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2897 |
> |
TH1F *LcorrJZBem = systsamples.Draw("LcorrJZBem",var,binning, "JZB [GeV]", "events",cutmass&&cutOSOF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2898 |
> |
|
2899 |
> |
TH1F *RcorrJZBSBem; |
2900 |
> |
TH1F *LcorrJZBSBem; |
2901 |
> |
TH1F *RcorrJZBSBeemm; |
2902 |
> |
TH1F *LcorrJZBSBeemm; |
2903 |
> |
|
2904 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2905 |
> |
RcorrJZBSBem = systsamples.Draw("RcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2906 |
> |
LcorrJZBSBem = systsamples.Draw("LcorrJZBSBem",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSOF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2907 |
> |
RcorrJZBSBeemm = systsamples.Draw("RcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ONLYTau&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2908 |
> |
LcorrJZBSBeemm = systsamples.Draw("LcorrJZBSBeemm",var,binning, "JZB [GeV]", "events",sidebandcut&&cutOSSF&&reducedNJets&&ONLYTau&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2909 |
> |
} |
2910 |
> |
|
2911 |
> |
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
2912 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2913 |
> |
Bpred->Add(RcorrJZBem,1.0/3.); |
2914 |
> |
Bpred->Add(LcorrJZBem,-1.0/3.); |
2915 |
> |
Bpred->Add(RcorrJZBSBem,1.0/3.); |
2916 |
> |
Bpred->Add(LcorrJZBSBem,-1.0/3.); |
2917 |
> |
Bpred->Add(RcorrJZBSBeemm,1.0/3.); |
2918 |
> |
Bpred->Add(LcorrJZBSBeemm,-1.0/3.); |
2919 |
> |
} else { |
2920 |
> |
Bpred->Add(RcorrJZBem,1.0); |
2921 |
> |
Bpred->Add(LcorrJZBem,-1.0); |
2922 |
> |
} |
2923 |
> |
|
2924 |
> |
Bpred->SetLineColor(kRed); |
2925 |
> |
|
2926 |
> |
TAUhJZBpos->SetLineColor(kBlack); |
2927 |
> |
Bpred->SetLineColor(kRed); |
2928 |
> |
|
2929 |
> |
TAUhJZBpos->SetMinimum(1.0); |
2930 |
> |
TAUhJZBpos->Draw("e1"); |
2931 |
> |
Bpred->Draw("same,hist"); |
2932 |
> |
TAUhJZBpos->Draw("same,e1"); |
2933 |
> |
|
2934 |
> |
TLegend *TAUleg = make_legend("MC Z+jets #rightarrow ee,#mu#mu,#tau#tau",0.55,0.75,false); |
2935 |
> |
TAUleg->AddEntry(TAUhJZBpos,"Observed","pe"); |
2936 |
> |
TAUleg->AddEntry(Bpred,"Predicted","l"); |
2937 |
> |
TAUleg->Draw("same"); |
2938 |
> |
DrawMCPrelim(simulatedlumi); |
2939 |
> |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction"); |
2940 |
> |
|
2941 |
> |
TH1F* TAUhratio = (TH1F*)TAUhJZBpos->Clone("TAUhratio"); |
2942 |
> |
TAUhratio->Divide(Bpred); |
2943 |
> |
|
2944 |
> |
for(int i=1;i<=TAUhJZBpos->GetNbinsX();i++) { |
2945 |
> |
cout << "ee/mm/tautau observed: " << TAUhJZBpos->GetBinContent(i) << " vs predicted : " << Bpred->GetBinContent(i) << " (ratio : " << TAUhJZBpos->GetBinContent(i) / Bpred->GetBinContent(i) << endl; |
2946 |
> |
} |
2947 |
> |
|
2948 |
> |
zcan->SetLogy(0); |
2949 |
> |
TAUhratio->GetYaxis()->SetRangeUser(0,2.5); |
2950 |
> |
TAUhratio->GetYaxis()->SetTitle("Observed/Predicted"); |
2951 |
> |
TAUhratio->Draw("e1"); |
2952 |
> |
|
2953 |
> |
top->Draw("same"); |
2954 |
> |
center->Draw("same"); |
2955 |
> |
bottom->Draw("same"); |
2956 |
> |
|
2957 |
> |
TLegend *TAUleg2 = make_legend("MC Z+jets #rightarrow #tau#tau",0.25,0.75,false); |
2958 |
> |
TAUleg2->AddEntry(TAUhratio,"obs / pred","pe"); |
2959 |
> |
TAUleg2->AddEntry(bottom,"syst. envelope","l"); |
2960 |
> |
TAUleg2->Draw("same"); |
2961 |
> |
DrawMCPrelim(simulatedlumi); |
2962 |
> |
CompleteSave(zcan,"Systematics/ZJets/zjets_eemumutautau_prediction_ratio"); |
2963 |
> |
|
2964 |
> |
delete Bpred; |
2965 |
> |
delete TAUhJZBpos; |
2966 |
> |
delete LcorrJZBeemm; |
2967 |
> |
delete RcorrJZBem; |
2968 |
> |
delete LcorrJZBem; |
2969 |
> |
|
2970 |
> |
if(PlottingSetup::RestrictToMassPeak) { |
2971 |
> |
delete RcorrJZBSBem; |
2972 |
> |
delete LcorrJZBSBem; |
2973 |
> |
delete RcorrJZBSBeemm; |
2974 |
> |
delete LcorrJZBSBeemm; |
2975 |
> |
} |
2976 |
> |
|
2977 |
|
|
2978 |
|
delete zcan; |
2979 |
|
cutWeight=weightbackup; |