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; |
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.); |
206 |
< |
} else { |
207 |
< |
Bpred->Add(RcorrJZBem,1.0); |
208 |
< |
Bpred->Add(LcorrJZBem,-1.0); |
209 |
< |
} |
210 |
< |
|
198 |
> |
// Separate predictions |
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) { |
203 |
> |
OFP->Scale(1.0/3.0); |
204 |
> |
OFP->Add(RcorrJZBSBem,1.0/3.); |
205 |
> |
OFP->Add(RcorrJZBSBeemm,1.0/3.); |
206 |
> |
OFN->Scale(1.0/3.0); |
207 |
> |
OFN->Add(LcorrJZBSBem,1.0/3.); |
208 |
> |
OFN->Add(LcorrJZBSBeemm,1.0/3.); |
209 |
> |
} |
210 |
> |
|
211 |
> |
TH1F* Bpred = (TH1F*)SFN->Clone("Bpred"); |
212 |
> |
Bpred->Add(OFP); |
213 |
> |
Bpred->Add(OFN,-1); |
214 |
|
Bpred->SetLineColor(kRed); |
215 |
|
|
216 |
+ |
RcorrJZBeemm->SetTitleOffset(1.3,"y"); |
217 |
|
RcorrJZBeemm->Draw(); |
218 |
|
mcRcorrJZBeemm.Draw("same"); |
219 |
|
Bpred->Draw("histo,same"); |
229 |
|
saveas << "kin/Mll_After_Cut/Cut_At" << jzbthreshold; |
230 |
|
CompleteSave(ckin,saveas.str()); |
231 |
|
|
232 |
< |
|
232 |
> |
// Draw all predictions overlayed |
233 |
> |
unsigned int w = gStyle->GetHistLineWidth()+1; // Make line a bit wider, since we dash it |
234 |
> |
SFN->SetLineColor(kGreen+2); |
235 |
> |
SFN->SetLineStyle(2); |
236 |
> |
SFN->SetLineWidth(w); |
237 |
> |
OFP->SetLineColor(kBlue+2); |
238 |
> |
OFP->SetLineStyle(2); |
239 |
> |
OFP->SetLineWidth(w); |
240 |
> |
OFN->SetLineColor(kMagenta+2); |
241 |
> |
OFN->SetLineStyle(3); |
242 |
> |
OFN->SetLineWidth(w); |
243 |
|
|
244 |
|
RcorrJZBeemm->Draw(); |
245 |
+ |
SFN->Draw("histo,same"); |
246 |
+ |
OFP->Draw("histo,same"); |
247 |
+ |
OFN->Draw("histo,same"); |
248 |
|
Bpred->Draw("histo,same"); |
249 |
|
RcorrJZBeemm->Draw("same"); |
250 |
|
|
251 |
< |
TLegend *leg2 = make_legend(); |
252 |
< |
leg2->SetX1(0.58); |
236 |
< |
leg2->AddEntry(RcorrJZBeemm,"observed (data)","l"); |
251 |
> |
TLegend *leg2 = make_legend("",0.52,0.7); |
252 |
> |
leg2->AddEntry(RcorrJZBeemm,"observed (data)","lp"); |
253 |
|
leg2->AddEntry(Bpred,"predicted (data)","l"); |
254 |
+ |
leg2->AddEntry(SFN, " SF JZB<0","l"); |
255 |
+ |
leg2->AddEntry(OFN, " OF JZB<0","l"); |
256 |
+ |
leg2->AddEntry(OFP, " OF JZB>0","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()); |
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; |
2517 |
|
mcjzb = noPUmcjzb.str(); |
2518 |
|
} |
2519 |
|
|
2520 |
< |
|
2456 |
< |
|
2457 |
< |
|
2458 |
< |
|
2459 |
< |
|
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"); |
2479 |
– |
|
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); |
2646 |
< |
bottom2->SetLineColor(kBlue);bottom2->SetLineStyle(2); |
2647 |
< |
center2->SetLineColor(kBlue); |
2730 |
> |
leg3->Draw("same"); |
2731 |
|
|
2732 |
< |
top2->Draw("same"); |
2733 |
< |
center2->Draw("same"); |
2651 |
< |
bottom2->Draw("same"); |
2732 |
> |
DrawMCPrelim(simulatedlumi); |
2733 |
> |
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_deltajzb_comparison_ratio"); |
2734 |
|
|
2653 |
– |
rightofzp->SetMarkerStyle(21); |
2654 |
– |
if(PlottingSetup::RestrictToMassPeak) { |
2655 |
– |
rightofsb->SetMarkerStyle(24); |
2656 |
– |
rightsfsb->SetMarkerStyle(32); |
2735 |
|
} |
2736 |
|
|
2659 |
– |
TLegend *leg3 = make_legend("MC t#bar{t}",0.55,0.75,false); |
2660 |
– |
leg3->AddEntry(rightofzp,"OFZP / SFZP","ple"); |
2661 |
– |
if(PlottingSetup::RestrictToMassPeak) { |
2662 |
– |
leg3->AddEntry(rightsfsb,"SFSB / SFZP","ple"); |
2663 |
– |
leg3->AddEntry(rightofsb,"OFSB / SFZP","ple"); |
2664 |
– |
} |
2665 |
– |
leg3->AddEntry(bottom,"syst. envelope","l"); |
2666 |
– |
leg3->SetX1(0.25);leg3->SetX2(0.6); |
2667 |
– |
leg3->SetY1(0.65); |
2668 |
– |
|
2669 |
– |
leg3->Draw("same"); |
2670 |
– |
|
2671 |
– |
DrawMCPrelim(simulatedlumi); |
2672 |
– |
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_deltajzb_comparison_ratio"); |
2673 |
– |
|
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/"); |
2820 |
|
binning.push_back(0); |
2821 |
|
binning.push_back(10); |
2822 |
|
binning.push_back(20); |
2760 |
– |
// binning.push_back(30); |
2823 |
|
binning.push_back(40); |
2824 |
+ |
binning.push_back(60); |
2825 |
|
// binning.push_back(50); |
2826 |
|
// binning.push_back(60); |
2827 |
|
// binning.push_back(70); |
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 |
|
|