26 TString
base_dataset =
"/sphenix/u/weihuma/analysis/Calorimeter/macros/";
31 TVirtualFitter::SetDefaultFitter(
"Minuit2");
41 const TString
config =
"Single #pi^{-}, Track-based 5x5 clusterizer";
44 GetResolution(
"pi-",
"eta0",
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
45 QA_Eta0->
name =
"0<|eta|<0.1";
48 GetResolution(
"pi-",
"eta0.30",
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
49 QA_Eta3->
name =
"0.3<|eta|<0.4";
52 GetResolution(
"pi-",
"eta0.60",
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
53 QA_Eta6->
name =
"0.6<|eta|<0.7";
56 GetResolution(
"pi-",
"eta0.90",
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
57 QA_Eta9->
name =
"0.9<|eta|<1.0";
60 QA_Eta0->
resolution->SetMarkerStyle(kFullCircle);
64 QA_Eta0->
linearity->SetMarkerStyle(kFullCircle);
65 QA_Eta0->
linearity->SetMarkerColor(kRed + 3);
66 QA_Eta0->
linearity->SetLineColor(kRed + 3);
68 QA_Eta0->
f_res->SetLineColor(kRed + 3);
71 QA_Eta3->
resolution->SetMarkerStyle(kFullSquare);
72 QA_Eta3->
resolution->SetMarkerColor(kBlue + 3);
75 QA_Eta3->
linearity->SetMarkerStyle(kFullSquare);
76 QA_Eta3->
linearity->SetMarkerColor(kBlue + 3);
77 QA_Eta3->
linearity->SetLineColor(kBlue + 3);
79 QA_Eta3->
f_res->SetLineColor(kBlue + 3);
82 QA_Eta6->
resolution->SetMarkerStyle(kFullCross);
83 QA_Eta6->
resolution->SetMarkerColor(kMagenta + 3);
84 QA_Eta6->
resolution->SetLineColor(kMagenta + 3);
86 QA_Eta6->
linearity->SetMarkerStyle(kFullCross);
87 QA_Eta6->
linearity->SetMarkerColor(kMagenta + 3);
88 QA_Eta6->
linearity->SetLineColor(kMagenta + 3);
90 QA_Eta6->
f_res->SetLineColor(kMagenta + 3);
91 QA_Eta6->
f_res->SetLineStyle(kDashed);
95 QA_Eta9->
resolution->SetMarkerColor(kCyan + 3);
98 QA_Eta9->
linearity->SetMarkerStyle(kStar);
99 QA_Eta9->
linearity->SetMarkerColor(kCyan + 3);
100 QA_Eta9->
linearity->SetLineColor(kCyan + 3);
102 QA_Eta9->
f_res->SetLineColor(kCyan + 3);
103 QA_Eta9->
f_res->SetLineStyle(kDashed);
105 TCanvas *c1 =
new TCanvas(Form(
"EtaScan"),
106 Form(
"EtaScan"), 1300, 600);
111 p = (TPad *) c1->cd(idx++);
115 p->DrawFrame(0, 0, 60, 1.2,
116 Form(
"Linearity;Truth energy [GeV];Measured Energy / Truth energy"));
117 TLine *l =
new TLine(0, 1, 60, 1);
119 l->SetLineColor(kGray);
127 TLegend *
leg =
new TLegend(.2, .2, .85, .45);
128 leg->SetHeader(
"#splitline{#it{#bf{sPHENIX}} Geant4 Simulation}{" + config +
"}");
129 leg->AddEntry(
"",
"",
"");
136 p = (TPad *) c1->cd(idx++);
139 TF1 *f_calo_t1044 =
new TF1(
"f_calo_t1044",
"sqrt([0]*[0]+[1]*[1]/x)/100", 6,
141 f_calo_t1044->SetParameters(13.5, 64.9);
142 f_calo_t1044->SetLineWidth(3);
143 f_calo_t1044->SetLineColor(kGreen + 2);
145 TH1 *hframe = p->DrawFrame(0, 0, 60, 0.7,
146 Form(
"Resolution;Truth energy [GeV];#DeltaE/<E>"));
148 QA_Eta0->
f_res->Draw(
"same");
151 QA_Eta3->
f_res->Draw(
"same");
154 QA_Eta6->
f_res->Draw(
"same");
157 QA_Eta9->
f_res->Draw(
"same");
160 f_calo_t1044->Draw(
"same");
162 TLegend *leg =
new TLegend(.2, .6, .85, .9);
163 leg->SetHeader(
"#splitline{#it{#bf{sPHENIX}} Geant4 Simulation}{" + config +
"}");
164 leg->AddEntry(
"",
"",
"");
166 QA_Eta0->
name +
" " +
167 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
168 QA_Eta0->
f_res->GetParameter(0),
169 QA_Eta0->
f_res->GetParameter(1)),
171 leg->AddEntry(f_calo_t1044,
172 TString(
"T-1044 (#eta=0)") +
" " +
173 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
174 f_calo_t1044->GetParameter(0),
175 f_calo_t1044->GetParameter(1)),
178 QA_Eta3->
name +
" " +
179 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
180 QA_Eta3->
f_res->GetParameter(0),
181 QA_Eta3->
f_res->GetParameter(1)),
184 QA_Eta6->
name +
" " +
185 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
186 QA_Eta6->
f_res->GetParameter(0),
187 QA_Eta6->
f_res->GetParameter(1)),
190 QA_Eta9->
name +
" " +
191 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
192 QA_Eta9->
f_res->GetParameter(0),
193 QA_Eta9->
f_res->GetParameter(1)),
198 base_dataset +
"DrawHadronShowers_" + TString(c1->GetName()), kTRUE);
203 const TString
config =
"Single Particles, 0<|#eta|<0.1, Track-based 5x5 clusterizer";
206 GetResolution(
"e-",
"eta0",
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
207 QA_electron->
name =
"Electron";
210 GetResolution(
"pi-",
"eta0",
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
211 QA_PiNeg->
name =
"#pi^{-}";
214 GetResolution(
"pi\\+",
"eta0",
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
215 QA_PiPos->
name =
"#pi^{+}";
218 GetResolution(
"proton",
"eta0",
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
219 QA_Proton->
name =
"Proton";
222 QA_electron->
resolution->SetMarkerStyle(kFullCircle);
223 QA_electron->
resolution->SetMarkerColor(kRed + 3);
224 QA_electron->
resolution->SetLineColor(kRed + 3);
226 QA_electron->
linearity->SetMarkerStyle(kFullCircle);
227 QA_electron->
linearity->SetMarkerColor(kRed + 3);
228 QA_electron->
linearity->SetLineColor(kRed + 3);
230 QA_electron->
f_res->SetLineColor(kRed + 3);
233 QA_PiNeg->
resolution->SetMarkerStyle(kFullSquare);
234 QA_PiNeg->
resolution->SetMarkerColor(kBlue + 3);
235 QA_PiNeg->
resolution->SetLineColor(kBlue + 3);
237 QA_PiNeg->
linearity->SetMarkerStyle(kFullSquare);
238 QA_PiNeg->
linearity->SetMarkerColor(kBlue + 3);
239 QA_PiNeg->
linearity->SetLineColor(kBlue + 3);
241 QA_PiNeg->
f_res->SetLineColor(kBlue + 3);
244 QA_PiPos->
resolution->SetMarkerStyle(kFullCross);
245 QA_PiPos->
resolution->SetMarkerColor(kMagenta + 3);
246 QA_PiPos->
resolution->SetLineColor(kMagenta + 3);
248 QA_PiPos->
linearity->SetMarkerStyle(kFullCross);
249 QA_PiPos->
linearity->SetMarkerColor(kMagenta + 3);
250 QA_PiPos->
linearity->SetLineColor(kMagenta + 3);
252 QA_PiPos->
f_res->SetLineColor(kMagenta + 3);
253 QA_PiPos->
f_res->SetLineStyle(kDashed);
257 QA_Proton->
resolution->SetMarkerColor(kCyan + 3);
258 QA_Proton->
resolution->SetLineColor(kCyan + 3);
260 QA_Proton->
linearity->SetMarkerStyle(kStar);
261 QA_Proton->
linearity->SetMarkerColor(kCyan + 3);
262 QA_Proton->
linearity->SetLineColor(kCyan + 3);
264 QA_Proton->
f_res->SetLineColor(kCyan + 3);
265 QA_Proton->
f_res->SetLineStyle(kDashed);
267 TCanvas *c1 =
new TCanvas(Form(
"PIDScan"),
268 Form(
"PIDScan"), 1300, 600);
273 p = (TPad *) c1->cd(idx++);
277 p->DrawFrame(0, 0, 60, 1.2,
278 Form(
"Linearity;Truth energy [GeV];Measured Energy / Truth energy"));
279 TLine *l =
new TLine(0, 1, 60, 1);
281 l->SetLineColor(kGray);
290 TLegend *
leg =
new TLegend(.2, .2, 1, .45);
291 leg->SetHeader(
"#splitline{#it{#bf{sPHENIX}} Geant4 Simulation}{" + config +
"}");
292 leg->AddEntry(
"",
"",
"");
293 leg->AddEntry(QA_electron->
linearity, QA_electron->
name,
"ep");
299 p = (TPad *) c1->cd(idx++);
302 TF1 *f_calo_t1044 =
new TF1(
"f_calo_t1044",
"sqrt([0]*[0]+[1]*[1]/x)/100", 6,
304 f_calo_t1044->SetParameters(13.5, 64.9);
305 f_calo_t1044->SetLineWidth(3);
306 f_calo_t1044->SetLineColor(kGreen + 2);
308 TH1 *hframe = p->DrawFrame(0, 0, 60, 0.7,
309 Form(
"Resolution;Truth energy [GeV];#DeltaE/<E>"));
311 QA_electron->
f_res->Draw(
"same");
314 QA_PiNeg->
f_res->Draw(
"same");
317 QA_PiPos->
f_res->Draw(
"same");
320 QA_Proton->
f_res->Draw(
"same");
323 f_calo_t1044->Draw(
"same");
325 TLegend *leg =
new TLegend(.2, .6, 1, .9);
326 leg->SetHeader(
"#splitline{#it{#bf{sPHENIX}} Geant4 Simulation}{" + config +
"}");
327 leg->AddEntry(
"",
"",
"");
329 QA_electron->
name +
" " +
330 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
331 QA_electron->
f_res->GetParameter(0),
332 QA_electron->
f_res->GetParameter(1)),
334 leg->AddEntry(f_calo_t1044,
335 TString(
"T-1044 Data, #pi^{-}") +
" " +
336 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
337 f_calo_t1044->GetParameter(0),
338 f_calo_t1044->GetParameter(1)),
341 QA_PiNeg->
name +
" " +
342 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
343 QA_PiNeg->
f_res->GetParameter(0),
344 QA_PiNeg->
f_res->GetParameter(1)),
347 QA_PiPos->
name +
" " +
348 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
349 QA_PiPos->
f_res->GetParameter(0),
350 QA_PiPos->
f_res->GetParameter(1)),
353 QA_Proton->
name +
" " +
354 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
355 QA_Proton->
f_res->GetParameter(0),
356 QA_Proton->
f_res->GetParameter(1)),
361 base_dataset +
"DrawHadronShowers_" + TString(c1->GetName()), kTRUE);
366 const TString
config =
"Single #pi^{-}, " + eta_desc;
368 lin_res *QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP =
369 GetResolution(
"pi-", seta,
"h_QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP");
370 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
name =
"3x3 cluster";
372 lin_res *QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP =
373 GetResolution(
"pi-", seta,
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP");
374 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
name =
"5x5 cluster";
376 lin_res *QAG4SimJet_AntiKt_Tower_r02_Leading_Et =
377 GetResolution(
"pi-", seta,
"h_QAG4SimJet_AntiKt_Tower_r02_Leading_Et");
378 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
name =
"Anti-k_{T} R=0.2";
380 lin_res *QAG4SimJet_AntiKt_Tower_r04_Leading_Et =
381 GetResolution(
"pi-", seta,
"h_QAG4SimJet_AntiKt_Tower_r04_Leading_Et");
382 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
name =
"Anti-k_{T} R=0.4";
385 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
resolution->SetMarkerStyle(kFullCircle);
386 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
resolution->SetMarkerColor(kRed + 3);
387 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
resolution->SetLineColor(kRed + 3);
389 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
linearity->SetMarkerStyle(kFullCircle);
390 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
linearity->SetMarkerColor(kRed + 3);
391 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
linearity->SetLineColor(kRed + 3);
393 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
f_res->SetLineColor(kRed + 3);
396 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
resolution->SetMarkerStyle(kFullSquare);
397 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
resolution->SetMarkerColor(kBlue + 3);
398 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
resolution->SetLineColor(kBlue + 3);
400 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
linearity->SetMarkerStyle(kFullSquare);
401 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
linearity->SetMarkerColor(kBlue + 3);
402 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
linearity->SetLineColor(kBlue + 3);
404 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
f_res->SetLineColor(kBlue + 3);
407 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
resolution->SetMarkerStyle(kFullCross);
408 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
resolution->SetMarkerColor(kMagenta + 3);
409 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
resolution->SetLineColor(kMagenta + 3);
411 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
linearity->SetMarkerStyle(kFullCross);
412 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
linearity->SetMarkerColor(kMagenta + 3);
413 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
linearity->SetLineColor(kMagenta + 3);
415 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
f_res->SetLineColor(kMagenta + 3);
416 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
f_res->SetLineStyle(kDashed);
419 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
resolution->SetMarkerStyle(kStar);
420 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
resolution->SetMarkerColor(kCyan + 3);
421 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
resolution->SetLineColor(kCyan + 3);
423 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
linearity->SetMarkerStyle(kStar);
424 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
linearity->SetMarkerColor(kCyan + 3);
425 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
linearity->SetLineColor(kCyan + 3);
427 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
f_res->SetLineColor(kCyan + 3);
428 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
f_res->SetLineStyle(kDashed);
430 TCanvas *c1 =
new TCanvas(Form(
"ClusterSizeScan_") + seta,
431 Form(
"ClusterSizeScan_") + seta, 1300, 600);
436 p = (TPad *) c1->cd(idx++);
440 p->DrawFrame(0, 0, 60, 1.2,
441 Form(
"Linearity;Truth energy [GeV];Measured Energy / Truth energy"));
442 TLine *l =
new TLine(0, 1, 60, 1);
444 l->SetLineColor(kGray);
447 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
linearity->Draw(
"ep");
448 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
linearity->Draw(
"ep");
449 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
linearity->Draw(
"ep");
450 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
linearity->Draw(
"ep");
452 TLegend *
leg =
new TLegend(.2, .2, .85, .45);
453 leg->SetHeader(
"#splitline{#it{#bf{sPHENIX}} Geant4 Simulation}{" + config +
"}");
454 leg->AddEntry(
"",
"",
"");
455 leg->AddEntry(QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
linearity, QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
name,
"ep");
456 leg->AddEntry(QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
linearity, QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
name,
"ep");
457 leg->AddEntry(QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
linearity, QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
name,
"ep");
458 leg->AddEntry(QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
linearity, QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
name,
"ep");
461 p = (TPad *) c1->cd(idx++);
464 TF1 *f_calo_t1044 =
new TF1(
"f_calo_t1044",
"sqrt([0]*[0]+[1]*[1]/x)/100", 6,
466 f_calo_t1044->SetParameters(13.5, 64.9);
467 f_calo_t1044->SetLineWidth(3);
468 f_calo_t1044->SetLineColor(kGreen + 2);
470 TH1 *hframe = p->DrawFrame(0, 0, 60, 0.7,
471 Form(
"Resolution;Truth energy [GeV];#DeltaE/<E>"));
473 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
f_res->Draw(
"same");
474 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
resolution->Draw(
"ep");
476 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
f_res->Draw(
"same");
477 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
resolution->Draw(
"ep");
479 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
f_res->Draw(
"same");
480 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
resolution->Draw(
"ep");
482 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
f_res->Draw(
"same");
483 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
resolution->Draw(
"ep");
485 f_calo_t1044->Draw(
"same");
487 TLegend *leg =
new TLegend(.2, .6, .85, .9);
488 leg->SetHeader(
"#splitline{#it{#bf{sPHENIX}} Geant4 Simulation}{" + config +
"}");
489 leg->AddEntry(
"",
"",
"");
490 leg->AddEntry(QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
linearity,
491 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
name +
" " +
492 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
493 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
f_res->GetParameter(0),
494 QAG4Sim_CalorimeterSum_TrackProj_3x3Tower_EP->
f_res->GetParameter(1)),
496 leg->AddEntry(f_calo_t1044,
497 TString(
"T-1044 (4x4, #eta=0)") +
" " +
498 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
499 f_calo_t1044->GetParameter(0),
500 f_calo_t1044->GetParameter(1)),
502 leg->AddEntry(QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
linearity,
503 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
name +
" " +
504 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
505 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
f_res->GetParameter(0),
506 QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP->
f_res->GetParameter(1)),
508 leg->AddEntry(QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
linearity,
509 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
name +
" " +
510 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
511 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
f_res->GetParameter(0),
512 QAG4SimJet_AntiKt_Tower_r02_Leading_Et->
f_res->GetParameter(1)),
514 leg->AddEntry(QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
linearity,
515 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
name +
" " +
516 Form(
"%.1f%% #oplus %.1f%%/#sqrt{E}",
517 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
f_res->GetParameter(0),
518 QAG4SimJet_AntiKt_Tower_r04_Leading_Et->
f_res->GetParameter(1)),
523 base_dataset +
"DrawHadronShowers_" + TString(c1->GetName()), kTRUE);
527 GetResolution(TString PID =
"pi-", TString
eta =
"eta0", TString qa_histo =
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP")
529 TString dataset_name = PID +
"_" +
eta +
"_" + qa_histo;
532 const double Ps[] = {8, 12, 16, 32, 40, 50, -1, -1};
535 vector<double> mean_err;
537 vector<double> res_err;
539 TCanvas *c1 =
new TCanvas(
"GetResolution_LineShape_" + dataset_name,
540 "GetResolution_LineShape_" + dataset_name, 1800, 900);
547 for (
int i = 2;
i < 3; ++
i)
551 p = (TPad *) c1->cd(idx++);
554 const double P = Ps[
i];
556 TString sEnergy = Form(
"%.0fGeV", P);
565 TF1 *fgaus_g =
new TF1(
"fgaus_LG_g_" + dataset_name,
"gaus",
566 h->GetMean() - 4 * h->GetRMS(), h->GetMean() + 4 * h->GetRMS());
567 fgaus_g->SetParameters(1, h->GetMean(),
569 h->Fit(fgaus_g,
"MR0N");
570 fgaus_g->SetLineColor(kGray);
572 TF1 *fgaus =
new TF1(
"fgaus_LG_" + dataset_name,
"gaus",
573 fgaus_g->GetParameter(1) - 1.5 * fgaus_g->GetParameter(2),
574 fgaus_g->GetParameter(1) + 1.5 * fgaus_g->GetParameter(2));
575 fgaus->SetParameters(fgaus_g->GetParameter(0), fgaus_g->GetParameter(1),
576 fgaus_g->GetParameter(2));
577 fgaus->SetLineColor(kBlue);
578 h->Fit(fgaus,
"MR0N");
581 fgaus_g->Draw(
"same");
585 if (qa_histo.Contains(
"Leading_Et")) scale = 1. / P;
587 mean.push_back(fgaus->GetParameter(1) * scale);
588 mean_err.push_back(fgaus->GetParError(1) * scale);
589 res.push_back(fgaus->GetParameter(2) / fgaus->GetParameter(1));
590 res_err.push_back(fgaus->GetParError(2) / fgaus->GetParameter(1));
596 TGraphErrors *ge_linear =
new TGraphErrors(N, Ps,
597 &mean[0], 0, &mean_err[0]);
599 TGraphErrors *ge_res =
new TGraphErrors(N, Ps,
600 &res[0], 0, &res_err[0]);
601 ge_res->GetHistogram()->SetStats(0);
605 ret->
name = dataset_name;
608 ret->
f_res =
new TF1(
"f_calo_r_" + dataset_name,
"sqrt([0]*[0]+[1]*[1]/x)/100",
610 ge_res->Fit(ret->
f_res,
"RM0N");
613 base_dataset +
"DrawHadronShowers_" + TString(c1->GetName()), kTRUE);
625 TString dataset_name = PID +
"_" +
eta +
"_" +
energy;
626 TH1 *h_E =
new TH1F(
"h_ESumOverp_" + dataset_name, dataset_name +
" h_ESumOverp;E/p;Count per bin", 100, 0, 2);
628 TString
infile =
base_dataset +
"G4Hits_sPHENIX_" + dataset_name +
".root_g4svtx_eval.root";
630 TChain *ntp_track =
new TChain(
"ntp_track");
631 const int n = ntp_track->Add(infile);
633 cout <<
"GetEvalHisto - loaded " << n <<
" files from " << infile << endl;
635 ntp_track->Draw(
"(cemce3x3 + hcaloute3x3 + hcaline3x3)/sqrt(gpx**2+gpy**2+gpz**2)>>h_ESumOverp_" + dataset_name,
636 "nfromtruth>50 && gtrackID == 1",
"goff");
643 TH1 *
GetQAHisto(TString PID =
"pi-", TString
eta =
"eta0", TString
energy =
"16GeV", TString qa_histo =
"h_QAG4Sim_CalorimeterSum_TrackProj_5x5Tower_EP")
645 cout <<
"Weihu Ma run test " << endl;
647 TString dataset_name = PID +
"_" +
eta +
"_" +
energy;
651 cout <<
"GetQAHisto - searching " << infile << endl;
653 TChain *
T =
new TChain(
"T");
654 const int n = T->Add(infile);
656 TObjArray *fileElements = T->GetListOfFiles();
657 TIter
next(fileElements);
658 TChainElement *chEl = 0;
659 while ((chEl = (TChainElement *)
next()))
661 cout <<
"GetQAHisto - processing " << chEl->GetTitle() << endl;
663 TFile
f(chEl->GetTitle());
667 TH1 *hqa = (TH1 *)
f.GetObjectChecked(qa_histo,
"TH1");
668 cout <<
"Weihu Ma run test1 " << endl;
671 cout <<
"Weihu Ma run test4 " << endl;
674 cout <<
"Weihu Ma run test2 " << endl;
679 cout <<
"Weihu Ma run test3 " << endl;
680 h = (TH1 *) (hqa->Clone(TString(hqa->GetName()) +
"_" + dataset_name));
681 h->SetDirectory(NULL);