19 #include "sPhenixStyle.C"
25 const char *qa_file_name_new =
26 "/phenix/u/jinhuang/links/ePHENIX_work/sPHENIX_work/production_analysis_updates/spacal1d/fieldmap/G4Hits_sPHENIX_pi-_eta0.30_32GeV-0000.root_qa.root",
27 const char *qa_file_name_ref =
28 "/phenix/u/jinhuang/links/ePHENIX_work/sPHENIX_work/production_analysis_updates/spacal1d/fieldmap/G4Hits_sPHENIX_pi+_eta0.30_32GeV-0000.root_qa.root")
35 TVirtualFitter::SetDefaultFitter(
"Minuit2");
37 TFile *qa_file_new =
new TFile(qa_file_name_new);
38 assert(qa_file_new->IsOpen());
40 TFile *qa_file_ref = NULL;
43 qa_file_ref =
new TFile(qa_file_name_ref);
44 assert(qa_file_ref->IsOpen());
48 double Nevent_new = 1;
49 double Nevent_ref = 1;
53 TH1D *h_norm = (TH1D *) qa_file_new->GetObjectChecked(
54 TString(
"h_QAG4Sim_CalorimeterSum_Normalization"),
"TH1D");
57 Nevent_new = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Event"));
61 TH1D *h_norm = (TH1D *) qa_file_ref->GetObjectChecked(
62 TString(
"h_QAG4Sim_CalorimeterSum_Normalization"),
"TH1D");
65 Nevent_ref = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Event"));
68 TCanvas *
c1 =
new TCanvas(
"QA_Draw_Calorimeter_Sum_Cluster",
69 "QA_Draw_Calorimeter_Sum_Cluster", 1800, 900);
74 p = (TPad *) c1->cd(idx++);
79 TH2F *h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN =
80 (TH2F *) qa_file_new->GetObjectChecked(
81 "h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN",
"TH2F");
82 assert(h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN);
83 h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN->GetYaxis()->SetTitleOffset(
85 h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN->Draw(
"COLZ");
88 p = (TPad *) c1->cd(idx++);
93 TH2F *h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN_HCALOUT =
94 (TH2F *) qa_file_new->GetObjectChecked(
95 "h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN_HCALOUT",
"TH2F");
96 assert(h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN_HCALOUT);
97 h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN_HCALOUT->GetYaxis()->SetTitleOffset(
99 h_QAG4Sim_CalorimeterSum_Cluster_CEMC_HCALIN_HCALOUT->Draw(
"COLZ");
102 p = (TPad *) c1->cd(idx++);
106 p = (TPad *) c1->cd(idx++);
111 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
112 "h_QAG4Sim_CalorimeterSum_Cluster_Ratio_CEMC_HCALIN",
"TH1F");
116 h_new->Scale(1. / Nevent_new);
121 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
122 "h_QAG4Sim_CalorimeterSum_Cluster_Ratio_CEMC_HCALIN",
"TH1F");
125 h_ref->Scale(1. / Nevent_ref);
128 h_new->GetYaxis()->SetTitleOffset(1.5);
129 h_new->GetYaxis()->SetTitle(
"Count / event / bin");
135 p = (TPad *) c1->cd(idx++);
140 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
141 "h_QAG4Sim_CalorimeterSum_Cluster_Ratio_CEMC_HCALIN_HCALOUT",
"TH1F");
145 h_new->Scale(1. / Nevent_new);
150 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
151 "h_QAG4Sim_CalorimeterSum_Cluster_Ratio_CEMC_HCALIN_HCALOUT",
155 h_ref->Scale(1. / Nevent_ref);
158 h_new->GetYaxis()->SetTitleOffset(1.5);
159 h_new->GetYaxis()->SetTitle(
"Count / event / bin");
165 p = (TPad *) c1->cd(idx++);
170 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
171 "h_QAG4Sim_CalorimeterSum_Cluster_EP",
"TH1F");
175 h_new->Scale(1. / Nevent_new);
180 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
181 "h_QAG4Sim_CalorimeterSum_Cluster_EP",
"TH1F");
184 h_ref->Scale(1. / Nevent_ref);
187 h_new->GetYaxis()->SetTitleOffset(1.5);
188 h_new->GetYaxis()->SetTitle(
"Count / event / bin");
195 SaveCanvas(c1, TString(qa_file_name_new) + TString(c1->GetName()),
true);