1 |
|
#include <iostream> |
2 |
|
#include <vector> |
3 |
|
#include <sys/stat.h> |
4 |
+ |
#include <math.h> |
5 |
|
|
6 |
|
#include <TCut.h> |
7 |
|
#include <TROOT.h> |
17 |
|
#include <TProfile.h> |
18 |
|
#include <TLegendEntry.h> |
19 |
|
|
20 |
+ |
#include <RooRealVar.h> |
21 |
+ |
#include <RooArgSet.h> |
22 |
+ |
#include <RooDataSet.h> |
23 |
+ |
#include <RooDataHist.h> |
24 |
+ |
#include <RooMCStudy.h> |
25 |
+ |
#include <RooCategory.h> |
26 |
+ |
|
27 |
+ |
#include <RooPlot.h> |
28 |
+ |
#include <RooSimultaneous.h> |
29 |
+ |
#include <RooAddPdf.h> |
30 |
+ |
#include <RooFitResult.h> |
31 |
+ |
#include <RooVoigtian.h> |
32 |
+ |
#include <RooChebychev.h> |
33 |
+ |
#include <RooMsgService.h> |
34 |
+ |
|
35 |
+ |
#include <RooStats/ModelConfig.h> |
36 |
+ |
#include "RooStats/ProfileLikelihoodCalculator.h" |
37 |
+ |
#include "RooStats/LikelihoodInterval.h" |
38 |
+ |
#include "RooStats/HypoTestResult.h" |
39 |
+ |
#include "RooStats/SimpleLikelihoodRatioTestStat.h" |
40 |
+ |
#include "RooStats/ProfileLikelihoodTestStat.h" |
41 |
+ |
#include "RooStats/HybridCalculatorOriginal.h" |
42 |
+ |
#include "RooStats/HypoTestInverterOriginal.h" |
43 |
+ |
|
44 |
+ |
|
45 |
+ |
|
46 |
|
using namespace std; |
47 |
|
|
48 |
|
using namespace PlottingSetup; |
49 |
|
|
50 |
|
namespace ZbData { |
51 |
< |
vector<float> data_over_mc; |
51 |
> |
TCut ZplusBsel("pt1>20&&pt2>20&&mll>60&&mll<120&&id1==id2"); |
52 |
> |
TCut LeadingB("ZbCHS3010_bTagProbCSVBP[0]>0.898"); |
53 |
> |
TCut EtaB("abs(ZbCHS3010_pfJetGoodEta[0])<1.3"); |
54 |
> |
TCut PhiZcut("abs(ZbCHS3010_pfJetDphiZ[0])>2.7"); |
55 |
> |
float LowerHistoBoundary=0.5; // where to cut on MPF (or Rabs) |
56 |
> |
float UpperHistoBoundary=1.5; // where to cut on MPF (or Rabs) |
57 |
|
|
26 |
– |
TCut ZplusBsel("pt1>20&&pt2>20&&mll>60&&mll<120"); |
27 |
– |
TCut LeadingB("Zb3010_bTagProbCSVBP[0]>0.898"); |
28 |
– |
TCut EtaB("abs(Zb3010_pfJetGoodEta[0])<1.3"); |
29 |
– |
TCut PhiZcut("abs(pfJetDphiZ[0])>2.7"); |
30 |
– |
|
58 |
|
} |
59 |
|
|
60 |
+ |
TCut STDWEIGHT; |
61 |
+ |
|
62 |
+ |
class ZbPointResult { |
63 |
+ |
public: |
64 |
+ |
ZbPointResult(string var, float ptlow, float pthigh, float alphalow, float alphahigh, Value Data, Value MC); |
65 |
+ |
float PtLow; |
66 |
+ |
float PtHigh; |
67 |
+ |
float AlphaLow; |
68 |
+ |
float AlphaHigh; |
69 |
+ |
string variable; |
70 |
+ |
Value Data; |
71 |
+ |
Value MC; |
72 |
+ |
Value Ratio; |
73 |
+ |
}; |
74 |
+ |
|
75 |
+ |
ZbPointResult::ZbPointResult(string var, float ptlow, float pthigh, float alphalow, float alphahigh, Value data, Value mc) : |
76 |
+ |
variable(var), PtLow(ptlow), PtHigh(pthigh), AlphaLow(alphalow), AlphaHigh(alphahigh), Data(data), MC(mc) { |
77 |
+ |
Ratio = data/mc; |
78 |
+ |
} |
79 |
+ |
|
80 |
+ |
std::ostream &operator<<(std::ostream &ostr, ZbPointResult &b) |
81 |
+ |
{ |
82 |
+ |
ostr << b.PtLow << ";" << b.PtHigh << ";" << b.AlphaLow << ";" << b.AlphaHigh << ";" << b.Data.getValue() << ";" << b.Data.getError() << ";" << b.MC.getValue() << ";" << b.MC.getError() << ";" << b.Ratio.getValue() << ";" << b.Ratio.getError(); |
83 |
+ |
return ostr; |
84 |
+ |
} |
85 |
+ |
|
86 |
+ |
|
87 |
+ |
class ZbResultContainer { |
88 |
+ |
public: |
89 |
+ |
string name; |
90 |
+ |
vector<ZbPointResult> MPF_Rabs_location; |
91 |
+ |
Value MPF_Result_FaceValue; |
92 |
+ |
Value Rabs_Result_FaceValue; |
93 |
+ |
Value MPF_Result_Extrapolated; |
94 |
+ |
Value Rabs_Result_Extrapolated; |
95 |
+ |
void Print(); |
96 |
+ |
|
97 |
+ |
ZbResultContainer(string name); |
98 |
+ |
}; |
99 |
+ |
|
100 |
+ |
|
101 |
+ |
ZbResultContainer::ZbResultContainer(string _name) { |
102 |
+ |
name=_name; |
103 |
+ |
dout<< "Result Container for \"" << name << "\" has been initialized" << endl; |
104 |
+ |
|
105 |
+ |
} |
106 |
+ |
|
107 |
+ |
void ZbResultContainer::Print() |
108 |
+ |
{ |
109 |
+ |
dout << "Results for " << this->name << endl; |
110 |
+ |
dout << " MPF and Rabs locations: " << endl; |
111 |
+ |
for(int i=0;i<this->MPF_Rabs_location.size();i++) dout << " " << this->MPF_Rabs_location[i] << endl; |
112 |
+ |
dout << " Results: " << endl; |
113 |
+ |
dout << " Face Value: " << endl; |
114 |
+ |
dout << " MPF " << this->MPF_Result_FaceValue << endl; |
115 |
+ |
dout << " Rabs " << this->Rabs_Result_FaceValue << endl; |
116 |
+ |
dout << " Extrapolated: " << endl; |
117 |
+ |
dout << " MPF " << this->MPF_Result_Extrapolated << endl; |
118 |
+ |
dout << " Rabs " << this->Rabs_Result_Extrapolated << endl; |
119 |
+ |
} |
120 |
+ |
|
121 |
+ |
|
122 |
|
using namespace ZbData; |
123 |
|
|
124 |
|
|
128 |
|
//*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/* AND THIS LINE /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*// |
129 |
|
|
130 |
|
|
131 |
< |
void print_yield(TCut cut) { |
131 |
> |
class CutYields{ |
132 |
> |
public: |
133 |
> |
float data; |
134 |
> |
float Zb; |
135 |
> |
float Zc; |
136 |
> |
float Zl; |
137 |
> |
float tt; |
138 |
> |
float SiTo; |
139 |
> |
float Dibosons; |
140 |
> |
float WJets; |
141 |
> |
float Other; |
142 |
> |
|
143 |
> |
CutYields(); |
144 |
> |
}; |
145 |
> |
|
146 |
> |
CutYields::CutYields() { |
147 |
> |
this->data=0; |
148 |
> |
this->Zb=0; |
149 |
> |
this->Zc=0; |
150 |
> |
this->Zl=0; |
151 |
> |
this->tt=0; |
152 |
> |
this->SiTo=0; |
153 |
> |
this->Dibosons=0; |
154 |
> |
this->WJets=0; |
155 |
> |
this->Other=0; |
156 |
> |
} |
157 |
> |
|
158 |
> |
std::ostream &operator<<(std::ostream &ostr, CutYields y) |
159 |
> |
{ |
160 |
> |
return ostr << y.data << ";" << y.Zb << ";" << y.Zc << ";" << y.Zl << ";" << y.tt << ";" << y.SiTo << ";" << y.Dibosons << ";" << y.WJets << ";" << endl; |
161 |
> |
} |
162 |
> |
|
163 |
> |
|
164 |
> |
CutYields print_yield(TCut cut) { |
165 |
> |
|
166 |
> |
CutYields Yield; |
167 |
|
TH1F *data = allsamples.Draw("data", "mll",1,0,10000000, "m_{ll} [GeV]", "events", cut,data,luminosity); |
168 |
|
dout << " Yields for " << (const char*) cut << endl; |
169 |
< |
dout << " data: " << data->Integral() << endl; |
169 |
> |
// dout << " data: " << data->Integral() << endl; |
170 |
> |
|
171 |
> |
Yield.data=data->Integral(); |
172 |
|
THStack mcm = allsamples.DrawStack("mc", "mll",1,0,10000000, "m_{ll} [GeV]", "events", cut,mc,luminosity); |
173 |
|
int nhists = mcm.GetHists()->GetEntries(); |
48 |
– |
dout << "Going to loop over " << nhists << " histograms " << endl; |
174 |
|
TFile *test = new TFile("test.root","RECREATE"); |
175 |
|
mcm.Write(); |
176 |
|
test->Close(); |
177 |
|
for (int i = 0; i < nhists; i++) { |
178 |
|
TH1* hist = static_cast<TH1*>(mcm.GetHists()->At(i)); |
179 |
< |
cout << " " << hist->GetName() << ": " << hist->Integral() << endl; |
179 |
> |
string name=hist->GetName(); |
180 |
> |
if(Contains(name,"t_bar_t")) Yield.tt+=hist->Integral(); |
181 |
> |
if(Contains(name,"W_Jets")) Yield.WJets+=hist->Integral(); |
182 |
> |
if(Contains(name,"Single_top")) Yield.SiTo+=hist->Integral(); |
183 |
> |
if(Contains(name,"Dibosons")) Yield.Dibosons+=hist->Integral(); |
184 |
> |
if(Contains(name,"Z_l_")) Yield.Zl+=hist->Integral(); |
185 |
> |
if(Contains(name,"Z_c_")) Yield.Zc+=hist->Integral(); |
186 |
> |
if(Contains(name,"Z_b_")) Yield.Zb+=hist->Integral(); |
187 |
|
} |
188 |
< |
|
189 |
< |
cout << endl << endl; |
188 |
> |
|
189 |
> |
dout << Yield << endl; |
190 |
> |
dout << endl << endl; |
191 |
|
|
192 |
|
delete data; |
193 |
+ |
CleanLegends(); |
194 |
+ |
DeleteStack(mcm); |
195 |
+ |
|
196 |
+ |
return Yield; |
197 |
|
} |
198 |
|
|
199 |
|
void draw_kin_variable(string variable, TCut cut, int nbins, float min, float max, string xlabel, string saveas, bool dologscale, string speciallabel="") { |
63 |
– |
|
200 |
|
TCanvas *ckin = new TCanvas("ckin","kin variable canvas"); |
201 |
< |
ckin->SetLogy(dologscale); |
201 |
> |
if(dologscale) ckin->SetLogy(1); |
202 |
|
TH1F *datahisto = allsamples.Draw("datahisto",variable,nbins,min,max, xlabel, "events",cut,data,luminosity); |
203 |
|
datahisto->SetMarkerSize(DataMarkerSize); |
204 |
|
THStack mcstack = allsamples.DrawStack("mcstack",variable,nbins,min,max, xlabel, "events",cut,mc,luminosity); |
205 |
|
if(dologscale) datahisto->SetMaximum(3*datahisto->GetMaximum()); |
206 |
|
else datahisto->SetMaximum(1.5*datahisto->GetMaximum()); |
207 |
< |
TText *speciall; |
208 |
< |
if(speciallabel!="") { |
209 |
< |
speciall = new TText(0.2,0.8,speciallabel.c_str()); |
210 |
< |
speciall->Draw(); |
207 |
> |
|
208 |
> |
float SumMC=0.0; |
209 |
> |
TIter nextH(mcstack.GetHists()); |
210 |
> |
TH1F* h; |
211 |
> |
while ( h = (TH1F*)nextH() ) { |
212 |
> |
SumMC += h->Integral(); |
213 |
> |
} |
214 |
> |
float scale = datahisto->Integral()/SumMC; |
215 |
> |
|
216 |
> |
// Re-scale stack to data integral |
217 |
> |
nextH = TIter(mcstack.GetHists()); |
218 |
> |
|
219 |
> |
while ( h = (TH1F*)nextH() ) { |
220 |
> |
h->Scale(scale); |
221 |
|
} |
222 |
+ |
|
223 |
+ |
TText *speciall; |
224 |
|
datahisto->Draw("e1"); |
225 |
|
ckin->Update(); |
226 |
< |
mcstack.Draw("same"); |
226 |
> |
mcstack.Draw("histo,same"); |
227 |
|
datahisto->Draw("same,e1"); |
228 |
|
TLegend *kinleg = allsamples.allbglegend(); |
229 |
+ |
|
230 |
|
kinleg->Draw(); |
231 |
|
|
232 |
|
TPad *kinpad = new TPad("kinpad","kinpad",0,0,1,1); |
233 |
|
kinpad->cd(); |
234 |
< |
kinpad->SetLogy(dologscale); |
234 |
> |
if(dologscale) kinpad->SetLogy(1); |
235 |
|
datahisto->Draw("e1"); |
236 |
< |
mcstack.Draw("same"); |
236 |
> |
mcstack.Draw("histo,same"); |
237 |
|
datahisto->Draw("same,e1"); |
238 |
|
datahisto->Draw("same,axis"); |
239 |
|
kinleg->Draw(); |
240 |
|
DrawPrelim(); |
241 |
|
saveas="kin/"+saveas; |
242 |
< |
save_with_ratio(datahisto,mcstack,kinpad->cd(),saveas); |
94 |
< |
|
95 |
< |
|
242 |
> |
kinpad->cd(); |
243 |
|
|
244 |
+ |
if(speciallabel!="") { |
245 |
+ |
speciall = write_title(speciallabel); |
246 |
+ |
speciall->SetX(0.18); |
247 |
+ |
speciall->SetTextAlign(11); |
248 |
+ |
speciall->SetTextSize(0.03); |
249 |
+ |
speciall->SetY(0.85); |
250 |
+ |
speciall->Draw(); |
251 |
+ |
} |
252 |
|
|
253 |
< |
ZbData::data_over_mc.push_back(datahisto->Integral()/CollapseStack(mcstack)->Integral()); |
253 |
> |
Save_With_Ratio(datahisto,mcstack,kinpad->cd(),saveas); |
254 |
|
|
255 |
|
datahisto->Delete(); |
256 |
+ |
delete kinleg; |
257 |
|
delete ckin; |
258 |
+ |
CleanLegends(); |
259 |
+ |
DeleteStack(mcstack); |
260 |
|
} |
261 |
< |
|
104 |
< |
Value getfrom2Dmap(TH2F *map, int ixbin, int iybin) { |
105 |
< |
Value sum(0,0); |
106 |
< |
for(int iy=1;iy<=iybin;iy++) { |
107 |
< |
sum=sum+Value(map->GetBinContent(ixbin,iy),map->GetBinError(ixbin,iy)); |
108 |
< |
} |
109 |
< |
return sum; |
110 |
< |
} |
111 |
< |
|
261 |
> |
|
262 |
|
void print_all_b_yields() { |
263 |
< |
cout << "Basic selection with a b jet" << endl; |
264 |
< |
print_yield(ZplusBsel&&"Zb3010_pfJetGoodNumBtag>0"); |
265 |
< |
cout << "Leading jet is a b-jet " << endl; |
266 |
< |
print_yield(ZplusBsel&&LeadingB); |
267 |
< |
cout << "|#eta_{b}|<1.3 " << endl; |
268 |
< |
print_yield(ZplusBsel&&LeadingB&&EtaB); |
269 |
< |
cout << "|#delta#phi(b<Z)|>2.7" << endl; |
270 |
< |
print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut); |
271 |
< |
cout << "10<ptZ<1000 GeV" << endl; |
272 |
< |
print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"); |
273 |
< |
cout << "#alpha < 0.3" << endl; |
274 |
< |
print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"(Zb3010_alpha)<0.3"); |
275 |
< |
cout << "#alpha < 0.2" << endl; |
276 |
< |
print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"(Zb3010_alpha)<0.2"); |
277 |
< |
cout << "#alpha < 0.15" << endl; |
278 |
< |
print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"(Zb3010_alpha)<0.15"); |
279 |
< |
cout << "#alpha < 0.1" << endl; |
280 |
< |
print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"(Zb3010_alpha)<0.1"); |
281 |
< |
// cout << "#alpha < 0.05" << endl; |
282 |
< |
// print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"(Zb3010_alpha)<0.05"); |
263 |
> |
vector<CutYields> yields; |
264 |
> |
dout << "Basic selection with a b jet" << endl; |
265 |
> |
yields.push_back(print_yield(ZplusBsel&&"ZbCHS3010_pfJetGoodNumBtag>0")); |
266 |
> |
dout << "Leading jet is a b-jet " << endl; |
267 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB)); |
268 |
> |
dout << "|#eta_{b}|<1.3 " << endl; |
269 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB&&EtaB)); |
270 |
> |
dout << "|#delta#phi(b<Z)|>2.7" << endl; |
271 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut)); |
272 |
> |
dout << "30<ptZ<1000 GeV" << endl; |
273 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000")); |
274 |
> |
dout << "#alpha < 0.35" << endl; |
275 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000"&&"(ZbCHS3010_alpha)<0.35")); |
276 |
> |
dout << "#alpha < 0.3" << endl; |
277 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000"&&"(ZbCHS3010_alpha)<0.3")); |
278 |
> |
/* dout << "#alpha < 0.2" << endl; |
279 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000"&&"(ZbCHS3010_alpha)<0.2")); |
280 |
> |
dout << "#alpha < 0.15" << endl; |
281 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000"&&"(ZbCHS3010_alpha)<0.15")); |
282 |
> |
dout << "#alpha < 0.1" << endl; |
283 |
> |
yields.push_back(print_yield(ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000"&&"(ZbCHS3010_alpha)<0.1"));*/ |
284 |
> |
|
285 |
> |
for(int iy=0;iy<yields.size();iy++) { |
286 |
> |
dout << yields[iy] << endl; |
287 |
> |
} |
288 |
|
} |
289 |
|
|
290 |
|
void DrawEvilCutFlow() { |
291 |
|
stringstream MegaCut; |
292 |
|
|
293 |
< |
MegaCut << " 1*(" << (const char*) (ZplusBsel&&TCut("Zb3010_pfJetGoodNumBtag>0")) << ")"; |
293 |
> |
MegaCut << " 1*(" << (const char*) (ZplusBsel&&TCut("ZbCHS3010_pfJetGoodNumBtag>0")) << ")"; |
294 |
|
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB) << ")"; |
295 |
|
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB) << ")"; |
296 |
|
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut) << ")"; |
297 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000")) << ")"; |
298 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb3010_alpha<0.3")) << ")"; |
299 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb3010_alpha<0.2")) << ")"; |
300 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb3010_alpha<0.15")) << ")"; |
301 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb3010_alpha<0.1")) << ")"; |
302 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>10&&pt<1000&&Zb3010_alpha<0.05")) << ")"; |
297 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000")) << ")"; |
298 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.3")) << ")"; |
299 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.2")) << ")"; |
300 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.15")) << ")"; |
301 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.1")) << ")"; |
302 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.05")) << ")"; |
303 |
|
MegaCut << " "; |
304 |
|
|
305 |
|
TCanvas *can = new TCanvas("can","can"); |
312 |
|
|
313 |
|
|
314 |
|
TH1F *data = allsamples.Draw("data", MegaCut.str(),11,-0.5,10.5, "", "events", basecut,data,luminosity); |
315 |
< |
THStack mcm = allsamples.DrawStack("mc", MegaCut.str(),11,-0.5,10.5, "", "events", basecut,mc,luminosity); |
315 |
> |
THStack mcm = allsamples.DrawStack("mc", MegaCut.str(),11,-0.5,10.5, "", "events", basecut,mc,luminosity); |
316 |
|
|
317 |
|
float runningsum=0; |
318 |
|
for(int i=data->GetNbinsX();i>0;i--) { |
343 |
|
data->GetXaxis()->SetBinLabel(3,"Leading jet is b-jet"); |
344 |
|
data->GetXaxis()->SetBinLabel(4,"|#eta_{b}|<1.3 "); |
345 |
|
data->GetXaxis()->SetBinLabel(5,"|#delta#phi(b,Z)|>2.7"); |
346 |
< |
data->GetXaxis()->SetBinLabel(6,"10<p_{T}^{Z}<1000 GeV"); |
346 |
> |
data->GetXaxis()->SetBinLabel(6,"30<p_{T}^{Z}<1000 GeV"); |
347 |
|
data->GetXaxis()->SetBinLabel(7,"#alpha < 0.3"); |
348 |
|
data->GetXaxis()->SetBinLabel(8,"#alpha < 0.2"); |
349 |
|
data->GetXaxis()->SetBinLabel(9,"#alpha < 0.15"); |
352 |
|
data->GetXaxis()->LabelsOption("v"); |
353 |
|
|
354 |
|
data->Draw("e1"); |
355 |
< |
mcm.Draw("same"); |
355 |
> |
mcm.Draw("histo,same"); |
356 |
|
data->Draw("same,e1,axis"); |
357 |
|
data->Draw("same,e1"); |
358 |
|
// data->Draw("same,TEXT"); |
362 |
|
DrawPrelim(); |
363 |
|
|
364 |
|
CompleteSave(can,"CutFlow"); |
365 |
+ |
CleanLegends(); |
366 |
+ |
DeleteStack(mcm); |
367 |
+ |
|
368 |
|
} |
369 |
|
|
370 |
|
void draw_Zb_kin_vars() { |
371 |
< |
draw_kin_variable("pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",25,0,200,"Z p_{T}","Official/Zpt",1); |
372 |
< |
draw_kin_variable("Zb3010_pfJetGoodPt[1]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",25,0,200,"Sub-Leading Jet Pt","Official/Jet2Pt",1); |
373 |
< |
draw_kin_variable("Zb3010_pfJetGoodPt[0]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",25,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt",1); |
374 |
< |
draw_kin_variable("Zb3010_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",20,0,2,"p_{T}^{J2} / p_{T}^{Z}","Official/SubLeadingJetPt_Over_ZPt",1); |
375 |
< |
draw_kin_variable("Zb3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<50", 40,0,2,"#alpha","Official/alpha_pt_30_to_50",1); |
376 |
< |
draw_kin_variable("Zb3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>50&&pt<75", 40,0,2,"#alpha","Official/alpha_50_to_75",1); |
377 |
< |
draw_kin_variable("Zb3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>75&&pt<125", 40,0,2,"#alpha","Official/alpha_pt_75_to_125",1); |
378 |
< |
draw_kin_variable("Zb3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>125&&pt<1000",40,0,2,"#alpha","Official/alpha_pt_125_to_1000",1); |
379 |
< |
draw_kin_variable("Zb3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000",40,0,2,"#alpha","Official/alpha_pt_30_to_1000",1); |
380 |
< |
|
381 |
< |
draw_kin_variable("pfBJetDphiZ[0]",ZplusBsel&&LeadingB&&"pt>10&&pt<1000&&pfBJetDphiZ[0]>0",30,0,3.2,"#delta#phi (Z,b lead)","DeltaPhiZBlead",0); |
382 |
< |
|
383 |
< |
/* |
384 |
< |
draw_kin_variable("pt1",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",20,0,200,"p_{T}^{l1}","Lep/pt1",1); |
385 |
< |
draw_kin_variable("pt1",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000&&id1==0",20,0,200,"p_{T}^{e1}","Lep/pt1_e",1); |
386 |
< |
draw_kin_variable("pt1",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000&&id1==1",20,0,200,"p_{T}^{#mu1}","Lep/pt1_m",1); |
387 |
< |
draw_kin_variable("pt2",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",20,0,200,"p_{T}^{l2}","Lep/pt2",1); |
388 |
< |
draw_kin_variable("pt2",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000&&id2==0",20,0,200,"p_{T}^{e2}","Lep/pt2_e",1); |
389 |
< |
draw_kin_variable("pt2",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000&&id2==1",20,0,200,"p_{T}^{#mu2}","Lep/pt2_m",1); |
390 |
< |
draw_kin_variable("eta1",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",20,-3.1,3.1,"#eta^{l1}","Lep/eta1",1); |
391 |
< |
draw_kin_variable("eta1",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000&&id1==0",20,-3.1,3.1,"#eta^{e1}","Lep/eta1_e",1); |
392 |
< |
draw_kin_variable("eta1",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000&&id1==1",20,-3.1,3.1,"#eta^{m1}","Lep/eta1_m",1); |
393 |
< |
draw_kin_variable("eta2",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",20,-3.1,3.1,"#eta^{l1}","Lep/eta2",1); |
394 |
< |
draw_kin_variable("eta2",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000&&id2==0",20,-3.1,3.1,"#eta^{e2}","Lep/eta2_e",1); |
395 |
< |
draw_kin_variable("eta2",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000&&id2==1",20,-3.1,3.1,"#eta^{#mu2}","Lep/eta2_m",1); |
396 |
< |
draw_kin_variable("numVtx",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",30,0,30,"N(Vtx)","Lep/nVtx",1); |
397 |
< |
*/ |
371 |
> |
|
372 |
> |
draw_kin_variable("pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000"),25,0,200,"Z p_{T}","Official/Zpt",0); |
373 |
> |
draw_kin_variable("pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==0"),25,0,200,"Z p_{T}","Official/Zpt_ee",1); |
374 |
> |
draw_kin_variable("pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==1"),25,0,200,"Z p_{T}","Official/Zpt_mm",1); |
375 |
> |
draw_kin_variable("pt",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000"),25,0,200,"Z p_{T}","Official/Zpt__nonBtagged",1); |
376 |
> |
draw_kin_variable("pt",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==0"),25,0,200,"Z p_{T}","Official/Zpt__nonBtagged_ee",1); |
377 |
> |
draw_kin_variable("pt",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==1"),25,0,200,"Z p_{T}","Official/Zpt__nonBtagged_mm",1); |
378 |
> |
|
379 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[1]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000"),25,0,200,"Sub-Leading Jet Pt","Official/Jet2Pt",1); |
380 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[1]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==0"),25,0,200,"Sub-Leading Jet Pt","Official/Jet2Pt_ee",1); |
381 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[1]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==1"),25,0,200,"Sub-Leading Jet Pt","Official/Jet2Pt_mm",1); |
382 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[1]",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000"),25,0,200,"Sub-Leading Jet Pt","Official/Jet2Pt__nonBtagged",1); |
383 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[1]",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==0"),25,0,200,"Sub-Leading Jet Pt","Official/Jet2Pt__nonBtagged_ee",1); |
384 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[1]",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==1"),25,0,200,"Sub-Leading Jet Pt","Official/Jet2Pt__nonBtagged_mm",1); |
385 |
> |
|
386 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000"),25,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt",1); |
387 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==0"),25,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt_ee",1); |
388 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==1"),25,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt_mm",1); |
389 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000"),25,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt__nonBtagged",1); |
390 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==0"),25,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt__nonBtagged_ee",1); |
391 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]",ZplusBsel&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&id1==1"),25,0,200,"Leading Jet Pt (B)","Official/LeadingJetPt__nonBtagged_mm",1); |
392 |
> |
|
393 |
> |
|
394 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000"),20,0,2,"p_{T}^{J2} / p_{T}^{Z}","Official/SubLeadingJetPt_Over_ZPt",1); |
395 |
> |
draw_kin_variable("ZbCHS3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<50"), 40,0,2,"#alpha","Official/alpha_pt_30_to_50",1); |
396 |
> |
draw_kin_variable("ZbCHS3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>50&&pt<75"), 40,0,2,"#alpha","Official/alpha_50_to_75",1); |
397 |
> |
draw_kin_variable("ZbCHS3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>75&&pt<125"), 40,0,2,"#alpha","Official/alpha_pt_75_to_125",1); |
398 |
> |
draw_kin_variable("ZbCHS3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>125&&pt<1000"),40,0,2,"#alpha","Official/alpha_pt_125_to_1000",1); |
399 |
> |
draw_kin_variable("ZbCHS3010_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000"),40,0,2,"#alpha","Official/alpha_pt_30_to_1000",1); |
400 |
> |
|
401 |
> |
draw_kin_variable("ZbCHS3010_pfBJetDphiZ[0]",ZplusBsel&&LeadingB&&TCut("pt>30&&pt<1000&&pfBJetDphiZ[0]>0"),30,0,3.2,"#delta#phi (Z,b lead)","DeltaPhiZBlead",0); |
402 |
|
} |
403 |
|
|
404 |
|
void draw_mpf_vars() { |
405 |
< |
ZbData::data_over_mc.clear(); |
406 |
< |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.3",20,0,2,"Z+b MPF","mpf_alpha_smaller_0p3",0,"#alpha<0.3, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
407 |
< |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.2",20,0,2,"Z+b MPF","mpf_alpha_smaller_0p2",0,"#alpha<0.2, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
408 |
< |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.15",20,0,2,"Z+b MPF","mpf_alpha_smaller_0p15",0,"#alpha<0.15, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
409 |
< |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.1",20,0,2,"Z+b MPF","mpf_alpha_smaller_0p1",0,"#alpha<0.1, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
410 |
< |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.05",20,0,2,"Z+b MPF","mpf_alpha_smaller_0p05",0,"#alpha<0.05, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
411 |
< |
|
412 |
< |
draw_kin_variable("Zb3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.3",20,0,2,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p3",0,"#alpha<0.3, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
413 |
< |
draw_kin_variable("Zb3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.2",20,0,2,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p2",0,"#alpha<0.2, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
414 |
< |
draw_kin_variable("Zb3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.15",20,0,2,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p15",0,"#alpha<0.15, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
415 |
< |
draw_kin_variable("Zb3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.1",20,0,2,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p1",0,"#alpha<0.1, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
254 |
< |
draw_kin_variable("Zb3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000"&&"Zb3010_alpha<0.05",20,0,2,"p_{T} b-jet / p_{T} Z","ptb_over_ptz__mpf_alpha_smaller_0p05",0,"#alpha<0.05, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
405 |
> |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.3"), 20,0.0,2.0,"Z+b MPF","mpf_alpha_smaller_0p3",0,"#alpha<0.3, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
406 |
> |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.2"), 20,0.0,2.0,"Z+b MPF","mpf_alpha_smaller_0p2",0,"#alpha<0.2, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
407 |
> |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.15"),20,0.0,2.0,"Z+b MPF","mpf_alpha_smaller_0p15",0,"#alpha<0.15, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
408 |
> |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.1"), 20,0.0,2.0,"Z+b MPF","mpf_alpha_smaller_0p1",0,"#alpha<0.1, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
409 |
> |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.05"),20,0.0,2.0,"Z+b MPF","mpf_alpha_smaller_0p05",0,"#alpha<0.05, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
410 |
> |
|
411 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.3"), 20,0.0,2.0,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p3", 0,"#alpha<0.3, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
412 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.2"), 20,0.0,2.0,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p2", 0,"#alpha<0.2, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
413 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.15"),20,0.0,2.0,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p15", 0,"#alpha<0.15, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
414 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.1"), 20,0.0,2.0,"p_{T} b-jet / p_{T} Z","ptb_over_ptz___alpha_smaller_0p1", 0,"#alpha<0.1, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
415 |
> |
draw_kin_variable("ZbCHS3010_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<1000&&ZbCHS3010_alpha<0.05"),20,0.0,2.0,"p_{T} b-jet / p_{T} Z","ptb_over_ptz__mpf_alpha_smaller_0p05",0,"#alpha<0.05, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
416 |
|
} |
417 |
|
|
418 |
< |
Value get_Zb_data_over_mc(string variable, TCut cut) { |
418 |
> |
void make_RooFit(string ContainerName, TH1F *h, float &peak, float &error_peak, string saveas) { |
419 |
> |
TCanvas *fcan = new TCanvas("fcan","fcan"); |
420 |
> |
RooRealVar mpf("mpf","mpf", -5, 5, ""); |
421 |
> |
RooDataHist AllData("AllData", "CMS Real Dataset", mpf , h); |
422 |
> |
|
423 |
> |
RooRealVar fraction("fraction", "fraction", 0.8, 0, 1); |
424 |
> |
RooRealVar mean("mean", "mean", 1, 0, 3); |
425 |
> |
RooRealVar sigma("sigma", "sigma", 1, 0, 5); |
426 |
> |
RooRealVar width("width", "width", 2.4, 0, 5); |
427 |
> |
RooRealVar chevvar1("chevvar1", "chevvar1", 0.2,-1.0, 1.0); |
428 |
> |
RooRealVar chevvar2("chevvar2", "chevvar2", 0.2,-1.0, 1.0); |
429 |
> |
|
430 |
> |
RooVoigtian signal("signal", "signal", mpf, mean, width, sigma); |
431 |
> |
RooChebychev background("background_", "background", mpf, RooArgList(chevvar1, chevvar2)); |
432 |
> |
|
433 |
> |
RooAddPdf pdf("pdf", "pdf", RooArgList(signal, background), fraction); |
434 |
> |
|
435 |
> |
RooFitResult *result = pdf.fitTo(AllData, RooFit::Save()); |
436 |
> |
RooPlot* frame = mpf.frame(RooFit::Bins(30), RooFit::Title("MPF")) ; |
437 |
> |
AllData.plotOn(frame); |
438 |
> |
pdf.plotOn(frame, RooFit::LineColor(kBlue)) ; |
439 |
> |
pdf.plotOn(frame, RooFit::Components(RooArgSet(background)), RooFit::LineStyle(kDashed), RooFit::LineColor(kRed)) ; |
440 |
> |
pdf.plotOn(frame, RooFit::Components(RooArgSet(signal)), RooFit::LineStyle(kDashed), RooFit::LineColor(kGreen)) ; |
441 |
> |
|
442 |
> |
RooRealVar* thePeak = (RooRealVar*) result->floatParsFinal().find("mean"); |
443 |
> |
peak = thePeak->getVal(); |
444 |
> |
error_peak = thePeak->getError(); |
445 |
> |
|
446 |
> |
///******************* just making it beautiful .... |
447 |
> |
RooPlot* frame2 = mpf.frame(RooFit::Bins(30), RooFit::Title("MPF")) ; |
448 |
> |
TH1F *hcopy = (TH1F*)h->Clone("hcopy"); |
449 |
> |
hcopy->Rebin(40); |
450 |
> |
RooDataHist AllRData("AllRData", "CMS Dataset", mpf , hcopy); |
451 |
> |
|
452 |
> |
AllRData.plotOn(frame2); |
453 |
> |
pdf.plotOn(frame2, RooFit::LineColor(kBlue)) ; |
454 |
> |
pdf.plotOn(frame2, RooFit::Components(RooArgSet(background)), RooFit::LineStyle(kDashed), RooFit::LineColor(kRed)) ; |
455 |
> |
pdf.plotOn(frame2, RooFit::Components(RooArgSet(signal)), RooFit::LineStyle(kDashed), RooFit::LineColor(kGreen)) ; |
456 |
> |
|
457 |
> |
string saveasFinal = saveas + "_Fit"; |
458 |
> |
fcan->cd() ; gPad->SetLeftMargin(0.15) ; frame->GetYaxis()->SetTitleOffset(1.4) ; frame2->Draw(); |
459 |
> |
|
460 |
> |
if(h->GetName()=="hdata") DrawPrelim(); |
461 |
> |
else DrawMCPrelim(); |
462 |
> |
|
463 |
> |
CompleteSave(fcan, ContainerName+"/Fit/"+saveasFinal); |
464 |
> |
|
465 |
> |
delete hcopy; |
466 |
> |
delete fcan; |
467 |
> |
delete frame; |
468 |
> |
delete thePeak; |
469 |
> |
} |
470 |
> |
|
471 |
> |
Value get_Zb_data_over_mc(string ContainerName, ZbResultContainer &res, string variable, string variable2, TCut cut, string saveas, float pt1, float pt2, float a1, float a2) { |
472 |
|
// write_warning(__FUNCTION__,"Debugging this function, therefore always returning 3.1415+/-1.010101"); return Value(3.1415,1.010101); |
473 |
< |
TH1F *hdata = allsamples.Draw("hdata",variable,1000,0,30, "#alpha [GeV]", "events", cut,data,luminosity); |
474 |
< |
TH1F *hmc = allsamples.Draw("hmc" , variable,1000,0,30, "#alpha [GeV]", "events", cut,mc, luminosity); |
473 |
> |
TCanvas *cn = new TCanvas("cn","cn"); |
474 |
> |
string varname="MPF"; |
475 |
|
|
476 |
< |
hdata->Fit("gaus","QE"); |
477 |
< |
hmc->Fit("gaus","QE"); |
478 |
< |
TF1 *fdata = (TF1*) hdata->GetFunction("gaus"); |
479 |
< |
TF1 *fmc = (TF1*) hmc->GetFunction("gaus"); |
480 |
< |
|
481 |
< |
/* float a=hdata->GetMean(); |
476 |
> |
bool DoFit=false; |
477 |
> |
bool UseFit=false; |
478 |
> |
bool DoRooFit=false; |
479 |
> |
|
480 |
> |
|
481 |
> |
if(Contains(variable,"pfJetGood")) varname="R_{abs}"; |
482 |
> |
// TH1F *hdata = allsamples.Draw("hdata",variable,1200,0,30, varname, "events", cut,data,luminosity); |
483 |
> |
// TH1F *hmc = allsamples.Draw("hmc" , variable,1200,0,30, varname, "events", cut, mc, luminosity); |
484 |
> |
TH1F *hdata, hmc; |
485 |
> |
if(!DoRooFit) { |
486 |
> |
hdata = allsamples.Draw("hdata",variable,1200,ZbData::LowerHistoBoundary,ZbData::UpperHistoBoundary, varname, "events", cut,data,luminosity); // making it more precise |
487 |
> |
hmc = allsamples.Draw("hmc" , variable,1200,ZbData::LowerHistoBoundary,ZbData::UpperHistoBoundary, varname, "events", cut, mc, luminosity); // making it more precise |
488 |
> |
} |
489 |
> |
|
490 |
> |
hmc->SetLineColor(kBlue); |
491 |
> |
|
492 |
> |
float a=hdata->GetMean(); |
493 |
|
float b=hmc->GetMean(); |
494 |
|
float da=hdata->GetMeanError(); |
495 |
< |
float db=hmc->GetMeanError();*/ |
271 |
< |
float a = fdata->GetParameter(1); |
272 |
< |
float da = fdata->GetParError(1); |
273 |
< |
float b = fmc->GetParameter(1); |
274 |
< |
float db = fmc->GetParError(1); |
495 |
> |
float db=hmc->GetMeanError(); |
496 |
|
float factor = a / b; |
497 |
|
float error = TMath::Sqrt( (1/(b*b)) * (da*da) + ((a*a)/(b*b))*db*db); |
498 |
+ |
|
499 |
+ |
TF1 *gaus_data = new TF1("gaus_data","gaus",0.7,1.3); |
500 |
+ |
TF1 *gaus_mc = new TF1("gaus_mc","gaus",0.7,1.3); |
501 |
+ |
if(DoFit) { |
502 |
+ |
gaus_data->SetParameter(0,hdata->GetMaximum()); |
503 |
+ |
gaus_data->SetParameter(2,hdata->GetMean()); |
504 |
+ |
gaus_data->SetParameter(1,hdata->GetRMS()); |
505 |
+ |
hdata->Fit(gaus_data); |
506 |
+ |
|
507 |
+ |
gaus_mc->SetParameter(0,hmc->GetMaximum()); |
508 |
+ |
gaus_mc->SetParameter(1,hmc->GetMean()); |
509 |
+ |
gaus_mc->SetParameter(2,hmc->GetRMS()); |
510 |
+ |
hmc->Fit(gaus_mc); |
511 |
+ |
} |
512 |
+ |
if(DoRooFit) { |
513 |
+ |
hdata = allsamples.Draw("hdata",variable,7200,0.0,6.0, varname, "events", cut,data,luminosity); // making it more precise |
514 |
+ |
hmc = allsamples.Draw("hmc" , variable,7200,0.0,6.0, varname, "events", cut, mc, luminosity); // making it more precise |
515 |
+ |
if(hdata->Integral()>10) { |
516 |
+ |
make_RooFit(ContainerName, hdata, a, da, saveas+"_data"); |
517 |
+ |
make_RooFit(ContainerName, hmc, b, db, saveas+"_mc"); |
518 |
+ |
factor = a / b; |
519 |
+ |
error = TMath::Sqrt( (1/(b*b)) * (da*da) + ((a*a)/(b*b))*db*db); |
520 |
+ |
} else { |
521 |
+ |
factor=NAN;//set to nan |
522 |
+ |
error=NAN;//set to nan |
523 |
+ |
} |
524 |
+ |
} |
525 |
+ |
|
526 |
+ |
cn->cd(); |
527 |
+ |
hdata->Rebin(int(0.05*1200/(ZbData::UpperHistoBoundary-ZbData::LowerHistoBoundary))); |
528 |
+ |
hmc->Rebin(int(0.05*1200/(ZbData::UpperHistoBoundary-ZbData::LowerHistoBoundary))); |
529 |
+ |
hdata->GetYaxis()->SetTitle("events / 0.05"); |
530 |
+ |
hdata->SetMarkerColor(kRed); |
531 |
+ |
if(DoFit) { |
532 |
+ |
gaus_mc->SetLineColor(kBlue); |
533 |
+ |
gaus_data->SetLineColor(kRed); |
534 |
+ |
} |
535 |
+ |
|
536 |
+ |
hdata->GetXaxis()->SetRangeUser(0,2); |
537 |
+ |
hdata->GetYaxis()->SetTitleOffset(1.3); |
538 |
+ |
hdata->Draw("e1"); |
539 |
+ |
|
540 |
+ |
hmc->Scale(hdata->Integral()/hmc->Integral()); |
541 |
+ |
if(hmc->GetMaximum()>hdata->GetMaximum()) hdata->SetMaximum((hmc->GetMaximum()+sqrt((double)hmc->GetMaximum()))*1.2); |
542 |
+ |
|
543 |
+ |
hmc->Draw("histo,same"); |
544 |
+ |
hdata->Draw("e1,same"); |
545 |
+ |
if(DoFit) { |
546 |
+ |
gaus_data->Draw("same"); |
547 |
+ |
gaus_mc->Draw("same"); |
548 |
+ |
} |
549 |
+ |
|
550 |
+ |
stringstream summary; |
551 |
+ |
summary << "#splitline{#bf{" << varname << "}}{#splitline{" << pt1 << " < p_{T}^{Z} < " << pt2 << ", " << a1 << " #leq #alpha < " << a2 << "}{#splitline{data: " << std::setprecision(4) << a << " #pm " << std::setprecision(4) << da << "}{"; |
552 |
+ |
summary << "#splitline{mc: " << std::setprecision(4) << b << " #pm " << std::setprecision(4) << db << "}{#splitline{ratio: " << factor; |
553 |
+ |
summary << " #pm " << error; |
554 |
+ |
if(DoFit) { |
555 |
+ |
summary << "}{#splitline{}{#splitline{data fit: " << std::setprecision(4) << gaus_data->GetParameter(1) << "+/-"; |
556 |
+ |
summary << std::setprecision(4) << gaus_data->GetParError(1) << "}{#splitline{"; |
557 |
+ |
summary << "mc fit:" << std::setprecision(4) << gaus_mc->GetParameter(1) << "#pm" << std::setprecision(4) << gaus_mc->GetParError(1) << "}{ratio: "; |
558 |
+ |
summary << gaus_data->GetParameter(1)/gaus_mc->GetParameter(1) << "#pm" << gaus_data->GetParameter(1)/gaus_mc->GetParameter(1) * sqrt((gaus_data->GetParError(1) * gaus_data->GetParError(1))/(gaus_data->GetParameter(1)*gaus_data->GetParameter(1)) + (gaus_mc->GetParError(1) * gaus_mc->GetParError(1))/(gaus_mc->GetParameter(1)*gaus_mc->GetParameter(1)) ) << "}}}}"; |
559 |
+ |
summary << "}}}}"; |
560 |
+ |
} else { |
561 |
+ |
summary << "}{}}}}}"; |
562 |
+ |
} |
563 |
+ |
|
564 |
+ |
if(UseFit) { |
565 |
+ |
write_error(__FUNCTION__,"Requested using fit result for final result - not implemented yet!"); |
566 |
+ |
assert(0); |
567 |
+ |
} |
568 |
+ |
|
569 |
+ |
|
570 |
+ |
TText *infobox = write_title(summary.str()); |
571 |
+ |
infobox->SetX(0.75); |
572 |
+ |
infobox->SetTextSize(0.03); |
573 |
+ |
infobox->SetY(0.75); |
574 |
+ |
infobox->Draw(); |
575 |
+ |
|
576 |
+ |
|
577 |
+ |
DrawPrelim(); |
578 |
+ |
CompleteSave(cn,ContainerName+"/ResponsePlots/"+saveas); |
579 |
+ |
|
580 |
+ |
res.MPF_Rabs_location.push_back(ZbPointResult(variable,pt1,pt2,a1,a2,Value(a,da),Value(b,db))); |
581 |
+ |
dout << "Data;" << a << ";"<<da<<";MC;"<<b<<";"<<db<<endl; |
582 |
+ |
delete cn; |
583 |
|
delete hdata; |
584 |
|
delete hmc; |
585 |
|
|
280 |
– |
// cout << a << "+/-" << da << " " << b << "=/-" << db << endl; |
281 |
– |
|
586 |
|
return Value(factor,error); |
587 |
|
} |
588 |
|
|
589 |
+ |
int nFakes=1; |
590 |
+ |
|
591 |
+ |
float PurityInclusive=0.05; |
592 |
+ |
float PurityLoose=0.20; |
593 |
+ |
float PurityMedium=0.54; |
594 |
+ |
float PurityTight=0.82; |
595 |
+ |
|
596 |
+ |
|
597 |
+ |
void GetPtPointPosition(float AvPos[], const int nptcuts,string AlphaVariable, TCut basecut, float FaceValueToBeTakenAt, float ptcuts[]) { |
598 |
+ |
for(int i=0;i<nptcuts-1;i++) { |
599 |
+ |
stringstream specialcut; |
600 |
+ |
specialcut << "((pt>30&& pt< 1000) && (" << AlphaVariable << "<" << FaceValueToBeTakenAt << "))"; |
601 |
+ |
TH1F *hdata = allsamples.Draw("hada", "pt",100,ptcuts[i],ptcuts[i+1], "MPF", "events", TCut(basecut && specialcut.str().c_str()), data, luminosity); |
602 |
+ |
AvPos[i]=hdata->GetMean(); |
603 |
+ |
dout << AvPos[i] << " : "; |
604 |
+ |
delete hdata; |
605 |
+ |
} |
606 |
+ |
dout << endl; |
607 |
+ |
} |
608 |
+ |
|
609 |
+ |
|
610 |
+ |
void DeterminePurity(TCut basecut, int nptcuts, float ptcuts[], string AlphaVariable, string ContainerName, float FaceValueToBeTakenAt) { |
611 |
+ |
|
612 |
+ |
bool ComputePurity=false; |
613 |
+ |
|
614 |
+ |
if(ContainerName=="inclusive") ComputePurity=true; |
615 |
+ |
if(ContainerName=="loose") ComputePurity=true; |
616 |
+ |
if(ContainerName=="medium") ComputePurity=true; |
617 |
+ |
if(ContainerName=="reference") ComputePurity=true; |
618 |
+ |
|
619 |
+ |
if(!ComputePurity) return; |
620 |
+ |
|
621 |
+ |
stringstream specialcut; |
622 |
+ |
specialcut << "((pt>30&& pt< 1000) && (" << AlphaVariable << "<" << FaceValueToBeTakenAt << "))"; |
623 |
+ |
|
624 |
+ |
THStack mcm = allsamples.DrawStack("mcm" , "mpf",1200,0,30, "MPF", "events", TCut(basecut && specialcut.str().c_str()), mc, luminosity); |
625 |
+ |
int nhists = mcm.GetHists()->GetEntries(); |
626 |
+ |
|
627 |
+ |
float total=0; |
628 |
+ |
float Zb=0; |
629 |
+ |
|
630 |
+ |
for (int i = 0; i < nhists; i++) { |
631 |
+ |
TH1* hist = static_cast<TH1*>(mcm.GetHists()->At(i)); |
632 |
+ |
string name=hist->GetName(); |
633 |
+ |
if(Contains(name,"t_bar_t")) total+=hist->Integral(); |
634 |
+ |
if(Contains(name,"W_Jets")) total+=hist->Integral(); |
635 |
+ |
if(Contains(name,"Single_top")) total+=hist->Integral(); |
636 |
+ |
if(Contains(name,"Dibosons")) total+=hist->Integral(); |
637 |
+ |
if(Contains(name,"Z_l_")) total+=hist->Integral(); |
638 |
+ |
if(Contains(name,"Z_c_")) total+=hist->Integral(); |
639 |
+ |
if(Contains(name,"Z_b_")) { |
640 |
+ |
total+=hist->Integral(); |
641 |
+ |
Zb+=hist->Integral(); |
642 |
+ |
} |
643 |
+ |
} |
644 |
+ |
|
645 |
+ |
float purity=Zb/total; |
646 |
+ |
dout << "Determined a purity of " << 100*purity << " % for the container \"" << ContainerName << "\"" << endl; |
647 |
|
|
648 |
+ |
if(ContainerName=="inclusive") PurityInclusive=purity; |
649 |
+ |
if(ContainerName=="loose") PurityLoose=purity; |
650 |
+ |
if(ContainerName=="medium") PurityMedium=purity; |
651 |
+ |
if(ContainerName=="reference") PurityTight=purity; |
652 |
+ |
|
653 |
+ |
DeleteStack(mcm); |
654 |
+ |
} |
655 |
+ |
|
656 |
+ |
string NiceAlphaPrint(float alpha) { |
657 |
+ |
//get in : 0.3, return 0p3 ... |
658 |
+ |
stringstream res; |
659 |
+ |
res << int(alpha) << "p" << int(100*alpha); |
660 |
+ |
return res.str(); |
661 |
+ |
} |
662 |
|
|
663 |
< |
void new_data_mc_agreement_2d() { |
663 |
> |
ZbResultContainer new_data_mc_agreement_2d(bool gofast, string AlphaVariable, string ContainerName, TCut BTagCut, TCut BTagWgt, float FaceValueToBeTakenAt) { |
664 |
> |
|
665 |
> |
if(gofast) write_info(__FUNCTION__,"Fast mode activated for "+ContainerName); |
666 |
> |
ZbResultContainer results(ContainerName); |
667 |
> |
|
668 |
> |
cutWeight=STDWEIGHT*BTagWgt; |
669 |
> |
LeadingB=BTagCut; |
670 |
> |
|
671 |
> |
|
672 |
|
gStyle->SetOptFit(0); |
673 |
|
TCut basecut(ZplusBsel&&LeadingB&&EtaB&&PhiZcut); |
674 |
< |
const int nalphacuts=5; |
675 |
< |
float alphacuts[nalphacuts] = {0.1,0.15,0.2,0.25,0.3}; |
676 |
< |
int PointThree=-1; |
293 |
< |
for(int i=0;i<nalphacuts;i++) { |
294 |
< |
if((alphacuts[i]-0.3)<0.01) PointThree=i-1; |
295 |
< |
} |
296 |
< |
if(PointThree<0) { |
297 |
< |
write_warning(__FUNCTION__,"alpha=0.3 MUST BE ONE OF THE ALPHA VALUES!"); |
298 |
< |
assert(PointThree<0); |
299 |
< |
} |
674 |
> |
const int nalphacuts=6; |
675 |
> |
float alphacuts[nalphacuts] = {0.1,0.15,0.2,0.25,0.3,0.35}; |
676 |
> |
|
677 |
|
|
678 |
|
const int nptcuts=5; |
679 |
|
float ptcuts[nptcuts]={30,50,75,125,1000}; |
680 |
+ |
float ptPointPosition[nptcuts]; |
681 |
+ |
GetPtPointPosition(ptPointPosition,nptcuts,AlphaVariable,basecut,FaceValueToBeTakenAt,ptcuts); |
682 |
+ |
|
683 |
+ |
|
684 |
+ |
DeterminePurity(basecut, nptcuts,ptcuts, AlphaVariable, ContainerName, FaceValueToBeTakenAt); |
685 |
|
|
686 |
|
float MPF_Results[nalphacuts][nptcuts]; |
687 |
|
float MPF_Errors[nalphacuts][nptcuts]; |
689 |
|
float RABS_Errors[nalphacuts][nptcuts]; |
690 |
|
|
691 |
|
|
692 |
< |
for(int ia=0;ia<nalphacuts;ia++) { |
692 |
> |
for(int ia=0;ia<nalphacuts && !gofast;ia++) { |
693 |
|
for(int ipt=0;ipt<nptcuts-1;ipt++) { |
694 |
|
stringstream specialcut; |
695 |
< |
specialcut << "((pt>" << ptcuts[ipt] << " && pt< " << ptcuts[ipt+1] << ") && (Zb3010_alpha<" << alphacuts[ia] << "))"; |
696 |
< |
cout << specialcut.str() << endl; |
697 |
< |
Value MPF_data_over_mc = get_Zb_data_over_mc("mpf",TCut(basecut && specialcut.str().c_str())); |
698 |
< |
Value RABS_data_over_mc = get_Zb_data_over_mc("Zb3010_pfJetGoodPt[0]/pt",TCut(basecut && specialcut.str().c_str())); |
695 |
> |
float alow,ahigh; |
696 |
> |
if(ia>0) { |
697 |
> |
specialcut << "((pt>" << ptcuts[ipt] << " && pt< " << ptcuts[ipt+1] << ") && (" << AlphaVariable << "<" << alphacuts[ia] << " && " << AlphaVariable << ">" << alphacuts[ia-1] << "))"; |
698 |
> |
alow=alphacuts[ia-1]; |
699 |
> |
ahigh=alphacuts[ia]; |
700 |
> |
} else { |
701 |
> |
specialcut << "((pt>" << ptcuts[ipt] << " && pt< " << ptcuts[ipt+1] << ") && (" << AlphaVariable << "<" << alphacuts[ia] << "))"; |
702 |
> |
alow=0; |
703 |
> |
ahigh=alphacuts[ia]; |
704 |
> |
} |
705 |
> |
dout << specialcut.str() << endl; |
706 |
> |
Value MPF_data_over_mc = get_Zb_data_over_mc(ContainerName,results,"mpf","",TCut(basecut && specialcut.str().c_str()),"MPF___pt_"+any2string(ptcuts[ipt])+"_"+any2string(ptcuts[ipt+1])+"__alpha_"+any2string(NiceAlphaPrint(alphacuts[ia])), ptcuts[ipt], ptcuts[ipt+1],alow,ahigh); |
707 |
> |
Value RABS_data_over_mc = get_Zb_data_over_mc(ContainerName,results,"ZbCHS3010_pfJetGoodPt[0]/pt","",TCut(basecut && specialcut.str().c_str()),"Rabs___pt_"+any2string(ptcuts[ipt])+"_"+any2string(ptcuts[ipt+1])+"__alpha_"+any2string(NiceAlphaPrint(alphacuts[ia])), ptcuts[ipt], ptcuts[ipt+1],alow,ahigh); |
708 |
|
|
709 |
|
MPF_Results[ia][ipt]=MPF_data_over_mc.getValue(); |
710 |
|
MPF_Errors[ia][ipt]=MPF_data_over_mc.getError(); |
712 |
|
RABS_Results[ia][ipt]=RABS_data_over_mc.getValue(); |
713 |
|
RABS_Errors[ia][ipt]=RABS_data_over_mc.getError(); |
714 |
|
|
715 |
< |
cout << "alpha cut at " << alphacuts[ia+1] << " and pt range " << ptcuts[ipt] << " , " << ptcuts[ipt+1] << " \t : \t" << specialcut.str() << " \t \t --> " << MPF_data_over_mc << " (MPF) " << RABS_data_over_mc << " (RABS)" << endl; |
715 |
> |
dout << "alpha cut at " << alphacuts[ia+1] << " and pt range " << ptcuts[ipt] << " , " << ptcuts[ipt+1] << " \t : \t" << specialcut.str() << " \t \t --> " << MPF_data_over_mc << " (MPF) " << RABS_data_over_mc << " (RABS)" << endl; |
716 |
|
} |
717 |
|
} |
718 |
|
|
720 |
|
float RABS_ExtraPolatedResults[nptcuts]; |
721 |
|
|
722 |
|
TCanvas *can = new TCanvas("can"); |
723 |
+ |
can->cd(1)->SetLeftMargin(0.15); |
724 |
|
|
725 |
|
TGraphErrors *MPF_FinalGraph = new TGraphErrors(); |
726 |
|
TGraphErrors *RABS_FinalGraph = new TGraphErrors(); |
727 |
< |
TGraphErrors *FaceValueAtPoint3 = new TGraphErrors(); |
727 |
> |
TGraphErrors *MPF_FaceValueAtPoint3 = new TGraphErrors(); |
728 |
> |
TGraphErrors *RABS_FaceValueAtPoint3 = new TGraphErrors(); |
729 |
|
|
730 |
|
for(int ipt=0;ipt<nptcuts-1;ipt++) { |
731 |
|
|
732 |
|
stringstream filename; |
733 |
|
filename << "Extrapolation/Zplusb_data_over_mc___" << ptcuts[ipt] << "_to_" << ptcuts[ipt+1]; |
734 |
< |
cout << "Going to create histo for " << filename.str() << endl; |
734 |
> |
dout << "Going to create histo for " << filename.str() << endl; |
735 |
|
TGraphErrors *mpf_gr =new TGraphErrors(); |
736 |
|
TGraphErrors *rabs_gr =new TGraphErrors(); |
344 |
– |
for(int ia=0;ia<nalphacuts;ia++) { |
345 |
– |
cout << "Setting a point for an alpha cut at " << alphacuts[ia] << " with value " << MPF_Results[ia][ipt] << " (MPF) and " << RABS_Results[ia][ipt] << " (RABS)" << endl; |
346 |
– |
mpf_gr->SetPoint(ia,alphacuts[ia],MPF_Results[ia][ipt]); // avoiding empty bins (nan's) |
347 |
– |
mpf_gr->SetPointError(ia,0,MPF_Errors[ia][ipt]); // avoiding empty bins (nan's) |
348 |
– |
rabs_gr->SetPoint(ia,alphacuts[ia],RABS_Results[ia][ipt]); // avoiding empty bins (nan's) |
349 |
– |
rabs_gr->SetPointError(ia,0,RABS_Errors[ia][ipt]); // avoiding empty bins (nan's) |
350 |
– |
} |
351 |
– |
cout << "About to add a point in pt (" << ptcuts[ipt]+ptcuts[ipt+1] << " ) to face value : " << MPF_Results[PointThree][ipt] << endl; |
352 |
– |
FaceValueAtPoint3->SetPoint(ipt,(ptcuts[ipt]+ptcuts[ipt+1]),MPF_Results[PointThree][ipt]); |
353 |
– |
FaceValueAtPoint3->SetPointError(ipt,0,MPF_Errors[PointThree][ipt]); |
354 |
– |
|
355 |
– |
mpf_gr->SetMarkerStyle(21); |
356 |
– |
mpf_gr->SetMarkerColor(kBlue); |
357 |
– |
mpf_gr->Draw("AP"); |
358 |
– |
mpf_gr->Fit("pol1","QE"); // quiet, use minos |
359 |
– |
mpf_gr->GetXaxis()->SetTitle("#alpha"); |
360 |
– |
mpf_gr->GetXaxis()->CenterTitle(); |
361 |
– |
mpf_gr->GetYaxis()->SetTitle("<MPF>_{data}/<MPF>_{mc}"); |
362 |
– |
mpf_gr->GetYaxis()->CenterTitle(); |
363 |
– |
TF1 *mpf_pol=(TF1*)mpf_gr->GetFunction("pol1"); |
364 |
– |
float mpf_a=mpf_pol->GetParameter(0); |
365 |
– |
float mpf_b=mpf_pol->GetParameter(1); |
366 |
– |
MPF_FinalGraph->SetPoint(ipt,0.5*(ptcuts[ipt]+ptcuts[ipt+1]),mpf_a); |
367 |
– |
MPF_FinalGraph->SetPointError(ipt,0,mpf_pol->GetParError(0)); |
368 |
– |
|
369 |
– |
MPF_ExtraPolatedResults[ipt]=mpf_a; |
370 |
– |
|
371 |
– |
stringstream mpf_info; |
372 |
– |
mpf_info << "#splitline{#splitline{#splitline{" << ptcuts[ipt] << " GeV < p_{T}^{Z} < " << ptcuts[ipt+1] << " GeV }{ (MPF) }}{Extrapolated value: " << std::setprecision(3) << mpf_a << "}}{#chi^{2}/NDF : " << mpf_pol->GetChisquare() << " / " << mpf_pol->GetNDF() << "}"; |
373 |
– |
|
374 |
– |
TText *mpf_mark = write_title(mpf_info.str()); |
375 |
– |
mpf_mark->SetX(0.75); |
376 |
– |
mpf_mark->SetTextSize(0.03); |
377 |
– |
mpf_mark->SetY(0.75); |
378 |
– |
mpf_mark->Draw(); |
379 |
– |
|
380 |
– |
string filenamebkp=filename.str(); |
381 |
– |
filename << "__MPF"; |
382 |
– |
DrawPrelim(); |
383 |
– |
CompleteSave(can,filename.str()); |
384 |
– |
cout << "MPF : " << mpf_a << " + " << mpf_b << " * alpha " << endl; |
385 |
– |
|
386 |
– |
filename.str(""); |
737 |
|
|
738 |
< |
rabs_gr->SetMarkerStyle(21); |
739 |
< |
rabs_gr->SetMarkerColor(kBlue); |
390 |
< |
rabs_gr->Fit("pol1","QE"); // quiet, use minos |
391 |
< |
rabs_gr->Draw("AP"); |
392 |
< |
rabs_gr->GetXaxis()->SetTitle("#alpha"); |
393 |
< |
rabs_gr->GetXaxis()->CenterTitle(); |
394 |
< |
rabs_gr->GetYaxis()->SetTitle("<R_{abs}>_{data}/<R_{abs}>_{mc}"); |
395 |
< |
rabs_gr->GetYaxis()->CenterTitle(); |
738 |
> |
int rabs_counter=0; |
739 |
> |
int mpf_counter=0; |
740 |
|
|
741 |
< |
TF1 *rabs_pol=(TF1*)rabs_gr->GetFunction("pol1"); |
742 |
< |
float rabs_a=rabs_pol->GetParameter(0); |
743 |
< |
float rabs_b=rabs_pol->GetParameter(1); |
744 |
< |
RABS_FinalGraph->SetPoint(ipt,0.5*(ptcuts[ipt]+ptcuts[ipt+1]),rabs_a); |
745 |
< |
RABS_FinalGraph->SetPointError(ipt,0,rabs_pol->GetParError(0)); |
746 |
< |
|
747 |
< |
cout << "!+!+!+!+!+!+!+!+!+ Just added a point to the final plot : " << rabs_a << " +/- " << rabs_pol->GetParError(0) << endl; |
741 |
> |
for(int ia=0;ia<nalphacuts && !gofast;ia++) { |
742 |
> |
dout << "Setting a point for an alpha cut at " << alphacuts[ia] << " with value " << MPF_Results[ia][ipt] << " (MPF) and " << RABS_Results[ia][ipt] << " (RABS)" << endl; |
743 |
> |
if(MPF_Results[ia][ipt]==MPF_Results[ia][ipt] && MPF_Errors[ia][ipt]==MPF_Errors[ia][ipt]) { // remove nan's |
744 |
> |
mpf_gr->SetPoint(mpf_counter,alphacuts[ia],MPF_Results[ia][ipt]); |
745 |
> |
mpf_gr->SetPointError(mpf_counter,0,MPF_Errors[ia][ipt]); |
746 |
> |
mpf_counter++; |
747 |
> |
} else { |
748 |
> |
dout << "Detected BS for MPF method (bin ignored) : " << endl; |
749 |
> |
dout << " alpha: " << alphacuts[ia] << " , pt range: " << ptcuts[ipt] << " < pt < " << ptcuts[ipt+1] << endl; |
750 |
> |
dout << " value (MPF) : " << MPF_Results[ia][ipt] << " +/- " << MPF_Errors[ia][ipt] << endl; |
751 |
> |
} |
752 |
> |
if(RABS_Results[ia][ipt]==RABS_Results[ia][ipt] && RABS_Errors[ia][ipt]==RABS_Errors[ia][ipt]) { |
753 |
> |
rabs_gr->SetPoint(rabs_counter,alphacuts[ia],RABS_Results[ia][ipt]); |
754 |
> |
rabs_gr->SetPointError(rabs_counter,0,RABS_Errors[ia][ipt]); |
755 |
> |
rabs_counter++; |
756 |
> |
} else { |
757 |
> |
dout << "Detected BS for RABS method (bin ignored) : " << endl; |
758 |
> |
dout << " alpha: " << alphacuts[ia] << " , pt range: " << ptcuts[ipt] << " < pt < " << ptcuts[ipt+1] << endl; |
759 |
> |
dout << " value (RABS) : " << RABS_Results[ia][ipt] << " +/- " << RABS_Errors[ia][ipt] << endl; |
760 |
> |
} |
761 |
> |
} |
762 |
|
|
763 |
+ |
stringstream specialcut; |
764 |
+ |
specialcut << "((pt>" << ptcuts[ipt] << " && pt< " << ptcuts[ipt+1] << ") && (" << AlphaVariable << "<" << FaceValueToBeTakenAt << "))"; |
765 |
+ |
Value MPF_data_over_mc = get_Zb_data_over_mc(ContainerName,results,"mpf","",TCut(basecut && specialcut.str().c_str()),"MPF___pt_"+any2string(ptcuts[ipt])+"_"+any2string(ptcuts[ipt+1])+"__INCLUSIVEalpha_"+any2string(FaceValueToBeTakenAt),ptcuts[ipt],ptcuts[ipt+1],0,FaceValueToBeTakenAt); |
766 |
+ |
Value RABS_data_over_mc = get_Zb_data_over_mc(ContainerName,results,"ZbCHS3010_pfJetGoodPt[0]/pt","",TCut(basecut && specialcut.str().c_str()),"Rabs___pt_"+any2string(ptcuts[ipt])+"_"+any2string(ptcuts[ipt+1])+"__INCLUSIVEalpha_"+any2string(FaceValueToBeTakenAt),ptcuts[ipt],ptcuts[ipt+1],0,FaceValueToBeTakenAt); |
767 |
+ |
dout << "About to add a point in pt (" << (ptcuts[ipt]+ptcuts[ipt+1])/2 << " ) to face value : " << MPF_data_over_mc << " (MPF) , " << RABS_data_over_mc << "(RABS)" << endl; |
768 |
+ |
MPF_FaceValueAtPoint3->SetPoint(ipt,(ptcuts[ipt]+ptcuts[ipt+1])/2,MPF_data_over_mc.getValue()); |
769 |
+ |
MPF_FaceValueAtPoint3->SetPointError(ipt,0,MPF_data_over_mc.getError()); |
770 |
+ |
RABS_FaceValueAtPoint3->SetPoint(ipt,(ptcuts[ipt]+ptcuts[ipt+1])/2,RABS_data_over_mc.getValue()); |
771 |
+ |
RABS_FaceValueAtPoint3->SetPointError(ipt,0,RABS_data_over_mc.getError()); |
772 |
+ |
|
773 |
+ |
|
774 |
+ |
TH1D *mpf_band, *rabs_band; |
775 |
+ |
|
776 |
+ |
if(!gofast) { |
777 |
+ |
can->cd(); |
778 |
+ |
mpf_gr->SetMarkerStyle(21); |
779 |
+ |
mpf_gr->SetMarkerColor(kBlue); |
780 |
+ |
mpf_gr->Draw("AP"); |
781 |
+ |
|
782 |
+ |
TF1 *mpf_pol = new TF1("mpf_pol","[0]+[1]*x",ZbData::LowerHistoBoundary,ZbData::UpperHistoBoundary); |
783 |
+ |
|
784 |
+ |
mpf_gr->Fit(mpf_pol,"E"); // better error estimation using MINOS (E), quiet (Q) and using loglikelihood method |
785 |
+ |
mpf_gr->GetXaxis()->SetTitle("#alpha"); |
786 |
+ |
mpf_gr->GetXaxis()->CenterTitle(); |
787 |
+ |
mpf_gr->GetYaxis()->SetTitle("<MPF>_{data}/<MPF>_{mc}"); |
788 |
+ |
mpf_gr->GetYaxis()->CenterTitle(); |
789 |
+ |
//TF1 *mpf_pol=(TF1*)mpf_gr->GetFunction("pol1"); |
790 |
+ |
mpf_band = getBand(mpf_pol,"MPF_band"); |
791 |
+ |
mpf_pol->SetLineWidth(0); |
792 |
+ |
TF1 *mpf_pol_complete = new TF1("mpf_pol_complete","[0]+[1]*x"); |
793 |
+ |
mpf_pol_complete->SetParameters(mpf_pol->GetParameters()); |
794 |
+ |
mpf_pol_complete->SetLineWidth(1); |
795 |
+ |
mpf_pol_complete->SetLineColor(kBlue); |
796 |
+ |
|
797 |
+ |
float min,max; |
798 |
+ |
FindMinMax(mpf_gr,min,max); |
799 |
+ |
TH1F *histo = new TH1F("histo","histo",1,0,0.4); |
800 |
+ |
histo->GetXaxis()->SetTitle("#alpha"); |
801 |
+ |
histo->GetYaxis()->SetTitle("<MPF>_{data}/<MPF>_{mc}"); |
802 |
+ |
histo->GetXaxis()->CenterTitle(); |
803 |
+ |
histo->GetYaxis()->CenterTitle(); |
804 |
+ |
histo->GetYaxis()->SetTitleOffset(1.3); |
805 |
+ |
histo->SetStats(0); |
806 |
+ |
histo->GetXaxis()->SetRangeUser(0,0.4); |
807 |
+ |
histo->GetYaxis()->SetRangeUser(min,max); |
808 |
+ |
mpf_gr->GetYaxis()->SetRangeUser(min,max); |
809 |
+ |
|
810 |
+ |
//TPolyLine *mpf_fit_uncert = GetFitUncertaintyShape(mpf_gr, "pol1", min, max,0.0,0.4); |
811 |
+ |
|
812 |
+ |
mpf_pol->SetLineColor(TColor::GetColor("#0101DF")); |
813 |
+ |
//mpf_fit_uncert->SetFillColor(TColor::GetColor("#A2A2FA")); |
814 |
+ |
mpf_band->SetFillColor(TColor::GetColor("#A2A2FA")); |
815 |
+ |
histo->GetYaxis()->SetTitle("<MPF>_{data}/<MPF>_{mc}"); |
816 |
+ |
histo->Draw(); |
817 |
+ |
//mpf_fit_uncert->Draw("F"); |
818 |
+ |
//mpf_fit_uncert->Draw(""); |
819 |
+ |
mpf_gr->Draw("P"); |
820 |
+ |
mpf_band->Draw("C E3 SAME"); |
821 |
+ |
mpf_gr->Draw("P"); |
822 |
+ |
mpf_pol_complete->Draw("same"); |
823 |
+ |
|
824 |
+ |
float mpf_a=mpf_pol->GetParameter(0); |
825 |
+ |
float mpf_b=mpf_pol->GetParameter(1); |
826 |
+ |
MPF_FinalGraph->SetPoint(ipt,0.5*(ptcuts[ipt]+ptcuts[ipt+1]),mpf_a); |
827 |
+ |
MPF_FinalGraph->SetPointError(ipt,0,mpf_pol->GetParError(0)); |
828 |
+ |
|
829 |
+ |
MPF_ExtraPolatedResults[ipt]=mpf_a; |
830 |
+ |
|
831 |
+ |
stringstream mpf_info; |
832 |
+ |
mpf_info << "#splitline{#splitline{#splitline{" << ptcuts[ipt] << " GeV < p_{T}^{Z} < " << ptcuts[ipt+1] << " GeV }{ (MPF) }}{Extrapolated value: " << std::setprecision(4) << mpf_a << "}}{#chi^{2}/NDF : " << mpf_pol->GetChisquare() << " / " << mpf_pol->GetNDF() << "}"; |
833 |
+ |
|
834 |
+ |
TText *mpf_mark = write_title(mpf_info.str()); |
835 |
+ |
mpf_mark->SetX(0.75); |
836 |
+ |
mpf_mark->SetTextSize(0.03); |
837 |
+ |
mpf_mark->SetY(0.75); |
838 |
+ |
mpf_mark->Draw(); |
839 |
+ |
|
840 |
+ |
string filenamebkp=filename.str(); |
841 |
+ |
filename << "__MPF"; |
842 |
+ |
DrawPrelim(); |
843 |
+ |
CompleteSave(can,ContainerName+"/"+filename.str()); |
844 |
+ |
dout << "MPF : " << mpf_a << " + " << mpf_b << " * alpha " << endl; |
845 |
+ |
|
846 |
+ |
filename.str(""); |
847 |
+ |
|
848 |
+ |
TF1 *rabs_pol = new TF1("rabs_pol","[0]+[1]*x",ZbData::LowerHistoBoundary,ZbData::UpperHistoBoundary); |
849 |
+ |
rabs_gr->SetMarkerStyle(21); |
850 |
+ |
rabs_gr->SetMarkerColor(kRed); |
851 |
+ |
rabs_gr->Draw("AP"); |
852 |
+ |
//rabs_gr->Fit("pol1","E"); |
853 |
+ |
rabs_gr->Fit(rabs_pol,"E"); |
854 |
+ |
rabs_band = getBand(rabs_pol,"Rabs_band"); |
855 |
+ |
|
856 |
+ |
|
857 |
+ |
rabs_gr->GetXaxis()->SetTitle("#alpha"); |
858 |
+ |
rabs_gr->GetXaxis()->CenterTitle(); |
859 |
+ |
rabs_gr->GetYaxis()->SetTitle("<R_{abs}>_{data}/<R_{abs}>_{mc}"); |
860 |
+ |
rabs_gr->GetYaxis()->CenterTitle(); |
861 |
+ |
//TF1 *rabs_pol=(TF1*)rabs_gr->GetFunction("pol1"); |
862 |
+ |
rabs_pol->SetLineWidth(0); |
863 |
+ |
TF1 *rabs_pol_complete = new TF1("rabs_pol_complete","[0]+[1]*x"); |
864 |
+ |
rabs_pol_complete->SetParameters(rabs_pol->GetParameters()); |
865 |
+ |
rabs_pol_complete->SetLineColor(kRed); |
866 |
+ |
rabs_pol_complete->SetLineWidth(1); |
867 |
+ |
FindMinMax(rabs_gr,min,max); |
868 |
+ |
rabs_gr->GetYaxis()->SetRangeUser(min,max); |
869 |
+ |
histo->GetYaxis()->SetRangeUser(min,max); |
870 |
+ |
//TPolyLine *rabs_fit_uncert = GetFitUncertaintyShape(rabs_gr, "pol1", min, max,0.0,0.4); |
871 |
+ |
rabs_pol->SetLineColor(TColor::GetColor("#F99C9C")); |
872 |
+ |
rabs_pol->SetFillColor(TColor::GetColor("#F99C9C")); |
873 |
+ |
rabs_band->SetLineColor(TColor::GetColor("#F99C9C")); |
874 |
+ |
rabs_band->SetFillColor(TColor::GetColor("#F99C9C")); |
875 |
+ |
//rabs_fit_uncert->SetLineColor(TColor::GetColor("#F99C9C")); |
876 |
+ |
//rabs_fit_uncert->SetFillColor(TColor::GetColor("#F99C9C")); |
877 |
+ |
histo->GetYaxis()->SetTitle("<R_{abs}>_{data}/<R_{abs}>_{mc}"); |
878 |
+ |
histo->Draw(); |
879 |
+ |
rabs_band->Draw("C E3 SAME"); |
880 |
+ |
//rabs_fit_uncert->Draw("F"); |
881 |
+ |
//rabs_fit_uncert->Draw(""); |
882 |
+ |
rabs_gr->Draw("P"); |
883 |
+ |
rabs_pol_complete->Draw("same"); |
884 |
+ |
|
885 |
+ |
float rabs_a=rabs_pol->GetParameter(0); |
886 |
+ |
float rabs_b=rabs_pol->GetParameter(1); |
887 |
+ |
RABS_FinalGraph->SetPoint(ipt,0.5*(ptcuts[ipt]+ptcuts[ipt+1]),rabs_a); |
888 |
+ |
RABS_FinalGraph->SetPointError(ipt,0,rabs_pol->GetParError(0)); |
889 |
+ |
|
890 |
+ |
dout << "!+!+!+!+!+!+!+!+!+ Just added a point to the final plot : " << rabs_a << " +/- " << rabs_pol->GetParError(0) << endl; |
891 |
+ |
|
892 |
+ |
stringstream rabs_info; |
893 |
+ |
rabs_info << "#splitline{#splitline{#splitline{" << ptcuts[ipt] << " GeV < p_{T}^{Z} < " << ptcuts[ipt+1] << " GeV }{ (R_{abs}) }}{Extrapolated value: " << std::setprecision(4) << rabs_a << "}}{#chi^{2}/NDF : " << rabs_pol->GetChisquare() << " / " << rabs_pol->GetNDF() << "}"; |
894 |
+ |
TText *rabs_mark = write_title(rabs_info.str()); |
895 |
+ |
rabs_mark->SetX(0.75); |
896 |
+ |
rabs_mark->SetTextSize(0.03); |
897 |
+ |
rabs_mark->SetY(0.75); |
898 |
+ |
rabs_mark->Draw(); |
899 |
+ |
|
900 |
+ |
RABS_ExtraPolatedResults[ipt]=rabs_a; |
901 |
+ |
filename << filenamebkp << "__RABS"; |
902 |
+ |
DrawPrelim(); |
903 |
+ |
CompleteSave(can,ContainerName+"/"+filename.str()); |
904 |
+ |
dout << "RABS : " << rabs_a << " + " << rabs_b << " * alpha " << endl; |
905 |
+ |
} |
906 |
+ |
} |
907 |
+ |
|
908 |
+ |
float MPFResult; |
909 |
+ |
float MPFResultError; |
910 |
+ |
|
911 |
+ |
float RabsResult; |
912 |
+ |
float RabsResultError; |
913 |
+ |
|
914 |
+ |
if(!gofast) { |
915 |
+ |
MPF_FinalGraph->SetMarkerStyle(21); |
916 |
+ |
MPF_FinalGraph->SetMarkerColor(kBlue); |
917 |
+ |
MPF_FinalGraph->Fit("pol0",""); // quiet, use minos |
918 |
+ |
|
919 |
+ |
TF1 *mpf_pol0=(TF1*)MPF_FinalGraph->GetFunction("pol0"); |
920 |
+ |
TF1 *mpf_pol0_complete = new TF1("mpf_pol0_complete","[0]+[1]*x"); |
921 |
+ |
mpf_pol0_complete->SetLineWidth(1); |
922 |
+ |
mpf_pol0_complete->SetLineColor(kBlue); |
923 |
+ |
mpf_pol0->SetLineColor(kBlue); |
924 |
+ |
MPF_FinalGraph->Draw("AP"); |
925 |
+ |
MPF_FinalGraph->GetXaxis()->SetTitle("p_{T}^{Z}"); |
926 |
+ |
MPF_FinalGraph->GetXaxis()->CenterTitle(); |
927 |
+ |
MPF_FinalGraph->GetYaxis()->SetTitle("<MPF>_{data}/<MPF>_{mc}"); |
928 |
+ |
MPF_FinalGraph->GetYaxis()->CenterTitle(); |
929 |
+ |
MPF_FinalGraph->Draw("AP"); |
930 |
+ |
mpf_pol0_complete->Draw("same"); |
931 |
+ |
|
932 |
+ |
stringstream mpf_result; |
933 |
+ |
mpf_result << "#splitline{C_{abs}= " << std::setprecision(5) << 1/mpf_pol0->GetParameter(0) << " #pm " << std::setprecision(2) << mpf_pol0->GetParError(0)/(mpf_pol0->GetParameter(0)*mpf_pol0->GetParameter(0)) << "}{ (MPF)}"; |
934 |
+ |
TText *rmpf_final_mark = write_title(mpf_result.str()); |
935 |
+ |
rmpf_final_mark->SetX(0.75); |
936 |
+ |
rmpf_final_mark->SetY(0.75); |
937 |
+ |
rmpf_final_mark->SetTextSize(0.03); |
938 |
+ |
rmpf_final_mark->Draw(); |
939 |
+ |
DrawPrelim(); |
940 |
+ |
MPFResult=1/mpf_pol0->GetParameter(0); |
941 |
+ |
MPFResultError=mpf_pol0->GetParError(0)/(mpf_pol0->GetParameter(0)*mpf_pol0->GetParameter(0)); |
942 |
|
|
943 |
< |
stringstream rabs_info; |
944 |
< |
rabs_info << "#splitline{#splitline{#splitline{" << ptcuts[ipt] << " GeV < p_{T}^{Z} < " << ptcuts[ipt+1] << " GeV }{ (R_{abs}) }}{Extrapolated value: " << std::setprecision(3) << rabs_a << "}}{#chi^{2}/NDF : " << rabs_pol->GetChisquare() << " / " << rabs_pol->GetNDF() << "}"; |
945 |
< |
TText *rabs_mark = write_title(rabs_info.str()); |
946 |
< |
rabs_mark->SetX(0.75); |
947 |
< |
rabs_mark->SetTextSize(0.03); |
948 |
< |
rabs_mark->SetY(0.75); |
949 |
< |
rabs_mark->Draw(); |
943 |
> |
stringstream filename2; |
944 |
> |
filename2 << "Extrapolation/FINAL_RESULT_MPF"; |
945 |
> |
CompleteSave(can,ContainerName+"/"+filename2.str()); |
946 |
> |
|
947 |
> |
RABS_FinalGraph->SetMarkerStyle(21); |
948 |
> |
RABS_FinalGraph->SetMarkerStyle(21); |
949 |
> |
RABS_FinalGraph->SetMarkerColor(kRed); |
950 |
> |
RABS_FinalGraph->Fit("pol0","QE"); // quiet, use minos |
951 |
> |
RABS_FinalGraph->Draw("AP"); |
952 |
> |
RABS_FinalGraph->GetXaxis()->SetTitle("p_{T}^{Z}"); |
953 |
> |
RABS_FinalGraph->GetXaxis()->CenterTitle(); |
954 |
> |
RABS_FinalGraph->GetYaxis()->SetTitle("<R_{abs}>_{data}/<R_{abs}>_{mc}"); |
955 |
> |
RABS_FinalGraph->GetYaxis()->CenterTitle(); |
956 |
> |
RABS_FinalGraph->Draw("AP"); |
957 |
> |
TF1 *rabs_pol0=(TF1*)RABS_FinalGraph->GetFunction("pol0"); |
958 |
> |
stringstream rabs_result; |
959 |
> |
rabs_result << "#splitline{C_{abs}= " << std::setprecision(5) << 1/rabs_pol0->GetParameter(0) << " #pm " << std::setprecision(2) << rabs_pol0->GetParError(0)/(rabs_pol0->GetParameter(0)*rabs_pol0->GetParameter(0)) << "}{ (R_{abs})}";; |
960 |
> |
TText *rabs_final_mark = write_title(rabs_result.str()); |
961 |
> |
rabs_final_mark->SetX(0.75); |
962 |
> |
rabs_final_mark->SetY(0.75); |
963 |
> |
rabs_final_mark->SetTextSize(0.03); |
964 |
> |
rabs_final_mark->Draw(); |
965 |
> |
DrawPrelim(); |
966 |
|
|
967 |
+ |
RabsResult=1/rabs_pol0->GetParameter(0); |
968 |
+ |
RabsResultError=rabs_pol0->GetParError(0)/(rabs_pol0->GetParameter(0)*rabs_pol0->GetParameter(0)); |
969 |
|
|
970 |
< |
|
971 |
< |
RABS_ExtraPolatedResults[ipt]=rabs_a; |
972 |
< |
filename << filenamebkp << "__RABS"; |
418 |
< |
DrawPrelim(); |
419 |
< |
CompleteSave(can,filename.str()); |
420 |
< |
cout << "RABS : " << rabs_a << " + " << rabs_b << " * alpha " << endl; |
970 |
> |
filename2.str(""); |
971 |
> |
filename2 << "Extrapolation/FINAL_RESULT_RABS"; |
972 |
> |
CompleteSave(can,ContainerName+"/"+filename2.str()); |
973 |
|
} |
974 |
< |
|
423 |
< |
MPF_FinalGraph->SetMarkerStyle(21); |
424 |
< |
MPF_FinalGraph->SetMarkerColor(kRed); |
425 |
< |
MPF_FinalGraph->Fit("pol0","QE"); // quiet, use minos |
426 |
< |
|
427 |
< |
TF1 *mpf_pol0=(TF1*)MPF_FinalGraph->GetFunction("pol0"); |
428 |
< |
MPF_FinalGraph->Draw("AP"); |
429 |
< |
MPF_FinalGraph->GetXaxis()->SetTitle("p_{T}^{Z}"); |
430 |
< |
MPF_FinalGraph->GetXaxis()->CenterTitle(); |
431 |
< |
MPF_FinalGraph->GetYaxis()->SetTitle("<MPF>_{data}/<MPF>_{mc}"); |
432 |
< |
MPF_FinalGraph->GetYaxis()->CenterTitle(); |
433 |
< |
MPF_FinalGraph->Draw("AP"); |
434 |
< |
|
435 |
< |
stringstream mpf_result; |
436 |
< |
mpf_result << "#splitline{C_{abs}= " << std::setprecision(5) << 1/mpf_pol0->GetParameter(0) << " #pm " << std::setprecision(2) << mpf_pol0->GetParError(0)/(mpf_pol0->GetParameter(0)*mpf_pol0->GetParameter(0)) << "}{ (MPF)}"; |
437 |
< |
TText *rmpf_final_mark = write_title(mpf_result.str()); |
438 |
< |
rmpf_final_mark->SetX(0.75); |
439 |
< |
rmpf_final_mark->SetY(0.75); |
440 |
< |
rmpf_final_mark->SetTextSize(0.03); |
441 |
< |
rmpf_final_mark->Draw(); |
442 |
< |
DrawPrelim(); |
443 |
< |
float MPFResult=1/mpf_pol0->GetParameter(0); |
444 |
< |
float MPFResultError=mpf_pol0->GetParError(0)/(mpf_pol0->GetParameter(0)*mpf_pol0->GetParameter(0)); |
445 |
< |
|
446 |
< |
stringstream filename2; |
447 |
< |
filename2 << "Extrapolation/FINAL_RESULT_MPF"; |
448 |
< |
CompleteSave(can,filename2.str()); |
449 |
< |
|
450 |
< |
|
451 |
< |
RABS_FinalGraph->SetMarkerStyle(21); |
452 |
< |
RABS_FinalGraph->SetMarkerStyle(21); |
453 |
< |
RABS_FinalGraph->SetMarkerColor(kRed); |
454 |
< |
RABS_FinalGraph->Fit("pol0","QE"); // quiet, use minos |
455 |
< |
RABS_FinalGraph->Draw("AP"); |
456 |
< |
RABS_FinalGraph->GetXaxis()->SetTitle("p_{T}^{Z}"); |
457 |
< |
RABS_FinalGraph->GetXaxis()->CenterTitle(); |
458 |
< |
RABS_FinalGraph->GetYaxis()->SetTitle("<R_{abs}>_{data}/<R_{abs}>_{mc}"); |
459 |
< |
RABS_FinalGraph->GetYaxis()->CenterTitle(); |
460 |
< |
RABS_FinalGraph->Draw("AP"); |
461 |
< |
TF1 *rabs_pol0=(TF1*)RABS_FinalGraph->GetFunction("pol0"); |
462 |
< |
stringstream rabs_result; |
463 |
< |
rabs_result << "#splitline{C_{abs}= " << std::setprecision(5) << 1/rabs_pol0->GetParameter(0) << " #pm " << std::setprecision(2) << rabs_pol0->GetParError(0)/(rabs_pol0->GetParameter(0)*rabs_pol0->GetParameter(0)) << "}{ (R_{abs})}";; |
464 |
< |
TText *rabs_final_mark = write_title(rabs_result.str()); |
465 |
< |
rabs_final_mark->SetX(0.75); |
466 |
< |
rabs_final_mark->SetY(0.75); |
467 |
< |
rabs_final_mark->SetTextSize(0.03); |
468 |
< |
rabs_final_mark->Draw(); |
469 |
< |
DrawPrelim(); |
470 |
< |
|
471 |
< |
float RabsResult=1/rabs_pol0->GetParameter(0); |
472 |
< |
float RabsResultError=rabs_pol0->GetParError(0)/(rabs_pol0->GetParameter(0)*rabs_pol0->GetParameter(0)); |
473 |
< |
|
474 |
< |
filename2.str(""); |
475 |
< |
filename2 << "Extrapolation/FINAL_RESULT_RABS"; |
476 |
< |
CompleteSave(can,filename2.str()); |
477 |
< |
|
974 |
> |
|
975 |
|
can->cd(); |
976 |
< |
TCanvas *FaceValueCanvas = new TCanvas("FaceValueCanvas","FaceValueCanvas"); |
977 |
< |
FaceValueAtPoint3->SetMarkerStyle(21); |
978 |
< |
FaceValueAtPoint3->SetMarkerStyle(21); |
979 |
< |
FaceValueAtPoint3->Fit("pol0","QE"); // quiet, use minos |
980 |
< |
FaceValueAtPoint3->Draw("AP"); |
981 |
< |
FaceValueAtPoint3->GetXaxis()->SetTitle("p_{T}^{Z}"); |
982 |
< |
FaceValueAtPoint3->GetXaxis()->CenterTitle(); |
983 |
< |
FaceValueAtPoint3->GetYaxis()->SetTitle("data/mc for #alpha<0.3"); |
984 |
< |
FaceValueAtPoint3->GetYaxis()->CenterTitle(); |
985 |
< |
FaceValueAtPoint3->Draw("AP"); |
986 |
< |
TF1 *faceval_pol0=(TF1*)FaceValueAtPoint3->GetFunction("pol0"); |
976 |
> |
MPF_FaceValueAtPoint3->SetMarkerStyle(21); |
977 |
> |
MPF_FaceValueAtPoint3->SetMarkerColor(kBlue); |
978 |
> |
MPF_FaceValueAtPoint3->Fit("pol0","QE"); // quiet, use minos |
979 |
> |
MPF_FaceValueAtPoint3->Draw("AP"); |
980 |
> |
MPF_FaceValueAtPoint3->GetXaxis()->SetTitle("p_{T}^{Z}"); |
981 |
> |
MPF_FaceValueAtPoint3->GetXaxis()->CenterTitle(); |
982 |
> |
MPF_FaceValueAtPoint3->GetYaxis()->SetTitle(((string)"<MPF>__{data}/<MPF>_{mc} for #alpha<"+any2string(FaceValueToBeTakenAt)).c_str()); |
983 |
> |
MPF_FaceValueAtPoint3->GetYaxis()->CenterTitle(); |
984 |
> |
MPF_FaceValueAtPoint3->Draw("AP"); |
985 |
> |
TF1 *faceval_pol0=(TF1*)MPF_FaceValueAtPoint3->GetFunction("pol0"); |
986 |
> |
faceval_pol0->SetLineColor(kBlue); |
987 |
> |
faceval_pol0->SetLineWidth(1); |
988 |
> |
faceval_pol0->Draw("same"); |
989 |
> |
TF1 *faceval_pol0_complete = new TF1("faceval_pol0_complete","[0]+[1]*x"); |
990 |
> |
faceval_pol0_complete->SetParameters(faceval_pol0->GetParameters()); |
991 |
|
stringstream faceval_result; |
992 |
< |
faceval_result << "#splitline{C_{abs}= " << std::setprecision(5) << 1/faceval_pol0->GetParameter(0) << " #pm " << std::setprecision(2) << faceval_pol0->GetParError(0)/(faceval_pol0->GetParameter(0)*faceval_pol0->GetParameter(0)) << "}{ (MPF at #alpha<0.3)}";; |
992 |
> |
faceval_result << "#splitline{C_{abs}= " << std::setprecision(5) << 1/faceval_pol0->GetParameter(0) << " #pm " << std::setprecision(2) << faceval_pol0->GetParError(0)/(faceval_pol0->GetParameter(0)*faceval_pol0->GetParameter(0)) << "}{ (MPF at #alpha<" << FaceValueToBeTakenAt << ")}";; |
993 |
|
TText *faceval_final_mark = write_title(faceval_result.str()); |
994 |
|
faceval_final_mark->SetX(0.75); |
995 |
|
faceval_final_mark->SetY(0.75); |
1000 |
|
float FaceValResult=1/faceval_pol0->GetParameter(0); |
1001 |
|
float FaceValResultError=faceval_pol0->GetParError(0)/(faceval_pol0->GetParameter(0)*faceval_pol0->GetParameter(0)); |
1002 |
|
|
1003 |
+ |
stringstream filename2; |
1004 |
|
filename2.str(""); |
1005 |
|
filename2 << "Extrapolation/FINAL_RESULT_MPF_FaceValp3"; |
1006 |
< |
CompleteSave(can,filename2.str()); |
1006 |
> |
CompleteSave(can,ContainerName+"/"+filename2.str()); |
1007 |
|
|
1008 |
< |
cout << "FINAL RESULTS: " << endl; |
1009 |
< |
cout << "MPF : " << MPFResult << " +/- " << MPFResultError << endl; |
1010 |
< |
cout << "Rabs: " << RabsResult << " +/- " << RabsResultError << endl; |
1011 |
< |
cout << "Face value at 0.3 :" << FaceValResult << " +/- " << FaceValResultError << endl; |
1008 |
> |
can->cd(); |
1009 |
> |
RABS_FaceValueAtPoint3->SetMarkerStyle(21); |
1010 |
> |
RABS_FaceValueAtPoint3->SetMarkerColor(kRed); |
1011 |
> |
RABS_FaceValueAtPoint3->Fit("pol0","QE"); // quiet, use minos |
1012 |
> |
RABS_FaceValueAtPoint3->Draw("AP"); |
1013 |
> |
RABS_FaceValueAtPoint3->GetXaxis()->SetTitle("p_{T}^{Z}"); |
1014 |
> |
RABS_FaceValueAtPoint3->GetXaxis()->CenterTitle(); |
1015 |
> |
RABS_FaceValueAtPoint3->GetYaxis()->SetTitle(((string)"<R_{abs}>_{data}/<R_{abs}>_{mc} for #alpha<"+any2string(FaceValueToBeTakenAt)).c_str()); |
1016 |
> |
RABS_FaceValueAtPoint3->GetYaxis()->CenterTitle(); |
1017 |
> |
RABS_FaceValueAtPoint3->Draw("AP"); |
1018 |
> |
TF1 *faceval_pol0RABS=(TF1*)RABS_FaceValueAtPoint3->GetFunction("pol0"); |
1019 |
> |
TF1 *faceval_pol0RABS_complete = new TF1("faceval_pol0_complete","[0]+[1]*x"); |
1020 |
> |
faceval_pol0RABS_complete->SetParameters(faceval_pol0RABS->GetParameters()); |
1021 |
> |
faceval_pol0RABS->SetLineWidth(1); |
1022 |
> |
faceval_pol0RABS->SetLineColor(kRed); |
1023 |
> |
faceval_pol0RABS_complete->Draw("same"); |
1024 |
> |
stringstream RABSfaceval_result; |
1025 |
> |
RABSfaceval_result << "#splitline{C_{abs}= " << std::setprecision(5) << 1/faceval_pol0RABS->GetParameter(0) << " #pm " << std::setprecision(2) << faceval_pol0RABS->GetParError(0)/(faceval_pol0RABS->GetParameter(0)*faceval_pol0RABS->GetParameter(0)) << "}{ (R_{abs} at #alpha<" << FaceValueToBeTakenAt << ")}";; |
1026 |
> |
TText *RABSfaceval_final_mark = write_title(RABSfaceval_result.str()); |
1027 |
> |
RABSfaceval_final_mark->SetX(0.75); |
1028 |
> |
RABSfaceval_final_mark->SetY(0.75); |
1029 |
> |
RABSfaceval_final_mark->SetTextSize(0.03); |
1030 |
> |
RABSfaceval_final_mark->Draw(); |
1031 |
> |
DrawPrelim(); |
1032 |
|
|
1033 |
< |
delete can; |
1033 |
> |
float RABSFaceValResult=1/faceval_pol0RABS->GetParameter(0); |
1034 |
> |
float RABSFaceValResultError=faceval_pol0RABS->GetParError(0)/(faceval_pol0RABS->GetParameter(0)*faceval_pol0RABS->GetParameter(0)); |
1035 |
|
|
1036 |
+ |
filename2.str(""); |
1037 |
+ |
filename2 << "Extrapolation/FINAL_RESULT_RABS_FaceValp3"; |
1038 |
+ |
CompleteSave(can,ContainerName+"/"+filename2.str()); |
1039 |
+ |
|
1040 |
+ |
dout << "FINAL RESULTS: " << endl; |
1041 |
+ |
if(!gofast) dout << "MPF : " << MPFResult << " +/- " << MPFResultError << endl; |
1042 |
+ |
if(!gofast) dout << "Rabs: " << RabsResult << " +/- " << RabsResultError << endl; |
1043 |
+ |
dout << "Face value at " << FaceValueToBeTakenAt << " :" << FaceValResult << " +/- " << FaceValResultError << " (MPF) " << endl; |
1044 |
+ |
dout << "Face value at " << FaceValueToBeTakenAt << " :" << RABSFaceValResult << " +/- " << RABSFaceValResultError << " (RABS) " << endl; |
1045 |
+ |
|
1046 |
+ |
delete can; |
1047 |
|
|
1048 |
+ |
results.MPF_Result_FaceValue=Value(FaceValResult,FaceValResultError); |
1049 |
+ |
results.Rabs_Result_FaceValue=Value(RABSFaceValResult,RABSFaceValResultError); |
1050 |
+ |
if(!gofast) results.MPF_Result_Extrapolated=Value(MPFResult,MPFResultError); |
1051 |
+ |
if(!gofast) results.Rabs_Result_Extrapolated=Value(RabsResult,RabsResultError); |
1052 |
+ |
results.Print(); |
1053 |
+ |
return results; |
1054 |
|
} |
1055 |
|
|
1056 |
|
|
1061 |
|
TCanvas *can = new TCanvas("can","can"); |
1062 |
|
TH1F *malpha[8]; |
1063 |
|
TH1F *dalpha[8]; |
1064 |
< |
cout << identifier << ";"; |
1065 |
< |
cout << endl; |
1064 |
> |
dout << identifier << ";"; |
1065 |
> |
dout << endl; |
1066 |
|
for(int i=1;i<5;i++) { |
1067 |
|
stringstream sSpecialCut; |
1068 |
|
if(i<4) { |
1069 |
|
sSpecialCut << "numVtx>" << numVtxcuts[i-1] << " && numVtx<" << numVtxcuts[i]; |
1070 |
< |
cout << numVtxcuts[i-1] << " < nVtx < " << numVtxcuts[i] << ";"; |
1070 |
> |
dout << numVtxcuts[i-1] << " < nVtx < " << numVtxcuts[i] << ";"; |
1071 |
|
} else { |
1072 |
|
sSpecialCut << "numVtx>" << numVtxcuts[i-1]; |
1073 |
< |
cout << numVtxcuts[i-1] << ";"; |
1073 |
> |
dout << numVtxcuts[i-1] << ";"; |
1074 |
|
} |
1075 |
|
|
1076 |
+ |
sSpecialCut << " && " << identifier << "_alpha<0.3"; |
1077 |
|
TCut SpecialCut(sSpecialCut.str().c_str()); |
1078 |
|
|
1079 |
|
|
1080 |
< |
malpha[i] = allsamples.Draw("malpha"+any2string(i),"mpf",1000,0,10,"MPF","events",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&SpecialCut,mc,luminosity); |
1081 |
< |
dalpha[i] = allsamples.Draw("dalpha"+any2string(i),"mpf",1000,0,10,"MPF","events",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&SpecialCut,data,luminosity); |
1080 |
> |
malpha[i] = allsamples.Draw("malpha"+any2string(i),"mpf",1000,0,2,"MPF","events",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&SpecialCut,mc,luminosity); |
1081 |
> |
dalpha[i] = allsamples.Draw("dalpha"+any2string(i),"mpf",1000,0,2,"MPF","events",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&SpecialCut,data,luminosity); |
1082 |
|
|
1083 |
|
|
1084 |
|
float a=dalpha[i]->GetMean(); |
1088 |
|
float factor = a / b; |
1089 |
|
float error = TMath::Sqrt( (1/(b*b)) * (da*da) + ((a*a)/(b*b))*db*db); |
1090 |
|
|
1091 |
< |
cout << malpha[i]->GetMean() << ";" << malpha[i]->GetMeanError() << ";" << dalpha[i]->GetMean() << ";" << dalpha[i]->GetMeanError() << ";" << malpha[i]->Integral()<<";"<<dalpha[i]->Integral() << ";"<<factor << ";" << error << endl; |
551 |
< |
malpha[i]->SetLineColor(i+1); |
552 |
< |
if(i==0) malpha[i]->Draw("histo"); |
553 |
< |
else malpha[i]->Draw("histo,same"); |
554 |
< |
} |
555 |
< |
|
556 |
< |
CompleteSave(can,"AlphaOverview_"+identifier); |
557 |
< |
delete can; |
558 |
< |
|
559 |
< |
/* for(int i=1;i<8;i++) { |
1091 |
> |
dout << malpha[i]->GetMean() << ";" << malpha[i]->GetMeanError() << ";" << dalpha[i]->GetMean() << ";" << dalpha[i]->GetMeanError() << ";" << malpha[i]->Integral()<<";"<<dalpha[i]->Integral() << ";"<<factor << ";" << error << endl; |
1092 |
|
delete malpha[i]; |
1093 |
|
delete dalpha[i]; |
1094 |
|
} |
1095 |
< |
*/ |
1095 |
> |
|
1096 |
> |
delete can; |
1097 |
|
|
1098 |
|
} |
1099 |
|
|
1100 |
|
void ScenarioComparison() { |
1101 |
< |
|
1101 |
> |
//very dumb way to do this. |
1102 |
> |
|
1103 |
|
TGraphAsymmErrors *gr[5]; |
1104 |
|
TF1 *fit[5]; |
1105 |
< |
bool dofit=false; |
1105 |
> |
bool dofit=true; |
1106 |
|
|
1107 |
|
TCanvas *can = new TCanvas("can","can",500,500); |
1108 |
|
|
1110 |
|
leg->SetBorderSize(0); |
1111 |
|
leg->SetFillColor(kWhite); |
1112 |
|
|
1113 |
< |
for(int i=0;i<5;i++) { |
1113 |
> |
for(int i=0;i<6;i++) { |
1114 |
|
gr[i] = new TGraphAsymmErrors(); |
1115 |
< |
double x[4] = {5,12.5,17.5,20}; |
1116 |
< |
double dxl[4] = {5,2.5,2.5,2.5}; |
1115 |
> |
double x[4] = {5,12.5,17.5,25}; |
1116 |
> |
double dxl[4] = {5,2.5,2.5,5}; |
1117 |
|
double dxh[4] = {5,2.5,2.5,10}; |
1118 |
|
|
1119 |
|
string name=""; |
1120 |
|
string color=""; |
1121 |
|
|
1122 |
|
if(i==0) { |
1123 |
< |
double y[4] = {1.008,1.013,1.003,1.007}; |
1124 |
< |
double dyl[4] = {0.011,0.009,0.013,0.020}; |
1125 |
< |
double dyh[4] = {0.011,0.009,0.013,0.020}; |
1123 |
> |
double y[4] = {1.01935,1.01558,0.996438,1.01901}; |
1124 |
> |
double dyl[4] = {0.0132973,0.0131661,0.017629,0.0319767}; |
1125 |
> |
double dyh[4] = {0.0132973,0.0131661,0.017629,0.0319767}; |
1126 |
|
name="30/30"; |
1127 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1128 |
|
color="#a01d99"; |
1129 |
|
} |
1130 |
|
if(i==1) { |
1131 |
< |
double y[4] = {1.008+0.001,1.013+0.001,1.003+0.001,1.007+0.001}; |
1132 |
< |
double dyl[4] = {0.011,0.009,0.013,0.020}; |
1133 |
< |
double dyh[4] = {0.011,0.009,0.013,0.020}; |
1131 |
> |
double y[4] = {1.00577,1.00706,0.991029,0.954098}; |
1132 |
> |
double dyl[4] = {0.0135575,0.0136548,0.0170778,0.0263919}; |
1133 |
> |
double dyh[4] = {0.0135575,0.0136548,0.0170778,0.0263919}; |
1134 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1135 |
< |
name="30/10"; |
1135 |
> |
name="30/15"; |
1136 |
|
color="#2464bc"; |
1137 |
|
} |
1138 |
|
if(i==2) { |
1139 |
< |
double y[4] = {1.014,1.026,1.014,1.059}; |
1140 |
< |
double dyl[4] = {0.011,0.010,0.014,0.023}; |
1141 |
< |
double dyh[4] = {0.011,0.010,0.014,0.023}; |
1139 |
> |
double y[4] = {1.023,1.00648,1.02217,1.03181}; |
1140 |
> |
double dyl[4] = {0.0157372,0.0187778,0.0261512,0.0422295}; |
1141 |
> |
double dyh[4] = {0.0157372,0.0187778,0.0261512,0.0422295}; |
1142 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1143 |
|
name="15/15"; |
1144 |
|
color="#f49230"; |
1145 |
|
} |
1146 |
|
if(i==3) { |
1147 |
< |
double y[4] = {1.015,1.020,1.008,1.050}; |
1148 |
< |
double dyl[4] = {0.011,0.010,0.014,0.022}; |
1149 |
< |
double dyh[4] = {0.011,0.010,0.014,0.022}; |
1147 |
> |
double y[4] = {1.02029,1.01338,0.999769,1.00357}; |
1148 |
> |
double dyl[4] = {0.0129509,0.0120127,0.0160537,0.0268972}; |
1149 |
> |
double dyh[4] = {0.0129509,0.0120127,0.0160537,0.0268972}; |
1150 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1151 |
< |
name="20/15"; |
1151 |
> |
name="CHS 30/30"; |
1152 |
|
color="#c72f3c"; |
1153 |
|
} |
1154 |
|
if(i==4) { |
1155 |
< |
double y[4] = {1.015+0.001,1.020+0.001,1.008+0.001,1.050+0.001}; |
1156 |
< |
double dyl[4] = {0.011,0.010,0.014,0.022}; |
1157 |
< |
double dyh[4] = {0.011,0.010,0.014,0.022}; |
1155 |
> |
double y[4] = {1.00274,1.01056,0.993214,0.997963}; |
1156 |
> |
double dyl[4] = {0.0127179,0.0140344,0.0162814,0.0278914}; |
1157 |
> |
double dyh[4] = {0.0127179,0.0140344,0.0162814,0.0278914}; |
1158 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1159 |
< |
name="20/20"; |
1159 |
> |
name="CHS 30/15"; |
1160 |
|
color="#7cb433"; |
1161 |
|
} |
1162 |
< |
|
1163 |
< |
|
1162 |
> |
if(i==5) { |
1163 |
> |
double y[4] = {1.04103,1.03726,1.04649,1.05383}; |
1164 |
> |
double dyl[4] = {0.0156465,0.0168194,0.0231982,0.0376114}; |
1165 |
> |
double dyh[4] = {0.0156465,0.0168194,0.0231982,0.0376114}; |
1166 |
> |
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1167 |
> |
name="CHS 15/15"; |
1168 |
> |
color="#DF013A"; |
1169 |
> |
} |
1170 |
> |
|
1171 |
> |
|
1172 |
> |
gStyle->SetOptFit(0); |
1173 |
|
gr[i]->SetTitle(); |
1174 |
|
gr[i]->GetXaxis()->SetTitle("N(Vtx)"); |
1175 |
|
gr[i]->GetYaxis()->SetTitle("<MPF>_{data}/<MPF>_{mc}"); |
1198 |
|
} |
1199 |
|
|
1200 |
|
void ScenarioComparisonInclusive() { |
1201 |
< |
|
1201 |
> |
//dumbest way ever to do this. but ok we only need to do it once. |
1202 |
|
TGraphAsymmErrors *gr[5]; |
1203 |
|
TF1 *fit[5]; |
1204 |
|
bool dofit=true; |
1205 |
|
|
1206 |
|
TCanvas *can = new TCanvas("can","can",500,500); |
1207 |
|
|
1208 |
< |
TLegend *leg = new TLegend(0.2,0.2,0.5,0.45); |
1208 |
> |
TLegend *leg = new TLegend(0.2,0.2,0.65,0.45); |
1209 |
|
leg->SetBorderSize(0); |
1210 |
|
leg->SetFillColor(kWhite); |
1211 |
|
|
1212 |
< |
for(int i=0;i<5;i++) { |
1212 |
> |
for(int i=0;i<6;i++) { |
1213 |
|
gr[i] = new TGraphAsymmErrors(); |
1214 |
< |
double x[4] = {5,12.5,17.5,20}; |
1215 |
< |
double dxl[4] = {5,2.5,2.5,2.5}; |
1216 |
< |
double dxh[4] = {5,2.5,2.5,10}; |
1214 |
> |
double x[4] = {5,12.5,17.5,25}; |
1215 |
> |
double dxl[4] = {5,2.5,2.5,5}; |
1216 |
> |
double dxh[4] = {5,2.5,2.5,5}; |
1217 |
|
|
1218 |
|
string name=""; |
1219 |
|
string color=""; |
1220 |
|
|
1221 |
|
if(i==0) { |
1222 |
< |
double y[4] = {1.01103,1.01496,1.01486,1.02785}; |
1223 |
< |
double dyl[4] = {0.00235044,0.00225264,0.00313574,0.00541047}; |
1224 |
< |
double dyh[4] = {0.00235044,0.00225264,0.00313574,0.00541047}; |
1222 |
> |
double y[4] = {1.01093,1.01379,1.0147,1.02766}; |
1223 |
> |
double dyl[4] = {0.00243596,0.00242534,0.00341941,0.00600663}; |
1224 |
> |
double dyh[4] = {0.00243596,0.00242534,0.00341941,0.00600663}; |
1225 |
|
name="30/30"; |
1226 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1227 |
|
color="#a01d99"; |
1228 |
|
} |
1229 |
|
if(i==1) { |
1230 |
< |
double y[4] = {1.01103+0.001,1.01496+0.001,1.01486+0.001,1.02785+0.001}; |
1231 |
< |
double dyl[4] = {0.00235044,0.00225264,0.00313574,0.00541047}; |
1232 |
< |
double dyh[4] = {0.00235044,0.00225264,0.00313574,0.00541047}; |
1230 |
> |
double y[4] = {1.0068,1.00779,0.999692,0.994484}; |
1231 |
> |
double dyl[4] = {0.00249233,0.00257169,0.00371399,0.00631138}; |
1232 |
> |
double dyh[4] = {0.00249233,0.00257169,0.00371399,0.00631138}; |
1233 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1234 |
< |
name="30/10"; |
1234 |
> |
name="30/15"; |
1235 |
|
color="#2464bc"; |
1236 |
|
} |
1237 |
|
if(i==2) { |
1238 |
< |
double y[4] = {1.01575,1.02879,1.0325,1.05456}; |
1239 |
< |
double dyl[4] = {0.00288281,0.00278536,0.00367451,0.00590421}; |
1240 |
< |
double dyh[4] = {0.00288281,0.00278536,0.00367451,0.00590421}; |
1238 |
> |
double y[4] = {1.01208,1.01991,1.02185,1.03479}; |
1239 |
> |
double dyl[4] = {0.00366745,0.00400001,0.00584054,0.0104661}; |
1240 |
> |
double dyh[4] = {0.00366745,0.00400001,0.00584054,0.0104661}; |
1241 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1242 |
|
name="15/15"; |
1243 |
|
color="#f49230"; |
1244 |
|
} |
1245 |
|
if(i==3) { |
1246 |
< |
double y[4] = {1.01221,1.01922,1.02396,1.04677}; |
1247 |
< |
double dyl[4] = {0.00263821,0.00260853,0.00353673,0.00584728}; |
1248 |
< |
double dyh[4] = {0.00263821,0.00260853,0.00353673,0.00584728}; |
1246 |
> |
double y[4] = {1.01177,1.01568,1.01616,1.03211}; |
1247 |
> |
double dyl[4] = {0.00217317,0.00203014,0.00276838,0.00465643}; |
1248 |
> |
double dyh[4] = {0.00217317,0.00203014,0.00276838,0.00465643}; |
1249 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1250 |
< |
name="20/15"; |
1250 |
> |
name="CHS 30/30"; |
1251 |
|
color="#c72f3c"; |
1252 |
|
} |
1253 |
|
if(i==4) { |
1254 |
< |
double y[4] = {1.01221+0.001,1.01922+0.001,1.02396+0.001,1.04677+0.001}; |
1255 |
< |
double dyl[4] = {0.00263821,0.00260853,0.00353673,0.00584728}; |
1256 |
< |
double dyh[4] = {0.00263821,0.00260853,0.00353673,0.00584728}; |
1254 |
> |
double y[4] = {1.00751,1.00964,1.00804,1.01073}; |
1255 |
> |
double dyl[4] = {0.00224851,0.00215563,0.0029592,0.00499805}; |
1256 |
> |
double dyh[4] = {0.00224851,0.00215563,0.0029592,0.00499805}; |
1257 |
|
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1258 |
< |
name="20/20"; |
1258 |
> |
name="CHS 30/15"; |
1259 |
|
color="#7cb433"; |
1260 |
|
} |
1261 |
+ |
if(i==5) { |
1262 |
+ |
double y[4] = {1.01557,1.0318,1.03535,1.06331}; |
1263 |
+ |
double dyl[4] = {0.00300783,0.00302486,0.00421064,0.00739416}; |
1264 |
+ |
double dyh[4] = {0.00300783,0.00302486,0.00421064,0.00739416}; |
1265 |
+ |
gr[i] = new TGraphAsymmErrors(4,x,y,dxl,dxh,dyl,dyh); |
1266 |
+ |
name="CHS 15/15"; |
1267 |
+ |
color="#DF013A"; |
1268 |
+ |
} |
1269 |
|
|
1270 |
< |
|
1270 |
> |
gStyle->SetOptFit(0); |
1271 |
|
gr[i]->SetTitle(); |
1272 |
|
gr[i]->GetXaxis()->SetTitle("N(Vtx)"); |
1273 |
|
gr[i]->GetYaxis()->SetTitle("<MPF>_{data}/<MPF>_{mc}"); |
1283 |
|
fit[i] = (TF1*)gr[i]->GetFunction("pol1"); |
1284 |
|
fit[i]->SetLineColor(TColor::GetColor(color.c_str())); |
1285 |
|
} |
1286 |
< |
leg->AddEntry(gr[i],name.c_str(),"l"); |
1286 |
> |
|
1287 |
> |
stringstream nameplus; |
1288 |
> |
nameplus << name << " (slope: " << std::setprecision(3) << fit[i]->GetParameter(1) << ")"; |
1289 |
> |
|
1290 |
> |
leg->AddEntry(gr[i],nameplus.str().c_str(),"l"); |
1291 |
|
if(i==0) gr[i]->Draw("AP*"); |
1292 |
|
else gr[i]->Draw("P"); |
1293 |
|
} |
1302 |
|
void compare_selection(string identifier) { |
1303 |
|
bool recognized_scenario=false; |
1304 |
|
|
1305 |
< |
cout << "Running with identifier " << identifier << endl; |
1305 |
> |
dout << "Running with identifier " << identifier << endl; |
1306 |
> |
if(identifier=="Zb30") { |
1307 |
> |
LeadingB=TCut ("Zb30_bTagProbCSVBP[0]>0.898"); |
1308 |
> |
EtaB=TCut("abs(Zb30_pfJetGoodEta[0])<1.3"); |
1309 |
> |
PhiZcut=TCut("abs(Zb30_pfJetDphiZ[0])>2.7"); |
1310 |
> |
recognized_scenario=true; |
1311 |
> |
} |
1312 |
|
if(identifier=="Zb3010") { |
1313 |
|
LeadingB=TCut ("Zb3010_bTagProbCSVBP[0]>0.898"); |
1314 |
|
EtaB=TCut("abs(Zb3010_pfJetGoodEta[0])<1.3"); |
1316 |
|
recognized_scenario=true; |
1317 |
|
} |
1318 |
|
|
1319 |
< |
if(identifier=="Zb3010") { |
1320 |
< |
LeadingB=TCut ("Zb3010_bTagProbCSVBP[0]>0.898"); |
1321 |
< |
EtaB=TCut("abs(Zb3010_pfJetGoodEta[0])<1.3"); |
1322 |
< |
PhiZcut=TCut("abs(Zb3010_pfJetDphiZ[0])>2.7"); |
1319 |
> |
if(identifier=="ZbCHS3010") { |
1320 |
> |
LeadingB=TCut ("ZbCHS1510_bTagProbCSVBP[0]>0.898"); |
1321 |
> |
EtaB=TCut("abs(ZbCHS1510_pfJetGoodEta[0])<1.3"); |
1322 |
> |
PhiZcut=TCut("abs(ZbCHS1510_pfJetDphiZ[0])>2.7"); |
1323 |
|
recognized_scenario=true; |
1324 |
|
} |
1325 |
|
|
1330 |
|
recognized_scenario=true; |
1331 |
|
} |
1332 |
|
|
1333 |
< |
if(identifier=="Zb301030") { |
1334 |
< |
LeadingB=TCut ("Zb301030_bTagProbCSVBP[0]>0.898"); |
1335 |
< |
EtaB=TCut("abs(Zb301030_pfJetGoodEta[0])<1.3"); |
1336 |
< |
PhiZcut=TCut("abs(Zb301030_pfJetDphiZ[0])>2.7"); |
1333 |
> |
if(identifier=="ZbCHS301030") { |
1334 |
> |
LeadingB=TCut ("ZbCHS301030_bTagProbCSVBP[0]>0.898"); |
1335 |
> |
EtaB=TCut("abs(ZbCHS301030_pfJetGoodEta[0])<1.3"); |
1336 |
> |
PhiZcut=TCut("abs(ZbCHS301030_pfJetDphiZ[0])>2.7"); |
1337 |
|
recognized_scenario=true; |
1338 |
|
} |
1339 |
|
|
1344 |
|
recognized_scenario=true; |
1345 |
|
} |
1346 |
|
|
1347 |
< |
if(identifier=="Zb301010") { |
1348 |
< |
LeadingB=TCut ("Zb301010_bTagProbCSVBP[0]>0.898"); |
1349 |
< |
EtaB=TCut("abs(Zb301010_pfJetGoodEta[0])<1.3"); |
1350 |
< |
PhiZcut=TCut("abs(Zb301010_pfJetDphiZ[0])>2.7"); |
1347 |
> |
if(identifier=="ZbCHS301010") { |
1348 |
> |
LeadingB=TCut ("ZbCHS301010_bTagProbCSVBP[0]>0.898"); |
1349 |
> |
EtaB=TCut("abs(ZbCHS301010_pfJetGoodEta[0])<1.3"); |
1350 |
> |
PhiZcut=TCut("abs(ZbCHS301010_pfJetDphiZ[0])>2.7"); |
1351 |
|
recognized_scenario=true; |
1352 |
|
} |
1353 |
|
|
1358 |
|
recognized_scenario=true; |
1359 |
|
} |
1360 |
|
|
1361 |
< |
if(identifier=="Zb301010") { |
1362 |
< |
LeadingB=TCut ("Zb301010_bTagProbCSVBP[0]>0.898"); |
1363 |
< |
EtaB=TCut("abs(Zb301010_pfJetGoodEta[0])<1.3"); |
1364 |
< |
PhiZcut=TCut("abs(Zb301010_pfJetDphiZ[0])>2.7"); |
1361 |
> |
if(identifier=="ZbCHS301010") { |
1362 |
> |
LeadingB=TCut ("ZbCHS301010_bTagProbCSVBP[0]>0.898"); |
1363 |
> |
EtaB=TCut("abs(ZbCHS301010_pfJetGoodEta[0])<1.3"); |
1364 |
> |
PhiZcut=TCut("abs(ZbCHS301010_pfJetDphiZ[0])>2.7"); |
1365 |
|
recognized_scenario=true; |
1366 |
|
} |
1367 |
|
|
1372 |
|
recognized_scenario=true; |
1373 |
|
} |
1374 |
|
|
1375 |
< |
if(identifier=="Zb3010_SecEta3") { |
1376 |
< |
LeadingB=TCut ("Zb3010_SecEta3_bTagProbCSVBP[0]>0.898"); |
1377 |
< |
EtaB=TCut("abs(Zb3010_SecEta3_pfJetGoodEta[0])<1.3"); |
1378 |
< |
PhiZcut=TCut("abs(Zb3010_SecEta3_pfJetDphiZ[0])>2.7"); |
1375 |
> |
if(identifier=="ZbCHS3010_SecEta3") { |
1376 |
> |
LeadingB=TCut ("ZbCHS3010_SecEta3_bTagProbCSVBP[0]>0.898"); |
1377 |
> |
EtaB=TCut("abs(ZbCHS3010_SecEta3_pfJetGoodEta[0])<1.3"); |
1378 |
> |
PhiZcut=TCut("abs(ZbCHS3010_SecEta3_pfJetDphiZ[0])>2.7"); |
1379 |
|
recognized_scenario=true; |
1380 |
|
} |
1381 |
|
|
1382 |
< |
if(identifier=="Zb3010_SecEta5") { |
1383 |
< |
LeadingB=TCut ("Zb3010_SecEta5_bTagProbCSVBP[0]>0.898"); |
1384 |
< |
EtaB=TCut("abs(Zb3010_SecEta5_pfJetGoodEta[0])<1.3"); |
1385 |
< |
PhiZcut=TCut("abs(Zb3010_SecEta5_pfJetDphiZ[0])>2.7"); |
1382 |
> |
if(identifier=="ZbCHS3010_SecEta5") { |
1383 |
> |
LeadingB=TCut ("ZbCHS3010_SecEta5_bTagProbCSVBP[0]>0.898"); |
1384 |
> |
EtaB=TCut("abs(ZbCHS3010_SecEta5_pfJetGoodEta[0])<1.3"); |
1385 |
> |
PhiZcut=TCut("abs(ZbCHS3010_SecEta5_pfJetDphiZ[0])>2.7"); |
1386 |
|
recognized_scenario=true; |
1387 |
|
} |
1388 |
|
|
1389 |
< |
if(identifier=="Zb3010_p5Clean") { |
1390 |
< |
LeadingB=TCut ("Zb3010_p5Clean_bTagProbCSVBP[0]>0.898 && Zb3010_p5Clean_IsClean"); |
1391 |
< |
EtaB=TCut("abs(Zb3010_p5Clean_pfJetGoodEta[0])<1.3 && Zb3010_p5Clean_IsClean"); |
1392 |
< |
PhiZcut=TCut("abs(Zb3010_p5Clean_pfJetDphiZ[0])>2.7 && Zb3010_p5Clean_IsClean"); |
1389 |
> |
if(identifier=="ZbCHS3010_p5Clean") { |
1390 |
> |
LeadingB=TCut ("ZbCHS3010_p5Clean_bTagProbCSVBP[0]>0.898 && ZbCHS3010_p5Clean_IsClean"); |
1391 |
> |
EtaB=TCut("abs(ZbCHS3010_p5Clean_pfJetGoodEta[0])<1.3 && ZbCHS3010_p5Clean_IsClean"); |
1392 |
> |
PhiZcut=TCut("abs(ZbCHS3010_p5Clean_pfJetDphiZ[0])>2.7 && ZbCHS3010_p5Clean_IsClean"); |
1393 |
|
recognized_scenario=true; |
1394 |
|
} |
1395 |
|
|
1396 |
< |
if(identifier=="Zb3010CHS") { |
1397 |
< |
LeadingB=TCut ("Zb3010CHS_bTagProbCSVBP[0]>0.898"); |
1398 |
< |
EtaB=TCut("abs(Zb3010CHS_pfJetGoodEta[0])<1.3"); |
1399 |
< |
PhiZcut=TCut("abs(Zb3010CHS_pfJetDphiZ[0])>2.7"); |
1396 |
> |
if(identifier=="ZbCHS3010") { |
1397 |
> |
LeadingB=TCut ("ZbCHS3010_bTagProbCSVBP[0]>0.898"); |
1398 |
> |
EtaB=TCut("abs(ZbCHS3010_pfJetGoodEta[0])<1.3"); |
1399 |
> |
PhiZcut=TCut("abs(ZbCHS3010_pfJetDphiZ[0])>2.7"); |
1400 |
> |
recognized_scenario=true; |
1401 |
> |
} |
1402 |
> |
if(identifier=="ZbCHS3010") { |
1403 |
> |
LeadingB=TCut ("ZbCHS3010_bTagProbCSVBP[0]>0.898"); |
1404 |
> |
EtaB=TCut("abs(ZbCHS3010_pfJetGoodEta[0])<1.3"); |
1405 |
> |
PhiZcut=TCut("abs(ZbCHS3010_pfJetDphiZ[0])>2.7"); |
1406 |
> |
recognized_scenario=true; |
1407 |
> |
} |
1408 |
> |
if(identifier=="ZbCHS30") { |
1409 |
> |
LeadingB=TCut ("ZbCHS30_bTagProbCSVBP[0]>0.898"); |
1410 |
> |
EtaB=TCut("abs(ZbCHS30_pfJetGoodEta[0])<1.3"); |
1411 |
> |
PhiZcut=TCut("abs(ZbCHS30_pfJetDphiZ[0])>2.7"); |
1412 |
|
recognized_scenario=true; |
1413 |
|
} |
1414 |
|
|
1415 |
|
assert(recognized_scenario); |
1416 |
|
|
1417 |
< |
cout << "Cuts: " << endl; |
1418 |
< |
cout << " " << (const char*) LeadingB << endl; |
1419 |
< |
cout << " " << (const char*) EtaB << endl; |
1420 |
< |
cout << " " << (const char*) PhiZcut << endl; |
1421 |
< |
|
1422 |
< |
cout << endl << endl; |
1423 |
< |
|
1424 |
< |
// ScenarioComparison(); |
1425 |
< |
// ScenarioComparisonInclusive(); |
1426 |
< |
|
1427 |
< |
|
1428 |
< |
// DoPUStudy(identifier); |
1429 |
< |
|
1430 |
< |
// SpecialCutFlow(identifier); |
1431 |
< |
// draw_kin_variable("pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",17000,30,200,"Z p_{T}","Official/"+identifier+"/Zpt__"+identifier,1); |
1432 |
< |
// draw_kin_variable(identifier+"_pfJetGoodPt[0]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",40,0,200,"Leading Jet Pt (B)","Official/"+identifier+"/LeadingJetPt__"+identifier,1); |
1433 |
< |
// draw_kin_variable(identifier+"_pfJetGoodPt[1]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",40,0,200,"Sub-Leading Jet Pt [GeV]","Official/"+identifier+"/Jet2Pt__"+identifier,1); |
861 |
< |
// draw_kin_variable(identifier+"_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>10&&pt<1000",20,0,2,"p_{T}^{J2} / p_{T}^{Z}","Official/"+identifier+"/SubLeadingJetPt_Over_ZPt__"+identifier,1); |
1417 |
> |
dout << "Cuts: " << endl; |
1418 |
> |
dout << " " << (const char*) LeadingB << endl; |
1419 |
> |
dout << " " << (const char*) EtaB << endl; |
1420 |
> |
dout << " " << (const char*) PhiZcut << endl; |
1421 |
> |
|
1422 |
> |
dout << endl << endl; |
1423 |
> |
|
1424 |
> |
// ScenarioComparison(); |
1425 |
> |
// ScenarioComparisonInclusive(); |
1426 |
> |
|
1427 |
> |
// DoPUStudy(identifier); |
1428 |
> |
// SpecialCutFlow(identifier); |
1429 |
> |
|
1430 |
> |
// draw_kin_variable("pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000",17000,30,200,"Z p_{T}","Official/"+identifier+"/Zpt__"+identifier,1); |
1431 |
> |
// draw_kin_variable(identifier+"_pfJetGoodPt[0]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000",40,0,200,"Leading Jet Pt (B)","Official/"+identifier+"/LeadingJetPt__"+identifier,1); |
1432 |
> |
// draw_kin_variable(identifier+"_pfJetGoodPt[1]",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000",40,0,200,"Sub-Leading Jet Pt [GeV]","Official/"+identifier+"/Jet2Pt__"+identifier,1); |
1433 |
> |
// draw_kin_variable(identifier+"_pfJetGoodPt[1]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&"pt>30&&pt<1000",20,0,2,"p_{T}^{J2} / p_{T}^{Z}","Official/"+identifier+"/SubLeadingJetPt_Over_ZPt__"+identifier,1); |
1434 |
|
draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>30&&pt<50"),20,0,2,"#alpha","Official/"+identifier+"/alpha_pt_30_to_50__"+identifier,1); |
1435 |
|
draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>50&&pt<75"),20,0,2,"#alpha","Official/"+identifier+"/alpha_50_to_75__"+identifier,1); |
1436 |
|
draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>75&&pt<125"),20,0,2,"#alpha","Official/"+identifier+"/alpha_pt_75_to_125__"+identifier,1); |
1437 |
|
draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut("pt>125&&pt<1000"),20,0,2,"#alpha","Official/"+identifier+"/alpha_pt_125_to_1000__"+identifier,1); |
1438 |
|
draw_kin_variable(identifier+"_alpha",ZplusBsel&&LeadingB&&EtaB&&PhiZcut,20,0,2,"#alpha","Official/"+identifier+"/alpha_full__"+identifier,1); |
1439 |
< |
// draw_kin_variable(identifier+"_pfBJetDphiZ[0]",ZplusBsel&&LeadingB&&"pt>10&&pt<1000&&pfBJetDphiZ[0]>0",30,0,3.2,"#delta#phi (Z,b lead)","Official/"+identifier+"/DeltaPhiZBlead__"+identifier,0); |
1439 |
> |
draw_kin_variable(identifier+"_pfBJetDphiZ[0]",ZplusBsel&&LeadingB&&"pt>30&&pt<1000&&pfBJetDphiZ[0]>0",30,0,3.2,"#delta#phi (Z,b lead)","Official/"+identifier+"/DeltaPhiZBlead__"+identifier,0); |
1440 |
|
|
1441 |
< |
// draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.3").c_str()),20,0,2,"Z+b MPF","Official/"+identifier+"/mpf_alpha_smaller_0p3___"+identifier,0,"#alpha<0.3, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
1442 |
< |
// draw_kin_variable(identifier+"_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.3").c_str()),20,0,2,"p_{T} b-jet / p_{T} Z","Official/"+identifier+"/ptb_over_ptz___alpha_smaller_0p3______"+identifier,0,"#alpha<0.3, 10 GeV < p_{T}^{Z} < 1000 GeV"); |
1443 |
< |
|
1441 |
> |
draw_kin_variable("mpf",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<1000&&"+identifier+"_alpha<0.3").c_str()),20,0,2,"Z+b MPF","Official/"+identifier+"/mpf_alpha_smaller_0p3___"+identifier,0,"#alpha<0.3, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
1442 |
> |
draw_kin_variable(identifier+"_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<1000&&"+identifier+"_alpha<0.3").c_str()),20,0,2,"p_{T} b-jet / p_{T} Z","Official/"+identifier+"/ptb_over_ptz___alpha_smaller_0p3______"+identifier,0,"#alpha<0.3, 30 GeV < p_{T}^{Z} < 1000 GeV"); |
1443 |
> |
draw_kin_variable(identifier+"_pfJetGoodPt[0]/pt",ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<50&&"+identifier+"_alpha<0.3").c_str()),20,0,2,"p_{T} b-jet / p_{T} Z","Official/"+identifier+"/ptb_over_ptz___alpha_smaller_0p3___pt3050___"+identifier,0,"#alpha<0.3, 30 GeV < p_{T}^{Z} < 1000 GeV}{30<p_{T}^{Z}<50 GeV}"); |
1444 |
|
|
1445 |
< |
// */ |
1445 |
> |
} |
1446 |
> |
|
1447 |
> |
void GetNumberEventsInsideOutsideAlphaWindow(TCut specialcut, string title) { |
1448 |
|
|
1449 |
+ |
// TCut cut = ZplusBsel&&LeadingB&&PhiZcut&&specialcut&&TCut("ZbCHS3010_alpha<0.3"); |
1450 |
+ |
TCut cut = specialcut; |
1451 |
+ |
TCut in = EtaB; |
1452 |
+ |
TCut out = TCut("abs(ZbCHS3010_pfJetGoodEta[0])>1.3"); |
1453 |
+ |
|
1454 |
+ |
TH1F *data_IN = allsamples.Draw("data_IN", "mll",1,0,150, "nothing [GeV]", "events", cut&&in, data,luminosity); |
1455 |
+ |
TH1F *data_OUT = allsamples.Draw("data_OUT", "mll",1,0,150, "nothing [GeV]", "events", cut&&out,data,luminosity); |
1456 |
+ |
TH1F *mc_IN = allsamples.Draw("mc_IN", "mll",1,0,150, "nothing [GeV]", "events", cut&&in, mc ,luminosity); |
1457 |
+ |
TH1F *mc_OUT = allsamples.Draw("mc_OUT", "mll",1,0,150, "nothing [GeV]", "events", cut&&out,mc ,luminosity); |
1458 |
+ |
|
1459 |
+ |
dout << title << " : " << endl; |
1460 |
+ |
dout << " Data: In " << data_IN->Integral() << " vs out " << data_OUT->Integral() << endl; |
1461 |
+ |
dout << " MC : In " << mc_IN->Integral() << " vs out " << mc_OUT->Integral() << endl; |
1462 |
+ |
dout << " ratio in : " << data_IN->Integral()/mc_IN->Integral() << " +/- " << (data_IN->Integral()/mc_IN->Integral()) * sqrt(1.0/mc_IN->Integral()+ 1.0/data_IN->Integral()) << endl; |
1463 |
+ |
dout << " ratio out : " << data_OUT->Integral()/mc_OUT->Integral() << " +/- " << (data_OUT->Integral()/mc_OUT->Integral()) * sqrt(1.0/mc_OUT->Integral()+ 1.0/data_OUT->Integral()) << endl; |
1464 |
+ |
|
1465 |
+ |
delete data_IN; |
1466 |
+ |
delete data_OUT; |
1467 |
+ |
delete mc_IN; |
1468 |
+ |
delete mc_OUT; |
1469 |
|
} |
1470 |
|
|
1471 |
< |
void do_basic_ZB_analysis() { |
1471 |
> |
void TEST_GetNumberEventsInsideOutsideAlphaWindow() { |
1472 |
> |
TCanvas *ca = new TCanvas("ca","ca"); |
1473 |
> |
// GetNumberEventsInsideOutsideAlphaWindow(TCut("id1==id2&&id1==0"), "ee"); |
1474 |
> |
// GetNumberEventsInsideOutsideAlphaWindow(TCut("id1==id2&&id1==1"), "mm"); |
1475 |
> |
// GetNumberEventsInsideOutsideAlphaWindow(TCut("id1==id2"), "ee/mm"); |
1476 |
> |
|
1477 |
> |
dout << "BASE SELECTION" << endl; |
1478 |
> |
GetNumberEventsInsideOutsideAlphaWindow(TCut("id1==id2&&id1==0"), "ee"); |
1479 |
> |
GetNumberEventsInsideOutsideAlphaWindow(TCut("id1==id2&&id1==1"), "mm"); |
1480 |
> |
GetNumberEventsInsideOutsideAlphaWindow(TCut("id1==id2"), "ee/mm"); |
1481 |
> |
|
1482 |
> |
dout << "BASE SELECTION: Z+b" << endl; |
1483 |
> |
GetNumberEventsInsideOutsideAlphaWindow(ZplusBsel&&TCut("id1==id2&&id1==0"), "ee"); |
1484 |
> |
GetNumberEventsInsideOutsideAlphaWindow(ZplusBsel&&TCut("id1==id2&&id1==1"), "mm"); |
1485 |
> |
GetNumberEventsInsideOutsideAlphaWindow(ZplusBsel&&TCut("id1==id2"), "ee/mm"); |
1486 |
> |
|
1487 |
> |
dout << "Leading B" << endl; |
1488 |
> |
GetNumberEventsInsideOutsideAlphaWindow(LeadingB&&ZplusBsel&&TCut("id1==id2&&id1==0"), "ee"); |
1489 |
> |
GetNumberEventsInsideOutsideAlphaWindow(LeadingB&&ZplusBsel&&TCut("id1==id2&&id1==1"), "mm"); |
1490 |
> |
GetNumberEventsInsideOutsideAlphaWindow(LeadingB&&ZplusBsel&&TCut("id1==id2"), "ee/mm"); |
1491 |
> |
|
1492 |
> |
dout << "PhiZcut" << endl; |
1493 |
> |
GetNumberEventsInsideOutsideAlphaWindow(PhiZcut&&LeadingB&&ZplusBsel&&TCut("id1==id2&&id1==0"), "ee"); |
1494 |
> |
GetNumberEventsInsideOutsideAlphaWindow(PhiZcut&&LeadingB&&ZplusBsel&&TCut("id1==id2&&id1==1"), "mm"); |
1495 |
> |
GetNumberEventsInsideOutsideAlphaWindow(PhiZcut&&LeadingB&&ZplusBsel&&TCut("id1==id2"), "ee/mm"); |
1496 |
> |
|
1497 |
> |
dout << "alpha cut" << endl; |
1498 |
> |
GetNumberEventsInsideOutsideAlphaWindow(PhiZcut&&LeadingB&&ZplusBsel&&TCut("id1==id2&&id1==0")&&TCut("ZbCHS3010_alpha<0.3"), "ee"); |
1499 |
> |
GetNumberEventsInsideOutsideAlphaWindow(PhiZcut&&LeadingB&&ZplusBsel&&TCut("id1==id2&&id1==1")&&TCut("ZbCHS3010_alpha<0.3"), "mm"); |
1500 |
> |
GetNumberEventsInsideOutsideAlphaWindow(PhiZcut&&LeadingB&&ZplusBsel&&TCut("id1==id2")&&TCut("ZbCHS3010_alpha<0.3"), "ee/mm"); |
1501 |
> |
|
1502 |
> |
delete ca; |
1503 |
|
|
1504 |
|
|
1505 |
< |
TCanvas *zbcanvas = new TCanvas("zbcanvas","zbcanvas"); |
1505 |
> |
} |
1506 |
|
|
882 |
– |
// compare_selection("Zb3010_p5Clean"); |
883 |
– |
// compare_selection("Zb3010CHS"); |
884 |
– |
// compare_selection("Zb3010"); |
885 |
– |
// compare_selection("Zb301030"); |
886 |
– |
// compare_selection("Zb1530"); |
887 |
– |
// compare_selection("Zb301010"); |
888 |
– |
// compare_selection("Zb3010_SecEta3"); |
889 |
– |
// compare_selection("Zb3010_SecEta5"); |
890 |
– |
// compare_selection("Zb1510"); |
891 |
– |
// compare_selection("Zb301010"); |
892 |
– |
// compare_selection("ZbMikko"); |
893 |
– |
// compare_selection("Zb3010"); |
894 |
– |
// compare_selection("Zb40"); |
1507 |
|
|
1508 |
+ |
void MetSpectrumDepletionIllustration(int isdata) { |
1509 |
+ |
|
1510 |
+ |
TCanvas *can = new TCanvas("can","can"); |
1511 |
+ |
TCut basecut(ZplusBsel&&LeadingB&&EtaB&&PhiZcut); |
1512 |
+ |
|
1513 |
+ |
cutWeight=STDWEIGHT*TCut("ZbCHS3010_BTagWgtTUp*(1.0)*(ZbCHS3010_bTagProbCSVBP[0]>0.898)"); |
1514 |
+ |
TH1F *standard = allsamples.Draw("standard","met[1]",80,0,400, "MET [GeV]", "events", basecut,isdata,luminosity); |
1515 |
+ |
|
1516 |
+ |
cutWeight=STDWEIGHT*TCut("ZbCHS3010_BTagWgtTUp*(1.0*softMuon)*(ZbCHS3010_bTagProbCSVBP[0]>0.898)"); |
1517 |
+ |
TH1F *Neutrinos = allsamples.Draw("Neutrinos","met[1]",80,0,400, "MET [GeV]", "events", basecut,isdata,luminosity); |
1518 |
+ |
|
1519 |
+ |
cutWeight=STDWEIGHT*TCut("ZbCHS3010_BTagWgtTUp*(1.0*(1.0-softMuon))*(ZbCHS3010_bTagProbCSVBP[0]>0.898)"); |
1520 |
+ |
TH1F *NoNeutrinos = allsamples.Draw("NoNeutrinos","met[1]",80,0,400, "MET [GeV]", "events", basecut,isdata,luminosity); |
1521 |
+ |
|
1522 |
+ |
standard->Scale(1.0/standard->Integral()); |
1523 |
+ |
Neutrinos->Scale(1.0/Neutrinos->Integral()); |
1524 |
+ |
NoNeutrinos->Scale(1.0/NoNeutrinos->Integral()); |
1525 |
|
|
1526 |
< |
// print_all_b_yields(); |
1527 |
< |
// draw_mpf_vars(); |
1528 |
< |
// DrawEvilCutFlow(); |
1526 |
> |
Neutrinos->SetLineColor(kGreen); |
1527 |
> |
NoNeutrinos->SetLineColor(kRed); |
1528 |
> |
|
1529 |
> |
can->SetLogy(1); |
1530 |
> |
TLegend *leg = make_legend(); |
1531 |
> |
leg->AddEntry(standard,"Standard sample","ep"); |
1532 |
> |
leg->AddEntry(Neutrinos,"#nu enriched sample","l"); |
1533 |
> |
leg->AddEntry(NoNeutrinos,"#nu depleted sample","l"); |
1534 |
> |
leg->SetX1(0.9*leg->GetX1()); |
1535 |
> |
standard->Draw("e1"); |
1536 |
> |
Neutrinos->Draw("histo,same"); |
1537 |
> |
NoNeutrinos->Draw("histo,same"); |
1538 |
> |
if(isdata==data) leg->SetHeader("Data:"); |
1539 |
> |
else leg->SetHeader("MC:"); |
1540 |
> |
leg->Draw(); |
1541 |
> |
DrawPrelim(); |
1542 |
> |
|
1543 |
> |
if(isdata==data) CompleteSave(can,"NeutrinoMetSpectrum__Data"); |
1544 |
> |
else CompleteSave(can,"NeutrinoMetSpectrum__MC"); |
1545 |
> |
delete standard; |
1546 |
> |
delete Neutrinos; |
1547 |
> |
delete NoNeutrinos; |
1548 |
> |
delete can; |
1549 |
> |
CleanLegends(); |
1550 |
> |
} |
1551 |
> |
|
1552 |
> |
void do_basic_ZB_analysis(bool DoCompleteAnalysis) { |
1553 |
> |
STDWEIGHT=TCut(cutWeight); |
1554 |
> |
cutWeight=TCut(STDWEIGHT*TCut("ZbCHS3010_BTagWgtT")); |
1555 |
> |
dout << "The lepton requirement is " << (const char*) leptoncut << endl; |
1556 |
> |
bool doquick=false; |
1557 |
|
|
1558 |
< |
// draw_Zb_kin_vars(); |
1558 |
> |
TCanvas *zbcanvas = new TCanvas("zbcanvas","zbcanvas"); |
1559 |
|
|
1560 |
< |
new_data_mc_agreement_2d(); |
1560 |
> |
|
1561 |
> |
// MetSpectrumDepletionIllustration(data); |
1562 |
> |
// MetSpectrumDepletionIllustration(mc); |
1563 |
> |
|
1564 |
> |
// compare_selection("ZbCHS3010_p5Clean"); |
1565 |
> |
// compare_selection("ZbCHS3010"); |
1566 |
> |
// compare_selection("Zb30"); |
1567 |
> |
// compare_selection("Zb3010"); |
1568 |
> |
// compare_selection("Zb1510"); |
1569 |
> |
// compare_selection("ZbCHS30"); |
1570 |
> |
// compare_selection("ZbCHS3010"); |
1571 |
> |
// compare_selection("ZbCHS3010"); |
1572 |
> |
// compare_selection("ZbCHS301010"); |
1573 |
> |
// compare_selection("ZbCHS3010_SecEta3"); |
1574 |
> |
// compare_selection("ZbCHS3010_SecEta5"); |
1575 |
> |
// compare_selection("Zb1510"); |
1576 |
> |
// compare_selection("ZbCHS301010"); |
1577 |
> |
// compare_selection("ZbMikko"); |
1578 |
> |
// compare_selection("ZbCHS3010"); |
1579 |
> |
// compare_selection("Zb40"); |
1580 |
> |
|
1581 |
> |
if(!doquick) { |
1582 |
> |
// draw_kin_variable("mll","",28,60.0,200.0,"m_{ll}","mll",1,"");//nice and quick test to see if the normalization is ok (i.e. all data is processed etc.) |
1583 |
> |
// print_all_b_yields(); |
1584 |
> |
// draw_mpf_vars(); |
1585 |
> |
// DrawEvilCutFlow(); |
1586 |
> |
|
1587 |
> |
// draw_Zb_kin_vars(); |
1588 |
> |
|
1589 |
> |
} |
1590 |
> |
|
1591 |
> |
// GetNumberEventsInsideOutsideAlphaWindow(); |
1592 |
> |
|
1593 |
> |
if(DoCompleteAnalysis) { |
1594 |
> |
/* need to run the following scenarios: |
1595 |
> |
* - normal |
1596 |
> |
* - inclusive |
1597 |
> |
* - medium WP |
1598 |
> |
* - alpha up |
1599 |
> |
* - alpha down |
1600 |
> |
*/ |
1601 |
> |
|
1602 |
> |
bool fast=true;bool slow=false;//don't change these |
1603 |
> |
|
1604 |
> |
ZbResultContainer inclusive = new_data_mc_agreement_2d(slow,"ZbCHS3010_alpha","inclusive",TCut("mll>0"),TCut("1.0"),0.3); |
1605 |
> |
ZbResultContainer Reference = new_data_mc_agreement_2d(slow,"ZbCHS3010_alpha","reference",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtT"),0.3); |
1606 |
> |
|
1607 |
> |
|
1608 |
> |
ZbResultContainer NeutrinoQ = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","NeutrinoQ",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtTUp*(1.0*softMuon)"),0.3); |
1609 |
> |
ZbResultContainer ANeutrinoQ = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","ANeutrinoQ",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtTUp*(1.0*(1.0-softMuon))"),0.3); |
1610 |
> |
|
1611 |
> |
ZbResultContainer effmistagUp = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","effmistagUp",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtTUp"),0.3); |
1612 |
> |
ZbResultContainer effmistagDown = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","effmistagDown",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtTDown"),0.3); |
1613 |
> |
ZbResultContainer medium = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","medium",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.679"),TCut("ZbCHS3010_BTagWgtM"),0.3); |
1614 |
> |
ZbResultContainer loose = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","loose",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.244"),TCut("ZbCHS3010_BTagWgtL"),0.3); |
1615 |
> |
ZbResultContainer AlphaUp = new_data_mc_agreement_2d(fast,"ZbCHS3010_alphaUp","AlphaUp",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtT"),0.3); |
1616 |
> |
ZbResultContainer AlphaDown = new_data_mc_agreement_2d(fast,"ZbCHS3010_alphaDown","AlphaDown",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtT"),0.3); |
1617 |
> |
|
1618 |
> |
ZbResultContainer L5inclusive = new_data_mc_agreement_2d(fast,"ZbCHS3010_alphaL5","L5inclusive",TCut("mll>0"),TCut("1.0"),0.3); |
1619 |
> |
ZbResultContainer L5Reference = new_data_mc_agreement_2d(fast,"ZbCHS3010_alphaL5","L5reference",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtT"),0.3); |
1620 |
> |
|
1621 |
> |
ZbResultContainer AlphaThresholdVariationDown10 = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","AlphaThresholdVariationDown10", TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"), TCut("ZbCHS3010_BTagWgtT"),0.3-0.1*0.3); |
1622 |
> |
ZbResultContainer AlphaThresholdVariationUp10 = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","AlphaThresholdVariationUp10", TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"), TCut("ZbCHS3010_BTagWgtT"),0.3+0.1*0.3); |
1623 |
> |
ZbResultContainer AlphaThresholdVariationDown30 = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","AlphaThresholdVariationDown30", TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"), TCut("ZbCHS3010_BTagWgtT"),0.3-0.3*0.3); |
1624 |
> |
ZbResultContainer AlphaThresholdVariationUp30 = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","AlphaThresholdVariationUp30", TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"), TCut("ZbCHS3010_BTagWgtT"),0.3+0.3*0.3); |
1625 |
> |
ZbResultContainer AlphaThresholdVariationDown10inc = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","AlphaThresholdVariationDown10inc",TCut("mll>0"), TCut("1.0"),0.3-0.1*0.3); |
1626 |
> |
ZbResultContainer AlphaThresholdVariationUp10inc = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","AlphaThresholdVariationUp10inc", TCut("mll>0"), TCut("1.0"),0.3+0.1*0.3); |
1627 |
> |
ZbResultContainer AlphaThresholdVariationDown30inc = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","AlphaThresholdVariationDown30inc",TCut("mll>0"), TCut("1.0"),0.3-0.3*0.3); |
1628 |
> |
ZbResultContainer AlphaThresholdVariationUp30inc = new_data_mc_agreement_2d(fast,"ZbCHS3010_alpha","AlphaThresholdVariationUp30inc", TCut("mll>0"), TCut("1.0"),0.3+0.3*0.3); |
1629 |
> |
|
1630 |
> |
//and now let's compute some systematics! |
1631 |
> |
//1 alpha variation |
1632 |
> |
float SysMPF_Alpha_down = Reference.MPF_Result_FaceValue.getValue()-AlphaDown.MPF_Result_FaceValue.getValue(); |
1633 |
> |
float SysMPF_Alpha_up = Reference.MPF_Result_FaceValue.getValue()-AlphaUp.MPF_Result_FaceValue.getValue(); |
1634 |
> |
|
1635 |
> |
//2 btagging efficiency/mistag correction |
1636 |
> |
float SysMPF_EFF_down = Reference.MPF_Result_FaceValue.getValue()-effmistagDown.MPF_Result_FaceValue.getValue(); |
1637 |
> |
float SysMPF_EFF_up = Reference.MPF_Result_FaceValue.getValue()-effmistagUp.MPF_Result_FaceValue.getValue(); |
1638 |
> |
|
1639 |
> |
//3 Presence of soft muons (->neutrino question) |
1640 |
> |
float SysMPF_Neutrino_up = Reference.MPF_Result_FaceValue.getValue()-NeutrinoQ.MPF_Result_FaceValue.getValue(); |
1641 |
> |
float SysMPF_Neutrino_down = Reference.MPF_Result_FaceValue.getValue()-ANeutrinoQ.MPF_Result_FaceValue.getValue(); |
1642 |
> |
|
1643 |
> |
//4 purity |
1644 |
> |
zbcanvas->cd(); |
1645 |
> |
gStyle->SetOptFit(0); |
1646 |
> |
write_info(__FUNCTION__,"Don't know the exact purity at the moment, still needs to be determined!"); |
1647 |
> |
TH1F *purityhisto = new TH1F("purityhisto","purityhisto",1,0,1); |
1648 |
> |
purityhisto->GetXaxis()->SetTitle("Purity"); |
1649 |
> |
purityhisto->GetYaxis()->SetTitle("C_{abs}"); |
1650 |
> |
purityhisto->GetXaxis()->CenterTitle(); |
1651 |
> |
purityhisto->GetYaxis()->CenterTitle(); |
1652 |
> |
|
1653 |
> |
TGraphErrors *gSysMPF_Purity = new TGraphErrors(); |
1654 |
> |
|
1655 |
> |
gSysMPF_Purity->SetPoint(0,PurityInclusive,inclusive.MPF_Result_FaceValue.getValue()); |
1656 |
> |
gSysMPF_Purity->SetPointError(0,0.0,inclusive.MPF_Result_FaceValue.getError()); |
1657 |
> |
|
1658 |
> |
gSysMPF_Purity->SetPoint(1,PurityLoose,loose.MPF_Result_FaceValue.getValue());//x value? |
1659 |
> |
gSysMPF_Purity->SetPointError(1,0.0,loose.MPF_Result_FaceValue.getError()); |
1660 |
> |
gSysMPF_Purity->SetPoint(2,PurityMedium,medium.MPF_Result_FaceValue.getValue());//x value? |
1661 |
> |
gSysMPF_Purity->SetPointError(2,0.0,medium.MPF_Result_FaceValue.getError()); |
1662 |
> |
gSysMPF_Purity->SetPoint(3,PurityTight,Reference.MPF_Result_FaceValue.getValue());//x value? |
1663 |
> |
gSysMPF_Purity->SetPointError(3,0.0,Reference.MPF_Result_FaceValue.getError()); |
1664 |
> |
|
1665 |
> |
|
1666 |
> |
float min,max; |
1667 |
> |
FindMinMax(gSysMPF_Purity,min,max); |
1668 |
> |
purityhisto->SetStats(0); |
1669 |
> |
purityhisto->GetYaxis()->SetRangeUser(min,max); |
1670 |
> |
|
1671 |
> |
gSysMPF_Purity->Fit("pol1"); |
1672 |
> |
TPolyLine *purity_fit_uncert = GetFitUncertaintyShape(gSysMPF_Purity, "pol1", min, max,0.0,1.0); |
1673 |
> |
TF1* pufit = (TF1*)gSysMPF_Purity->GetFunction("pol1"); |
1674 |
> |
|
1675 |
> |
TF1* pufit_c = new TF1("pufit_c","[0]+[1]*x"); |
1676 |
> |
pufit_c->SetParameters(pufit->GetParameters()); |
1677 |
> |
pufit_c->SetLineColor(TColor::GetColor("#0101DF")); |
1678 |
> |
purity_fit_uncert->SetFillColor(TColor::GetColor("#5353FC")); |
1679 |
> |
pufit->SetLineColor(TColor::GetColor("#5353FC")); |
1680 |
> |
|
1681 |
> |
purityhisto->Draw(); |
1682 |
> |
purity_fit_uncert->Draw("f"); |
1683 |
> |
gSysMPF_Purity->Draw("P*"); |
1684 |
> |
pufit_c->Draw("same"); |
1685 |
> |
DrawPrelim(); |
1686 |
> |
|
1687 |
> |
float ExtrapolatedResult=pufit->GetParameter(0)+1.0*pufit->GetParameter(1); |
1688 |
> |
float dExtrapolatedResult=sqrt(pufit->GetParError(0)*pufit->GetParError(0)+1.0*1.0*pufit->GetParError(1)*pufit->GetParError(1)); |
1689 |
> |
|
1690 |
> |
stringstream summary; |
1691 |
> |
summary << "#splitline{Reference: " << std::setprecision(4) << Reference.MPF_Result_FaceValue.getValue() << "+/-" << std::setprecision(4) << Reference.MPF_Result_FaceValue.getError() << "}{"; |
1692 |
> |
summary << "Extrapolation: " << std::setprecision(4) << ExtrapolatedResult << " +/- " << std::setprecision(4) << dExtrapolatedResult << "}"; |
1693 |
> |
|
1694 |
> |
dout << "Have found an extrapolated result at 1.0 of " << ExtrapolatedResult << " ; will use the difference between this result and the face value as "; |
1695 |
> |
dout << "purity-related systematic uncertainty" << endl; |
1696 |
> |
|
1697 |
> |
TText *infobox = write_title(summary.str()); |
1698 |
> |
infobox->SetX(0.75); |
1699 |
> |
infobox->SetTextSize(0.03); |
1700 |
> |
infobox->SetY(0.75); |
1701 |
> |
infobox->Draw(); |
1702 |
> |
|
1703 |
> |
CompleteSave(zbcanvas,"Systematics/Purity"); |
1704 |
> |
|
1705 |
> |
|
1706 |
> |
|
1707 |
> |
float SysMPF_Purity = abs(ExtrapolatedResult-Reference.MPF_Result_FaceValue.getValue()); |
1708 |
> |
|
1709 |
> |
float sys_alpha = abs(SysMPF_Alpha_down)>abs(SysMPF_Alpha_up)?abs(SysMPF_Alpha_down):abs(SysMPF_Alpha_up); |
1710 |
> |
float sys_eff = abs(SysMPF_EFF_down)>abs(SysMPF_EFF_up)?abs(SysMPF_EFF_down):abs(SysMPF_EFF_up); |
1711 |
> |
float sys_purity = abs(SysMPF_Purity); |
1712 |
> |
float sys_neutrino = abs(SysMPF_Neutrino_down)>abs(SysMPF_Neutrino_up)?abs(SysMPF_Neutrino_down):abs(SysMPF_Neutrino_up); |
1713 |
> |
float sys = sqrt(sys_alpha*sys_alpha+sys_eff*sys_eff+sys_purity*sys_purity+sys_neutrino*sys_neutrino); |
1714 |
> |
|
1715 |
> |
dout << "MPF METHOD:" << endl; |
1716 |
> |
dout << " Systematics : down up (selected)" << endl; |
1717 |
> |
dout << " Oversmearing : " << SysMPF_Alpha_down << " , " << SysMPF_Alpha_up << " ( " << sys_alpha << ") " << endl; |
1718 |
> |
dout << " eff/mistag variation : " << SysMPF_EFF_down << " , " << SysMPF_EFF_up << " ( " << sys_eff << ") " << endl; |
1719 |
> |
dout << " purity : " << SysMPF_Purity << " ( " << sys_purity << " )" << endl; |
1720 |
> |
dout << " neutrino : " << SysMPF_Neutrino_down << " , " << SysMPF_Neutrino_up << " ( " << sys_neutrino << ") " << endl; |
1721 |
> |
dout << " total : " << sys << " (note that this is the sys on C_{abs}^{b}, not yet on C_{corr} - there will also be an additional source!)" << endl; |
1722 |
> |
dout << endl << endl; |
1723 |
> |
dout << " FINAL RESULTS : " << endl; |
1724 |
> |
dout << " C_{abs}^{b} = " << Reference.MPF_Result_FaceValue << " (stat) +/- " << sys << " (sys) " << endl; |
1725 |
> |
dout << " C_{abs}^{inc} = " << inclusive.MPF_Result_FaceValue << " (stat) " << endl; |
1726 |
> |
|
1727 |
> |
float sysfinal = Reference.MPF_Result_FaceValue.getValue()/inclusive.MPF_Result_FaceValue.getValue(); |
1728 |
> |
sysfinal *= sqrt(sys*sys/(Reference.MPF_Result_FaceValue.getValue()*Reference.MPF_Result_FaceValue.getValue())); |
1729 |
> |
//yes, this could be simplified but it would look like a bug. |
1730 |
> |
|
1731 |
> |
|
1732 |
> |
|
1733 |
> |
|
1734 |
> |
dout << "Note: Varying the alpha cut (->face value) we get the following results: " << endl; |
1735 |
> |
dout << "-30%: " << AlphaThresholdVariationDown30.MPF_Result_FaceValue/AlphaThresholdVariationDown30inc.MPF_Result_FaceValue << " (stat)" << endl; |
1736 |
> |
dout << "-10%: " << AlphaThresholdVariationDown10.MPF_Result_FaceValue/AlphaThresholdVariationDown10inc.MPF_Result_FaceValue << " (stat)" << endl; |
1737 |
> |
dout << " 0%: " << Reference.MPF_Result_FaceValue/inclusive.MPF_Result_FaceValue << " (stat) +/- " << endl; |
1738 |
> |
dout << "+10%: " << AlphaThresholdVariationUp10.MPF_Result_FaceValue/AlphaThresholdVariationUp10inc.MPF_Result_FaceValue << " (stat)" << endl; |
1739 |
> |
dout << "+30%: " << AlphaThresholdVariationUp30.MPF_Result_FaceValue/AlphaThresholdVariationUp30inc.MPF_Result_FaceValue << " (stat)" << endl; |
1740 |
> |
|
1741 |
> |
dout << " XCheck for Rabs, varying the alpha cut (->face value) we get the following results: " << endl; |
1742 |
> |
dout << " -30%: " << AlphaThresholdVariationDown30.Rabs_Result_FaceValue/AlphaThresholdVariationDown30inc.Rabs_Result_FaceValue << " (stat)" << endl; |
1743 |
> |
dout << " -10%: " << AlphaThresholdVariationDown10.Rabs_Result_FaceValue/AlphaThresholdVariationDown10inc.Rabs_Result_FaceValue << " (stat)" << endl; |
1744 |
> |
dout << " 0%: " << Reference.Rabs_Result_FaceValue/inclusive.Rabs_Result_FaceValue << " (stat) +/- " << endl; |
1745 |
> |
dout << " +10%: " << AlphaThresholdVariationUp10.Rabs_Result_FaceValue/AlphaThresholdVariationUp10inc.Rabs_Result_FaceValue << " (stat)" << endl; |
1746 |
> |
dout << " +30%: " << AlphaThresholdVariationUp30.Rabs_Result_FaceValue/AlphaThresholdVariationUp30inc.Rabs_Result_FaceValue << " (stat)" << endl; |
1747 |
> |
|
1748 |
> |
|
1749 |
> |
float sys_alphavar_up = abs(AlphaThresholdVariationUp30.MPF_Result_FaceValue.getValue()/AlphaThresholdVariationUp30inc.MPF_Result_FaceValue.getValue() - Reference.MPF_Result_FaceValue.getValue()/inclusive.MPF_Result_FaceValue.getValue()); |
1750 |
> |
float sys_alphavar_down = abs(AlphaThresholdVariationDown30.MPF_Result_FaceValue.getValue()/AlphaThresholdVariationDown30inc.MPF_Result_FaceValue.getValue() - Reference.MPF_Result_FaceValue.getValue()/inclusive.MPF_Result_FaceValue.getValue()); |
1751 |
> |
float sys_alphavar = sys_alphavar_up>sys_alphavar_down?sys_alphavar_up:sys_alphavar_down; |
1752 |
> |
|
1753 |
> |
dout << " -> Additional systematic (from 30%) : " << sys_alphavar << endl; |
1754 |
> |
sysfinal=sqrt(sysfinal*sysfinal+sys_alphavar*sys_alphavar); |
1755 |
> |
dout << "Final systematic is : " << sysfinal << endl; |
1756 |
> |
|
1757 |
> |
dout << " ******************************************** < FINAL RESULT > ******************************************** " << endl; |
1758 |
> |
dout << " C_{corr} = " << Reference.MPF_Result_FaceValue/inclusive.MPF_Result_FaceValue << " (stat) +/- " << sysfinal << " (sys) " << endl; |
1759 |
> |
dout << " ******************************************** < /FINAL RESULT > ******************************************** " << endl; |
1760 |
> |
|
1761 |
> |
dout << "Note that if L5 corrections are applied, we get " << L5Reference.MPF_Result_FaceValue/L5inclusive.MPF_Result_FaceValue << " (stat) " << endl; |
1762 |
> |
|
1763 |
> |
LeadingB=TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"); |
1764 |
> |
|
1765 |
> |
} else { |
1766 |
> |
ZbResultContainer Reference = new_data_mc_agreement_2d(false,"ZbCHS3010_alpha","reference",TCut("ZbCHS3010_bTagProbCSVBP[0]>0.898"),TCut("ZbCHS3010_BTagWgtT"),0.3); |
1767 |
> |
} |
1768 |
|
|
1769 |
|
|
1770 |
|
delete zbcanvas; |
1791 |
|
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB) << ")"; |
1792 |
|
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB) << ")"; |
1793 |
|
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut) << ")"; |
1794 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000").c_str())) << ")"; |
1795 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.3").c_str())) << ")"; |
1796 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.2").c_str())) << ")"; |
1797 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.15").c_str())) << ")"; |
1798 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.1").c_str())) << ")"; |
1799 |
< |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>10&&pt<1000&&"+identifier+"_alpha<0.05").c_str())) << ")"; |
1794 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<1000").c_str())) << ")"; |
1795 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<1000&&"+identifier+"_alpha<0.3").c_str())) << ")"; |
1796 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<1000&&"+identifier+"_alpha<0.2").c_str())) << ")"; |
1797 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<1000&&"+identifier+"_alpha<0.15").c_str())) << ")"; |
1798 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<1000&&"+identifier+"_alpha<0.1").c_str())) << ")"; |
1799 |
> |
MegaCut << " + 1*(" << (const char*) (ZplusBsel&&LeadingB&&EtaB&&PhiZcut&&TCut(((string)"pt>30&&pt<1000&&"+identifier+"_alpha<0.05").c_str())) << ")"; |
1800 |
|
MegaCut << " "; |
1801 |
|
|
1802 |
|
TCanvas *can = new TCanvas("can","can"); |
1809 |
|
|
1810 |
|
|
1811 |
|
TH1F *data = allsamples.Draw("data", MegaCut.str(),11,-0.5,10.5, "", "events", basecut,data,luminosity); |
1812 |
< |
THStack mcm = allsamples.DrawStack("mc", MegaCut.str(),11,-0.5,10.5, "", "events", basecut,mc,luminosity); |
1812 |
> |
THStack mcm = allsamples.DrawStack("mc", MegaCut.str(),11,-0.5,10.5, "", "events", basecut,mc,luminosity); |
1813 |
|
|
1814 |
|
float runningsum=0; |
1815 |
|
for(int i=data->GetNbinsX();i>0;i--) { |
1847 |
|
data->GetXaxis()->SetBinLabel(3,"Leading jet is b-jet"); |
1848 |
|
data->GetXaxis()->SetBinLabel(4,"|#eta_{b}|<1.3 "); |
1849 |
|
data->GetXaxis()->SetBinLabel(5,"|#delta#phi(b,Z)|>2.7"); |
1850 |
< |
data->GetXaxis()->SetBinLabel(6,"10<p_{T}^{Z}<1000 GeV"); |
1850 |
> |
data->GetXaxis()->SetBinLabel(6,"30<p_{T}^{Z}<1000 GeV"); |
1851 |
|
data->GetXaxis()->SetBinLabel(7,"#alpha < 0.3"); |
1852 |
|
data->GetXaxis()->SetBinLabel(8,"#alpha < 0.2"); |
1853 |
|
data->GetXaxis()->SetBinLabel(9,"#alpha < 0.15"); |
1865 |
|
leg->AddEntry(crap,neventsinfo.str().c_str(),"l"); |
1866 |
|
|
1867 |
|
data->Draw("e1"); |
1868 |
< |
mcm.Draw("same"); |
1868 |
> |
mcm.Draw("histo,same"); |
1869 |
|
data->Draw("same,e1,axis"); |
1870 |
|
data->Draw("same,e1"); |
1871 |
|
// data->Draw("same,TEXT"); |
1878 |
|
|
1879 |
|
delete crap; |
1880 |
|
delete data; |
1881 |
< |
|
1881 |
> |
CleanLegends(); |
1882 |
> |
DeleteStack(mcm); |
1883 |
> |
|
1884 |
|
|
1885 |
|
} |