ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/IPHCalignment2/analysis/histograms.cpp
Revision: 1.1
Committed: Fri Nov 25 16:33:02 2011 UTC (13 years, 5 months ago) by econte
Branch: MAIN
CVS Tags: TBD2011, HEAD
Error occurred while calculating annotation data.
Log Message:
new IPHC alignment

File Contents

# Content
1 #include "histograms.h"
2 #include <math.h>
3 #include <TColor.h>
4
5
6
7 #define FITMODE 1
8
9
10 TLegend* createTLegend2()
11 {
12 TLegend* leg = new TLegend(0.17,0.72,0.43,0.85);
13 leg->SetFillColor(0);
14 }
15
16 TLegend* createTLegend3()
17 {
18 TLegend* leg = new TLegend(0.17,0.66,0.43,0.85);
19 leg->SetFillColor(0);
20 }
21
22
23 void HistoCollection::Initialize()
24 {
25
26 //################### Eric and Jeremy #################
27 /*
28 pp_histo = new TH1D("#mu^{+} momentum","#mu^{+} momentum",200,0.,500.);
29 pm_histo = new TH1D("#mu^{-} momentum","#mu^{-} momentum",200,0.,500.);
30 pall_histo = new TH1D("#mu^{#pm} momentum","#mu^{#pm} momentum",200,0.,500.);
31 ep_histo = new TH1D("#mu^{+} error/momentum","#mu^{+} error / momentum",200,0.,30.);
32 em_histo = new TH1D("#mu^{-} error/momentum","#mu^{-} error / momentum",200,0.,30.);
33 eall_histo = new TH1D("#mu^{#pm} error/momentum from TwoBodyDecay",
34 "#mu^{#pm} error/momentum from TwoBodyDecay" ,1000,0.,1.);
35 mref_histo = new TH1D("#mu^{+}#mu^{-} invariant mass (refitter only)","#mu^{+}#mu^{-} invariant mass (no refit)",100,65.,115.);
36 m_histo = new TH1D("#mu^{#pm} error/momentum","#mu^{#pm} error/momentum from TwoBodyDecay after refitting" ,100,65.,115.);
37 massrec_histo = new TH1D("#mu^{#pm} error/momentum from TwoBodyDecay before refitting","#mu^{#pm} error/momentum from TwoBodyDecay before refitting" ,100,65.,115.);
38 mgen_histo = new TH1D("#mu^{#pm} error/momentum gen","#mu^{#pm} error/momentum (GenratedParticle)" ,100,65.,115.);
39 mbefore_histo = new TH1D("Estimated Z mass from refitter only (homemade extraction)",
40 "Estimated Z mass from refitter only (homemade extraction)",100,65,115);
41
42 rptref_histo = new TH1D("pT resolution - Refitter","pT resolution - Refitter" ,90,-0.2,+0.2);
43 rpt_histo = new TH1D("pT resolution - TwoBodyDecay+Refitter","pT resolution - TwoBodyDecay+Refitter" ,90,-0.2,+0.2);
44 rptTBD_histo = new TH1D("pT resolution - TBD","pT resolution - TBD" ,90,-0.2,+0.2);
45
46 rpref_histo = new TH1D("p resolution - Refitter","p resolution - Refitter" ,90,-0.2,+0.2);
47 rpTBD_histo = new TH1D("p resolution - TBD","p resolution - TBD" ,90,-0.2,+0.2);
48 rp_histo = new TH1D("p resolution - TwoBodyDecay+Refitter","p resolution - TwoBodyDecay+Refitter" ,90,-0.2,+0.2);
49 mass_histo = new TH1D("Estimated Z mass from TwoBodyDecay","Estimated Z mass from TwoBodyDecay",100,65,115);
50
51 mVSphi_m = new TH2D("Z mass vs negative muon phi","Z mass vs negative muon phi",50,-M_PI,M_PI,50,65,115);
52 mVSphi_p = new TH2D("Z mass vs positive muon phi","Z mass vs positive muon phi",50,-M_PI,M_PI,50,65,115);
53 mVSphi_m_TBD = new TH2D("Z mass vs negative muon phi TBD","Z mass vs negative muon phi TBD",50,-M_PI,M_PI,50,65,115);
54 mVSphi_p_TBD = new TH2D("Z mass vs positive muon phi TBD","Z mass vs positive muon phi TBD",50,-M_PI,M_PI,50,65,115);
55
56
57
58 DeltaM_None = new TH1D("Z mass resolution None","Estimated Z mass from None",100,-0.2,+0.2);
59 DeltaM_TBD = new TH1D("Z mass resolution TwoBodyDecay","Estimated Z mass from TwoBodyDecay",100,-0.2,+0.2);
60 DeltaM_Refit = new TH1D("Z mass resolution TwoBodyDecay+Refitter","Estimated Z mass from TwoBodyDecay+Refitter",100,-0.2,+0.2);
61 */
62
63 //################### Christophe ###################
64
65 mGen_histo = new TH1D("#mu^{#pm} error/momentum gen","#mu^{#pm} error/momentum (GenratedParticle)" ,100,65.,115.);
66 mRef_histo = new TH1D("#mu^{#pm} error/momentum ref","#mu^{#pm} error/momentum (FirstFit)" ,100,65.,115.);
67 mVtx_histo = new TH1D("#mu^{#pm} error/momentum vtx","#mu^{#pm} error/momentum (VtxConstraint)" ,100,65.,115.);
68 mMom_histo = new TH1D("#mu^{#pm} error/momentum mom","#mu^{#pm} error/momentum (MomConstraint)" ,100,65.,115.);
69 mFull_histo = new TH1D("#mu^{#pm} error/momentum full","#mu^{#pm} error/momentum (FullConstraint)" ,100,65.,115.);
70 mKinFit_histo = new TH1D("#mu^{#pm} error/momentum kinfit","#mu^{#pm} error/momentum (KinFitConstraint)" ,100,65.,115.);
71
72 rpRef_histo = new TH1D("p resolution - Refitter","p resolution - Refitter",90,-0.2,+0.2);
73 rpVtx_histo = new TH1D("p resolution - VtxConstraint","p resolution - VtxConstraint",90,-0.2,+0.2);
74 rpMom_histo = new TH1D("p resolution - MomConstraint","p resolution - MomConstraint",90,-0.2,+0.2);
75 rpFull_histo = new TH1D("p resolution - FullConstraint","p resolution - FullConstraint",90,-0.2,+0.2);
76 rpKinFit_histo = new TH1D("p resolution - KinFitConstraint","p resolution - KinFitConstraint",90,-0.2,+0.2);
77
78 rptRef_histo = new TH1D("pT resolution - Refitter","pT resolution - Refitter",90,-0.2,+0.2);
79 rptVtx_histo = new TH1D("pT resolution - VtxConstraint","pT resolution - VtxConstraint",90,-0.2,+0.2);
80 rptMom_histo = new TH1D("pT resolution - MomConstraint","pT resolution - MomConstraint",90,-0.2,+0.2);
81 rptFull_histo = new TH1D("pT resolution - FullConstraint","pT resolution - FullConstraint",90,-0.2,+0.2);
82 rptKinFit_histo = new TH1D("pT resolution - KinFitConstraint","pT resolution - KinFitConstraint",90,-0.2,+0.2);
83
84
85
86 }
87
88 void HistoCollection::Finalize()
89 {
90
91 //################### Eric and Jeremy #################
92
93 /*
94 TCanvas* pp_can=new TCanvas("pp_can","pp_can");
95 pp_histo->Draw();
96 pp_can->SaveAs("Results_vertex/pp_can.root");
97 TCanvas* pm_can=new TCanvas("pm_can","pm_can");
98 pm_histo->Draw();
99 pm_can->SaveAs("Results_vertex/pm_can.root");
100 TCanvas* pall_can=new TCanvas("pall_can","pall_can");
101 pall_histo->Draw();
102 pall_can->SaveAs("Results_vertex/pall_can.root");
103 TCanvas* ep_can=new TCanvas("ep_can","ep_can");
104 ep_histo->Draw();
105 ep_can->SaveAs("Results_vertex/ep_can.root");
106 TCanvas* em_can=new TCanvas("em_can","em_can");
107 em_histo->Draw();
108 em_can->SaveAs("Results_vertex/em_can.root");
109
110 // ---------------------------------------------------------------------
111 // ERROR/MOMENTUM ON MUON
112 // ---------------------------------------------------------------------
113 TCanvas* eall_can=new TCanvas("eall_can","eall_can");
114 eall_histo->SetLineColor(4);
115 eall_histo->GetXaxis()->SetTitle("error/momentum");
116 eall_histo->GetYaxis()->SetTitle("# events");
117 eall_can->SetLogy();
118 eall_can->SetLogx();
119 eall_histo->Draw();
120 eall_can->SaveAs("Results_vertex/eall_can.root");
121
122 // ---------------------------------------------------------------------
123 // CHECK REFITTER EXTRACTION - Z MASS
124 // ---------------------------------------------------------------------
125 TCanvas* mcheck_can=new TCanvas("mcheck","mcheck");
126 mref_histo->SetLineColor(3); mref_histo->Draw("");
127 mref_histo->GetXaxis()->SetTitle("#mu^{+}#mu^{-} invariant mass (GeV)");
128 mref_histo->GetYaxis()->SetTitle("# events");
129 mbefore_histo->SetLineColor(2); mbefore_histo->Draw("same");
130 TLegend * leg = createTLegend2();
131 leg->AddEntry(mref_histo,"Reffiter+JejeExtraction","l");
132 leg->AddEntry(mbefore_histo,"Refitter+EricExtraction","l");
133 leg->Draw();
134 mcheck_can->SaveAs("Results_vertex/mcheck.root");
135
136 // ---------------------------------------------------------------------
137 // Z MASS @ TBD LEVEL
138 // ---------------------------------------------------------------------
139 TCanvas* mass_can=new TCanvas("estimatedMass","estimatedMass");
140 mgen_histo->SetLineColor(3);
141 mgen_histo->GetXaxis()->SetTitle("#mu^{+}#mu^{-} invariant mass (GeV)");
142 mgen_histo->GetYaxis()->SetTitle("# events");
143 mgen_histo->Draw();
144 mass_histo->SetLineColor(4); mass_histo->Draw("same");
145 mref_histo->SetLineColor(2); mref_histo->Draw("same");
146 */
147 /* if (FITMODE==1)
148 {
149 std::cout << "FITMODE : M resolution @ TBD level" << std::endl;
150 std::cout << "generated case" << std::endl;
151 TF1* m2_total = new TF1("mm","gaus(0)",65,115);
152 m2_total->SetParameter(1,91);
153 m2_total->SetParameter(2,2.2);
154 mgen_histo->Fit(m2_total,"R+");
155 }
156 if (FITMODE==1)
157 {
158 std::cout << "FITMODE : M resolution @ TBD level" << std::endl;
159 std::cout << "StandardRefo" << std::endl;
160 TF1* m2_total = new TF1("mmm","gaus(0)",65,115);
161 m2_total->SetParameter(1,91);
162 m2_total->SetParameter(2,2.2);
163 mref_histo->Fit(m2_total,"R+");
164 }
165 if (FITMODE==1)
166 {
167 std::cout << "FITMODE : M resolution @ TBD level" << std::endl;
168 std::cout << "TBD" << std::endl;
169 TF1* m2_total = new TF1("m","gaus(0)",65,115);
170 m2_total->SetParameter(1,91);
171 m2_total->SetParameter(2,2.2);
172 mass_histo->Fit(m2_total,"R+");
173 }*/
174 /*
175 TLegend * legA = createTLegend3();
176 legA->AddEntry(mgen_histo,"From Generated Particles","l");
177 legA->AddEntry(mref_histo,"From Standard Reco","l");
178 legA->AddEntry(mass_histo,"From TwoBodyDecay","l");
179 legA->Draw();
180 mass_can->SaveAs("Results_vertex/TBD_ZMass.root");
181
182 // ---------------------------------------------------------------------
183 // PT RESOLUTION @ REFITTER LEVEL
184 // ---------------------------------------------------------------------
185 TCanvas* pt_can=new TCanvas("ptcan","ptcan");
186 rptref_histo->SetLineColor(2); rptref_histo->Draw("");
187 rptref_histo->GetXaxis()->SetTitle("pT resolution");
188 rptref_histo->GetYaxis()->SetTitle("# events");
189 rpt_histo->SetLineColor(4); rpt_histo->Draw("same");
190 TLegend * leg2 = createTLegend2();
191 leg2->AddEntry(rptref_histo,"Refitter","l");
192 leg2->AddEntry(rpt_histo,"TwoBodyDecay + Refitter","l");
193 leg2->Draw();
194 pt_can->SaveAs("Results_vertex/REFIT_pt_can.root");
195
196 // ---------------------------------------------------------------------
197 // P RESOLUTION @ REFITTER LEVEL
198 // ---------------------------------------------------------------------
199 TCanvas* p_can=new TCanvas("pcan","pcan");
200 rpref_histo->SetLineColor(2); rpref_histo->Draw("");
201 rpref_histo->GetXaxis()->SetTitle("p resolution");
202 rpref_histo->GetYaxis()->SetTitle("# events");
203 rp_histo->SetLineColor(4); rp_histo->Draw("same");
204 TLegend * leg12 = createTLegend2();
205 leg12->SetFillColor(0);
206 leg12->AddEntry(rpref_histo,"From Standard Reco","l");
207 leg12->AddEntry(rp_histo,"From TwoBodyDecay","l");
208 leg12->Draw();
209 p_can->SaveAs("Results_vertex/REFIT_p_can.root");
210 if (FITMODE==1)
211 {
212 std::cout << "FITMODE : P resolution @ TBD level" << std::endl;
213 std::cout << "StandardRefo" << std::endl;
214 TF1* eric_total = new TF1("aa2","gaus(0)",-0.2,0.2);
215 eric_total->SetParameter(0,1000);
216 eric_total->SetParameter(1,0);
217 eric_total->SetParameter(2,0.02);
218 rpref_histo->Fit(eric_total,"R+");
219 }
220 if (FITMODE==1)
221 {
222 std::cout << "FITMODE : P resolution @ TBD level" << std::endl;
223 std::cout << "TBD" << std::endl;
224 TF1* eric_total1 = new TF1("aaa2","gaus(0)",-0.2,0.2);
225 eric_total1->SetParameter(0,1000);
226 eric_total1->SetParameter(1,0);
227 eric_total1->SetParameter(2,0.02);
228 rp_histo->Fit(eric_total1,"R+");
229 }
230
231
232
233 // ---------------------------------------------------------------------
234 // P RESOLUTION @ TBD LEVEL
235 // ---------------------------------------------------------------------
236 TCanvas* p_cana=new TCanvas("pcana","pcana");
237 rpref_histo->SetLineColor(2); rpref_histo->Draw("");
238 rpref_histo->GetXaxis()->SetTitle("p resolution");
239 rpref_histo->GetYaxis()->SetTitle("# events");
240 rpTBD_histo->SetLineColor(4); rpTBD_histo->Draw("same");
241 TLegend * leg12a = createTLegend2();
242 leg12a->AddEntry(rpref_histo,"From Standard Reco","l");
243 leg12a->AddEntry(rpTBD_histo,"From TwoBodyDecay","l");
244 leg12a->Draw();
245 p_cana->SaveAs("Results_vertex/TBD_p_can.root");
246 */
247 /* if (FITMODE==1)
248 {
249 std::cout << "FITMODE : P resolution @ TBD level" << std::endl;
250 std::cout << "StandardRefo" << std::endl;
251 TF1* eric_total = new TF1("aa2","gaus(0)",-0.2,0.2);
252 eric_total->SetParameter(0,1000);
253 eric_total->SetParameter(1,0);
254 eric_total->SetParameter(2,0.02);
255 rpref_histo->Fit(eric_total,"R+");
256 }
257 if (FITMODE==1)
258 {
259 std::cout << "FITMODE : P resolution @ TBD level" << std::endl;
260 std::cout << "TBD" << std::endl;
261 TF1* eric_total1 = new TF1("aaa2","gaus(0)",-0.2,0.2);
262 eric_total1->SetParameter(0,1000);
263 eric_total1->SetParameter(1,0);
264 eric_total1->SetParameter(2,0.02);
265 rpTBD_histo->Fit(eric_total1,"R+");
266 }*/
267
268 /*
269 // ---------------------------------------------------------------------
270 // DELTAM RESOLUTION @ REFITTER LEVEL
271 // ---------------------------------------------------------------------
272 TCanvas* deltam_can=new TCanvas("deltam","deltam");
273 DeltaM_None->SetLineColor(2); DeltaM_None->Draw("");
274 DeltaM_None->GetXaxis()->SetTitle("p resolution");
275 DeltaM_None->GetYaxis()->SetTitle("# events");
276 DeltaM_Refit->SetLineColor(4); DeltaM_Refit->Draw("same");
277 TLegend * legdeltam = createTLegend2();
278 legdeltam->SetFillColor(0);
279 legdeltam->AddEntry(DeltaM_None,"From Standard Reco","l");
280 legdeltam->AddEntry(DeltaM_Refit,"From TwoBodyDecay + Refitter","l");
281 legdeltam->Draw();
282 deltam_can->SaveAs("Results_vertex/REFIT_DeltaM_can.root");
283
284
285 // ---------------------------------------------------------------------
286 // M RESOLUTION @ TBD LEVEL
287 // ---------------------------------------------------------------------
288 TCanvas* deltam2_can=new TCanvas("deltam2","deltam2");
289 DeltaM_None->SetLineColor(2); DeltaM_None->Draw("");
290 DeltaM_None->GetXaxis()->SetTitle("p resolution");
291 DeltaM_None->GetYaxis()->SetTitle("# events");
292 DeltaM_TBD->SetLineColor(4); DeltaM_TBD->Draw("same");
293 legdeltam = createTLegend2();
294 legdeltam->SetFillColor(0);
295 legdeltam->AddEntry(DeltaM_None,"From Standard Reco","l");
296 legdeltam->AddEntry(DeltaM_TBD,"From TwoBodyDecay + Refitter","l");
297 legdeltam->Draw();
298 deltam2_can->SaveAs("Results_vertex/TBD_DeltaM_can.root");
299
300 // ---------------------------------------------------------------------
301 // ALESSIO PLOT
302 // ---------------------------------------------------------------------
303 TCanvas* vs_can_m=new TCanvas("vscan_m","vsvcan_m");
304 mVSphi_m->Draw("colz");
305 mVSphi_m->GetYaxis()->SetTitle("dimuon invariant mass (GeV)");
306 mVSphi_m->GetXaxis()->SetTitle("#phi (rad)");
307 vs_can_m->SaveAs("Results_vertex/NONEphi_vs_m.root");
308
309 TCanvas* vs_can_p=new TCanvas("vscan_p","vsvcan_p");
310 mVSphi_p->Draw("colz");
311 mVSphi_p->GetYaxis()->SetTitle("dimuon invariant mass (GeV)");
312 mVSphi_p->GetXaxis()->SetTitle("#phi (rad)");
313 vs_can_p->SaveAs("Results_vertex/NONE_vs_p.root");
314
315 TCanvas* vs_can_m_TBD=new TCanvas("vscan_m_TBD","vsvcan_m_TBD");
316 mVSphi_m_TBD->Draw("colz");
317 mVSphi_m_TBD->GetYaxis()->SetTitle("dimuon invariant mass (GeV)");
318 mVSphi_m_TBD->GetXaxis()->SetTitle("#phi (rad)");
319 vs_can_m_TBD->SaveAs("Results_vertex/TBDphi_vs_m.root");
320
321 TCanvas* vs_can_p_TBD=new TCanvas("vscan_p_TBD","vsvcan_p_TBD");
322 mVSphi_p_TBD->Draw("colz");
323 mVSphi_p_TBD->GetYaxis()->SetTitle("dimuon invariant mass (GeV)");
324 mVSphi_p_TBD->GetXaxis()->SetTitle("#phi (rad)");
325 vs_can_p_TBD->SaveAs("Results_vertex/TBD_vs_p.root");
326
327
328 // ---------------------------------------------------------------------
329 // Z MASS @ REFFITER
330 // ---------------------------------------------------------------------
331 TCanvas* m_can=new TCanvas("mcan","mcan");
332 mgen_histo->SetLineColor(3); mgen_histo->Draw("");
333 mgen_histo->GetXaxis()->SetTitle("#mu^{+}#mu^{-} invariant mass (GeV)");
334 mgen_histo->GetYaxis()->SetTitle("# events");
335 if (FITMODE==1)
336 {
337 TF1* mgen_fit1 = new TF1("mgen_fit","gaus",50,120);
338 TF1* mgen_fit2 = new TF1("mgen_fit","gaus",88,93);
339 TF1* mgen_total = new TF1("mfinal","gaus(0)+gaus(3)",70,110);
340 mgen_total->SetParameter(1,91);
341 mgen_total->SetParameter(2,2.2);
342 mgen_total->SetParameter(1+3,91);
343 mgen_total->SetParameter(2+3,1.5);
344 //mgen_histo->Fit(mgen_total,"R+");
345 }
346 mref_histo->SetLineColor(2); mref_histo->Draw("same");
347 if (FITMODE==1)
348 {
349 TF1* mref_total = new TF1("mreffinal","gaus(0)+gaus(3)",70,110);
350 mref_total->SetParameter(1,91);
351 mref_total->SetParameter(2,2.2);
352 mref_total->SetParameter(1+3,91);
353 mref_total->SetParameter(2+3,1.5);
354 //mref_histo->Fit(mref_total,"R+");
355 }
356 m_histo->SetLineColor(4); m_histo->Draw("same");
357 if (FITMODE==1)
358 {
359 TF1* m_total = new TF1("mreal","gaus(0)+gaus(3)",70,110);
360 m_total->SetParameter(1,91);
361 m_total->SetParameter(2,2.2);
362 m_total->SetParameter(1+3,91);
363 m_total->SetParameter(2+3,1.5);
364 //m_histo->Fit(m_total,"R+");
365 }
366
367
368 if (FITMODE==1)
369 {
370 std::cout << "FITMODE : M resolution @ TBD level" << std::endl;
371 std::cout << "StandardRefo" << std::endl;
372 TF1* m2_total = new TF1("mmm","gaus(0)",65,115);
373 m2_total->SetParameter(1,91);
374 m2_total->SetParameter(2,2.2);
375 mref_histo->Fit(m2_total,"R+");
376 }
377 if (FITMODE==1)
378 {
379 std::cout << "FITMODE : M resolution @ TBD level" << std::endl;
380 std::cout << "TBD" << std::endl;
381 TF1* m2_total = new TF1("m","gaus(0)",65,115);
382 m2_total->SetParameter(1,91);
383 m2_total->SetParameter(2,2.2);
384 m_histo->Fit(m2_total,"R+");
385 }
386
387 leg = createTLegend3();
388 leg->AddEntry(mgen_histo,"From Generated Particles","l");
389 leg->AddEntry(mref_histo,"From Standard Reco","l");
390 leg->AddEntry(m_histo,"From TwoBodyDecay+Refitter","l");
391 leg->Draw();
392 m_can->SaveAs("Results_vertex/REFIT_mass.root");
393
394 TCanvas* mb_can=new TCanvas("mbcan","mbcan");
395 m_histo->SetLineColor(2); m_histo->Draw("");
396 m_histo->GetXaxis()->SetTitle("#mu^{+}#mu^{-} invariant mass (GeV)");
397 massrec_histo->SetLineColor(4); massrec_histo->Draw("same");
398
399 TLegend * leg3 = createTLegend2();
400 leg3->AddEntry(massrec_histo,"TwoBodyDecay before refitting","l");
401 leg3->AddEntry(m_histo,"TwoBodyDecay after refitting","l");
402 leg3->Draw();
403
404 mb_can->SaveAs("Results_vertex/mb_can.root");
405 */
406
407
408 //################### Christophe ###################
409
410
411 //-----------------------------------------------------------------------------
412 // Z mass for TBD vertex, momentum and full constraint, and KinFit
413 //-----------------------------------------------------------------------------
414
415 TCanvas* mass1_can=new TCanvas("estimatedMass","estimatedMass");
416 mKinFit_histo->SetLineColor(6);
417 mKinFit_histo->GetXaxis()->SetTitle("#mu^{+}#mu^{-} invariant mass (GeV)");
418 mKinFit_histo->GetYaxis()->SetTitle("# events");
419 mKinFit_histo->Draw();
420 mMom_histo->SetLineColor(4); mMom_histo->Draw("same");
421 mFull_histo->SetLineColor(2); mFull_histo->Draw("same");
422 mVtx_histo->SetLineColor(3); mVtx_histo->Draw("same");
423
424 TLegend * legA = createTLegend3();
425 legA->AddEntry(mVtx_histo,"From TBD Vertex Constraint","l");
426 legA->AddEntry(mMom_histo,"From TBD Momentum Constraint","l");
427 legA->AddEntry(mFull_histo,"From TBD Full Constraint","l");
428 legA->AddEntry(mKinFit_histo,"From KinFit Constraint","l");
429 legA->Draw();
430 mass1_can->SaveAs("Results_Chris/ZMass.root");
431
432
433
434 //-----------------------------------------------------------------------------
435 // Z mass for Generated and First Fit Tracks
436 //-----------------------------------------------------------------------------
437
438 TCanvas* mass2_can=new TCanvas("Mass_GenVsRef","Mass_GenVsRef");
439 mGen_histo->SetLineColor(3);
440 mGen_histo->GetXaxis()->SetTitle("#mu^{+}#mu^{-} invariant mass (GeV)");
441 mGen_histo->GetYaxis()->SetTitle("# events");
442 mGen_histo->Draw();
443 mRef_histo->SetLineColor(4); mRef_histo->Draw("same");
444
445 TLegend * legB = createTLegend3();
446 legB->AddEntry(mGen_histo,"From Generator","l");
447 legB->AddEntry(mRef_histo,"From Reconstructed Tracks (no constraint)","l");
448 legB->Draw();
449 mass2_can->SaveAs("Results_Chris/ZMass_GenVsRef.root");
450
451
452 //-----------------------------------------------------------------------------
453 // p resolution for TBD vertex, momentum and full constraint, and KinFit
454 //-----------------------------------------------------------------------------
455
456 TCanvas* rp_can=new TCanvas("MomentumResolution","MomentumResolution");
457 rpVtx_histo->SetLineColor(3);
458 rpVtx_histo->GetXaxis()->SetTitle("p resolution");
459 rpVtx_histo->GetYaxis()->SetTitle("# events");
460 rpVtx_histo->Draw();
461 rpMom_histo->SetLineColor(4); rpMom_histo->Draw("same");
462 rpFull_histo->SetLineColor(2); rpFull_histo->Draw("same");
463 rpKinFit_histo->SetLineColor(6); rpKinFit_histo->Draw("same");
464
465 TLegend * legC = createTLegend3();
466 legC->AddEntry(rpVtx_histo,"From TBD Vertex Constraint","l");
467 legC->AddEntry(rpMom_histo,"From TBD Momentum Constraint","l");
468 legC->AddEntry(rpFull_histo,"From TBD Full Constraint","l");
469 legC->AddEntry(rpKinFit_histo,"From KinFit Constraint","l");
470 legC->Draw();
471 rp_can->SaveAs("Results_Chris/MomResolution.root");
472
473 //-----------------------------------------------------------------------------
474 // pT resolution for TBD vertex, momentum and full constraint, and KinFit
475 //-----------------------------------------------------------------------------
476
477 TCanvas* rpt_can=new TCanvas("TransverseMomentumResolution","TransverseMomentumResolution");
478 rptVtx_histo->SetLineColor(3);
479 rptVtx_histo->GetXaxis()->SetTitle("pT resolution");
480 rptVtx_histo->GetYaxis()->SetTitle("# events");
481 rptVtx_histo->Draw();
482 rptMom_histo->SetLineColor(4); rptMom_histo->Draw("same");
483 rptFull_histo->SetLineColor(2); rptFull_histo->Draw("same");
484 rptKinFit_histo->SetLineColor(6); rptKinFit_histo->Draw("same");
485
486 TLegend * legD = createTLegend3();
487 legD->AddEntry(rptVtx_histo,"From TBD Vertex Constraint","l");
488 legD->AddEntry(rptMom_histo,"From TBD Momentum Constraint","l");
489 legD->AddEntry(rptFull_histo,"From TBD Full Constraint","l");
490 legD->AddEntry(rptKinFit_histo,"From KinFit Constraint","l");
491 legD->Draw();
492 rpt_can->SaveAs("Results_Chris/TransMomResolution.root");
493
494
495 }
496
497
498
499
500 void HistoCollection::DrawInit()
501 {
502 gStyle->SetCanvasColor(0);
503 gStyle->SetCanvasBorderMode(0);
504 gStyle->SetCanvasBorderSize(3);
505
506 gStyle->SetPadLeftMargin(0.125);
507 gStyle->SetPadBottomMargin(0.12);
508 gStyle->SetPadColor(0);
509 gStyle->SetPadBorderMode(0);
510
511 gStyle->SetFrameBorderMode(0);
512 gStyle->SetFrameBorderSize(0);
513 gStyle->SetFrameFillColor(0);
514 gStyle->SetOptStat(0);
515
516 gStyle->SetLabelOffset(0.005,"X");
517 gStyle->SetLabelSize(0.03,"X");
518 gStyle->SetLabelFont(22,"X");
519
520 gStyle->SetTitleOffset(1.1,"X");
521 gStyle->SetTitleSize(0.04,"X");
522 gStyle->SetTitleFont(22,"X");
523
524 gStyle->SetLabelOffset(0.005,"Y");
525 gStyle->SetLabelSize(0.03,"Y");
526 gStyle->SetLabelFont(22,"Y");
527
528 gStyle->SetTitleOffset(1.1,"Y");
529 gStyle->SetTitleSize(0.04,"Y");
530 gStyle->SetTitleFont(22,"Y");
531
532 gStyle->SetStatColor(0);
533 gStyle->SetStatBorderSize(0);
534
535 gStyle->SetTextFont(2);
536 gStyle->SetTextSize(.05);
537
538 gStyle->SetLegendBorderSize(1);
539
540 gStyle->SetHistLineWidth(2);
541
542 gStyle->SetTitleFillColor(0);
543 gStyle->SetTitleFontSize(0.05);
544 gStyle->SetTitleBorderSize(0);
545 gStyle->SetTitleAlign(13);
546 gStyle->SetTextAlign(22);
547
548 //Canvas declaration and configuration
549 // TCanvas *c1 = new TCanvas("c1", "plots",200,10,800,600);
550
551 //General ROOT style setup
552 gStyle->SetOptDate(0);
553 gStyle->SetStatColor(0);
554 gStyle->SetTitleColor(1);
555 gStyle->SetOptStat(0);
556 gStyle->SetPalette(1);
557
558 const Int_t NRGBs = 5;
559 const Int_t NCont = 255;
560
561 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
562 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
563 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
564 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
565 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
566 gStyle->SetNumberContours(NCont);
567
568
569 }
570