28 |
|
dout << "Info : The pt requirement is currently set to " << (const char*) passtrig << endl; |
29 |
|
dout << "Info : The mll requirement is currently set to " << (const char*) cutmass << endl; |
30 |
|
dout << "Info : The lepton requirement is currently set to " << (const char*) leptoncut << endl; |
31 |
+ |
dout << "Info : The weight applied to all MC is " << (const char*) cutWeight << endl; |
32 |
|
} |
33 |
|
|
34 |
< |
void find_peaks(float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, float &MCSigma, float &DataSigma, stringstream &result, bool doPUreweighting = true ) |
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="") |
37 |
|
{ |
38 |
|
// Temporarily switch off PU reweighting, if asked |
39 |
|
TCut weightbackup=cutWeight; |
40 |
|
if ( !doPUreweighting ) cutWeight="1.0"; |
41 |
< |
|
41 |
> |
|
42 |
> |
int nbins=100; |
43 |
> |
if(PlottingSetup::DoBTag) nbins=25; |
44 |
> |
|
45 |
|
TCanvas *tempcan = new TCanvas("tempcan","Temporary canvas for peak finding preparations"); |
46 |
< |
TH1F *rawJZBeemmMC = allsamples.Draw("rawJZBeemmMC",jzbvariablemc,100,-50,50, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,mc, luminosity); |
47 |
< |
TH1F *rawJZBeemmData = allsamples.Draw("rawJZBeemmData",jzbvariabledata,100, -50,50, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data, luminosity); |
48 |
< |
TH1F *rawJZBemMC = allsamples.Draw("rawJZBemMC",jzbvariablemc,100,-50,50, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,mc, luminosity); |
49 |
< |
TH1F *rawJZBemData = allsamples.Draw("rawJZBemData",jzbvariabledata,100, -50,50, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,data, luminosity); |
46 |
> |
TH1F *rawJZBeemmMC = allsamples.Draw("rawJZBeemmMC",jzbvariablemc,nbins,-50,50, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&specialcut,mc, luminosity); |
47 |
> |
TH1F *rawJZBeemmData = allsamples.Draw("rawJZBeemmData",jzbvariabledata,nbins, -50,50, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&specialcut,data, luminosity); |
48 |
> |
TH1F *rawJZBemMC = allsamples.Draw("rawJZBemMC",jzbvariablemc,nbins,-50,50, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&specialcut,mc, luminosity); |
49 |
> |
TH1F *rawJZBemData = allsamples.Draw("rawJZBemData",jzbvariabledata,nbins, -50,50, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&specialcut,data, luminosity); |
50 |
|
TH1F *rawttbarjzbeemmMC; |
51 |
|
|
52 |
|
if(method==doKM) { |
53 |
|
//we only need this histo for the KM fitting... |
54 |
< |
rawttbarjzbeemmMC = allsamples.Draw("rawttbarjzbeemmMC",jzbvariablemc,100, -50,50, "JZB [GeV]", "events",cutmass&&cutOSSF&&cutnJets,mc,luminosity,allsamples.FindSample("TTJet")); |
55 |
< |
MCPeak=find_peak(rawJZBeemmMC, rawttbarjzbeemmMC, -40, 40, mc, MCPeakError,MCSigma,method); |
56 |
< |
DataPeak=find_peak(rawJZBeemmData, rawJZBeemmData, -40, 40, data, DataPeakError,DataSigma,method); |
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); |
57 |
> |
delete rawttbarjzbeemmMC; |
58 |
|
} |
59 |
|
else { |
60 |
|
TH1F *reducedMC = (TH1F*)rawJZBeemmMC->Clone(); |
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); |
66 |
< |
DataPeak=find_peak(reducedData, rawJZBeemmData, -40, 40, data, DataPeakError,DataSigma,method); |
67 |
< |
|
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); |
67 |
> |
delete reducedMC; |
68 |
> |
delete reducedData; |
69 |
|
} |
70 |
|
|
71 |
|
// Revert to original PU reweighting |
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 << " +/- ?? (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; |
80 |
> |
delete rawJZBeemmData; |
81 |
> |
delete rawJZBeemmMC; |
82 |
> |
delete rawJZBemData; |
83 |
> |
delete rawJZBemMC; |
84 |
|
delete tempcan; |
85 |
|
} |
86 |
|
|
87 |
+ |
void find_peaks(float &MCPeak,float &MCPeakError, float &DataPeak, float &DataPeakError, stringstream &result, bool doPUreweighting, stringstream &datajzb, stringstream &mcjzb) |
88 |
+ |
{ |
89 |
+ |
float mcpeak, datapeak; |
90 |
+ |
float mcpeakerr, datapeakerr; |
91 |
+ |
|
92 |
+ |
float mceepeak,mcmmpeak; |
93 |
+ |
float mceepeakerr,mcmmpeakerr; |
94 |
+ |
|
95 |
+ |
float datammpeak,dataeepeak; |
96 |
+ |
float datammpeakerr,dataeepeakerr; |
97 |
+ |
|
98 |
+ |
float mcSigma, dataSigma; |
99 |
+ |
|
100 |
+ |
dout << "Finding global peak : " << endl; |
101 |
+ |
find_one_peak_combination(TCut(""),mcpeak,mcpeakerr, datapeak,datapeakerr,mcSigma, dataSigma,result,doPUreweighting,""); |
102 |
+ |
|
103 |
+ |
dout << "Finding peak for electrons : " << endl; |
104 |
+ |
find_one_peak_combination(TCut("id1==0"),mceepeak,mceepeakerr, dataeepeak,dataeepeakerr,mcSigma, dataSigma,result,doPUreweighting,"_ele"); |
105 |
+ |
dout << "Finding peak for muons : " << endl; |
106 |
+ |
find_one_peak_combination(TCut("id1==1"),mcmmpeak,mcmmpeakerr, datammpeak,datammpeakerr,mcSigma, dataSigma,result,doPUreweighting,"_mu"); |
107 |
+ |
|
108 |
+ |
datajzb << "(" << jzbvariabledata; |
109 |
+ |
mcjzb << "(" << jzbvariablemc; |
110 |
+ |
|
111 |
+ |
if(dataeepeak>0) datajzb << "- (id1==id2)*(id1==0)*" << TMath::Abs(dataeepeak) << " "; |
112 |
+ |
else datajzb << "+ (id1==id2)*(id1==0)*" << TMath::Abs(dataeepeak) << " "; |
113 |
+ |
|
114 |
+ |
if(datammpeak>0) datajzb << "- (id1==id2)*(id1==1)*" << TMath::Abs(datammpeak) << " "; |
115 |
+ |
else datajzb << "+ (id1==id2)*(id1==1)*" << TMath::Abs(datammpeak) << " "; |
116 |
+ |
|
117 |
+ |
if(datapeak>0) datajzb << "- (id1!=id2)*" << TMath::Abs(datapeak) << " "; |
118 |
+ |
else datajzb << "+ (id1!=id2)*" << TMath::Abs(datapeak) << " "; |
119 |
+ |
|
120 |
+ |
datajzb << ")"; |
121 |
+ |
|
122 |
+ |
if(mceepeak>0) mcjzb << "- (id1==id2)*(id1==0)*" << TMath::Abs(mceepeak) << " "; |
123 |
+ |
else mcjzb << "+ (id1==id2)*(id1==0)*" << TMath::Abs(mceepeak) << " "; |
124 |
+ |
|
125 |
+ |
if(mcmmpeak>0) mcjzb << "- (id1==id2)*(id1==1)*" << TMath::Abs(mcmmpeak) << " "; |
126 |
+ |
else mcjzb << "+ (id1==id2)*(id1==1)*" << TMath::Abs(mcmmpeak) << " "; |
127 |
+ |
|
128 |
+ |
if(mcpeak>0) mcjzb << "- (id1!=id2)*" << TMath::Abs(mcpeak) << " "; |
129 |
+ |
else mcjzb << "+ (id1!=id2)*" << TMath::Abs(mcpeak) << " "; |
130 |
+ |
|
131 |
+ |
mcjzb << ")"; |
132 |
+ |
|
133 |
+ |
} |
134 |
+ |
|
135 |
|
void make_special_obs_pred_mll_plot(string mcjzb, float jzbthreshold) { |
136 |
|
float min=70.0; |
137 |
|
float max=115.0; |
151 |
|
smallerzeroS << "(" << mcjzb << "<-" << jzbthreshold << ")"; |
152 |
|
TCut smallerzero(smallerzeroS.str().c_str()); |
153 |
|
|
154 |
< |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,data,luminosity); |
155 |
< |
THStack mcRcorrJZBeemm = allsamples.DrawStack("mcRcorrJZBeemm","mll",nbins,min,max, "m_{ll} [GeV}", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,mc,luminosity); |
156 |
< |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,data,luminosity); |
157 |
< |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,data,luminosity); |
158 |
< |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,data,luminosity); |
154 |
> |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data,luminosity); |
155 |
> |
THStack mcRcorrJZBeemm = allsamples.DrawStack("mcRcorrJZBeemm","mll",nbins,min,max, "m_{ll} [GeV}", "events", cutmass&&cutOSSF&&cutnJets,mc,luminosity); |
156 |
> |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSSF&&cutnJets,data,luminosity); |
157 |
> |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets,data,luminosity); |
158 |
> |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem", "mll",nbins,min,max, "m_{ll} [GeV]", "events", cutmass&&cutOSOF&&cutnJets,data,luminosity); |
159 |
|
|
160 |
|
TH1F *RcorrJZBSBem; |
161 |
|
TH1F *LcorrJZBSBem; |
162 |
|
TH1F *RcorrJZBSBeemm; |
163 |
|
TH1F *LcorrJZBSBeemm; |
164 |
|
|
165 |
< |
TH1F *RcorrJZBeemmNoS; |
165 |
> |
// TH1F *RcorrJZBeemmNoS; |
166 |
|
|
167 |
|
if(PlottingSetup::RestrictToMassPeak) { |
168 |
< |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,data, luminosity); |
169 |
< |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,data, luminosity); |
170 |
< |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,data, luminosity); |
171 |
< |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,data, luminosity); |
168 |
> |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,data, luminosity); |
169 |
> |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem", "mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,data, luminosity); |
170 |
> |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,data, luminosity); |
171 |
> |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm","mll",nbins,min,max, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,data, luminosity); |
172 |
|
} |
173 |
|
|
174 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
249 |
|
TIter next(bgleg->GetListOfPrimitives()); |
250 |
|
TObject* obj; |
251 |
|
// Copy the nice bkgd legend skipping the "data" |
252 |
< |
while ( obj = next() ) |
252 |
> |
while ( (obj = next()) ) |
253 |
|
if ( strcmp(((TLegendEntry*)obj)->GetObject()->GetName(),"datahistoOSSF") ) |
254 |
|
kinleg->GetListOfPrimitives()->Add(obj); |
255 |
|
|
268 |
|
TIter next(hmc.GetHists()); |
269 |
|
TObject* obj; |
270 |
|
TH1* hratio = NULL; |
271 |
< |
while ( obj = next() ) { |
271 |
> |
while ( (obj = next()) ) { |
272 |
|
if ( !hratio ) { |
273 |
|
hratio = (TH1*)obj->Clone(); |
274 |
|
hratio->SetName("hratio"); |
329 |
|
TCut cut; |
330 |
|
cut=cutmass&&cutOSSF&&cutnJets&&ibasiccut; |
331 |
|
if(filename=="nJets") cut=cutmass&&cutOSSF&&ibasiccut; |
332 |
+ |
if(filename=="nJets_osof") cut=cutmass&&cutOSOF&&ibasiccut; |
333 |
|
if(filename=="nJets_nocuts_except_mll_ossf") cut=cutmass&&cutOSSF; |
334 |
|
if(filename=="mll") { |
335 |
|
cut=cutOSSF&&cutnJets&&ibasiccut; |
357 |
|
THStack mcstack = allsamples.DrawStack("mcstack",variable,nbins,min,max, xlabel, "events",cut,mc,luminosity); |
358 |
|
if(variable=="pfJetGoodPt[0]") datahisto->SetMaximum(10*datahisto->GetMaximum()); |
359 |
|
if(variable=="pt") datahisto->SetMaximum(10*datahisto->GetMaximum()); |
360 |
< |
if(filename=="mll_inclusive") datahisto->SetMinimum(1); |
360 |
> |
if(filename=="mll_inclusive"||filename=="mll_inclusive_mm"||filename=="mll_inclusive_ee") datahisto->SetMinimum(1); |
361 |
|
if(filename=="mll_osof") datahisto->SetMaximum(10*datahisto->GetMaximum()); |
362 |
|
if(filename=="mll_osof") datahisto->SetMinimum(9); |
302 |
– |
|
363 |
|
datahisto->SetMaximum(5.3*datahisto->GetMaximum()); |
364 |
|
datahisto->Draw("e1"); |
365 |
|
ckin->Update(); |
490 |
|
bool dolog=true; |
491 |
|
bool nolog=false; |
492 |
|
if(doPF) write_warning(__FUNCTION__,"Please use caution when trying to produce PF plots; not all versions of the JZB trees have these variables!"); |
493 |
< |
float mll_low=40; |
493 |
> |
float mll_low=50; |
494 |
|
float mll_hi=160; |
495 |
|
if(!PlottingSetup::RestrictToMassPeak) { |
496 |
< |
mll_low=10; |
496 |
> |
mll_low=20; |
497 |
|
mll_hi=210; |
498 |
|
} |
499 |
< |
/* |
499 |
> |
|
500 |
> |
make_kin_plot("met[4]","",40,0,200,dolog,"MET [GeV]","met",doPF,true); |
501 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll",doPF,true); |
502 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof",doPF,true,true); |
503 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_ee",doPF,true); |
505 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive",doPF,true); |
506 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_ee",doPF,true); |
507 |
|
make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_mm",doPF,true); |
508 |
< |
make_kin_plot("mll","",(int)((mll_hi-mll_low)),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true); |
509 |
< |
make_kin_plot("mll","",(int)((350-mll_low)),mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF);/* |
508 |
> |
make_kin_plot("mll","",(int)((mll_hi-mll_low))/2,mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_inclusive_osof",doPF,true); |
509 |
> |
make_kin_plot("mll","",(int)((350-mll_low)),mll_low,350,dolog,"m_{ll} [GeV]","mll_inclusive_highrange",doPF); |
510 |
|
make_kin_plot("numVtx","",(int)(30.5-(-0.5)),-0.5,30.5,nolog,"N(Vtx)","numVtx",doPF); |
511 |
< |
make_kin_plot("jetpt[0]","",40,0,200,dolog,"leading jet p_{T} [GeV]","pfJetGoodPt_0",doPF); |
512 |
< |
make_kin_plot("jeteta[0]","",40,-5,5,nolog,"leading jet #eta","pfJetGoodEta_0",doPF); |
511 |
> |
// make_kin_plot("jetpt[0]","",40,0,200,dolog,"leading jet p_{T} [GeV]","pfJetGoodPt_0",doPF); |
512 |
> |
// make_kin_plot("jeteta[0]","",40,-5,5,nolog,"leading jet #eta","pfJetGoodEta_0",doPF); |
513 |
|
make_kin_plot("pt","",50,0,400,dolog,"Z p_{T} [GeV]","Zpt",doPF); |
514 |
|
make_kin_plot("pt1","",50,0,100,nolog,"p_{T} [GeV]","pt1",doPF); |
515 |
|
make_kin_plot("pt2","",50,0,100,nolog,"p_{T} [GeV]","pt2",doPF); |
516 |
|
make_kin_plot("eta1","",40,-5,5,nolog,"#eta_{l}","eta",doPF); |
517 |
|
make_kin_plot("jzb[1]","",100,-150,150,dolog,"JZB [GeV]","jzb_ossf",doPF); |
518 |
< |
make_kin_plot("pfJetGoodNum","",8,0.5,8.5,dolog,"nJets","nJets",doPF); |
519 |
< |
make_kin_plot("pfJetGoodNum","",8,0.5,8.5,dolog,"nJets","nJets_nocuts_except_mll_ossf",doPF);*//* |
518 |
> |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets",doPF); |
519 |
> |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_osof",doPF); |
520 |
> |
make_kin_plot("pfJetGoodNum40","",9,-0.5,8.5,dolog,"nJets","nJets_nocuts_except_mll_ossf",doPF); |
521 |
|
if(!doPF) make_special_mll_plot((int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]"); |
522 |
|
stringstream jzbcut; |
523 |
|
jzbcut << "((is_data&&("<<datajzb<<")>100)||(!is_data&&("<<mcjzb<<")>100))"; |
531 |
|
make_kin_plot("mll",jzbcut2.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_aboveJZB150",doPF,true); |
532 |
|
stringstream jzbcut3; |
533 |
|
jzbcut3 << "((is_data&&("<<datajzb<<")>50)||(!is_data&&("<<mcjzb<<")>50))"; |
534 |
< |
make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_aboveJZB50",doPF,true); make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_aboveJZB50",doPF,true,true); |
535 |
< |
*/ |
534 |
> |
make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_aboveJZB50",doPF,true); |
535 |
> |
make_kin_plot("mll",jzbcut3.str(),(int)((mll_hi-mll_low)/5),mll_low,mll_hi,dolog,"m_{ll} [GeV]","mll_osof_aboveJZB50",doPF,true,true); |
536 |
> |
|
537 |
> |
make_special_obs_pred_mll_plot(mcjzb,0); |
538 |
|
make_special_obs_pred_mll_plot(mcjzb,50); |
539 |
|
make_special_obs_pred_mll_plot(mcjzb,100); |
540 |
|
make_special_obs_pred_mll_plot(mcjzb,150); |
611 |
|
|
612 |
|
|
613 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- the arguments changed |
614 |
< |
for(int ijzb=0;ijzb<jzb_cuts.size();ijzb++) { |
614 |
> |
for(int ijzb=0;ijzb<(int)jzb_cuts.size();ijzb++) { |
615 |
|
float jzbcut=jzb_cuts[ijzb]; // Comparison plots are done for this JZB cut |
616 |
|
float mll_low=50;float mll_high=170; |
617 |
|
if(!PlottingSetup::RestrictToMassPeak) { |
918 |
|
return return_functions; |
919 |
|
} |
920 |
|
|
921 |
< |
void do_prediction_plot(string jzb, TCanvas *globalcanvas, float sigma, float high, int use_data, bool overlay_signal = false,string subdir="" ) |
921 |
> |
void do_prediction_plot(string jzb, TCanvas *globalcanvas, float high, int use_data, bool overlay_signal = false,string subdir="" ) |
922 |
|
{ |
859 |
– |
// note: sigma is not used ATM |
923 |
|
switch_overunderflow(true); |
924 |
|
bool is_data=false; |
925 |
|
bool use_signal=false; |
930 |
|
float low=0; |
931 |
|
float hi=500; |
932 |
|
|
870 |
– |
stringstream largerzeroS; |
871 |
– |
largerzeroS << "("<<jzb<<">0)"; |
872 |
– |
TCut largerzero(largerzeroS.str().c_str()); |
873 |
– |
stringstream smallerzeroS; |
874 |
– |
smallerzeroS << "("<<jzb<<"<0)"; |
875 |
– |
TCut smallerzero(smallerzeroS.str().c_str()); |
876 |
– |
|
933 |
|
TH1F *blankback = new TH1F("blankback","blankback",int(high/10),0,high); |
934 |
< |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
935 |
< |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
936 |
< |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
937 |
< |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
934 |
> |
TH1F *RcorrJZBeemm = allsamples.Draw("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
935 |
> |
TH1F *LcorrJZBeemm = allsamples.Draw("LcorrJZBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
936 |
> |
TH1F *RcorrJZBem = allsamples.Draw("RcorrJZBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
937 |
> |
TH1F *LcorrJZBem = allsamples.Draw("LcorrJZBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
938 |
|
|
939 |
|
blankback->GetXaxis()->SetTitle(RcorrJZBeemm->GetXaxis()->GetTitle()); |
940 |
|
blankback->GetYaxis()->SetTitle(RcorrJZBeemm->GetYaxis()->GetTitle()); |
951 |
|
|
952 |
|
//these are for the ratio |
953 |
|
|
954 |
< |
TH1F *JRcorrJZBeemm = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
955 |
< |
TH1F *JLcorrJZBeemm = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
956 |
< |
TH1F *JRcorrJZBem = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
957 |
< |
TH1F *JLcorrJZBem = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
954 |
> |
TH1F *JRcorrJZBeemm = allsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
955 |
> |
TH1F *JLcorrJZBeemm = allsamples.Draw("JLcorrJZBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
956 |
> |
TH1F *JRcorrJZBem = allsamples.Draw("JRcorrJZBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
957 |
> |
TH1F *JLcorrJZBem = allsamples.Draw("JLcorrJZBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
958 |
|
|
959 |
|
TH1F *JRcorrJZBSBem; |
960 |
|
TH1F *JLcorrJZBSBem; |
961 |
|
TH1F *JRcorrJZBSBeemm; |
962 |
|
TH1F *JLcorrJZBSBeemm; |
963 |
|
|
964 |
< |
if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,false); |
964 |
> |
if(use_data==2 || overlay_signal) RcorrJZBeemmNoS = allsamples.Draw("RcorrJZBeemmNoS",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,false); |
965 |
|
|
966 |
|
|
967 |
|
if(PlottingSetup::RestrictToMassPeak) { |
968 |
< |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
969 |
< |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
970 |
< |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
971 |
< |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
968 |
> |
RcorrJZBSBem = allsamples.Draw("RcorrJZBSBem",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
969 |
> |
LcorrJZBSBem = allsamples.Draw("LcorrJZBSBem",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
970 |
> |
RcorrJZBSBeemm = allsamples.Draw("RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
971 |
> |
LcorrJZBSBeemm = allsamples.Draw("LcorrJZBSBeemm",("-"+jzb).c_str(),nbins,low,hi, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
972 |
|
|
973 |
|
//these are for the ratio |
974 |
< |
JRcorrJZBSBem = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
975 |
< |
JLcorrJZBSBem = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
976 |
< |
JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,use_signal); |
977 |
< |
JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets&&smallerzero,is_data, luminosity,use_signal); |
974 |
> |
JRcorrJZBSBem = allsamples.Draw("JRcorrJZBSBem",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
975 |
> |
JLcorrJZBSBem = allsamples.Draw("JLcorrJZBSBem",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSOF&&cutnJets,is_data, luminosity,use_signal); |
976 |
> |
JRcorrJZBSBeemm = allsamples.Draw("JRcorrJZBSBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
977 |
> |
JLcorrJZBSBeemm = allsamples.Draw("JLcorrJZBSBeemm",("-"+jzb).c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", sidebandcut&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
978 |
|
} |
979 |
|
|
980 |
|
TH1F *lm4RcorrJZBeemm; |
981 |
< |
if(overlay_signal || use_data == 2 || use_data == 1) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets&&largerzero,is_data, luminosity,allsamples.FindSample("LM")); |
981 |
> |
if(overlay_signal || use_data == 2 || use_data == 1) lm4RcorrJZBeemm = allsamples.Draw("lm4RcorrJZBSBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,allsamples.FindSample("LM")); |
982 |
|
|
983 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed. |
984 |
|
|
987 |
|
|
988 |
|
TH1F *Bpred = (TH1F*)LcorrJZBeemm->Clone("Bpred"); |
989 |
|
TH1F *JBpred = (TH1F*)JLcorrJZBeemm->Clone("Bpred"); |
990 |
+ |
|
991 |
+ |
TH1F *BpredSys = new TH1F("Bpredsys","Bpredsys",PlottingSetup::global_ratio_binning.size()-1,&PlottingSetup::global_ratio_binning[0]); |
992 |
+ |
ClearHisto(BpredSys); |
993 |
+ |
|
994 |
|
if(PlottingSetup::RestrictToMassPeak) { |
995 |
|
Bpred->Add(RcorrJZBem,1.0/3.); |
996 |
|
Bpred->Add(LcorrJZBem,-1.0/3.); |
1013 |
|
JBpred->Add(JLcorrJZBSBem,-1.0/3.); |
1014 |
|
JBpred->Add(JRcorrJZBSBeemm,1.0/3.); |
1015 |
|
JBpred->Add(JLcorrJZBSBeemm,-1.0/3.); |
1016 |
+ |
|
1017 |
+ |
//Systematics: |
1018 |
+ |
AddSquared(BpredSys,JLcorrJZBeemm,zjetsestimateuncertONPEAK*zjetsestimateuncertONPEAK); |
1019 |
+ |
AddSquared(BpredSys,JRcorrJZBem,emuncertONPEAK*emuncertONPEAK*(1.0/9)); |
1020 |
+ |
AddSquared(BpredSys,JLcorrJZBem,emuncertONPEAK*emuncertONPEAK*(1.0/9)); |
1021 |
+ |
AddSquared(BpredSys,JRcorrJZBSBem,emsidebanduncertONPEAK*emsidebanduncertONPEAK*(1.0/9)); |
1022 |
+ |
AddSquared(BpredSys,JLcorrJZBSBem,emsidebanduncertONPEAK*emsidebanduncertONPEAK*(1.0/9)); |
1023 |
+ |
AddSquared(BpredSys,JRcorrJZBSBeemm,eemmsidebanduncertONPEAK*eemmsidebanduncertONPEAK*(1.0/9)); |
1024 |
+ |
AddSquared(BpredSys,JLcorrJZBSBeemm,eemmsidebanduncertONPEAK*eemmsidebanduncertONPEAK*(1.0/9)); |
1025 |
|
} else { |
1026 |
|
Bpred->Add(RcorrJZBem,1.0); |
1027 |
|
Bpred->Add(LcorrJZBem,-1.0); |
1031 |
|
//these are for the ratio |
1032 |
|
JBpred->Add(JRcorrJZBem,1.0); |
1033 |
|
JBpred->Add(JLcorrJZBem,-1.0); |
1034 |
+ |
|
1035 |
+ |
//Systematics |
1036 |
+ |
AddSquared(BpredSys,JLcorrJZBeemm,zjetsestimateuncertOFFPEAK*zjetsestimateuncertOFFPEAK); |
1037 |
+ |
AddSquared(BpredSys,JRcorrJZBem,emuncertOFFPEAK*emuncertOFFPEAK); |
1038 |
+ |
AddSquared(BpredSys,JLcorrJZBem,emuncertOFFPEAK*emuncertOFFPEAK); |
1039 |
+ |
|
1040 |
|
} |
1041 |
|
|
1042 |
< |
|
1042 |
> |
SQRT(BpredSys); |
1043 |
> |
BpredSys->Divide(JBpred); |
1044 |
> |
|
1045 |
|
|
1046 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak ---- prediction changed |
1047 |
|
TH1F *Tpred = (TH1F*)RcorrJZBem->Clone("Bpred"); |
1086 |
|
blankback->Draw(); |
1087 |
|
if(use_data==1) |
1088 |
|
{ |
1089 |
+ |
//Bpred->SetLineWidth(3); //paper style.overruled. |
1090 |
+ |
//lm4RcorrJZBeemm->SetLineWidth(3); //paper style.overruled. |
1091 |
|
analytical_function = do_extended_fit_to_plot(Bpred,Tpred,LcorrJZBeemm,LcorrJZBem,is_data); |
1092 |
|
kinpad->cd();//necessary because the extended fit function creates its own canvas |
1093 |
|
RcorrJZBeemm->Draw("e1x0,same"); |
1094 |
|
|
1095 |
|
Bpred->Draw("hist,same"); |
1096 |
< |
analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
1096 |
> |
//analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
1097 |
|
RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP! |
1098 |
|
lm4RcorrJZBeemm->Draw("hist,same"); |
1099 |
|
legBpred->AddEntry(RcorrJZBeemm,"observed","p"); |
1100 |
|
legBpred->AddEntry(Bpred,"predicted","l"); |
1101 |
< |
legBpred->AddEntry(analytical_function[1],"predicted fit","l"); |
1102 |
< |
legBpred->AddEntry(analytical_function[2],"stat. uncert.","l"); |
1103 |
< |
if ( overlay_signal ) legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
1101 |
> |
// legBpred->AddEntry(analytical_function[1],"predicted fit","l"); |
1102 |
> |
// legBpred->AddEntry(analytical_function[2],"stat. uncert.","l"); |
1103 |
> |
legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
1104 |
|
legBpred->Draw(); |
1105 |
|
DrawPrelim(); |
1106 |
|
|
1129 |
|
Bpred->Draw("hist,same"); |
1130 |
|
// analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
1131 |
|
RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP! |
1132 |
< |
// TH1F *lm4RcorrJZBeemmC = (TH1F*)lm4RcorrJZBeemm->Clone("lm4RcorrJZBeemmC"); |
1054 |
< |
// lm4RcorrJZBeemmC->SetLineColor(kOrange+1); |
1055 |
< |
lm4RcorrJZBeemm->SetLineColor(kOrange+1); |
1056 |
< |
// lm4RcorrJZBeemmC->Draw("histo,same"); |
1132 |
> |
// lm4RcorrJZBeemm->SetLineColor(kOrange+1); |
1133 |
|
lm4RcorrJZBeemm->SetLineWidth(2); |
1134 |
+ |
//lm4RcorrJZBeemm->SetLineWidth(2); // paper style. overruled. |
1135 |
|
lm4RcorrJZBeemm->Draw("histo,same"); |
1136 |
|
DrawPrelim(); |
1137 |
|
TLegend *speciallegBpred = make_legend("",0.45,0.55); |
1138 |
+ |
//TLegend *speciallegBpred = make_legend("",0.35,0.55); // paper style. overruled. |
1139 |
|
speciallegBpred->AddEntry(RcorrJZBeemm,"Data","pl"); |
1140 |
|
speciallegBpred->AddEntry(Bpred,"Total background","l"); |
1141 |
|
speciallegBpred->AddEntry(jzbnegative,"JZB<0 (data)","f"); |
1142 |
< |
speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f"); |
1142 |
> |
if(PlottingSetup::RestrictToMassPeak) speciallegBpred->AddEntry(sidebandsemu,"Sidebands/e#mu (data)","f"); |
1143 |
> |
else speciallegBpred->AddEntry(sidebandsemu,"e#mu (data)","f"); |
1144 |
|
// speciallegBpred->AddEntry(lm4RcorrJZBeemmC,"LM4","l"); |
1145 |
|
speciallegBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
1146 |
|
speciallegBpred->Draw(); |
1147 |
< |
save_with_ratio(JRcorrJZBeemm,JBpred,predcomppad,subdir+"Bpred_Data_____PredictionComposition",true,use_data!=1,"data/pred"); |
1147 |
> |
save_with_ratio(JRcorrJZBeemm,JBpred,predcomppad,subdir+"Bpred_Data_____PredictionComposition",true,true,"data/pred",BpredSys); |
1148 |
|
|
1149 |
|
TCanvas *specialcanv = new TCanvas("specialcanv","specialcanv"); |
1150 |
< |
THStack kostack = allsamples.DrawStack("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,!is_data, luminosity,use_signal); |
1150 |
> |
specialcanv->SetLogy(1); |
1151 |
> |
// THStack kostack = allsamples.DrawStack("RcorrJZBeemm",jzb.c_str(),nbins,low,hi, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,!is_data, luminosity,use_signal); |
1152 |
|
blankback->Draw(); |
1153 |
< |
kostack.Draw("same"); |
1153 |
> |
// kostack.Draw("same"); |
1154 |
> |
predcomposition.Draw(); |
1155 |
|
Bpred->Draw("hist,same"); |
1156 |
< |
analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
1156 |
> |
//analytical_function[0]->Draw("same"); analytical_function[1]->Draw("same");analytical_function[2]->Draw("same"); |
1157 |
|
RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP! |
1158 |
|
legBpred->Draw(); |
1159 |
|
DrawPrelim(); |
1168 |
|
} |
1169 |
|
if(use_data==0) { |
1170 |
|
RcorrJZBeemm->Draw("e1x0,same"); |
1171 |
+ |
//Bpred->SetLineWidth(3); // paper style. overruled. |
1172 |
|
Bpred->Draw("hist,same"); |
1173 |
|
RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP! |
1174 |
|
legBpred->AddEntry(RcorrJZBeemm,"MC true","p"); |
1175 |
< |
legBpred->AddEntry(Bpred,"MC predicted","l"); |
1175 |
> |
legBpred->AddEntry(Bpred,"MC predicted","l"); |
1176 |
|
if(versok) legBpred->AddEntry((TObject*)0,"",""); // Just for alignment // causes seg fault on root v5.18 |
1177 |
|
if(versok) legBpred->AddEntry((TObject*)0,"",""); // causes seg fault on root v5.18 |
1178 |
|
if ( overlay_signal ) legBpred->AddEntry(lm4RcorrJZBeemm,"LM4","l"); |
1183 |
|
} |
1184 |
|
if(use_data==2) { |
1185 |
|
RcorrJZBeemm->Draw("e1x0,same"); |
1186 |
+ |
//Bpred->SetLineWidth(3); // paper style. overruled. |
1187 |
|
Bpred->Draw("hist,same"); |
1188 |
|
RcorrJZBeemm->Draw("e1x0,same");//HAVE IT ON TOP! |
1189 |
|
legBpred->AddEntry(RcorrJZBeemm,"MC true","p"); |
1199 |
|
// CompleteSave(globalcanvas,"Bpred_MCwithS"); // done below in save_with_ratio |
1200 |
|
} |
1201 |
|
{ |
1202 |
+ |
//lm4RcorrJZBeemm->SetLineWidth(3); //paper style. overruled. |
1203 |
+ |
//RcorrJZBeemmNoS->SetLineWidth(3); //paper style. overruled. |
1204 |
+ |
//lm4RcorrJZBeemm->SetLineStyle(2); //paper style. overruled. |
1205 |
+ |
//RcorrJZBeemmNoS->SetLineStyle(3); //paper style. overruled. |
1206 |
+ |
//lm4RcorrJZBeemm->SetLineColor(kOrange+1); //paper style. overruled. |
1207 |
+ |
|
1208 |
|
RcorrJZBeemmNoS->SetLineStyle(2); |
1209 |
|
legBpred2->AddEntry(RcorrJZBeemmNoS,"MC B","l"); |
1210 |
|
legBpred2->AddEntry(lm4RcorrJZBeemm,"MC S","l"); |
1224 |
|
string ytitle("ratio"); |
1225 |
|
if ( use_data==1 ) ytitle = "data/pred"; |
1226 |
|
//save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,Bpredsaveas,true,use_data!=1,ytitle); |
1227 |
< |
save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,false,ytitle);//not extending the y range anymore up to 4 |
1227 |
> |
save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,subdir+Bpredsaveas,true,true,ytitle,BpredSys);//not extending the y range anymore up to 4 |
1228 |
|
|
1229 |
|
|
1230 |
|
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1231 |
< |
/// The part below is meaningless for the offpeak analysis (it's a comparison of the different estimates but there is but one estimate!) |
1231 |
> |
// The part below is meaningless for the offpeak analysis (it's a comparison of the different estimates but there is but one estimate!) |
1232 |
|
if(PlottingSetup::RestrictToMassPeak) { |
1233 |
|
TH1F *Bpredem = (TH1F*)LcorrJZBeemm->Clone("Bpredem"); |
1234 |
|
Bpredem->Add(RcorrJZBem); |
1302 |
|
|
1303 |
|
delete blankback; |
1304 |
|
|
1305 |
+ |
delete BpredSys; |
1306 |
|
if(PlottingSetup::RestrictToMassPeak) { |
1307 |
|
delete RcorrJZBSBem; |
1308 |
|
delete LcorrJZBSBem; |
1320 |
|
|
1321 |
|
void do_prediction_plots(string mcjzb, string datajzb, float DataSigma, float MCSigma, bool overlay_signal ) { |
1322 |
|
TCanvas *globalcanvas = new TCanvas("globalcanvas","Prediction Canvas"); |
1323 |
< |
do_prediction_plot(datajzb,globalcanvas,DataSigma,jzbHigh ,data,overlay_signal); |
1324 |
< |
do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mc,overlay_signal); |
1325 |
< |
do_prediction_plot(mcjzb,globalcanvas,MCSigma,jzbHigh ,mcwithsignal,overlay_signal); |
1323 |
> |
do_prediction_plot(datajzb,globalcanvas,jzbHigh ,data,overlay_signal); |
1324 |
> |
if ( !PlottingSetup::Approved ) { |
1325 |
> |
do_prediction_plot(mcjzb,globalcanvas,jzbHigh ,mc,overlay_signal); |
1326 |
> |
do_prediction_plot(mcjzb,globalcanvas,jzbHigh ,mcwithsignal,overlay_signal); |
1327 |
> |
} else { |
1328 |
> |
write_info(__FUNCTION__,"You set approved to true, therefore not producing prediction/observation plots for MC with and without signal."); |
1329 |
> |
} |
1330 |
|
} |
1331 |
|
|
1332 |
|
void do_ratio_plot(int is_data,vector<float> binning, string jzb, TCanvas *can, float high=-9999) { |
1746 |
|
|
1747 |
|
|
1748 |
|
dout << "Going to increase the cross section for diboson samples ... " << endl; |
1749 |
< |
for(int i=0;i<SamplesToBeModified.size();i++) { |
1749 |
> |
for(int i=0;i<(int)SamplesToBeModified.size();i++) { |
1750 |
|
float origxs=(allsamples.collection)[SamplesToBeModified[i]].xs; |
1751 |
|
(allsamples.collection)[SamplesToBeModified[i]].xs=origxs*stretchfactor; |
1752 |
|
dout << " Increased xs for sample " << (allsamples.collection)[SamplesToBeModified[i]].filename << " from " << origxs << " to " << (allsamples.collection)[SamplesToBeModified[i]].xs << " (by a factor of " << stretchfactor << ")" << endl; |
1758 |
|
dout << "Going to produce JZB plots" << endl; |
1759 |
|
produce_stretched_jzb_plots(mcjzb,datajzb,ratio_binning); |
1760 |
|
TCanvas *gloca = new TCanvas("gloca","gloca"); |
1667 |
– |
float sigma=123456; |
1761 |
|
|
1762 |
|
dout << "Going to produce prediction plots" << endl; |
1763 |
< |
do_prediction_plot(mcjzb, gloca, sigma, PlottingSetup::jzbHigh, 0, false,"Dibosons/Bpred/" ); // do only MC plots, no signal |
1764 |
< |
do_prediction_plot(mcjzb, gloca, sigma, PlottingSetup::jzbHigh, 0, false,"Dibosons/Bpred/" ); // do MC plots with signal |
1763 |
> |
do_prediction_plot(mcjzb, gloca, PlottingSetup::jzbHigh, 0, false,"Dibosons/Bpred/" ); // do only MC plots, no signal |
1764 |
> |
do_prediction_plot(mcjzb, gloca, PlottingSetup::jzbHigh, 0, false,"Dibosons/Bpred/" ); // do MC plots with signal |
1765 |
|
delete gloca; |
1766 |
|
|
1767 |
|
dout << "Going to reset the cross section for diboson samples ... " << endl; |
1768 |
< |
for(int i=0;i<SamplesToBeModified.size();i++) { |
1768 |
> |
for(int i=0;i<(int)SamplesToBeModified.size();i++) { |
1769 |
|
float Upxs=(allsamples.collection)[SamplesToBeModified[i]].xs; |
1770 |
|
(allsamples.collection)[SamplesToBeModified[i]].xs=(allsamples.collection)[SamplesToBeModified[i]].xs*(1.0/stretchfactor); |
1771 |
|
string Upname=(allsamples.collection)[SamplesToBeModified[i]].samplename; |
1788 |
|
for(int i=0;i<=coarserbins;i++)coarse_binning.push_back(min+i*(max-min)/((float)coarserbins)); |
1789 |
|
for(int i=0;i<=rebinnedbins;i++)coarsest_binning.push_back(min+i*(max-min)/((float)rebinnedbins)); |
1790 |
|
|
1791 |
< |
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP",can,binning); |
1792 |
< |
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP",can,binning); |
1793 |
< |
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_SFZP",can,binning); |
1794 |
< |
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_SFZP",can,binning); |
1795 |
< |
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_OFZP",can,binning); |
1796 |
< |
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_OFZP",can,binning); |
1797 |
< |
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1798 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning); |
1799 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning); |
1791 |
> |
if ( !PlottingSetup::Approved ) { |
1792 |
> |
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP",can,binning); |
1793 |
> |
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP",can,binning); |
1794 |
> |
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_SFZP",can,binning); |
1795 |
> |
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_SFZP",can,binning); |
1796 |
> |
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==0",datajzb,mcjzb,"ee/jzb_OS_OFZP",can,binning); |
1797 |
> |
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass&&"id1==1",datajzb,mcjzb,"mm/jzb_OS_OFZP",can,binning); |
1798 |
> |
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1799 |
> |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB",can,binning); |
1800 |
> |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB",can,binning); |
1801 |
> |
} |
1802 |
|
|
1803 |
|
draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP_coarse",can,coarse_binning); |
1804 |
< |
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarse",can,coarse_binning); |
1805 |
< |
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1806 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning); |
1807 |
< |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning); |
1808 |
< |
|
1809 |
< |
// draw_pure_jzb_histo(cutOSSF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_SFZP_coarsest",can,coarsest_binning); |
1715 |
< |
// draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarsest",can,coarsest_binning); |
1716 |
< |
// flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1717 |
< |
// if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarsest",can,coarsest_binning); |
1718 |
< |
// if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarsest",can,coarsest_binning); |
1804 |
> |
if ( !PlottingSetup::Approved ) { |
1805 |
> |
draw_pure_jzb_histo(cutOSOF&&cutnJets&&cutmass,datajzb,mcjzb,"jzb_OS_OFZP_coarse",can,coarse_binning); |
1806 |
> |
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
1807 |
> |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSSF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_SFSB_coarse",can,coarse_binning); |
1808 |
> |
if(PlottingSetup::RestrictToMassPeak) draw_pure_jzb_histo(cutOSOF&&cutnJets&&sidebandcut,datajzb,mcjzb,"jzb_OS_OFSB_coarse",can,coarse_binning); |
1809 |
> |
} |
1810 |
|
delete can; |
1811 |
|
} |
1812 |
|
|
1862 |
|
string posneg[] = {"pos","neg"}; |
1863 |
|
TCut tkRegions[] = {cutOSSF&&cutnJets&&cutmass,cutOSOF&&cutnJets&&cutmass,cutOSSF&&cutnJets&&sidebandcut,cutOSOF&&cutnJets&&sidebandcut}; |
1864 |
|
|
1865 |
< |
for(int ijzb=0;ijzb<jzb_cuts.size();ijzb++) { |
1865 |
> |
for(int ijzb=0;ijzb<(int)jzb_cuts.size();ijzb++) { |
1866 |
|
TCut jzbMC[] = { give_jzb_expression(mcjzb,jzb_cuts[ijzb],"pos"), give_jzb_expression(mcjzb,jzb_cuts[ijzb],"neg") }; |
1867 |
|
dout << "_________________________________________________________" << endl; |
1868 |
|
dout << "Table for JZB> " << jzb_cuts[ijzb] << endl; |
1869 |
< |
for(int isample=0;isample<(allsamples.collection).size();isample++) { |
1869 |
> |
for(int isample=0;isample<(int)(allsamples.collection).size();isample++) { |
1870 |
|
if(!(allsamples.collection)[isample].is_data) dout << (allsamples.collection)[isample].samplename << " & "; |
1871 |
|
else dout << "Sample & "; |
1872 |
|
for(int iregion=0;iregion<nRegions;iregion++) { |
2125 |
|
|
2126 |
|
void draw_ttbar_and_zjets_shape(string mcjzb, string datajzb) { |
2127 |
|
int all_leptons=-1; |
2037 |
– |
int electrons_only=0; |
2038 |
– |
int mu_only=1; |
2039 |
– |
int twojetswith50gev=1; |
2128 |
|
int threejetswith30gev=0; |
2129 |
|
/* |
2130 |
+ |
int twojetswith50gev=1; |
2131 |
+ |
int electrons_only=0; |
2132 |
+ |
int mu_only=1; |
2133 |
+ |
|
2134 |
|
draw_ttbar_and_zjets_shape_for_one_configuration(mcjzb,datajzb,all_leptons,twojetswith50gev); |
2135 |
|
draw_ttbar_and_zjets_shape_for_one_configuration(mcjzb,datajzb,all_leptons,threejetswith30gev); |
2136 |
|
|
2144 |
|
draw_ttbar_and_zjets_shape_for_one_configuration(mcjzb,datajzb,all_leptons,threejetswith30gev,true); |
2145 |
|
} |
2146 |
|
|
2147 |
< |
void find_correction_factors(string &jzbvardata,string &jzbvarmc) { |
2056 |
< |
//first: colorful plots |
2147 |
> |
float find_one_correction_factor(string FindKeyword, TCut SpecialCut, string SaveAs) { |
2148 |
|
TCanvas *cancorr = new TCanvas("cancorr","Canvas for Response Correction"); |
2149 |
|
cancorr->SetLogz(); |
2150 |
|
cancorr->SetRightMargin(0.13); |
2151 |
< |
flag_this_change(__FUNCTION__,__LINE__,true);//PlottingSetup::RestrictToMassPeak |
2152 |
< |
TCut zptforresponsepresentation("pt<600"&&cutmass&&cutOSSF&&"((sumJetPt[1]/pt)<5.0)"); |
2151 |
> |
TCut zptforresponsepresentation("pt<600"&&cutmass&&cutOSSF&&"((sumJetPt[1]/pt)<5.0)"&&SpecialCut&&passtrig); |
2152 |
> |
if(PlottingSetup::DoBTag) zptforresponsepresentation=zptforresponsepresentation&&PlottingSetup::bTagRequirement; |
2153 |
|
TH2F *niceresponseplotd = new TH2F("niceresponseplotd","",100,0,600,100,0,5); |
2154 |
< |
(allsamples.collection)[allsamples.FindSample("Data")[0]].events->Draw("sumJetPt[1]/pt:pt>>niceresponseplotd",zptforresponsepresentation); |
2154 |
> |
vector<int> SampleIndices=allsamples.FindSample(FindKeyword); |
2155 |
> |
for(int iSample=0;iSample<SampleIndices.size();iSample++) { |
2156 |
> |
dout << " Response correction : Using sample " << (allsamples.collection)[SampleIndices[iSample]].filename << " for " << FindKeyword << endl; |
2157 |
> |
(allsamples.collection)[SampleIndices[iSample]].events->Draw("sumJetPt[1]/pt:pt>>+niceresponseplotd",zptforresponsepresentation*cutWeight); |
2158 |
> |
} |
2159 |
> |
|
2160 |
|
niceresponseplotd->SetStats(0); |
2161 |
|
niceresponseplotd->GetXaxis()->SetTitle("Z p_{T} [GeV]"); |
2162 |
|
niceresponseplotd->GetYaxis()->SetTitle("Response"); |
2165 |
|
niceresponseplotd->Draw("COLZ"); |
2166 |
|
TProfile * profd = (TProfile*)niceresponseplotd->ProfileX(); |
2167 |
|
profd->SetMarkerSize(DataMarkerSize); |
2168 |
< |
profd->Fit("pol0","","same,e1",30,400); |
2168 |
> |
profd->Fit("pol0","","same,e1",100,400); |
2169 |
|
DrawPrelim(); |
2170 |
< |
TText* title = write_text(0.5,0.7,"Data"); |
2170 |
> |
string stitle="Data"; |
2171 |
> |
if(!Contains(FindKeyword,"Data")) stitle="MC"; |
2172 |
> |
TText* title = write_text(0.5,0.7,stitle.c_str()); |
2173 |
|
title->SetTextAlign(12); |
2174 |
|
title->Draw(); |
2175 |
|
TF1 *datapol=(TF1*)profd->GetFunction("pol0"); |
2176 |
< |
float datacorrection=datapol->GetParameter(0); |
2177 |
< |
stringstream dataresstring; |
2178 |
< |
dataresstring<<"Response: "<<std::setprecision(2)<<100*datacorrection<<" %"; |
2179 |
< |
TText* restitle = write_text(0.5,0.65,dataresstring.str()); |
2176 |
> |
float correction=datapol->GetParameter(0); |
2177 |
> |
stringstream resstring; |
2178 |
> |
resstring<<"Response: "<<std::setprecision(2)<<100*correction<<" %"; |
2179 |
> |
TText* restitle = write_text(0.5,0.65,resstring.str()); |
2180 |
|
restitle->SetTextAlign(12); |
2181 |
|
restitle->SetTextSize(0.03); |
2182 |
|
restitle->Draw(); |
2183 |
< |
CompleteSave(cancorr,"ResponseCorrection/Response_Correction_Illustration_Data"); |
2184 |
< |
|
2185 |
< |
TH2F *niceresponseplotm = new TH2F("niceresponseplotm","",100,0,600,100,0,5); |
2186 |
< |
(allsamples.collection)[allsamples.FindSample("DY")[0]].events->Draw("sumJetPt[1]/pt:pt>>niceresponseplotm",zptforresponsepresentation); |
2187 |
< |
niceresponseplotm->SetStats(0); |
2188 |
< |
niceresponseplotm->GetXaxis()->SetTitle("Z p_{T} [GeV]"); |
2189 |
< |
niceresponseplotm->GetYaxis()->SetTitle("Response"); |
2092 |
< |
niceresponseplotm->GetXaxis()->CenterTitle(); |
2093 |
< |
niceresponseplotm->GetYaxis()->CenterTitle(); |
2094 |
< |
niceresponseplotm->Draw("COLZ"); |
2095 |
< |
(allsamples.collection)[allsamples.FindSample("DY")[0]].events->Draw("sumJetPt[1]/pt:pt",zptforresponsepresentation,"PROF,same"); |
2096 |
< |
TProfile * profm = (TProfile*)niceresponseplotm->ProfileX(); |
2097 |
< |
profm->SetMarkerSize(DataMarkerSize); |
2098 |
< |
profm->Fit("pol0","","same,e1",30,400); |
2099 |
< |
DrawMCPrelim(); |
2100 |
< |
title = write_text(0.5,0.7,"MC simulation"); |
2101 |
< |
title->SetTextAlign(12); |
2102 |
< |
title->Draw(); |
2103 |
< |
TF1 *mcpol=(TF1*)profm->GetFunction("pol0"); |
2104 |
< |
float mccorrection=mcpol->GetParameter(0); |
2105 |
< |
stringstream mcresstring; |
2106 |
< |
mcresstring<<"Response: "<<std::setprecision(2)<<100*mccorrection<<" %"; |
2107 |
< |
TText* mcrestitle = write_text(0.5,0.65,mcresstring.str()); |
2108 |
< |
mcrestitle->SetTextAlign(12); |
2109 |
< |
mcrestitle->SetTextSize(0.03); |
2110 |
< |
mcrestitle->Draw(); |
2111 |
< |
CompleteSave(cancorr,"ResponseCorrection/Response_Correction_Illustration_MC"); |
2183 |
> |
CompleteSave(cancorr,"ResponseCorrection/Response_Correction_Illustration_New_"+SaveAs); |
2184 |
> |
delete cancorr; |
2185 |
> |
delete niceresponseplotd; |
2186 |
> |
return correction; |
2187 |
> |
} |
2188 |
> |
|
2189 |
> |
void find_correction_factors(string &jzbvardata,string &jzbvarmc) { |
2190 |
|
|
2191 |
+ |
dout << "Computing response corrections: " << endl; |
2192 |
+ |
//Step 1 : Get results |
2193 |
+ |
float datacorrection=find_one_correction_factor("Data","","Data"); |
2194 |
+ |
float mccorrection=find_one_correction_factor("DY","","MC"); |
2195 |
+ |
|
2196 |
+ |
float dataEEcorrection=find_one_correction_factor("Data","id1==0","Data_ee"); |
2197 |
+ |
float mcEEcorrection=find_one_correction_factor("DY","id1==0","MC_ee"); |
2198 |
+ |
|
2199 |
+ |
float dataMMcorrection=find_one_correction_factor("Data","id1==1","Data_mm"); |
2200 |
+ |
float mcMMcorrection=find_one_correction_factor("DY","id1==1","MC_mm"); |
2201 |
+ |
|
2202 |
+ |
cout << "Corrections : " << endl; |
2203 |
+ |
cout << " Data : " << datacorrection << endl; |
2204 |
+ |
cout << " ee (" << dataEEcorrection << ") , mm (" << dataMMcorrection << ")" << endl; |
2205 |
+ |
cout << " MC : " << mccorrection << endl; |
2206 |
+ |
cout << " ee (" << mcEEcorrection << ") , mm (" << mcMMcorrection << ")" << endl; |
2207 |
|
|
2208 |
< |
//Step 2: Getting the result |
2115 |
< |
// TCut zptcutforresponse("pt>30&&pt<300&&TMath::Abs(91.2-mll)<20&&id1==id2&&(ch1*ch2<0)"); |
2208 |
> |
//Step 2: Processing the result and making it into something useful :-) |
2209 |
|
stringstream jzbvardatas; |
2210 |
< |
if(datacorrection>1) jzbvardatas<<"(jzb[1]-"<<datacorrection-1<<"*pt)"; |
2211 |
< |
if(datacorrection<1) jzbvardatas<<"(jzb[1]+"<<1-datacorrection<<"*pt)"; |
2210 |
> |
jzbvardatas << "("; |
2211 |
> |
|
2212 |
> |
if(dataEEcorrection>=1) jzbvardatas<<"((id1==0&&id1==id2)*(jzb[1]-" << dataEEcorrection-1 << "*pt))"; |
2213 |
> |
if(dataEEcorrection<1) jzbvardatas<<"((id1==0&&id1==id2)*(jzb[1]+" << 1-dataEEcorrection << "*pt))"; |
2214 |
> |
|
2215 |
> |
if(dataMMcorrection>=1) jzbvardatas<<"+((id1==1&&id1==id2)*(jzb[1]-" << dataMMcorrection-1 << "*pt))"; |
2216 |
> |
if(dataMMcorrection<1) jzbvardatas<<"+((id1==1&&id1==id2)*(jzb[1]+" << 1-dataMMcorrection << "*pt))"; |
2217 |
> |
|
2218 |
> |
float averagecorrection=(dataMMcorrection+dataEEcorrection)/2.0; |
2219 |
> |
|
2220 |
> |
if(datacorrection>=1) jzbvardatas<<"+((id1!=id2)*(jzb[1]-" << datacorrection-1 << "*pt))"; |
2221 |
> |
if(datacorrection<1) jzbvardatas<<"+((id1!=id2)*(jzb[1]+" << 1-datacorrection << "*pt))"; |
2222 |
> |
|
2223 |
> |
jzbvardatas << ")"; |
2224 |
|
jzbvardata=jzbvardatas.str(); |
2225 |
+ |
|
2226 |
|
stringstream jzbvarmcs; |
2227 |
< |
if(mccorrection>1) jzbvarmcs<<"(jzb[1]-"<<mccorrection-1<<"*pt)"; |
2228 |
< |
if(mccorrection<1) jzbvarmcs<<"(jzb[1]+"<<1-mccorrection<<"*pt)"; |
2227 |
> |
jzbvarmcs << "("; |
2228 |
> |
|
2229 |
> |
if(mcEEcorrection>=1) jzbvarmcs<<"((id1==0&&id1==id2)*(jzb[1]-" << mcEEcorrection-1 << "*pt))"; |
2230 |
> |
if(mcEEcorrection<1) jzbvarmcs<<"((id1==0&&id1==id2)*(jzb[1]+" << 1-mcEEcorrection << "*pt))"; |
2231 |
> |
|
2232 |
> |
if(mcMMcorrection>=1) jzbvarmcs<<"+((id1==1&&id1==id2)*(jzb[1]-" << mcMMcorrection-1 << "*pt))"; |
2233 |
> |
if(mcMMcorrection<1) jzbvarmcs<<"+((id1==1&&id1==id2)*(jzb[1]+" << 1-mcMMcorrection << "*pt))"; |
2234 |
> |
|
2235 |
> |
float averagemccorrection=(mcMMcorrection+mcEEcorrection)/2.0; |
2236 |
> |
|
2237 |
> |
if(mccorrection>=1) jzbvarmcs<<"+((id1!=id2)*(jzb[1]-" << mccorrection-1 << "*pt))"; |
2238 |
> |
if(mccorrection<1) jzbvarmcs<<"+((id1!=id2)*(jzb[1]+" << 1-mccorrection << "*pt))"; |
2239 |
> |
|
2240 |
> |
jzbvarmcs << ")"; |
2241 |
|
jzbvarmc=jzbvarmcs.str(); |
2242 |
+ |
|
2243 |
|
dout << "JZB Z pt correction summary : " << endl; |
2244 |
|
dout << " Data: The response is " << datacorrection << " --> jzb variable is now : " << jzbvardata << endl; |
2245 |
|
dout << " MC : The response is " << mccorrection << " --> jzb variable is now : " << jzbvarmc << endl; |
2246 |
+ |
|
2247 |
|
} |
2248 |
|
|
2249 |
|
void pick_up_events(string cut) { |
2251 |
|
allsamples.PickUpEvents(cut); |
2252 |
|
} |
2253 |
|
|
2254 |
< |
void save_template(string mcjzb, string datajzb,vector<float> jzb_cuts,float MCPeakError,float DataPeakError) { |
2254 |
> |
void save_template(string mcjzb, string datajzb,vector<float> jzb_cuts,float MCPeakError,float DataPeakError, vector<float> jzb_shape_limit_bins) { |
2255 |
|
dout << "Saving configuration template!" << endl; |
2256 |
|
ofstream configfile; |
2257 |
|
configfile.open("../DistributedModelCalculations/last_configuration.C"); |
2271 |
|
configfile<<"string datajzb=\"datajzb_ERROR\";\n"; |
2272 |
|
configfile<<"string mcjzb=\"mcjzb_ERROR\";\n"; |
2273 |
|
configfile<<"vector<float>jzb_cuts;\n"; |
2274 |
+ |
configfile<<"vector<float>jzb_shape_limit_bins;\n"; |
2275 |
|
configfile<<"float MCPeakError=-999;\n"; |
2276 |
|
configfile<<"float DataPeakError=-999;\n"; |
2277 |
|
configfile<<"}\n\n"; |
2281 |
|
configfile<<"mcjzb=\""<<mcjzb<<"\";\n\n"; |
2282 |
|
configfile<<"\n\nMCPeakError="<<MCPeakError<<";\n"; |
2283 |
|
configfile<<"DataPeakError="<<DataPeakError<<";\n\n"; |
2284 |
< |
for(int i=0;i<jzb_cuts.size();i++) configfile<<"jzb_cuts.push_back("<<jzb_cuts[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2284 |
> |
for(int i=0;i<(int)jzb_cuts.size();i++) configfile<<"jzb_cuts.push_back("<<jzb_cuts[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2285 |
|
configfile<<"\n\n"; |
2286 |
< |
for(int i=0;i<Nobs.size();i++) configfile<<"Nobs.push_back("<<Nobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2287 |
< |
for(int i=0;i<Npred.size();i++) configfile<<"Npred.push_back("<<Npred[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2288 |
< |
for(int i=0;i<Nprederr.size();i++) configfile<<"Nprederr.push_back("<<Nprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2286 |
> |
for(int i=0;i<(int)Nobs.size();i++) configfile<<"Nobs.push_back("<<Nobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2287 |
> |
for(int i=0;i<(int)Npred.size();i++) configfile<<"Npred.push_back("<<Npred[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2288 |
> |
for(int i=0;i<(int)Nprederr.size();i++) configfile<<"Nprederr.push_back("<<Nprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2289 |
> |
configfile<<"\n\n"; |
2290 |
> |
for(int i=0;i<(int)flippedNobs.size();i++) configfile<<"flippedNobs.push_back("<<flippedNobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2291 |
> |
for(int i=0;i<(int)flippedNpred.size();i++) configfile<<"flippedNpred.push_back("<<flippedNpred[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2292 |
> |
for(int i=0;i<(int)flippedNprederr.size();i++) configfile<<"flippedNprederr.push_back("<<flippedNprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2293 |
> |
for(int i=0;i<(int)jzb_shape_limit_bins.size();i++) configfile<<"jzb_shape_limit_bins.push_back("<<jzb_shape_limit_bins[i]<<"); // JZB shape bin boundary at " << jzb_shape_limit_bins[i] << "\n"; |
2294 |
|
configfile<<"\n\n"; |
2169 |
– |
for(int i=0;i<flippedNobs.size();i++) configfile<<"flippedNobs.push_back("<<flippedNobs[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2170 |
– |
for(int i=0;i<flippedNpred.size();i++) configfile<<"flippedNpred.push_back("<<flippedNpred[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2171 |
– |
for(int i=0;i<flippedNprederr.size();i++) configfile<<"flippedNprederr.push_back("<<flippedNprederr[i]<<"); // JZB cut at " << jzb_cuts[i] << "\n"; |
2295 |
|
configfile<<"\n\n"; |
2296 |
|
configfile<<"luminosity="<<luminosity<<";\n"; |
2297 |
|
configfile<<"RestrictToMassPeak="<<RestrictToMassPeak<<";//defines the type of analysis we're running\n"; |
2317 |
|
float max=histos[0]->GetMaximum(); |
2318 |
|
if(manualmin>=0) min=manualmin; |
2319 |
|
else { |
2320 |
< |
for(int i=1;i<histos.size();i++) { |
2320 |
> |
for(int i=1;i<(int)histos.size();i++) { |
2321 |
|
float curmin=get_nonzero_minimum(histos[i]); |
2322 |
|
float curmax=histos[i]->GetMaximum(); |
2323 |
|
if(curmin<min) min=curmin; |
2328 |
|
histos[0]->Draw(drawoption.c_str()); |
2329 |
|
stringstream drawopt; |
2330 |
|
drawopt << drawoption << ",same"; |
2331 |
< |
for(int i=1;i<histos.size();i++) { |
2331 |
> |
for(int i=1;i<(int)histos.size();i++) { |
2332 |
|
histos[i]->Draw(drawopt.str().c_str()); |
2333 |
|
} |
2334 |
|
} |
2337 |
|
//in the case of the on peak analysis, we compare the 3 control regions to the real value |
2338 |
|
//in the case of the OFF peak analysis, we compare our control region to the real value |
2339 |
|
TCut weightbackup=cutWeight; |
2340 |
< |
cutWeight="1.0"; |
2340 |
> |
// cutWeight="1.0"; |
2341 |
|
float simulatedlumi = luminosity; //in pb please - adjust to your likings |
2342 |
|
|
2343 |
|
|
2395 |
|
leg->Draw("same"); |
2396 |
|
DrawMCPrelim(simulatedlumi); |
2397 |
|
CompleteSave(tcan,"Systematics/"+prestring+"/ttbar_shape_comparison"); |
2275 |
– |
cout << __LINE__ << endl; |
2398 |
|
TH1F *TZemcopy = (TH1F*)TZem->Clone("TZemcopy"); |
2277 |
– |
cout << __LINE__ << endl; |
2399 |
|
TH1F *TZeemmcopy = (TH1F*)TZeemm->Clone("TZeemmcopy"); |
2279 |
– |
cout << __LINE__ << endl; |
2400 |
|
TH1F *TSeemmcopy; |
2401 |
|
TH1F *TSemcopy; |
2402 |
|
if(PlottingSetup::RestrictToMassPeak) { |
2506 |
|
tcan->SetLogy(0); |
2507 |
|
rightofzp->Divide(rightsfzp); |
2508 |
|
rightofzp->GetXaxis()->SetRangeUser(0.0,binning[binning.size()-1]); |
2509 |
< |
rightofzp->GetYaxis()->SetRangeUser(0.0,2.0); |
2509 |
> |
rightofzp->GetYaxis()->SetRangeUser(0.0,2.5); |
2510 |
|
rightofzp->GetYaxis()->SetTitle("#deltaJZB ratio"); |
2511 |
|
rightofzp->Draw(); |
2512 |
|
if(PlottingSetup::RestrictToMassPeak) { |
2587 |
|
} |
2588 |
|
|
2589 |
|
|
2590 |
< |
void zjets_prediction_comparison() { |
2590 |
> |
void zjets_prediction_comparison(string mcjzbWithPU) { |
2591 |
> |
TCanvas *zcan = new TCanvas("zcan","zcan"); |
2592 |
> |
zcan->SetLogy(1); |
2593 |
> |
TCut weightbackup=cutWeight; |
2594 |
> |
|
2595 |
> |
/* |
2596 |
|
// Do it without PU re-weighting |
2597 |
|
float MCPeakNoPU=0,MCPeakErrorNoPU=0,DataPeakNoPU=0,DataPeakErrorNoPU=0,MCSigma=0,DataSigma=0; |
2598 |
|
stringstream resultsNoPU; |
2599 |
|
|
2600 |
|
stringstream mcjzbnoPU; |
2601 |
< |
find_peaks(MCPeakNoPU,MCPeakErrorNoPU, DataPeakNoPU, DataPeakErrorNoPU,MCSigma,DataSigma,resultsNoPU,false); |
2601 |
> |
find_peaks(MCPeakNoPU,MCPeakErrorNoPU, DataPeakNoPU, DataPeakErrorNoPU,MCSigma,DataSigma,resultsNoPU,true); |
2602 |
|
if(MCPeakNoPU>0) mcjzbnoPU<<"("<<jzbvariablemc<<"-"<<TMath::Abs(MCPeakNoPU)<<")"; |
2603 |
|
else mcjzbnoPU<<"("<<jzbvariablemc<<"+"<<TMath::Abs(MCPeakNoPU)<<")"; |
2604 |
|
|
2605 |
|
string mcjzb = mcjzbnoPU.str(); |
2606 |
|
dout << "The peak corrected JZB expression for MC without pileup is : " << mcjzb << endl; |
2607 |
|
|
2483 |
– |
TCut weightbackup=cutWeight; |
2608 |
|
cutWeight="1.0"; |
2609 |
< |
float sbg_min=0.; |
2610 |
< |
float sbg_max=100.; |
2611 |
< |
int sbg_nbins=5; |
2609 |
> |
*/ |
2610 |
> |
string mcjzb = mcjzbWithPU; // this is with PURW, if you want without it you have to uncomment the part above (and comment out this line) |
2611 |
> |
|
2612 |
> |
vector<float> binning; |
2613 |
> |
binning.push_back(0); |
2614 |
> |
binning.push_back(20); |
2615 |
> |
binning.push_back(40); |
2616 |
> |
binning.push_back(60); |
2617 |
> |
binning.push_back(80); |
2618 |
> |
binning.push_back(100); |
2619 |
> |
// float sbg_min=0.; |
2620 |
> |
// float sbg_max=100.; |
2621 |
> |
// int sbg_nbins=5; |
2622 |
|
float simulatedlumi = luminosity;//in pb please - adjust to your likings |
2623 |
|
|
2624 |
|
TCut kPos((mcjzb+">0").c_str()); |
2625 |
|
TCut kNeg((mcjzb+"<0").c_str()); |
2626 |
|
string var( "abs("+mcjzb+")" ); |
2627 |
|
|
2628 |
< |
TCut kcut(cutmass&&cutOSSF&&"pfJetGoodNum>2"); |
2629 |
< |
TH1F *hJZBpos = systsamples.Draw("hJZBpos",var,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events", |
2630 |
< |
kcut&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2497 |
< |
TH1F *hJZBneg = systsamples.Draw("hJZBneg",var,sbg_nbins,sbg_min,sbg_max, "JZB [GeV]", "events", |
2498 |
< |
kcut&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2628 |
> |
TCut kcut(cutmass&&cutOSSF&&cutnJets); |
2629 |
> |
TH1F *hJZBpos = systsamples.Draw("hJZBpos",var,binning, "JZB [GeV]", "events",kcut&&kPos,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2630 |
> |
TH1F *hJZBneg = systsamples.Draw("hJZBneg",var,binning, "JZB [GeV]", "events",kcut&&kNeg,mc,simulatedlumi,systsamples.FindSample("/DY")); |
2631 |
|
hJZBpos->SetLineColor(kBlack); |
2632 |
|
hJZBneg->SetLineColor(kRed); |
2633 |
|
|
2634 |
< |
Int_t nbins = 5; |
2503 |
< |
Float_t xmax = 100.; |
2504 |
< |
|
2505 |
< |
|
2506 |
< |
TCanvas *zcan = new TCanvas("zcan","zcan"); |
2507 |
< |
zcan->SetLogy(1); |
2508 |
< |
|
2634 |
> |
hJZBpos->SetMinimum(1.0); |
2635 |
|
hJZBpos->Draw("e1"); |
2636 |
|
hJZBneg->Draw("same,hist"); |
2637 |
|
hJZBpos->Draw("same,e1"); // So it's on top... |
2646 |
|
TH1F* hratio = (TH1F*)hJZBpos->Clone("hratio"); |
2647 |
|
hratio->Divide(hJZBneg); |
2648 |
|
|
2649 |
+ |
for(int i=1;i<=hJZBpos->GetNbinsX();i++) { |
2650 |
+ |
cout << "Positive: " << hJZBpos->GetBinContent(i) << " vs Negative : " << hJZBneg->GetBinContent(i) << endl; |
2651 |
+ |
} |
2652 |
+ |
|
2653 |
|
zcan->SetLogy(0); |
2654 |
|
hratio->GetYaxis()->SetRangeUser(0,2.5); |
2655 |
|
hratio->GetYaxis()->SetTitle("Observed/Predicted"); |
2656 |
|
hratio->Draw("e1"); |
2657 |
|
|
2658 |
< |
TLine *top = new TLine(sbg_min,1.25,sbg_max,1.25); |
2659 |
< |
TLine *center = new TLine(sbg_min,1.0,sbg_max,1.0); |
2660 |
< |
TLine *bottom = new TLine(sbg_min,0.75,sbg_max,0.75); |
2658 |
> |
TLine *top = new TLine(binning[0],1.25,binning[binning.size()-1],1.25); |
2659 |
> |
TLine *center = new TLine(binning[0],1.0,binning[binning.size()-1],1.0); |
2660 |
> |
TLine *bottom = new TLine(binning[0],0.75,binning[binning.size()-1],0.75); |
2661 |
|
|
2662 |
|
|
2663 |
|
top->SetLineColor(kBlue);top->SetLineStyle(2); |
2699 |
|
tout << "\\begin{tabular}{l|cc}" << endl; |
2700 |
|
tout << "\\hline" << endl; |
2701 |
|
tout << "& {\\OFZP} & {\\OFSB} \\\\\\hline" << endl; |
2702 |
< |
tout << "\\#(events) & "<<OFSB<<" & "<<OFZP<<"\\\\ \\hline" << endl; |
2702 |
> |
tout << "\\#(events) & "<<OFZP<<" & "<<OFSB<<"\\\\ \\hline" << endl; |
2703 |
|
tout << "\\end{tabular}" << endl; |
2704 |
|
tout << "\\end{center}" << endl; |
2705 |
|
tout << "\\end{table}" << endl; |
2717 |
|
|
2718 |
|
TCanvas *cannie = new TCanvas("cannie","cannie"); |
2719 |
|
|
2720 |
< |
for(int icut=0;icut<jzb_cuts.size();icut++) { |
2720 |
> |
for(int icut=0;icut<(int)jzb_cuts.size();icut++) { |
2721 |
|
float currcut=jzb_cuts[icut]; |
2722 |
|
int nbins=1;float low=currcut; |
2723 |
|
vector<int> mysample; |
2776 |
|
//prediction part |
2777 |
|
if(is_data) cout << "Data prediction & "; |
2778 |
|
if(subselection!="none") cout << subselection << " prediction &"; |
2779 |
< |
for(int ij=0;ij<jzb_cuts.size();ij++) cout << jzbcutprediction[ij] << " vs " << metcutprediction[ij] << " & "; |
2779 |
> |
for(int ij=0;ij<(int)jzb_cuts.size();ij++) cout << jzbcutprediction[ij] << " vs " << metcutprediction[ij] << " & "; |
2780 |
|
|
2781 |
|
cout << endl; |
2782 |
|
//observation part |
2783 |
|
if(is_data) cout << "Data observation & "; |
2784 |
|
if(subselection!="none") cout << subselection << " observation &"; |
2785 |
< |
for(int ij=0;ij<jzb_cuts.size();ij++) cout << jzbcutobservation[ij] << " vs " << metcutobservation[ij] << " & "; |
2785 |
> |
for(int ij=0;ij<(int)jzb_cuts.size();ij++) cout << jzbcutobservation[ij] << " vs " << metcutobservation[ij] << " & "; |
2786 |
|
cout << endl; |
2787 |
|
cout << "_________________________________________________________________" << endl; |
2788 |
|
delete cannie; |
2817 |
|
int nbins = sizeof(xbins)/sizeof(float)-1; |
2818 |
|
int markers[] = { 20, 26, 21, 24, 22, 25, 28 }; |
2819 |
|
|
2820 |
< |
TH1F* heff = new TH1F("heff", "JZB eff ; generator-level JZB [GeV]; efficiency",nbins,xbins); |
2821 |
< |
TH1F* hgen = new TH1F("hgen", "JZB gen ; generator-level JZB [GeV]; efficiency",nbins,xbins); |
2822 |
< |
TH1F* hreco = new TH1F("hreco","JZB reco ; generator-level JZB [GeV]; efficiency",nbins,xbins); |
2820 |
> |
|
2821 |
> |
TH1F* heff = new TH1F("heff", "JZB eff ; generator JZB [GeV]; efficiency",nbins,xbins); |
2822 |
> |
TH1F* hgen = new TH1F("hgen", "JZB gen ; generator JZB [GeV]; efficiency",nbins,xbins); |
2823 |
> |
TH1F* hreco = new TH1F("hreco","JZB reco ; generator JZB [GeV]; efficiency",nbins,xbins); |
2824 |
|
|
2825 |
|
TCut kgen(genMassCut&&"genZPt>0&&genNjets>2&&abs(genMID)==23"&&cutOSSF); |
2826 |
|
TCut kreco(cutmass); |
2836 |
|
TCanvas *can = new TCanvas("can","Canvas for JZB Efficiency",600,600); |
2837 |
|
can->SetGridx(1); |
2838 |
|
can->SetGridy(1); |
2839 |
+ |
can->SetLeftMargin(0.16); |
2840 |
+ |
can->SetRightMargin(0.05); |
2841 |
|
TLegend *leg = make_legend("",0.6,0.2,false,0.89,0.5); |
2842 |
+ |
leg->SetBorderSize(1); |
2843 |
+ |
leg->SetLineColor(kBlack); |
2844 |
+ |
leg->SetTextFont(62); |
2845 |
|
|
2846 |
< |
|
2711 |
< |
|
2712 |
< |
for ( int icut=0; icut<jzb_bins.size(); ++icut ) { |
2846 |
> |
for ( int icut=0; icut<(int)jzb_bins.size(); ++icut ) { |
2847 |
|
|
2848 |
|
ostringstream selection; |
2849 |
|
selection << mcjzb << ">" << jzb_bins[icut]; |
2859 |
|
} |
2860 |
|
|
2861 |
|
heff->GetXaxis()->SetRangeUser(min, max); |
2862 |
+ |
// heff->GetXaxis()->SetLabelSize(0.05); // paper style. overruled. |
2863 |
+ |
// heff->GetYaxis()->SetLabelSize(0.05); // paper style. overruled. |
2864 |
+ |
// heff->GetXaxis()->SetTitleSize(0.06); // paper style. overruled. |
2865 |
+ |
// heff->GetYaxis()->SetTitleSize(0.06); // paper style. overruled. |
2866 |
|
heff->SetMarkerStyle(markers[icut]); |
2867 |
|
heff->Fit("func","Q+","same"); |
2868 |
|
|
2874 |
|
|
2875 |
|
// Store plot |
2876 |
|
TH1F* h = (TH1F*)heff->Clone(hname); |
2877 |
+ |
h->SetNdivisions(505,"X"); |
2878 |
|
if ( icut) h->Draw("same"); |
2879 |
|
else h->Draw(); |
2880 |
|
char htitle[256]; sprintf(htitle,"JZB > %3.0f GeV", jzb_bins[icut]); |
2895 |
|
// Calls the above function for each signal sample |
2896 |
|
void plot_jzb_sel_eff(string mcjzb, samplecollection &signalsamples, vector<float> bins ) |
2897 |
|
{ |
2898 |
< |
for (int isignal=0; isignal<signalsamples.collection.size();isignal++) { |
2898 |
> |
for (int isignal=0; isignal<(int)signalsamples.collection.size();isignal++) { |
2899 |
|
dout << "JZB selection efficiency curve: " << std::endl; |
2900 |
|
JZBSelEff(mcjzb,(signalsamples.collection)[isignal].events,(signalsamples.collection)[isignal].samplename,bins); // Only for some selected samples |
2901 |
|
} |
2938 |
|
TH1F *RcorrJZBSBeemm; |
2939 |
|
TH1F *LcorrJZBSBeemm; |
2940 |
|
|
2941 |
< |
TH1F *RcorrJZBeemmNoS; |
2941 |
> |
// TH1F *RcorrJZBeemmNoS; |
2942 |
|
|
2943 |
|
//these are for the ratio |
2944 |
|
TH1F *JRcorrJZBeemm = qcdsamples.Draw("JRcorrJZBeemm",jzb.c_str(),PlottingSetup::global_ratio_binning, "JZB [GeV]", "events", cutmass&&cutOSSF&&cutnJets,is_data, luminosity,use_signal); |
3022 |
|
//3rd last argument: do special bpred ratio, 2nd last argument: extended range!, last: y-axis title |
3023 |
|
string ytitle("ratio"); |
3024 |
|
if ( use_data==1 ) ytitle = "data/pred"; |
3025 |
< |
save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,"QCD/Bpred",true,use_data!=1,ytitle); |
3025 |
> |
save_with_ratio(JRcorrJZBeemm,JBpred,kinpad,"QCD/Bpred",true,false,ytitle); |
3026 |
|
|
3027 |
|
TH1F *allevents = qcdsamples.Draw("allevents","pfJetGoodNum",1,0,100, "internal code", "events", "" ,mc, luminosity); |
3028 |
|
TH1F *ossf = qcdsamples.Draw("ossf","pfJetGoodNum",1,0,100, "internal code", "events", cutOSSF ,mc, luminosity); |
3069 |
|
dout << " Observation increases by : " << RcorrJZBeemm->Integral() << endl; |
3070 |
|
|
3071 |
|
dout << endl; |
3072 |
< |
for(int i=0;i<bins.size();i++) { |
3072 |
> |
for(int i=0;i<(int)bins.size();i++) { |
3073 |
|
dout << " JZB > " << bins[i] << " : " << endl; |
3074 |
|
dout << " Observation increases by : " << RcorrJZBeemm->Integral(RcorrJZBeemm->FindBin(bins[i]),RcorrJZBeemm->GetNbinsX()) << endl; |
3075 |
|
if(PlottingSetup::RestrictToMassPeak) { |
3117 |
|
leg->SetY2(1.0); |
3118 |
|
|
3119 |
|
|
3120 |
< |
for(int isample=0;isample<allsamples.collection.size();isample++) { |
3120 |
> |
for(int isample=0;isample<(int)allsamples.collection.size();isample++) { |
3121 |
|
string nowname=(allsamples.collection)[isample].filename; |
3122 |
|
cout << "Drawing: " << nowname << " (sample " << isample+1 << " / " << allsamples.collection.size() << ")" << endl; |
3123 |
|
individualpt1histos[isample] = allsamples.Draw(GetNumericHistoName(),"pt1",50,0,50, "p_{T,1}", "events",cutOSSF&&cutnJets,mc,luminosity,allsamples.FindSample(nowname)); |
3141 |
|
ptsancan->cd(2); |
3142 |
|
fpt2->Draw(); |
3143 |
|
|
3144 |
< |
for(int isample=0;isample<allsamples.collection.size();isample++) { |
3144 |
> |
for(int isample=0;isample<(int)allsamples.collection.size();isample++) { |
3145 |
|
ptsancan->cd(1); |
3146 |
|
individualpt1histos[isample]->DrawNormalized("same,histo"); |
3147 |
|
ptsancan->cd(2); |
3157 |
|
void do_mlls_plot(string mcjzb) { |
3158 |
|
cout << "At this point we'd plot the mll distribution" << endl; |
3159 |
|
TCanvas *sigcan = new TCanvas("sigcan","sigcan"); |
3160 |
< |
for(int isig=0;isig<(signalsamples.collection).size();isig++) { |
3160 |
> |
for(int isig=0;isig<(int)(signalsamples.collection).size();isig++) { |
3161 |
|
if(!(signalsamples.collection)[isig].events) continue; |
3162 |
|
string nowname=(signalsamples.collection)[isig].filename; |
3163 |
|
TH1F *mll = signalsamples.Draw("mllhisto","mll",150,0,150, "m_{ll}", "events",cutOSSF&&cutnJets,mc,luminosity,signalsamples.FindSample(nowname)); |
3196 |
|
findme.push_back("TTJets"); |
3197 |
|
findme.push_back("LM"); |
3198 |
|
|
3199 |
< |
for(int ifind=0;ifind<findme.size();ifind++) { |
3199 |
> |
for(int ifind=0;ifind<(int)findme.size();ifind++) { |
3200 |
|
vector<int> selsamples = allsamples.FindSample(findme[ifind]); |
3201 |
|
TH2F *metvsjzb = new TH2F("metvsjzb","metvsjzb",200,0,100,400,-100,100); |
3202 |
< |
for(int isel=0;isel<selsamples.size();isel++) { |
3202 |
> |
for(int isel=0;isel<(int)selsamples.size();isel++) { |
3203 |
|
cout << "Producing MET:JZB plot ... working on sample: " << allsamples.collection[selsamples[isel]].filename << endl; |
3204 |
|
allsamples.collection[selsamples[isel]].events->Draw("jzb[1]:met[4]>>+metvsjzb",cutmass&&cutOSSF); |
3205 |
|
} |