19 #include "sPhenixStyle.C"
24 const char *qa_file_name_new =
25 "/phenix/u/jinhuang/links/ePHENIX_work/sPHENIX_work/production_analysis_updates/spacal1d/fieldmap/G4Hits_sPHENIX_pi-_eta0.30_32GeV-0000.root_qa.root",
26 const char *qa_file_name_ref =
27 "/phenix/u/jinhuang/links/ePHENIX_work/sPHENIX_work/production_analysis_updates/spacal1d/fieldmap/G4Hits_sPHENIX_pi+_eta0.30_32GeV-0000.root_qa.root")
31 TVirtualFitter::SetDefaultFitter(
"Minuit2");
33 TFile *qa_file_new =
new TFile(qa_file_name_new);
34 assert(qa_file_new->IsOpen());
36 TFile *qa_file_ref = NULL;
39 qa_file_ref =
new TFile(qa_file_name_ref);
40 assert(qa_file_ref->IsOpen());
43 TCanvas *
c1 =
new TCanvas(
"QA_Draw_HCALIN_G4Hit",
"QA_Draw_HCALIN_G4Hit",
49 p = (TPad *) c1->cd(idx++);
53 TH2F *h_QAG4Sim_HCALIN_G4Hit_XY = (TH2F *) qa_file_new->GetObjectChecked(
54 "h_QAG4Sim_HCALIN_G4Hit_XY",
"TH2F");
55 assert(h_QAG4Sim_HCALIN_G4Hit_XY);
56 h_QAG4Sim_HCALIN_G4Hit_XY->GetYaxis()->SetTitleOffset(1.5);
57 h_QAG4Sim_HCALIN_G4Hit_XY->Draw(
"COLZ");
59 p = (TPad *) c1->cd(idx++);
63 TH2F *h_QAG4Sim_HCALIN_G4Hit_RZ = (TH2F *) qa_file_new->GetObjectChecked(
64 "h_QAG4Sim_HCALIN_G4Hit_RZ",
"TH2F");
65 assert(h_QAG4Sim_HCALIN_G4Hit_RZ);
66 h_QAG4Sim_HCALIN_G4Hit_RZ->GetYaxis()->SetTitleOffset(1.5);
67 h_QAG4Sim_HCALIN_G4Hit_RZ->Draw(
"COLZ");
69 p = (TPad *) c1->cd(idx++);
74 TH2F *h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection =
75 (TH2F *) qa_file_new->GetObjectChecked(
76 "h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection",
"TH2F");
77 assert(h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection);
80 h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection->ProjectionX(
81 "qa_file_new_h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection_px");
83 proj_new->Scale(1. / proj_new->GetSum());
85 TH1D *proj_ref = NULL;
88 TH2F *h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection =
89 (TH2F *) qa_file_ref->GetObjectChecked(
90 "h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection",
"TH2F");
91 assert(h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection);
93 proj_ref = h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection->ProjectionX(
94 "qa_file_ref_h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection_px");
95 proj_ref->Scale(1. / proj_ref->GetSum());
98 proj_new->GetYaxis()->SetTitle(
"Normalized energy distribution");
104 p = (TPad *) c1->cd(idx++);
109 TH2F *h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection =
110 (TH2F *) qa_file_new->GetObjectChecked(
111 "h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection",
"TH2F");
112 assert(h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection);
115 h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection->ProjectionY(
116 "qa_file_new_h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection_py");
118 proj_new->Scale(1. / proj_new->GetSum());
120 TH1D *proj_ref = NULL;
123 TH2F *h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection =
124 (TH2F *) qa_file_ref->GetObjectChecked(
125 "h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection",
"TH2F");
126 assert(h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection);
128 proj_ref = h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection->ProjectionY(
129 "qa_file_ref_h_QAG4Sim_HCALIN_G4Hit_LateralTruthProjection_py");
130 proj_ref->Scale(1. / proj_ref->GetSum());
133 proj_new->GetYaxis()->SetTitle(
"Normalized energy distribution");
139 p = (TPad *) c1->cd(idx++);
145 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
146 "h_QAG4Sim_HCALIN_G4Hit_HitTime",
"TH1F");
149 h_new->Scale(1. / h_new->GetSum());
154 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
155 "h_QAG4Sim_HCALIN_G4Hit_HitTime",
"TH1F");
158 h_ref->Scale(1. / h_ref->GetSum());
161 h_new->GetYaxis()->SetTitleOffset(1.5);
162 h_new->GetYaxis()->SetTitle(
"Normalized energy per bin");
168 p = (TPad *) c1->cd(idx++);
174 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
175 "h_QAG4Sim_HCALIN_G4Hit_FractionTruthEnergy",
"TH1F");
180 h_new->Scale(1. / h_new->GetSum());
185 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
186 "h_QAG4Sim_HCALIN_G4Hit_FractionTruthEnergy",
"TH1F");
190 h_ref->Scale(1. / h_ref->GetSum());
193 h_new->GetYaxis()->SetTitleOffset(1.5);
194 h_new->GetYaxis()->SetTitle(
"Probability per bin");
200 p = (TPad *) c1->cd(idx++);
205 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
206 "h_QAG4Sim_HCALIN_G4Hit_VSF",
"TH1F");
211 h_new->Scale(1. / h_new->GetSum());
216 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
217 "h_QAG4Sim_HCALIN_G4Hit_VSF",
"TH1F");
221 h_ref->Scale(1. / h_ref->GetSum());
224 h_new->GetYaxis()->SetTitleOffset(1.5);
225 h_new->GetYaxis()->SetTitle(
"Probability per bin");
226 h_new->GetXaxis()->SetRangeUser(-0, .2);
231 p = (TPad *) c1->cd(idx++);
236 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
237 "h_QAG4Sim_HCALIN_G4Hit_FractionEMVisibleEnergy",
"TH1F");
242 h_new->Scale(1. / h_new->GetSum());
247 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
248 "h_QAG4Sim_HCALIN_G4Hit_FractionEMVisibleEnergy",
"TH1F");
252 h_ref->Scale(1. / h_ref->GetSum());
255 h_new->GetYaxis()->SetTitleOffset(1.5);
256 h_new->GetYaxis()->SetTitle(
"Probability per bin");
263 SaveCanvas(c1, TString(qa_file_name_new) + TString(c1->GetName()),
true);