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;
52 double Ntrack_new = 0;
53 double Ntrack_ref = 0;
57 TH1D *h_norm = (TH1D *) qa_file_new->GetObjectChecked(
58 TString(
"h_QAG4Sim_CalorimeterSum_Normalization"),
"TH1D");
61 Nevent_new = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Event"));
62 Ntrack_new = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Track"));
66 TH1D *h_norm = (TH1D *) qa_file_ref->GetObjectChecked(
67 TString(
"h_QAG4Sim_CalorimeterSum_Normalization"),
"TH1D");
70 Nevent_ref = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Event"));
71 Ntrack_ref = h_norm->GetBinContent(h_norm->GetXaxis()->FindBin(
"Track"));
74 TCanvas *
c1 =
new TCanvas(
"QA_Draw_Calorimeter_Sum_TrackProjEP",
75 "QA_Draw_Calorimeter_Sum_TrackProjEP", 1800, 600);
80 p = (TPad *) c1->cd(idx++);
86 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
87 "h_QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP",
"TH1F");
91 h_new->Scale(1. / Ntrack_new);
96 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
97 "h_QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP",
"TH1F");
100 h_ref->Scale(1. / Ntrack_ref);
103 h_new->GetYaxis()->SetTitleOffset(1.5);
104 h_new->GetYaxis()->SetTitle(
"Count / track / bin");
110 p = (TPad *) c1->cd(idx++);
116 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
117 "h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP",
"TH1F");
121 h_new->Scale(1. / Ntrack_new);
126 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
127 "h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP",
"TH1F");
130 h_ref->Scale(1. / Ntrack_ref);
133 h_new->GetYaxis()->SetTitleOffset(1.5);
134 h_new->GetYaxis()->SetTitle(
"Count / track / bin");
140 p = (TPad *) c1->cd(idx++);
146 TH1F *h_new = (TH1F *) qa_file_new->GetObjectChecked(
147 "h_QAG4Sim_CalorimeterSum_Cluster_EP",
"TH1F");
151 h_new->Scale(1. / Nevent_new);
156 h_ref = (TH1F *) qa_file_ref->GetObjectChecked(
157 "h_QAG4Sim_CalorimeterSum_Cluster_EP",
"TH1F");
160 h_ref->Scale(1. / Nevent_ref);
163 h_new->GetYaxis()->SetTitleOffset(1.5);
164 h_new->GetYaxis()->SetTitle(
"Count / event / bin");
172 SaveCanvas(c1, TString(qa_file_name_new) + TString(c1->GetName()),
true);