1 #include "../CommonTools.h"
2 #include <sPhenixStyle.C>
8 TFile *qa_file_new = TFile::Open(newfile.c_str());
9 TFile *qa_file_ref = TFile::Open(reffile.c_str());
11 TFile *outfilef =
new TFile(outfile.c_str(),
"recreate");
16 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
20 double Nevent_new = 1;
21 double Nevent_ref = 1;
23 TH2 *h_new = (TH2 *) qa_file_new->GetObjectChecked(
24 prefix + TString(
"DCArPhi_pT"),
"TH2");
34 h_ref = (TH2 *) qa_file_ref->GetObjectChecked(
35 prefix + TString(
"DCArPhi_pT"),
"TH2");
40 h_ref->Scale(Nevent_new / Nevent_ref);
43 TCanvas *c1 =
new TCanvas(TString(
"QA_Draw_Tracking_DCArPhi") + TString(
"_") + hist_name_prefix,
44 TString(
"QA_Draw_Tracking_DCArPhi") + TString(
"_") + hist_name_prefix,
50 vector<pair<double, double>> gpt_ranges{
62 Double_t sigma_unc = 0;
64 TLatex *res =
nullptr;
65 for (
auto pt_range : gpt_ranges)
69 p = (TPad *) c1->cd(idx++);
73 const double epsilon = 1
e-6;
74 const int bin_start = h_new->GetXaxis()->FindBin(pt_range.first + epsilon);
75 const int bin_end = h_new->GetXaxis()->FindBin(pt_range.second - epsilon);
77 TH1 *h_proj_new = h_new->ProjectionY(
80 h_new->GetName(), bin_start, bin_end),
82 if (pt_range.first < 2.0)
84 h_proj_new->GetXaxis()->SetRangeUser(-.05,.05);
89 h_proj_new->GetXaxis()->SetRangeUser(-.01,.01);
91 h_proj_new->SetTitle(TString(hist_name_prefix) + TString::Format(
92 ": %.1f - %.1f GeV/c", pt_range.first, pt_range.second));
93 h_proj_new->GetXaxis()->SetTitle(TString::Format(
94 "DCA (r #phi) [cm]"));
95 h_proj_new->GetXaxis()->SetNdivisions(5,5);
96 f1 =
new TF1(
"f1",
"gaus",-.01,.01);
97 h_proj_new->Fit(f1,
"qm");
98 sigma = f1->GetParameter(2);
99 sigma_unc = f1->GetParError(2);
101 TH1 *h_proj_ref =
nullptr;
107 "%s_Ref_ProjX_%d_%d",
108 h_new->GetName(), bin_start, bin_end),
110 if (pt_range.first < 2.0)
113 h_proj_ref->Rebin(5);
119 sprintf(resstr,
"#sigma = %.5f #pm %.5f cm", sigma, sigma_unc);
120 res =
new TLatex(0.325,0.825,resstr);
122 res->SetTextSize(0.05);
123 res->SetTextAlign(13);
126 p = (TPad *) c1->cd(idx++);
128 TPaveText *
pt =
new TPaveText(.05,.1,.95,.8);
129 pt->AddText(
"No cuts");
142 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
146 double Nevent_new = 1;
147 double Nevent_ref = 1;
149 TH2 *h_new2 = (TH2 *) qa_file_new->GetObjectChecked(
150 prefix + TString(
"DCArPhi_pT_cuts"),
"TH2");
160 h_ref2 = (TH2 *) qa_file_ref->GetObjectChecked(
161 prefix + TString(
"DCArPhi_pT_cuts"),
"TH2");
166 h_ref2->Scale(Nevent_new / Nevent_ref);
169 TCanvas *
c2 =
new TCanvas(TString(
"QA_Draw_Tracking_DCArPhi2") + TString(
"_") + hist_name_prefix,
170 TString(
"QA_Draw_Tracking_DCArPhi2") + TString(
"_") + hist_name_prefix,
176 vector<pair<double, double>> gpt_ranges2{
187 Double_t sigma_unc2 = 0;
189 TLatex *res2 =
nullptr;
190 for (
auto pt_range : gpt_ranges2)
194 p2 = (TPad *) c2->cd(idx2++);
198 const double epsilon = 1
e-6;
199 const int bin_start = h_new2->GetXaxis()->FindBin(pt_range.first + epsilon);
200 const int bin_end = h_new2->GetXaxis()->FindBin(pt_range.second - epsilon);
202 TH1 *h_proj_new2 = h_new2->ProjectionY(
204 "%s_New_ProjX_%d_%d",
205 h_new2->GetName(), bin_start, bin_end),
207 if (pt_range.first < 2.0)
209 h_proj_new2->GetXaxis()->SetRangeUser(-.05,.05);
210 h_proj_new2->Rebin(5);
214 h_proj_new2->GetXaxis()->SetRangeUser(-.01,.01);
216 h_proj_new2->SetTitle(TString(hist_name_prefix) + TString::Format(
217 ": %.1f - %.1f GeV/c", pt_range.first, pt_range.second));
218 h_proj_new2->GetXaxis()->SetTitle(TString::Format(
219 "DCA (r #phi) [cm]"));
220 h_proj_new2->GetXaxis()->SetNdivisions(5,5);
221 f2 =
new TF1(
"f2",
"gaus",-.01,.01);
222 h_proj_new2->Fit(f2 ,
"mq");
223 fit2 = h_proj_new2->GetFunction(
"f2");
224 sigma2 = fit2->GetParameter(2);
225 sigma_unc2 = fit2->GetParError(2);
227 TH1 *h_proj_ref2 =
nullptr;
233 "%s_Ref_ProjX_%d_%d",
234 h_new2->GetName(), bin_start, bin_end),
236 if (pt_range.first < 2.0)
239 h_proj_ref2->Rebin(5);
244 sprintf(resstr2,
"#sigma = %.5f #pm %.5f cm", sigma2, sigma_unc2);
245 res2 =
new TLatex(0.325,0.825,resstr2);
247 res2->SetTextSize(0.05);
248 res2->SetTextAlign(13);
253 p2 = (TPad *) c2->cd(idx2++);
255 TPaveText *pt2 =
new TPaveText(.05,.1,.95,.8);
256 pt2->AddText(
"Cuts: MVTX hits>=2, INTT hits>=1,");
257 pt2->AddText(
"TPC hits>=20");
269 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
273 double Nevent_new = 1;
274 double Nevent_ref = 1;
278 TH1 *h_norm = (TH1 *) qa_file_new->GetObjectChecked(
279 prefix + TString(
"Normalization"),
"TH1");
282 Nevent_new = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Truth Track"));
286 TH1 *h_norm = (TH1 *) qa_file_ref->GetObjectChecked(
287 prefix + TString(
"Normalization"),
"TH1");
290 Nevent_ref = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Truth Track"));
293 TH2 *h_new = (TH2 *) qa_file_new->GetObjectChecked(
294 prefix + TString(
"DCAZ_pT"),
"TH2");
304 h_ref = (TH2 *) qa_file_ref->GetObjectChecked(
305 prefix + TString(
"DCAZ_pT"),
"TH2");
310 h_ref->Scale(Nevent_new / Nevent_ref);
313 TCanvas *c1 =
new TCanvas(TString(
"QA_Draw_Tracking_DCAZ") + TString(
"_") + hist_name_prefix,
314 TString(
"QA_Draw_Tracking_DCAZ") + TString(
"_") + hist_name_prefix,
320 vector<pair<double, double>> gpt_ranges{
331 Double_t sigma_unc = 0;
333 TLatex *res =
nullptr;
334 for (
auto pt_range : gpt_ranges)
338 p = (TPad *) c1->cd(idx++);
342 const double epsilon = 1
e-6;
343 const int bin_start = h_new->GetXaxis()->FindBin(pt_range.first + epsilon);
344 const int bin_end = h_new->GetXaxis()->FindBin(pt_range.second - epsilon);
346 TH1 *h_proj_new = h_new->ProjectionY(
348 "%s_New_ProjX_%d_%d",
349 h_new->GetName(), bin_start, bin_end),
351 if (pt_range.first < 2.0)
353 h_proj_new->GetXaxis()->SetRangeUser(-.05, .05);
354 h_proj_new->Rebin(5);
358 h_proj_new->GetXaxis()->SetRangeUser(-.01, .01);
360 h_proj_new->SetTitle(TString(hist_name_prefix) + TString::Format(
361 ": %.1f - %.1f GeV/c", pt_range.first, pt_range.second));
362 h_proj_new->GetXaxis()->SetTitle(TString::Format(
364 h_proj_new->GetXaxis()->SetNdivisions(5, 5);
366 f1 =
new TF1(
"f1",
"gaus", -.01, .01);
367 h_proj_new->Fit(f1,
"mq");
368 sigma = f1->GetParameter(2);
369 sigma_unc = f1->GetParError(2);
371 TH1 *h_proj_ref =
nullptr;
377 "%s_Ref_ProjX_%d_%d",
378 h_new->GetName(), bin_start, bin_end),
380 if (pt_range.first < 2.0)
383 h_proj_ref->Rebin(5);
387 sprintf(resstr,
"#sigma = %.5f #pm %.5f cm", sigma, sigma_unc);
388 res =
new TLatex(0.325, 0.825, resstr);
390 res->SetTextSize(0.05);
391 res->SetTextAlign(13);
394 p = (TPad *) c1->cd(idx++);
396 TPaveText *
pt =
new TPaveText(.05, .1, .95, .8);
397 pt->AddText(
"No cuts");
410 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
414 double Nevent_new = 1;
415 double Nevent_ref = 1;
418 TH2 *h_new2 = (TH2 *) qa_file_new->GetObjectChecked(
419 prefix + TString(
"DCAZ_pT_cuts"),
"TH2");
429 h_ref2 = (TH2 *) qa_file_ref->GetObjectChecked(
430 prefix + TString(
"DCAZ_pT_cuts"),
"TH2");
435 h_ref2->Scale(Nevent_new / Nevent_ref);
438 TCanvas *
c2 =
new TCanvas(TString(
"QA_Draw_Tracking_DCAZ2") + TString(
"_") + hist_name_prefix,
439 TString(
"QA_Draw_Tracking_DCAZ2") + TString(
"_") + hist_name_prefix,
445 vector<pair<double, double>> gpt_ranges2{
456 Double_t sigma_unc2 = 0;
458 TLatex *res2 =
nullptr;
459 for (
auto pt_range : gpt_ranges2)
463 p2 = (TPad *) c2->cd(idx2++);
467 const double epsilon = 1
e-6;
468 const int bin_start = h_new2->GetXaxis()->FindBin(pt_range.first + epsilon);
469 const int bin_end = h_new2->GetXaxis()->FindBin(pt_range.second - epsilon);
471 TH1 *h_proj_new2 = h_new2->ProjectionY(
473 "%s_New_ProjX_%d_%d",
474 h_new2->GetName(), bin_start, bin_end),
476 if (pt_range.first < 2.0)
478 h_proj_new2->GetXaxis()->SetRangeUser(-.05, .05);
479 h_proj_new2->Rebin(5);
483 h_proj_new2->GetXaxis()->SetRangeUser(-.01, .01);
485 h_proj_new2->SetTitle(TString(hist_name_prefix) + TString::Format(
486 ": %.1f - %.1f GeV/c", pt_range.first, pt_range.second));
487 h_proj_new2->GetXaxis()->SetTitle(TString::Format(
489 h_proj_new2->GetXaxis()->SetNdivisions(5, 5);
491 f2 =
new TF1(
"f2",
"gaus", -.01, .01);
492 h_proj_new2->Fit(f2,
"mq");
493 fit2 = h_proj_new2->GetFunction(
"f2");
494 sigma2 = fit2->GetParameter(2);
495 sigma_unc2 = fit2->GetParError(2);
497 TH1 *h_proj_ref2 =
nullptr;
503 "%s_Ref_ProjX_%d_%d",
504 h_new2->GetName(), bin_start, bin_end),
506 if (pt_range.first < 2.0)
509 h_proj_ref2->Rebin(5);
513 sprintf(resstr2,
"#sigma = %.5f #pm %.5f cm", sigma2, sigma_unc2);
514 res2 =
new TLatex(0.325, 0.825, resstr2);
516 res2->SetTextSize(0.05);
517 res2->SetTextAlign(13);
520 p2 = (TPad *) c2->cd(idx2++);
522 TPaveText *pt2 =
new TPaveText(.05, .1, .95, .8);
523 pt2->AddText(
"Cuts: MVTX hits>=2, INTT hits>=1,");
524 pt2->AddText(
"TPC hits>=20");
535 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
539 double Nevent_new = 1;
540 double Nevent_ref = 1;
545 TH1 *h_norm = (TH1 *) qa_file_new->GetObjectChecked(
546 prefix + TString(
"Normalization"),
"TH1");
549 Nevent_new = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Event"));
553 TH1 *h_norm = (TH1 *) qa_file_ref->GetObjectChecked(
554 prefix + TString(
"Normalization"),
"TH1");
557 Nevent_ref = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Event"));
560 TCanvas *c1 =
new TCanvas(TString(
"QA_Draw_Tracking_DCA_Resolution") + TString(
"_") + hist_name_prefix,
561 TString(
"QA_Draw_Tracking_DCA_Resolution") + TString(
"_") + hist_name_prefix,
568 p = (TPad *) c1->cd(idx++);
571 TH1 *frame = p->DrawFrame(0.1, -0.01, 50, 0.01,
572 ";Truth p_{T} [GeV/c];<DCA (r #phi)> #pm #sigma(DCA (r #phi)) [cm]");
573 gPad->SetLeftMargin(.2);
574 frame->GetYaxis()->SetTitleOffset(2);
575 TLine *l =
new TLine(0.1, 0, 50, 0);
576 l->SetLineColor(kGray);
579 TH2 *h_QAG4SimulationTracking_DCArPhi = (TH2 *) qa_file_new->GetObjectChecked(
580 prefix +
"DCArPhi_pT_cuts",
"TH2");
581 assert(h_QAG4SimulationTracking_DCArPhi);
583 h_QAG4SimulationTracking_DCArPhi->Rebin2D(20, 1);
586 TGraphErrors *ge_QAG4SimulationTracking_DCArPhi =
FitProfile(h_QAG4SimulationTracking_DCArPhi);
587 ge_QAG4SimulationTracking_DCArPhi->Draw(
"pe");
589 TGraphErrors *h_ratio_ref = NULL;
592 TH2 *h_QAG4SimulationTracking_DCArPhi = (TH2 *) qa_file_ref->GetObjectChecked(
593 prefix +
"DCArPhi_pT_cuts",
"TH2");
594 assert(h_QAG4SimulationTracking_DCArPhi);
596 h_QAG4SimulationTracking_DCArPhi->Rebin2D(20, 1);
598 h_ratio_ref =
FitProfile(h_QAG4SimulationTracking_DCArPhi);
599 ge_QAG4SimulationTracking_DCArPhi->Draw(
"pe");
602 ge_QAG4SimulationTracking_DCArPhi->SetTitle(
"DCA (r #phi, #geq 2MVTX, #geq 1INTT, #geq 20TPC) [cm]");
603 DrawReference(ge_QAG4SimulationTracking_DCArPhi, h_ratio_ref,
true);
607 p = (TPad *) c1->cd(idx++);
610 TH1 *frame = p->DrawFrame(0.1, -0.01, 50, 0.01,
611 "DCA (Z) [cm];Truth p_{T} [GeV/c];<DCA (Z)> #pm #sigma(DCA (Z)) [cm]");
613 gPad->SetTopMargin(-1);
614 frame->GetYaxis()->SetTitleOffset(1.7);
620 TH2 *h_QAG4SimulationTracking_DCAZ = (TH2 *) qa_file_new->GetObjectChecked(
621 prefix +
"DCAZ_pT_cuts",
"TH2");
622 assert(h_QAG4SimulationTracking_DCAZ);
624 h_QAG4SimulationTracking_DCAZ->Rebin2D(40, 1);
626 TGraphErrors *ge_QAG4SimulationTracking_DCAZ =
FitProfile(h_QAG4SimulationTracking_DCAZ);
627 ge_QAG4SimulationTracking_DCAZ->Draw(
"pe");
628 ge_QAG4SimulationTracking_DCAZ->SetTitle(
"DCA (Z) [cm]");
630 TGraphErrors *h_ratio_ref = NULL;
633 TH2 *h_QAG4SimulationTracking_DCAZ = (TH2 *) qa_file_ref->GetObjectChecked(
634 prefix +
"DCAZ_pT_cuts",
"TH2");
635 assert(h_QAG4SimulationTracking_DCAZ);
637 h_QAG4SimulationTracking_DCAZ->Rebin2D(40, 1);
639 h_ratio_ref =
FitProfile(h_QAG4SimulationTracking_DCAZ);
640 ge_QAG4SimulationTracking_DCAZ->Draw(
"pe");
643 DrawReference(ge_QAG4SimulationTracking_DCAZ, h_ratio_ref,
true);
654 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
657 double Nevent_new = 1;
658 double Nevent_ref = 1;
662 TH1 *h_norm = (TH1 *) qa_file_new->GetObjectChecked(
663 prefix + TString(
"Normalization"),
"TH1");
666 Nevent_new = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Truth Track"));
670 TH1 *h_norm = (TH1 *) qa_file_ref->GetObjectChecked(
671 prefix + TString(
"Normalization"),
"TH1");
674 Nevent_ref = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Truth Track"));
679 TH2 *h_new = (TH2 *) qa_file_new->GetObjectChecked(
680 prefix + TString(
"SigmalizedDCArPhi_pT"),
"TH2");
690 h_ref = (TH2 *) qa_file_ref->GetObjectChecked(
691 prefix + TString(
"SigmalizedDCArPhi_pT"),
"TH2");
696 h_ref->Scale(Nevent_new / Nevent_ref);
699 TCanvas *c1 =
new TCanvas(TString(
"QA_Draw_Tracking_SigmalizedDCArPhi") + TString(
"_") + hist_name_prefix,
700 TString(
"QA_Draw_Tracking_SigmalizedDCArPhi") + TString(
"_") + hist_name_prefix,
706 vector<pair<double, double>> gpt_ranges{
717 Double_t sigma_unc = 0;
719 TLatex *res =
nullptr;
720 for (
auto pt_range : gpt_ranges)
724 p = (TPad *) c1->cd(idx++);
728 const double epsilon = 1
e-6;
729 const int bin_start = h_new->GetXaxis()->FindBin(pt_range.first + epsilon);
730 const int bin_end = h_new->GetXaxis()->FindBin(pt_range.second - epsilon);
732 TH1 *h_proj_new = h_new->ProjectionY(
734 "%s_New_ProjX_%d_%d",
735 h_new->GetName(), bin_start, bin_end),
737 h_proj_new->GetXaxis()->SetRangeUser(-5.,5.);
738 h_proj_new->Rebin(5);
739 h_proj_new->SetTitle(TString(hist_name_prefix) + TString::Format(
740 ": %.1f - %.1f GeV/c", pt_range.first, pt_range.second));
741 h_proj_new->GetXaxis()->SetTitle(TString::Format(
742 "Sigmalized DCA (r #phi)"));
743 h_proj_new->GetXaxis()->SetNdivisions(5,5);
745 f1 =
new TF1(
"f1",
"gaus",-4.,4.);
746 h_proj_new->Fit(f1,
"mq");
747 sigma = f1->GetParameter(2);
748 sigma_unc = f1->GetParError(2);
750 TH1 *h_proj_ref =
nullptr;
756 "%s_Ref_ProjX_%d_%d",
757 h_new->GetName(), bin_start, bin_end),
760 h_proj_ref->Rebin(5);
764 sprintf(resstr,
"#sigma = %.5f #pm %.5f", sigma, sigma_unc);
765 res =
new TLatex(0.325,0.825,resstr);
767 res->SetTextSize(0.05);
768 res->SetTextAlign(13);
771 p = (TPad *) c1->cd(idx++);
773 TPaveText *
pt =
new TPaveText(.05,.1,.95,.8);
774 pt->AddText(
"Cuts: MVTX hits>=2, INTT hits>=1,");
775 pt->AddText(
"TPC hits>=20");
787 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
790 double Nevent_new = 1;
791 double Nevent_ref = 1;
795 TH1 *h_norm = (TH1 *) qa_file_new->GetObjectChecked(
796 prefix + TString(
"Normalization"),
"TH1");
799 Nevent_new = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Truth Track"));
803 TH1 *h_norm = (TH1 *) qa_file_ref->GetObjectChecked(
804 prefix + TString(
"Normalization"),
"TH1");
807 Nevent_ref = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Truth Track"));
810 TH2 *h_new2 = (TH2 *) qa_file_new->GetObjectChecked(
811 prefix + TString(
"SigmalizedDCAZ_pT"),
"TH2");
821 h_ref2 = (TH2 *) qa_file_ref->GetObjectChecked(
822 prefix + TString(
"SigmalizedDCAZ_pT"),
"TH2");
827 h_ref2->Scale(Nevent_new / Nevent_ref);
830 TCanvas *
c2 =
new TCanvas(TString(
"QA_Draw_Tracking_SigmalizedDCAZ") + TString(
"_") + hist_name_prefix,
831 TString(
"QA_Draw_Tracking_SigmalizedDCAZ") + TString(
"_") + hist_name_prefix,
837 vector<pair<double, double>> gpt_ranges2{
848 Double_t sigma_unc2 = 0;
850 TLatex *res2 =
nullptr;
851 for (
auto pt_range : gpt_ranges2)
855 p2 = (TPad *) c2->cd(idx2++);
859 const double epsilon = 1
e-6;
860 const int bin_start = h_new2->GetXaxis()->FindBin(pt_range.first + epsilon);
861 const int bin_end = h_new2->GetXaxis()->FindBin(pt_range.second - epsilon);
863 TH1 *h_proj_new2 = h_new2->ProjectionY(
865 "%s_New_ProjX_%d_%d",
866 h_new2->GetName(), bin_start, bin_end),
868 h_proj_new2->GetXaxis()->SetRangeUser(-5.,5.);
869 h_proj_new2->Rebin(5);
870 h_proj_new2->SetTitle(TString(hist_name_prefix) + TString::Format(
871 ": %.1f - %.1f GeV/c", pt_range.first, pt_range.second));
872 h_proj_new2->GetXaxis()->SetTitle(TString::Format(
873 "Sigmalized DCA (Z)"));
874 h_proj_new2->GetXaxis()->SetNdivisions(5,5);
876 f2 =
new TF1(
"f2",
"gaus",-4.,4.);
877 h_proj_new2->Fit(f2,
"mq");
879 sigma2 = fit2->GetParameter(2);
880 sigma_unc2 = fit2->GetParError(2);
882 TH1 *h_proj_ref2 =
nullptr;
888 "%s_Ref_ProjX_%d_%d",
889 h_new2->GetName(), bin_start, bin_end),
892 h_proj_ref2->Rebin(5);
895 sprintf(resstr2,
"#sigma = %.5f #pm %.5f", sigma2, sigma_unc2);
896 res2 =
new TLatex(0.325,0.825,resstr2);
898 res2->SetTextSize(0.05);
899 res2->SetTextAlign(13);
902 p2 = (TPad *) c2->cd(idx2++);
904 TPaveText *pt2 =
new TPaveText(.05,.1,.95,.8);
905 pt2->AddText(
"Cuts: MVTX hits>=2, INTT hits>=1,");
906 pt2->AddText(
"TPC hits>=20");
917 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
921 double Nevent_new = 1;
922 double Nevent_ref = 1;
927 TH1 *h_norm = (TH1 *) qa_file_new->GetObjectChecked(
928 prefix + TString(
"Normalization"),
"TH1");
931 Nevent_new = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Event"));
935 TH1 *h_norm = (TH1 *) qa_file_ref->GetObjectChecked(
936 prefix + TString(
"Normalization"),
"TH1");
939 Nevent_ref = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Event"));
942 TCanvas *c1 =
new TCanvas(TString(
"QA_Draw_Tracking_SigmalizedDCA_Resolution") + TString(
"_") + hist_name_prefix,
943 TString(
"QA_Draw_Tracking_SigmalizedDCA_Resolution") + TString(
"_") + hist_name_prefix,
950 p = (TPad *) c1->cd(idx++);
953 TH1 *frame = p->DrawFrame(0.1, -2, 50, 2,
954 ";Truth p_{T} [GeV/c];<Sigmalized DCA (r #phi)> #pm #sigma(Sigmalized DCA (r #phi))");
955 gPad->SetLeftMargin(.2);
956 frame->GetYaxis()->SetTitleOffset(2);
957 TLine *l =
new TLine(0.1, 0, 50, 0);
958 l->SetLineColor(kGray);
963 TH2 *h_QAG4SimulationTracking_DCArPhi = (TH2 *) qa_file_new->GetObjectChecked(
964 prefix +
"SigmalizedDCArPhi_pT",
"TH2");
965 assert(h_QAG4SimulationTracking_DCArPhi);
967 h_QAG4SimulationTracking_DCArPhi->Rebin2D(20, 1);
970 TGraphErrors *ge_QAG4SimulationTracking_DCArPhi =
FitProfile(h_QAG4SimulationTracking_DCArPhi);
971 ge_QAG4SimulationTracking_DCArPhi->Draw(
"pe");
973 TGraphErrors *h_ratio_ref = NULL;
976 TH2 *h_QAG4SimulationTracking_DCArPhi = (TH2 *) qa_file_ref->GetObjectChecked(
977 prefix +
"SigmalizedDCArPhi_pT",
"TH2");
978 assert(h_QAG4SimulationTracking_DCArPhi);
980 h_QAG4SimulationTracking_DCArPhi->Rebin2D(20, 1);
982 h_ratio_ref =
FitProfile(h_QAG4SimulationTracking_DCArPhi);
983 ge_QAG4SimulationTracking_DCArPhi->Draw(
"pe");
986 ge_QAG4SimulationTracking_DCArPhi->SetTitle(
"DCA_{r#phi}/#sigma[DCA_{r#phi}]");
987 DrawReference(ge_QAG4SimulationTracking_DCArPhi, h_ratio_ref,
true);
991 p = (TPad *) c1->cd(idx++);
994 TH1 *frame = p->DrawFrame(0.1, -2, 50, 2,
995 "DCA_z/#sigma[DCA_z];Truth p_{T} [GeV/c];<Sigmalized DCA (Z)> #pm #sigma(Sigmalized DCA (Z))");
997 gPad->SetTopMargin(-1);
998 frame->GetYaxis()->SetTitleOffset(1.7);
999 TLine *l =
new TLine(0.1, 0, 50, 0);
1000 l->SetLineColor(kGray);
1005 TH2 *h_QAG4SimulationTracking_DCAZ = (TH2 *) qa_file_new->GetObjectChecked(
1006 prefix +
"SigmalizedDCAZ_pT",
"TH2");
1007 assert(h_QAG4SimulationTracking_DCAZ);
1009 h_QAG4SimulationTracking_DCAZ->Rebin2D(40, 1);
1011 TGraphErrors *ge_QAG4SimulationTracking_DCAZ =
FitProfile(h_QAG4SimulationTracking_DCAZ);
1012 ge_QAG4SimulationTracking_DCAZ->Draw(
"pe");
1013 ge_QAG4SimulationTracking_DCAZ->SetTitle(
"DCA_z/#sigma[DCA_z]");
1015 TGraphErrors *h_ratio_ref = NULL;
1018 TH2 *h_QAG4SimulationTracking_DCAZ = (TH2 *) qa_file_ref->GetObjectChecked(
1019 prefix +
"SigmalizedDCAZ_pT",
"TH2");
1020 assert(h_QAG4SimulationTracking_DCAZ);
1022 h_QAG4SimulationTracking_DCAZ->Rebin2D(40, 1);
1024 h_ratio_ref =
FitProfile(h_QAG4SimulationTracking_DCAZ);
1025 ge_QAG4SimulationTracking_DCAZ->Draw(
"pe");
1028 DrawReference(ge_QAG4SimulationTracking_DCAZ, h_ratio_ref,
true);
1041 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
1044 TCanvas *c1 =
new TCanvas(TString(
"QA_Draw_Vertex_nVertex") +
1045 TString(
"_") + hist_name_prefix,
1046 TString(
"QA_Draw_Vertex_nVertex") +
1047 TString(
"_") + hist_name_prefix,
1054 static const int nrebin = 1;
1056 p = (TPad *)c1->cd(idx++);
1062 (TH1 *)qa_file_new->GetObjectChecked(prefix +
"gntracks",
"TH1");
1065 h_pass->Rebin(nrebin);
1068 h_pass->GetYaxis()->SetTitle(
"Counts");
1074 (TH1 *)qa_file_ref->GetObjectChecked(prefix +
"gntracks",
"TH1");
1077 h_ref->Rebin(nrebin);
1080 h_pass->SetTitle(TString(hist_name_prefix) +
": gntracks");
1086 static const int nrebin = 1;
1088 p = (TPad *)c1->cd(idx++);
1094 (TH1 *)qa_file_new->GetObjectChecked(prefix +
"gntracksmaps",
"TH1");
1097 h_pass->Rebin(nrebin);
1100 h_pass->GetYaxis()->SetTitle(
"Counts");
1106 (TH1 *)qa_file_ref->GetObjectChecked(prefix +
"gntracksmaps",
"TH1");
1109 h_ref->Rebin(nrebin);
1112 h_pass->SetTitle(TString(hist_name_prefix) +
": gntracksmaps");
1118 static const int nrebin = 1;
1120 p = (TPad *)c1->cd(idx++);
1126 (TH1 *)qa_file_new->GetObjectChecked(prefix +
"ntracks",
"TH1");
1129 h_pass->Rebin(nrebin);
1132 h_pass->GetYaxis()->SetTitle(
"Counts");
1138 (TH1 *)qa_file_ref->GetObjectChecked(prefix +
"ntracks",
"TH1");
1141 h_ref->Rebin(nrebin);
1144 h_pass->SetTitle(TString(hist_name_prefix) +
": ntracks");
1150 static const int nrebin = 1;
1152 p = (TPad *)c1->cd(idx++);
1158 (TH1 *)qa_file_new->GetObjectChecked(prefix +
"ntracks_cuts",
"TH1");
1161 h_pass->Rebin(nrebin);
1164 h_pass->GetYaxis()->SetTitle(
"Counts");
1170 (TH1 *)qa_file_ref->GetObjectChecked(prefix +
"ntracks_cuts",
"TH1");
1173 h_ref->Rebin(nrebin);
1176 h_pass->SetTitle(TString(hist_name_prefix) +
": ntracks (#geq 2 MVTX)");
1192 TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
1197 TH2 *h_new = (TH2 *) qa_file_new->GetObjectChecked(
1198 prefix + TString(
"vxRes_gvz"),
"TH2");
1209 h_ref = (TH2 *) qa_file_ref->GetObjectChecked(
1210 prefix + TString(
"vxRes_gvz"),
"TH2");
1218 TCanvas *c1 =
new TCanvas(TString(
"QA_Draw_Vertex_Resolution_x") + TString(
"_") + hist_name_prefix,
1219 TString(
"QA_Draw_Vertex_Resolution_x") + TString(
"_") + hist_name_prefix,
1225 vector<pair<double, double>> gvz_ranges{
1230 Double_t sigma_unc = 0;
1232 TLatex *res =
nullptr;
1233 for (
auto gvz_range : gvz_ranges)
1237 p = (TPad *) c1->cd(idx++);
1241 const double epsilon = 1
e-6;
1242 const int bin_start = h_new->GetXaxis()->FindBin(gvz_range.first + epsilon);
1243 const int bin_end = h_new->GetXaxis()->FindBin(gvz_range.second - epsilon);
1245 TH1 *h_proj_new = h_new->ProjectionY(
1247 "%s_New_ProjX_%d_%d",
1248 h_new->GetName(), bin_start, bin_end));
1251 h_proj_new->SetTitle(TString(hist_name_prefix) + TString::Format(
1252 ": %.1f - %.1f cm - gvz", gvz_range.first, gvz_range.second));
1253 h_proj_new->GetXaxis()->SetTitle(TString::Format(
1254 "Vertex Resolution (x) [cm]"));
1255 h_proj_new->GetXaxis()->SetNdivisions(5,5);
1256 h_proj_new->GetXaxis()->SetRangeUser(-0.002,0.002);
1258 f1 =
new TF1(
"f1",
"gaus",-.002,.002);
1259 h_proj_new->Fit(f1,
"qm");
1260 sigma = f1->GetParameter(2);
1261 sigma_unc = f1->GetParError(2);
1264 TH1 *h_proj_ref =
nullptr;
1270 "%s_Ref_ProjX_%d_%d",
1271 h_new->GetName(), bin_start, bin_end));
1273 h_proj_ref->GetXaxis()->SetRangeUser(-10,10);
1277 sprintf(resstr,
"#sigma = %.5f #pm %.5f cm", sigma, sigma_unc);
1278 res =
new TLatex(0.325,0.825,resstr);
1280 res->SetTextSize(0.05);
1281 res->SetTextAlign(13);
1284 p = (TPad *) c1->cd(idx++);
1286 gPad->SetLeftMargin(.2);
1288 h_new->Draw(
"colz");
1296 TH2 *h_new2 = (TH2 *) qa_file_new->GetObjectChecked(
1297 prefix + TString(
"vyRes_gvz"),
"TH2");
1307 h_ref2 = (TH2 *) qa_file_ref->GetObjectChecked(
1308 prefix + TString(
"vyRes_gvz"),
"TH2");
1316 TCanvas *
c2 =
new TCanvas(TString(
"QA_Draw_Vertex_Resolution_y") + TString(
"_") + hist_name_prefix,
1317 TString(
"QA_Draw_Vertex_Resolution_y") + TString(
"_") + hist_name_prefix,
1323 vector<pair<double, double>> gvz_ranges2{
1326 TF1 *fit2 =
nullptr;
1327 Double_t sigma2 = 0;
1328 Double_t sigma_unc2 = 0;
1330 TLatex *res2 =
nullptr;
1331 for (
auto gvz_range : gvz_ranges2)
1335 p2 = (TPad *) c2->cd(idx2++);
1339 const double epsilon = 1
e-6;
1340 const int bin_start = h_new2->GetXaxis()->FindBin(gvz_range.first + epsilon);
1341 const int bin_end = h_new2->GetXaxis()->FindBin(gvz_range.second - epsilon);
1343 TH1 *h_proj_new2 = h_new2->ProjectionY(
1345 "%s_New_ProjX_%d_%d",
1346 h_new2->GetName(), bin_start, bin_end),
1347 bin_start, bin_end);
1349 h_proj_new2->SetTitle(TString(hist_name_prefix) + TString::Format(
1350 ": %.1f - %.1f cm - gvz", gvz_range.first, gvz_range.second));
1351 h_proj_new2->GetXaxis()->SetTitle(TString::Format(
1352 "Vertex Resolution (y) [cm]"));
1353 h_proj_new2->GetXaxis()->SetNdivisions(5,5);
1354 h_proj_new2->GetXaxis()->SetRangeUser(-0.002,0.002);
1356 f2 =
new TF1(
"f2",
"gaus",-.002,.002);
1357 h_proj_new2->Fit(f2,
"qm");
1358 fit2 = h_proj_new2->GetFunction(
"f2");
1359 sigma2 = fit2->GetParameter(2);
1360 sigma_unc2 = fit2->GetParError(2);
1362 TH1 *h_proj_ref2 =
nullptr;
1366 h_ref2->ProjectionY(
1368 "%s_Ref_ProjX_%d_%d",
1369 h_new2->GetName(), bin_start, bin_end),
1370 bin_start, bin_end);
1374 sprintf(resstr2,
"#sigma = %.5f #pm %.5f cm", sigma2, sigma_unc2);
1375 res2 =
new TLatex(0.325,0.825,resstr2);
1377 res2->SetTextSize(0.05);
1378 res2->SetTextAlign(13);
1381 p2 = (TPad *) c2->cd(idx2++);
1383 gPad->SetLeftMargin(.2);
1385 h_new2->Draw(
"colz");
1392 TH2 *h_new3 = (TH2 *) qa_file_new->GetObjectChecked(
1393 prefix + TString(
"vzRes_gvz"),
"TH2");
1403 h_ref3 = (TH2 *) qa_file_ref->GetObjectChecked(
1404 prefix + TString(
"vzRes_gvz"),
"TH2");
1412 TCanvas *c3 =
new TCanvas(TString(
"QA_Draw_Vertex_Resolution_z") + TString(
"_") + hist_name_prefix,
1413 TString(
"QA_Draw_Vertex_Resolution_z") + TString(
"_") + hist_name_prefix,
1419 vector<pair<double, double>> gvz_ranges3{
1422 TF1 *fit3 =
nullptr;
1423 Double_t sigma3 = 0;
1424 Double_t sigma_unc3 = 0;
1426 TLatex *res3 =
nullptr;
1427 for (
auto gvz_range : gvz_ranges3)
1431 p3 = (TPad *) c3->cd(idx3++);
1435 const double epsilon = 1
e-6;
1436 const int bin_start = h_new3->GetXaxis()->FindBin(gvz_range.first + epsilon);
1437 const int bin_end = h_new3->GetXaxis()->FindBin(gvz_range.second - epsilon);
1439 TH1 *h_proj_new3 = h_new3->ProjectionY(
1441 "%s_New_ProjX_%d_%d",
1442 h_new3->GetName(), bin_start, bin_end),
1443 bin_start, bin_end);
1445 h_proj_new3->SetTitle(TString(hist_name_prefix) + TString::Format(
1446 ": %.1f - %.1f cm -gvz", gvz_range.first, gvz_range.second));
1447 h_proj_new3->GetXaxis()->SetTitle(TString::Format(
1448 "Vertex Resolution (z) [cm]"));
1449 h_proj_new3->GetXaxis()->SetNdivisions(5,5);
1450 h_proj_new3->GetXaxis()->SetRangeUser(-0.002,0.002);
1452 f3 =
new TF1(
"f3",
"gaus",-.002,.002);
1453 h_proj_new3->Fit(f3,
"qm");
1454 fit3 = h_proj_new3->GetFunction(
"f3");
1455 sigma3 = fit3->GetParameter(2);
1456 sigma_unc3 = fit3->GetParError(2);
1458 TH1 *h_proj_ref3 =
nullptr;
1462 h_ref3->ProjectionY(
1464 "%s_Ref_ProjX_%d_%d",
1465 h_new3->GetName(), bin_start, bin_end),
1466 bin_start, bin_end);
1470 sprintf(resstr3,
"#sigma = %.5f #pm %.5f cm", sigma3, sigma_unc3);
1471 res3 =
new TLatex(0.325,0.825,resstr3);
1473 res3->SetTextSize(0.05);
1474 res3->SetTextAlign(13);
1477 p3 = (TPad *) c3->cd(idx3++);
1479 gPad->SetLeftMargin(.2);
1481 h_new3->Draw(
"colz");