15 gStyle->SetOptStat(0);
16 gStyle->SetOptFit(1111);
17 TVirtualFitter::SetDefaultFitter(
"Minuit2");
18 gSystem->Load(
"libg4eval.so");
67 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm_ALL.root_EMCalAna.root",
68 const TString
title =
"HIJING Au+Au 0-10% C + Geant4")
74 EMCalAna_h_CEMC_RZ->Add(EMCalAna_h_HCALIN_RZ);
75 EMCalAna_h_CEMC_RZ->Add(EMCalAna_h_HCALOUT_RZ);
77 for (
int r = 1;
r <= EMCalAna_h_CEMC_RZ->GetNbinsY();
r++)
79 const double radius = EMCalAna_h_CEMC_RZ->GetYaxis()->GetBinCenter(
r);
80 const double circ = 2 * TMath::Pi() * radius;
81 for (
int z = 1;
z <= EMCalAna_h_CEMC_RZ->GetNbinsX();
z++)
84 EMCalAna_h_CEMC_RZ->SetBinContent(
z,
r,
85 EMCalAna_h_CEMC_RZ->GetBinContent(
z,
r) / circ);
89 TCanvas *c1 =
new TCanvas(
"DrawEnergyDensity",
"DrawEnergyDensity", 1800,
94 p = (TPad *) c1->cd(idx++);
100 EMCalAna_h_CEMC_RZ->SetTitle(
";Z (cm);Radius (cm)");
101 EMCalAna_h_CEMC_RZ->Draw(
"colz");
103 t =
new TText(.5, .95, (
title));
115 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm_ALL.root_EMCalAna.root",
116 const TString
title =
"HIJING Au+Au 0-10% C + Geant4")
122 EMCalAna_h_CEMC_RZ->Add(EMCalAna_h_HCALIN_RZ);
123 EMCalAna_h_CEMC_RZ->Add(EMCalAna_h_HCALOUT_RZ);
137 TCanvas *c1 =
new TCanvas(
"DrawEnergyDensityXY",
"DrawEnergyDensityXY", 900,
142 p = (TPad *) c1->cd(idx++);
148 EMCalAna_h_CEMC_RZ->SetTitle(
";X (cm);Y (cm)");
149 EMCalAna_h_CEMC_RZ->Draw(
"colz");
152 t =
new TText(.5, .95, (
title));
154 t->SetTextSize(0.03);
165 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/")
169 +
"/pythia8/spacal2d/G4Hits_sPHENIX_pythia8-ALL.root_EMCalAna.root",
170 "EMCalAna_h_CEMC_TOWER_4x4_max");
181 TH1F * sig_EMCalAna_h_CEMC_TOWER_4x4_max =
184 +
"../test_production/Upsilon/spacal2d/fieldon/SimALL_PythiaUpsilon.root_EMCalAna.root",
185 "EMCalAna_h_CEMC_TOWER_4x4_max");
187 TH1F * rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC =
DrawTower_Load(
189 +
"/pythia8/spacal2d/G4Hits_sPHENIX_pythia8-ALL.root_EMCalAna.root",
190 "EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC");
201 TH1F * sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC =
204 +
"../test_production/Upsilon/spacal2d/fieldon/SimALL_PythiaUpsilon.root_EMCalAna.root",
205 "EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC");
208 rej_EMCalAna_h_CEMC_TOWER_4x4_max);
210 sig_EMCalAna_h_CEMC_TOWER_4x4_max);
213 rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC);
215 sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC);
217 TCanvas *c1 =
new TCanvas(
"DrawTower_EMCTrigEff",
"DrawTower_EMCTrigEff",
223 p = (TPad *) c1->cd(idx++);
226 rej_EMCalAna_h_CEMC_TOWER_4x4_max->Draw();
227 rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Draw(
"same");
228 rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetLineColor(kRed);
229 rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetMarkerColor(kRed);
231 p = (TPad *) c1->cd(idx++);
234 sig_EMCalAna_h_CEMC_TOWER_4x4_max->Draw();
235 sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Draw(
"same");
236 sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetLineColor(kRed);
237 sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetMarkerColor(kRed);
239 p = (TPad *) c1->cd(idx++);
242 ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->Draw(
"AP*");
243 ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Draw(
"P");
244 ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetLineColor(kRed);
245 ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetMarkerColor(kRed);
247 p = (TPad *) c1->cd(idx++);
250 ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->Draw(
"AP*");
251 ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Draw(
"P");
252 ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetLineColor(kRed);
253 ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetMarkerColor(kRed);
258 TGraphErrors* reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max =
259 (TGraphErrors*) ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->Clone(
260 "reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max");
262 TGraphErrors* reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC =
263 (TGraphErrors*) ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Clone(
264 "reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC");
278 const double y_min = 1;
279 const double y_max = 1e5;
280 const double y_min2 = .8;
281 const double y_max2 = 1;
283 TGraphErrors* plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max =
284 (TGraphErrors*) reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->Clone(
285 "plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max");
286 TGraphErrors* plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max =
287 (TGraphErrors*) ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->Clone(
288 "plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max");
291 TGraphErrors* plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC =
292 (TGraphErrors*) reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Clone(
293 "plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC");
294 TGraphErrors* plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC =
295 (TGraphErrors*) ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Clone(
296 "plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC");
298 for (
int i = 0;
i < plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->GetN(); ++
i)
300 (plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->GetY())[
i] =1./(plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->GetY())[
i];
303 for (
int i = 0;
i < plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->GetN(); ++
i)
305 (plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->GetY())[
i] = exp(
307 ((plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->GetY())[
i] - y_min2)/(y_max2 - y_min2)*(log(y_max) - log(y_min)) + log(y_min)
313 for (
int i = 0;
i < plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->GetN(); ++
i)
315 (plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->GetY())[
i] =1./(plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->GetY())[
i];
318 for (
int i = 0;
i < plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->GetN(); ++
i)
320 (plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->GetY())[
i] = exp(
322 ((plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->GetY())[
i] - y_min2)/(y_max2 - y_min2)*(log(y_max) - log(y_min)) + log(y_min)
328 TCanvas *c1 =
new TCanvas(
"DrawTower_EMCTrigEff_Compile",
329 "DrawTower_EMCTrigEff_Compile", 1800, 900);
334 p = (TPad *) c1->cd(idx++);
341 p->DrawFrame(0, y_min, 5.5, y_max,
342 ";EMCal trigger #Sigma_{4x4}[ E_{Tower} ] requirement (GeV);Rejection factor for MB events");
344 TGaxis *
a =
new TGaxis(5.5,y_min,5.5, y_max,y_min2,y_max2,510,
"+L");
345 a->SetTitle(
"Trigger efficiency for inclusive Upsilon (1S)");
346 a->SetLabelColor(kRed);
347 a->SetTitleColor(kRed);
348 a->SetLineColor(kRed);
352 TLine * l =
new TLine(4.3,y_min,4.3,y_max);
353 l->SetLineColor(kGray);
357 TLatex *
t =
new TLatex(0, y_max*1.1,
"PYTHIA8 p+p #sqrt{s} = 200 GeV + Geant4 + Trigger Emulator");
360 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->SetFillColor(kRed);
361 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineColor(kRed);
362 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineWidth(3);
363 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineStyle(kDashed);
365 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->Draw(
"lx");
367 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->SetFillColor(kBlack);
368 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineColor(kBlack);
369 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineWidth(3);
370 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineStyle(kDashed);
372 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->Draw(
"lx");
375 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetFillColor(kRed);
376 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetLineColor(kRed);
377 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetLineWidth(3);
378 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Draw(
"3");
379 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Draw(
"lx");
381 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetFillColor(kBlack);
382 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetLineColor(kBlack);
383 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->SetLineWidth(3);
384 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Draw(
"3");
385 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC->Draw(
"lx");
387 TLegend * legd =
new TLegend(0.13,0.5,0.5,0.9);
390 legd->AddEntry(plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC,
"Rej. for MB (8-bit truncated)",
"lx");
393 legd->AddEntry(plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max_trigger_ADC,
"Eff. for #Upsilon (8-bit truncated)",
"lx");
395 le->SetTextColor(kRed);
397 legd->AddEntry(plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max,
"Rej. for MB (full bit ADC)",
"lx");
400 legd->AddEntry(plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max,
"Eff. for #Upsilon (full bit ADC)",
"lx");
402 le->SetTextColor(kRed);
414 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/")
418 +
"/pythia8/spacal2d/G4Hits_sPHENIX_pythia8-ALL.root_EMCalAna.root",
419 "EMCalAna_h_CEMC_TOWER_4x4_max");
430 TH1F * sig_EMCalAna_h_CEMC_TOWER_4x4_max =
433 +
"../test_production/Upsilon/spacal2d/fieldon/SimALL_PythiaUpsilon.root_EMCalAna.root",
434 "EMCalAna_h_CEMC_TOWER_4x4_max");
436 TH1F * rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC =
DrawTower_Load(
438 +
"/pythia8/spacal2d/G4Hits_sPHENIX_pythia8-ALL.root_EMCalAna.root",
439 "EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC");
450 TH1F * sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC =
453 +
"../test_production/Upsilon/spacal2d/fieldon/SimALL_PythiaUpsilon.root_EMCalAna.root",
454 "EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC");
457 rej_EMCalAna_h_CEMC_TOWER_4x4_max);
459 sig_EMCalAna_h_CEMC_TOWER_4x4_max);
462 rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC);
464 sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC);
466 TCanvas *c1 =
new TCanvas(
"DrawTower_EMCTrigEff_SlideingWindow2",
"DrawTower_EMCTrigEff_SlideingWindow2",
472 p = (TPad *) c1->cd(idx++);
475 rej_EMCalAna_h_CEMC_TOWER_4x4_max->Draw();
476 rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Draw(
"same");
477 rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetLineColor(kRed);
478 rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetMarkerColor(kRed);
480 p = (TPad *) c1->cd(idx++);
483 sig_EMCalAna_h_CEMC_TOWER_4x4_max->Draw();
484 sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Draw(
"same");
485 sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetLineColor(kRed);
486 sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetMarkerColor(kRed);
488 p = (TPad *) c1->cd(idx++);
491 ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->Draw(
"AP*");
492 ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Draw(
"P");
493 ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetLineColor(kRed);
494 ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetMarkerColor(kRed);
496 p = (TPad *) c1->cd(idx++);
499 ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->Draw(
"AP*");
500 ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Draw(
"P");
501 ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetLineColor(kRed);
502 ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetMarkerColor(kRed);
507 TGraphErrors* reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max =
508 (TGraphErrors*) ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->Clone(
509 "reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max");
511 TGraphErrors* reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC =
512 (TGraphErrors*) ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Clone(
513 "reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC");
527 const double y_min = 1;
528 const double y_max = 1e5;
529 const double y_min2 = .8;
530 const double y_max2 = 1;
532 TGraphErrors* plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max =
533 (TGraphErrors*) reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->Clone(
534 "plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max");
535 TGraphErrors* plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max =
536 (TGraphErrors*) ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->Clone(
537 "plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max");
540 TGraphErrors* plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC =
541 (TGraphErrors*) reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Clone(
542 "plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC");
543 TGraphErrors* plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC =
544 (TGraphErrors*) ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Clone(
545 "plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC");
547 for (
int i = 0;
i < plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->GetN(); ++
i)
549 (plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->GetY())[
i] =1./(plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->GetY())[
i];
552 for (
int i = 0;
i < plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->GetN(); ++
i)
554 (plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->GetY())[
i] = exp(
556 ((plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->GetY())[
i] - y_min2)/(y_max2 - y_min2)*(log(y_max) - log(y_min)) + log(y_min)
562 for (
int i = 0;
i < plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->GetN(); ++
i)
564 (plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->GetY())[
i] =1./(plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->GetY())[
i];
567 for (
int i = 0;
i < plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->GetN(); ++
i)
569 (plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->GetY())[
i] = exp(
571 ((plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->GetY())[
i] - y_min2)/(y_max2 - y_min2)*(log(y_max) - log(y_min)) + log(y_min)
577 TCanvas *c1 =
new TCanvas(
"DrawTower_EMCTrigEff_SlideingWindow2_Compile",
578 "DrawTower_EMCTrigEff_SlideingWindow2_Compile", 1800, 900);
583 p = (TPad *) c1->cd(idx++);
590 p->DrawFrame(0, y_min, 5.5, y_max,
591 ";EMCal trigger #Sigma_{4x4}[ E_{Tower} ] requirement (GeV);Rejection factor for MB events");
593 TGaxis *
a =
new TGaxis(5.5,y_min,5.5, y_max,y_min2,y_max2,510,
"+L");
594 a->SetTitle(
"Trigger efficiency for inclusive Upsilon (1S)");
595 a->SetLabelColor(kRed);
596 a->SetTitleColor(kRed);
597 a->SetLineColor(kRed);
601 TLine * l =
new TLine(4.3,y_min,4.3,y_max);
602 l->SetLineColor(kGray);
606 TLatex *
t =
new TLatex(0, y_max*1.1,
"PYTHIA8 p+p #sqrt{s} = 200 GeV + Geant4 + Trigger Emulator");
609 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->SetFillColor(kRed);
610 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineColor(kRed);
611 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineWidth(3);
612 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineStyle(kDashed);
614 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max->Draw(
"lx");
616 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->SetFillColor(kBlack);
617 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineColor(kBlack);
618 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineWidth(3);
619 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->SetLineStyle(kDashed);
621 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max->Draw(
"lx");
624 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetFillColor(kRed);
625 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetLineColor(kRed);
626 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetLineWidth(3);
627 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Draw(
"3");
628 plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Draw(
"lx");
630 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetFillColor(kBlack);
631 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetLineColor(kBlack);
632 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->SetLineWidth(3);
633 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Draw(
"3");
634 plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC->Draw(
"lx");
636 TLegend * legd =
new TLegend(0.13,0.5,0.6,0.9);
639 legd->AddEntry(plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC,
"Rej. for MB (8-bit truncated 2x2 Sum)",
"lx");
642 legd->AddEntry(plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_slide2_max_trigger_ADC,
"Eff. for #Upsilon (8-bit truncated 2x2 Sum)",
"lx");
644 le->SetTextColor(kRed);
646 legd->AddEntry(plot_ge_rej_EMCalAna_h_CEMC_TOWER_4x4_max,
"Rej. for MB (full ADC info)",
"lx");
649 legd->AddEntry(plot_reg_ge_sig_EMCalAna_h_CEMC_TOWER_4x4_max,
"Eff. for #Upsilon (full ADC info)",
"lx");
651 le->SetTextColor(kRed);
664 double threshold[10000] =
668 double eff_err[10000] =
671 assert(hCEMC3_Max->GetNbinsX()<10000);
673 const double n = hCEMC3_Max->GetSum();
676 for (
int i = hCEMC3_Max->GetNbinsX();
i >= 1;
i--)
678 pass += hCEMC3_Max->GetBinContent(
i);
680 const double pp = pass /
n;
684 const double A = z * sqrt(1. / n * pp * (1 - pp) + z * z / 4 / n / n);
685 const double B = 1 / (1 + z * z /
n);
687 threshold[cnt] = hCEMC3_Max->GetBinCenter(
i);
688 eff[cnt] = (pp + z * z / 2 /
n) * B;
689 eff_err[cnt] = A * B;
691 cout << threshold[cnt] <<
": " <<
"CL " << eff[cnt] <<
"+/-"
692 << eff_err[cnt] << endl;
695 TGraphErrors * ge =
new TGraphErrors(cnt, threshold, eff, NULL, eff_err);
703 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm_ALL.root_EMCalAna.root",
704 const TString
title =
"HIJING Au+Au 0-10% C + Geant4 + Digi.")
709 hCEMC1->Scale(1. / hCEMC1->GetSum());
710 const double mean1 = hCEMC1->GetMean();
711 hCEMC3->Scale(1. / hCEMC3->GetSum());
712 const double mean3 = hCEMC3->GetMean();
714 TCanvas *c1 =
new TCanvas(
"DrawTower_EMCDistribution",
715 "DrawTower_EMCDistribution", 1800, 900);
719 p = (TPad *) c1->cd(idx++);
725 hCEMC1->GetXaxis()->SetRangeUser(0, .6);
726 hCEMC1->SetTitle(
";EMCal Single Tower Energy [GeV];A.U.");
727 hCEMC1->SetLineColor(kBlue + 2);
728 hCEMC1->SetLineWidth(3);
732 t =
new TText(.6, .8, Form(
"Tower Mean = %.0f MeV", mean1 * 1000));
736 t =
new TText(.5, .95, (
title));
741 p = (TPad *) c1->cd(idx++);
747 hCEMC3->GetXaxis()->SetRangeUser(0, 2);
748 hCEMC3->SetTitle(
";EMCal 3x3 Tower Energy Sum [GeV];A.U.");
749 hCEMC3->SetLineColor(kRed + 2);
750 hCEMC3->SetLineWidth(3);
753 t =
new TText(.6, .8, Form(
"3x3 Tower Mean = %.0f MeV", mean3 * 1000));
765 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm_ALL.root_EMCalAna.root",
766 const TString
title =
"HIJING Au+Au 0-10% C + Geant4 + Digi.")
771 hCEMC1->Scale(1. / hCEMC1->GetSum());
772 const double mean1 = hCEMC1->GetMean();
773 hCEMC3->Scale(1. / hCEMC3->GetSum());
774 const double mean3 = hCEMC3->GetMean();
776 TCanvas *c1 =
new TCanvas(
"DrawTower_EMCDistribution5x5",
777 "DrawTower_EMCDistribution5x5", 1800, 900);
781 p = (TPad *) c1->cd(idx++);
787 hCEMC1->GetXaxis()->SetRangeUser(0, .6);
788 hCEMC1->SetTitle(
";EMCal Single Tower Energy [GeV];A.U.");
789 hCEMC1->SetLineColor(kBlue + 2);
790 hCEMC1->SetLineWidth(3);
794 t =
new TText(.6, .8, Form(
"Tower Mean = %.0f MeV", mean1 * 1000));
798 t =
new TText(.5, .95, (
title));
803 p = (TPad *) c1->cd(idx++);
809 hCEMC3->GetXaxis()->SetRangeUser(0, 2);
810 hCEMC3->SetTitle(
";EMCal 5x5 Tower Energy Sum [GeV];A.U.");
811 hCEMC3->SetLineColor(kRed + 2);
812 hCEMC3->SetLineWidth(3);
815 t =
new TText(.6, .8, Form(
"5x5 Tower Mean = %.0f MeV", mean3 * 1000));
827 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/sHijing/spacal2d/G4Hits_sPHENIX_sHijing-0-4.4fm_ALL.root_EMCalAna.root",
828 const TString hist_name =
"EMCalAna_h_CEMC_TOWER_1x1")
830 TString chian_str =
infile;
831 chian_str.ReplaceAll(
"ALL",
"*");
833 TChain *
t =
new TChain(
"T_Index");
834 const int n = t->Add(chian_str);
836 cout <<
"Loaded " << n <<
" root files with " << chian_str << endl;
841 TObjArray *fileElements = t->GetListOfFiles();
842 TIter
next(fileElements);
843 TChainElement *chEl = 0;
844 while ((chEl = (TChainElement*)
next()))
847 cout <<
"DrawTower_Load - processing " << chEl->GetTitle() << endl;
848 TFile *
f =
new TFile(chEl->GetTitle());
851 TH1 *
h = (TH1 *) f->GetObjectChecked(hist_name,
"TH1");
857 h_sum = (TH1 *) h->Clone();
858 h_sum->ResetBit(kMustCleanup);
874 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/single_particle/",
875 const TString
config =
"")
877 gStyle->SetOptStat(0);
878 gStyle->SetOptFit(0);
901 base +
"/spacal2d/zerofield/G4Hits_sPHENIX",
"gamma_eta0",
true);
903 base +
"/spacal2d/zerofield/G4Hits_sPHENIX",
"gamma_eta0.90",
true);
906 base +
"/spacal1d/zerofield/G4Hits_sPHENIX",
"gamma_eta0",
true);
908 base +
"/spacal1d/zerofield/G4Hits_sPHENIX",
"gamma_eta0.90",
true);
910 TCanvas *c1 =
new TCanvas(
"DrawCluster_Linearality",
911 "DrawCluster_Linearality", 1100, 900);
916 p = (TPad *) c1->cd(idx++);
922 p->DrawFrame(0, 0, 55, 55,
923 ";Incoming Energy (GeV);Reconstructed cluster energy, E_{reco} (GeV)");
924 TLine * l =
new TLine(0, 0, 55, 55);
925 l->SetLineColor(kGray);
928 TLegend * lg =
new TLegend(1, 42, 44, 53, NULL,
"br");
929 TLegend * lg2 =
new TLegend(12, 40 - 40, 43 + 12, 51 - 40, NULL,
"br");
931 p = (TPad *) c1->cd(idx);
934 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"pol2", 0.5, 60);
935 gamma_eta0->Fit(f_calo,
"RM0");
937 double * Ys = gamma_eta0->GetY();
938 for (
int i = 0;
i < gamma_eta0->GetN();
i++)
940 Ys[
i] /= f_calo->GetParameter(1);
942 gamma_eta0->Fit(f_calo,
"RM0");
944 gamma_eta0->SetLineColor(kRed + 1);
945 gamma_eta0->SetMarkerColor(kRed + 1);
946 gamma_eta0->SetLineWidth(2);
947 gamma_eta0->SetMarkerStyle(kFullSquare);
948 gamma_eta0->SetMarkerSize(2);
949 f_calo->SetLineColor(kRed + 1);
950 f_calo->SetLineWidth(2);
952 gamma_eta0->Draw(
"p");
953 f_calo->Draw(
"same");
955 TString ltitle = Form(
956 "2D-proj., #eta = 0.0-0.1, E_{reco} ~ %.2f E + %.1e E^{2} ",
957 f_calo->GetParameter(1), f_calo->GetParameter(2));
958 lg->AddEntry(gamma_eta0, ltitle.Data(),
"pl");
960 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9",
"pol2", 0.5, 60);
961 gamma_eta9->Fit(f_calo,
"RM0");
962 double * Ys = gamma_eta9->GetY();
963 for (
int i = 0;
i < gamma_eta9->GetN();
i++)
965 Ys[
i] /= f_calo->GetParameter(1);
967 gamma_eta9->Fit(f_calo,
"RM0");
969 gamma_eta9->SetLineColor(kRed + 3);
970 gamma_eta9->SetMarkerColor(kRed + 3);
971 gamma_eta9->SetLineWidth(2);
972 gamma_eta9->SetMarkerStyle(kFullCircle);
973 gamma_eta9->SetMarkerSize(2);
974 f_calo->SetLineColor(kRed + 3);
975 f_calo->SetLineWidth(2);
977 gamma_eta9->Draw(
"p");
978 f_calo->Draw(
"same");
980 TString ltitle = Form(
981 "2D-proj., #eta = 0.9-1.0, E_{reco} ~ %.2f E + %.1e E^{2} ",
982 f_calo->GetParameter(1), f_calo->GetParameter(2));
983 lg->AddEntry(gamma_eta9, ltitle.Data(),
"pl");
984 cout <<
"Title = " << ltitle << endl;
988 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"pol2", 0.5, 60);
989 gamma_eta0_1d->Fit(f_calo,
"RM0");
990 double * Ys = gamma_eta0_1d->GetY();
991 for (
int i = 0;
i < gamma_eta0_1d->GetN();
i++)
993 Ys[
i] /= f_calo->GetParameter(1);
995 gamma_eta0_1d->Fit(f_calo,
"RM0");
997 gamma_eta0_1d->SetLineColor(kBlue + 1);
998 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
999 gamma_eta0_1d->SetLineWidth(2);
1000 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
1001 gamma_eta0_1d->SetMarkerSize(2);
1002 f_calo->SetLineColor(kBlue + 1);
1003 f_calo->SetLineWidth(2);
1005 gamma_eta0_1d->Draw(
"p");
1006 f_calo->Draw(
"same");
1008 TString ltitle = Form(
1009 "1D-proj., #eta = 0.0-0.1, E_{reco} ~ %.2f E + %.1e E^{2} ",
1010 f_calo->GetParameter(1), f_calo->GetParameter(2));
1011 lg2->AddEntry(gamma_eta0_1d, ltitle.Data(),
"pl");
1015 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9_1d",
"pol2", 0.5, 60);
1016 gamma_eta9_1d->Fit(f_calo,
"RM0");
1017 double * Ys = gamma_eta9_1d->GetY();
1018 for (
int i = 0;
i < gamma_eta9_1d->GetN();
i++)
1020 Ys[
i] /= f_calo->GetParameter(1);
1022 gamma_eta9_1d->Fit(f_calo,
"RM0");
1024 gamma_eta9_1d->SetLineColor(kBlue + 3);
1025 gamma_eta9_1d->SetMarkerColor(kBlue + 3);
1026 gamma_eta9_1d->SetLineWidth(2);
1027 gamma_eta9_1d->SetMarkerStyle(kOpenCircle);
1028 gamma_eta9_1d->SetMarkerSize(2);
1029 f_calo->SetLineColor(kBlue + 3);
1030 f_calo->SetLineWidth(2);
1032 gamma_eta9_1d->Draw(
"p");
1033 f_calo->Draw(
"same");
1035 TString ltitle = Form(
1036 "1D-proj., #eta = 0.9-1.0, E_{reco} ~ %.2f E + %.1e E^{2} ",
1037 f_calo->GetParameter(1), f_calo->GetParameter(2));
1038 lg2->AddEntry(gamma_eta9_1d, ltitle.Data(),
"pl");
1039 cout <<
"Title = " << ltitle << endl;
1044 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
1049 const TString base =
1050 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/single_particle/",
1051 const TString
config =
"")
1053 gStyle->SetOptStat(0);
1054 gStyle->SetOptFit(0);
1068 base +
"/spacal2d/zerofield/G4Hits_sPHENIX",
"gamma_eta0",
false);
1070 base +
"/spacal2d/zerofield/G4Hits_sPHENIX",
"gamma_eta0.90",
false);
1073 base +
"/spacal1d/zerofield/G4Hits_sPHENIX",
"gamma_eta0",
false);
1075 base +
"/spacal1d/zerofield/G4Hits_sPHENIX",
"gamma_eta0.90",
false);
1077 TCanvas *c1 =
new TCanvas(
"DrawCluster_Res_2Fit",
"DrawCluster_Res_2Fit",
1083 p = (TPad *) c1->cd(idx++);
1089 p->DrawFrame(0, 0, 35, 20
e-2,
1090 ";Incoming Energy (GeV);Relative energy resolution, #DeltaE/E");
1092 TLegend * lg =
new TLegend(2, 9.6
e-2, 17, 19.6
e-2, NULL,
"br");
1093 TLegend * lg2 =
new TLegend(16, 9
e-2, 33, 19
e-2, NULL,
"br");
1095 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1097 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0",
"([0]+[1]/sqrt(x))/100", 0.5,
1099 gamma_eta0->Fit(f_calo,
"RM0");
1100 gamma_eta0->Fit(f_calo_l,
"RM0");
1102 gamma_eta0->SetLineColor(kRed + 1);
1103 gamma_eta0->SetMarkerColor(kRed + 1);
1104 gamma_eta0->SetLineWidth(2);
1105 gamma_eta0->SetMarkerStyle(kFullSquare);
1106 gamma_eta0->SetMarkerSize(2);
1107 f_calo->SetLineColor(kRed + 1);
1108 f_calo->SetLineWidth(2);
1109 f_calo_l->SetLineColor(kRed + 1);
1110 f_calo_l->SetLineWidth(2);
1111 f_calo_l->SetLineStyle(kDashed);
1113 f_calo->Draw(
"same");
1114 f_calo_l->Draw(
"same");
1115 gamma_eta0->Draw(
"p");
1117 lg->AddEntry(gamma_eta0,
1118 Form(
"2D-proj., #eta = 0.0-0.1", f_calo->GetParameter(0),
1119 f_calo->GetParameter(1)),
"p");
1120 lg2->AddEntry(f_calo,
1121 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1122 f_calo->GetParameter(1)),
"l");
1123 TLegendEntry *
entry = lg2->AddEntry(f_calo_l,
1124 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1125 f_calo_l->GetParameter(1)),
"l");
1126 entry->SetTextColor(kGray + 1);
1128 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1130 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta9",
"([0]+[1]/sqrt(x))/100", 0.5,
1132 gamma_eta9->Fit(f_calo,
"RM0");
1133 gamma_eta9->Fit(f_calo_l,
"RM0");
1135 gamma_eta9->SetLineColor(kRed + 3);
1136 gamma_eta9->SetMarkerColor(kRed + 3);
1137 gamma_eta9->SetLineWidth(2);
1138 gamma_eta9->SetMarkerStyle(kFullCircle);
1139 gamma_eta9->SetMarkerSize(2);
1140 f_calo->SetLineColor(kRed + 3);
1141 f_calo->SetLineWidth(2);
1142 f_calo_l->SetLineColor(kRed + 3);
1143 f_calo_l->SetLineWidth(2);
1144 f_calo_l->SetLineStyle(kDashed);
1146 f_calo->Draw(
"same");
1147 f_calo_l->Draw(
"same");
1148 gamma_eta9->Draw(
"p");
1150 TString ltitle = Form(
"2D-proj., #eta = 0.9-1.0", f_calo->GetParameter(0),
1151 f_calo->GetParameter(1));
1152 lg->AddEntry(gamma_eta9, ltitle.Data(),
"p");
1153 lg2->AddEntry(f_calo,
1154 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1155 f_calo->GetParameter(1)),
"l");
1156 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1157 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1158 f_calo_l->GetParameter(1)),
"l");
1159 entry->SetTextColor(kGray + 1);
1160 cout <<
"Title = " << ltitle << endl;
1162 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1164 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1166 gamma_eta0_1d->Fit(f_calo,
"RM0");
1167 gamma_eta0_1d->Fit(f_calo_l,
"RM0");
1169 gamma_eta0_1d->SetLineColor(kBlue + 1);
1170 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
1171 gamma_eta0_1d->SetLineWidth(2);
1172 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
1173 gamma_eta0_1d->SetMarkerSize(2);
1174 f_calo->SetLineColor(kBlue + 1);
1175 f_calo->SetLineWidth(2);
1176 f_calo_l->SetLineColor(kBlue + 1);
1177 f_calo_l->SetLineWidth(2);
1178 f_calo_l->SetLineStyle(kDashed);
1180 f_calo->Draw(
"same");
1181 f_calo_l->Draw(
"same");
1182 gamma_eta0_1d->Draw(
"p");
1184 TString ltitle = Form(
"1D-proj., #eta = 0.0-0.1", f_calo->GetParameter(0),
1185 f_calo->GetParameter(1));
1186 lg->AddEntry(gamma_eta0_1d, ltitle.Data(),
"p");
1187 lg2->AddEntry(f_calo,
1188 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1189 f_calo->GetParameter(1)),
"l");
1190 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1191 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1192 f_calo_l->GetParameter(1)),
"l");
1193 entry->SetTextColor(kGray + 1);
1195 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1197 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1199 gamma_eta9_1d->Fit(f_calo,
"RM0");
1200 gamma_eta9_1d->Fit(f_calo_l,
"RM0");
1202 gamma_eta9_1d->SetLineColor(kBlue + 3);
1203 gamma_eta9_1d->SetMarkerColor(kBlue + 3);
1204 gamma_eta9_1d->SetLineWidth(2);
1205 gamma_eta9_1d->SetMarkerStyle(kOpenCircle);
1206 gamma_eta9_1d->SetMarkerSize(2);
1207 f_calo->SetLineColor(kBlue + 3);
1208 f_calo->SetLineWidth(2);
1209 f_calo_l->SetLineColor(kBlue + 3);
1210 f_calo_l->SetLineWidth(2);
1211 f_calo_l->SetLineStyle(kDashed);
1213 f_calo->Draw(
"same");
1214 f_calo_l->Draw(
"same");
1215 gamma_eta9_1d->Draw(
"p");
1217 TString ltitle = Form(
"1D-proj., #eta = 0.9-1.0", f_calo->GetParameter(0),
1218 f_calo->GetParameter(1));
1219 lg->AddEntry(gamma_eta9_1d, ltitle.Data(),
"p");
1220 lg2->AddEntry(f_calo,
1221 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1222 f_calo->GetParameter(1)),
"l");
1223 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1224 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1225 f_calo_l->GetParameter(1)),
"l");
1226 entry->SetTextColor(kGray + 1);
1227 cout <<
"Title = " << ltitle << endl;
1232 TLatex *
t =
new TLatex(0, 0.205,
"Single photon in full sPHENIX detector");
1235 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
1241 const TString base =
1242 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/",
1243 const TString
config =
"")
1245 gStyle->SetOptStat(0);
1246 gStyle->SetOptFit(0);
1249 base +
"/nosvtx/spacal2d/fieldmap/G4Hits_sPHENIX",
"e-_eta0",
false);
1251 base +
"/nosvtx/spacal2d/fieldmap/G4Hits_sPHENIX",
"e-_eta0.90",
false);
1254 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"e-_eta0",
false);
1256 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"e-_eta0.90",
false);
1259 TCanvas *c1 =
new TCanvas(
"DrawCluster_Res_2Fit_Electron_NoSVX",
"DrawCluster_Res_2Fit_Electron_NoSVX",
1265 p = (TPad *) c1->cd(idx++);
1271 p->DrawFrame(0, 0, 35, 20
e-2,
1272 ";Incoming Energy (GeV);Relative energy resolution, #DeltaE/E");
1274 TLegend * lg =
new TLegend(2, 9.6
e-2, 17, 19.6
e-2, NULL,
"br");
1275 TLegend * lg2 =
new TLegend(16, 9
e-2, 33, 19
e-2, NULL,
"br");
1277 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1279 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0",
"([0]+[1]/sqrt(x))/100", 0.5,
1281 gamma_eta0->Fit(f_calo,
"RM0");
1282 gamma_eta0->Fit(f_calo_l,
"RM0");
1284 gamma_eta0->SetLineColor(kRed + 1);
1285 gamma_eta0->SetMarkerColor(kRed + 1);
1286 gamma_eta0->SetLineWidth(2);
1287 gamma_eta0->SetMarkerStyle(kFullSquare);
1288 gamma_eta0->SetMarkerSize(2);
1289 f_calo->SetLineColor(kRed + 1);
1290 f_calo->SetLineWidth(2);
1291 f_calo_l->SetLineColor(kRed + 1);
1292 f_calo_l->SetLineWidth(2);
1293 f_calo_l->SetLineStyle(kDashed);
1295 f_calo->Draw(
"same");
1296 f_calo_l->Draw(
"same");
1297 gamma_eta0->Draw(
"p");
1299 lg->AddEntry(gamma_eta0,
1300 Form(
"2D-proj., #eta = 0.0-0.1", f_calo->GetParameter(0),
1301 f_calo->GetParameter(1)),
"p");
1302 lg2->AddEntry(f_calo,
1303 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1304 f_calo->GetParameter(1)),
"l");
1305 TLegendEntry *
entry = lg2->AddEntry(f_calo_l,
1306 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1307 f_calo_l->GetParameter(1)),
"l");
1308 entry->SetTextColor(kGray + 1);
1310 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1312 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta9",
"([0]+[1]/sqrt(x))/100", 0.5,
1314 gamma_eta9->Fit(f_calo,
"RM0");
1315 gamma_eta9->Fit(f_calo_l,
"RM0");
1317 gamma_eta9->SetLineColor(kRed + 3);
1318 gamma_eta9->SetMarkerColor(kRed + 3);
1319 gamma_eta9->SetLineWidth(2);
1320 gamma_eta9->SetMarkerStyle(kFullCircle);
1321 gamma_eta9->SetMarkerSize(2);
1322 f_calo->SetLineColor(kRed + 3);
1323 f_calo->SetLineWidth(2);
1324 f_calo_l->SetLineColor(kRed + 3);
1325 f_calo_l->SetLineWidth(2);
1326 f_calo_l->SetLineStyle(kDashed);
1328 f_calo->Draw(
"same");
1329 f_calo_l->Draw(
"same");
1330 gamma_eta9->Draw(
"p");
1332 TString ltitle = Form(
"2D-proj., #eta = 0.9-1.0", f_calo->GetParameter(0),
1333 f_calo->GetParameter(1));
1334 lg->AddEntry(gamma_eta9, ltitle.Data(),
"p");
1335 lg2->AddEntry(f_calo,
1336 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1337 f_calo->GetParameter(1)),
"l");
1338 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1339 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1340 f_calo_l->GetParameter(1)),
"l");
1341 entry->SetTextColor(kGray + 1);
1342 cout <<
"Title = " << ltitle << endl;
1344 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1346 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1348 gamma_eta0_1d->Fit(f_calo,
"RM0");
1349 gamma_eta0_1d->Fit(f_calo_l,
"RM0");
1351 gamma_eta0_1d->SetLineColor(kBlue + 1);
1352 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
1353 gamma_eta0_1d->SetLineWidth(2);
1354 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
1355 gamma_eta0_1d->SetMarkerSize(2);
1356 f_calo->SetLineColor(kBlue + 1);
1357 f_calo->SetLineWidth(2);
1358 f_calo_l->SetLineColor(kBlue + 1);
1359 f_calo_l->SetLineWidth(2);
1360 f_calo_l->SetLineStyle(kDashed);
1362 f_calo->Draw(
"same");
1363 f_calo_l->Draw(
"same");
1364 gamma_eta0_1d->Draw(
"p");
1366 TString ltitle = Form(
"1D-proj., #eta = 0.0-0.1", f_calo->GetParameter(0),
1367 f_calo->GetParameter(1));
1368 lg->AddEntry(gamma_eta0_1d, ltitle.Data(),
"p");
1369 lg2->AddEntry(f_calo,
1370 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1371 f_calo->GetParameter(1)),
"l");
1372 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1373 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1374 f_calo_l->GetParameter(1)),
"l");
1375 entry->SetTextColor(kGray + 1);
1377 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1379 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1381 gamma_eta9_1d->Fit(f_calo,
"RM0");
1382 gamma_eta9_1d->Fit(f_calo_l,
"RM0");
1384 gamma_eta9_1d->SetLineColor(kBlue + 3);
1385 gamma_eta9_1d->SetMarkerColor(kBlue + 3);
1386 gamma_eta9_1d->SetLineWidth(2);
1387 gamma_eta9_1d->SetMarkerStyle(kOpenCircle);
1388 gamma_eta9_1d->SetMarkerSize(2);
1389 f_calo->SetLineColor(kBlue + 3);
1390 f_calo->SetLineWidth(2);
1391 f_calo_l->SetLineColor(kBlue + 3);
1392 f_calo_l->SetLineWidth(2);
1393 f_calo_l->SetLineStyle(kDashed);
1395 f_calo->Draw(
"same");
1396 f_calo_l->Draw(
"same");
1397 gamma_eta9_1d->Draw(
"p");
1399 TString ltitle = Form(
"1D-proj., #eta = 0.9-1.0", f_calo->GetParameter(0),
1400 f_calo->GetParameter(1));
1401 lg->AddEntry(gamma_eta9_1d, ltitle.Data(),
"p");
1402 lg2->AddEntry(f_calo,
1403 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1404 f_calo->GetParameter(1)),
"l");
1405 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1406 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1407 f_calo_l->GetParameter(1)),
"l");
1408 entry->SetTextColor(kGray + 1);
1409 cout <<
"Title = " << ltitle << endl;
1415 TLatex *
t =
new TLatex(0, 0.205,
"Single electron in sPHENIX calorimetry (no tracker)");
1419 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
1425 const TString base =
1426 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/",
1427 const TString
config =
"")
1429 gStyle->SetOptStat(0);
1430 gStyle->SetOptFit(0);
1454 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"e-_eta0",
false);
1456 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"e-_eta0.90",
false);
1459 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"gamma_eta0",
false);
1461 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"gamma_eta0.90",
1463 TCanvas *c1 =
new TCanvas(
"DrawCluster_Res_2Fit_1DSpacalNoSVX",
1464 "DrawCluster_Res_2Fit_1DSpacalNoSVX", 1100, 900);
1469 p = (TPad *) c1->cd(idx++);
1475 p->DrawFrame(0, 0, 35, 20
e-2,
1476 ";Incoming Energy (GeV);Relative energy resolution, #DeltaE/E");
1478 TLegend * lg =
new TLegend(2, 9.6
e-2, 17, 19.6
e-2, NULL,
"br");
1479 TLegend * lg2 =
new TLegend(16, 9
e-2, 33, 19
e-2, NULL,
"br");
1481 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1483 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0",
"([0]+[1]/sqrt(x))/100", 0.5,
1485 gamma_eta0->Fit(f_calo,
"RM0");
1486 gamma_eta0->Fit(f_calo_l,
"RM0");
1488 gamma_eta0->SetLineColor(kRed + 1);
1489 gamma_eta0->SetMarkerColor(kRed + 1);
1490 gamma_eta0->SetLineWidth(2);
1491 gamma_eta0->SetMarkerStyle(kFullSquare);
1492 gamma_eta0->SetMarkerSize(2);
1493 f_calo->SetLineColor(kRed + 1);
1494 f_calo->SetLineWidth(2);
1495 f_calo_l->SetLineColor(kRed + 1);
1496 f_calo_l->SetLineWidth(2);
1497 f_calo_l->SetLineStyle(kDashed);
1499 f_calo->Draw(
"same");
1500 f_calo_l->Draw(
"same");
1501 gamma_eta0->Draw(
"p");
1503 lg->AddEntry(gamma_eta0,
1504 Form(
"Electrons, #eta = 0.0-0.1", f_calo->GetParameter(0),
1505 f_calo->GetParameter(1)),
"p");
1506 lg2->AddEntry(f_calo,
1507 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1508 f_calo->GetParameter(1)),
"l");
1509 TLegendEntry *
entry = lg2->AddEntry(f_calo_l,
1510 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1511 f_calo_l->GetParameter(1)),
"l");
1512 entry->SetTextColor(kGray + 1);
1514 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1516 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta9",
"([0]+[1]/sqrt(x))/100", 0.5,
1518 gamma_eta9->Fit(f_calo,
"RM0");
1519 gamma_eta9->Fit(f_calo_l,
"RM0");
1521 gamma_eta9->SetLineColor(kRed + 3);
1522 gamma_eta9->SetMarkerColor(kRed + 3);
1523 gamma_eta9->SetLineWidth(2);
1524 gamma_eta9->SetMarkerStyle(kFullCircle);
1525 gamma_eta9->SetMarkerSize(2);
1526 f_calo->SetLineColor(kRed + 3);
1527 f_calo->SetLineWidth(2);
1528 f_calo_l->SetLineColor(kRed + 3);
1529 f_calo_l->SetLineWidth(2);
1530 f_calo_l->SetLineStyle(kDashed);
1532 f_calo->Draw(
"same");
1533 f_calo_l->Draw(
"same");
1534 gamma_eta9->Draw(
"p");
1536 TString ltitle = Form(
"Electrons, #eta = 0.9-1.0", f_calo->GetParameter(0),
1537 f_calo->GetParameter(1));
1538 lg->AddEntry(gamma_eta9, ltitle.Data(),
"p");
1539 lg2->AddEntry(f_calo,
1540 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1541 f_calo->GetParameter(1)),
"l");
1542 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1543 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1544 f_calo_l->GetParameter(1)),
"l");
1545 entry->SetTextColor(kGray + 1);
1546 cout <<
"Title = " << ltitle << endl;
1548 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1550 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1552 gamma_eta0_1d->Fit(f_calo,
"RM0");
1553 gamma_eta0_1d->Fit(f_calo_l,
"RM0");
1555 gamma_eta0_1d->SetLineColor(kBlue + 1);
1556 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
1557 gamma_eta0_1d->SetLineWidth(2);
1558 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
1559 gamma_eta0_1d->SetMarkerSize(2);
1560 f_calo->SetLineColor(kBlue + 1);
1561 f_calo->SetLineWidth(2);
1562 f_calo_l->SetLineColor(kBlue + 1);
1563 f_calo_l->SetLineWidth(2);
1564 f_calo_l->SetLineStyle(kDashed);
1566 f_calo->Draw(
"same");
1567 f_calo_l->Draw(
"same");
1568 gamma_eta0_1d->Draw(
"p");
1570 TString ltitle = Form(
"Photons, #eta = 0.0-0.1", f_calo->GetParameter(0),
1571 f_calo->GetParameter(1));
1572 lg->AddEntry(gamma_eta0_1d, ltitle.Data(),
"p");
1573 lg2->AddEntry(f_calo,
1574 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1575 f_calo->GetParameter(1)),
"l");
1576 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1577 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1578 f_calo_l->GetParameter(1)),
"l");
1579 entry->SetTextColor(kGray + 1);
1581 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1583 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1585 gamma_eta9_1d->Fit(f_calo,
"RM0");
1586 gamma_eta9_1d->Fit(f_calo_l,
"RM0");
1588 gamma_eta9_1d->SetLineColor(kBlue + 3);
1589 gamma_eta9_1d->SetMarkerColor(kBlue + 3);
1590 gamma_eta9_1d->SetLineWidth(2);
1591 gamma_eta9_1d->SetMarkerStyle(kOpenCircle);
1592 gamma_eta9_1d->SetMarkerSize(2);
1593 f_calo->SetLineColor(kBlue + 3);
1594 f_calo->SetLineWidth(2);
1595 f_calo_l->SetLineColor(kBlue + 3);
1596 f_calo_l->SetLineWidth(2);
1597 f_calo_l->SetLineStyle(kDashed);
1599 f_calo->Draw(
"same");
1600 f_calo_l->Draw(
"same");
1601 gamma_eta9_1d->Draw(
"p");
1603 TString ltitle = Form(
"Photons, #eta = 0.9-1.0", f_calo->GetParameter(0),
1604 f_calo->GetParameter(1));
1605 lg->AddEntry(gamma_eta9_1d, ltitle.Data(),
"p");
1606 lg2->AddEntry(f_calo,
1607 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1608 f_calo->GetParameter(1)),
"l");
1609 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1610 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1611 f_calo_l->GetParameter(1)),
"l");
1612 entry->SetTextColor(kGray + 1);
1613 cout <<
"Title = " << ltitle << endl;
1618 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
1623 const TString base =
1624 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/",
1625 const TString
config =
"")
1627 gStyle->SetOptStat(0);
1628 gStyle->SetOptFit(0);
1652 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"e-_eta0.30",
false);
1655 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"gamma_eta0.30",
1657 TCanvas *c1 =
new TCanvas(
"DrawCluster_Res_2Fit_1DSpacalNoSVX_Eta3",
1658 "DrawCluster_Res_2Fit_1DSpacalNoSVX_Eta3", 1100, 900);
1663 p = (TPad *) c1->cd(idx++);
1669 p->DrawFrame(0, 0, 35, 20
e-2,
1670 ";Incoming Energy (GeV);Relative energy resolution, #DeltaE/E");
1672 TLegend * lg =
new TLegend(2, 10
e-2, 17, 20
e-2, NULL,
"br");
1673 TLegend * lg2 =
new TLegend(16, 9
e-2, 33, 19
e-2, NULL,
"br");
1675 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1677 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0",
"([0]+[1]/sqrt(x))/100", 0.5,
1679 gamma_eta0->Fit(f_calo,
"RM0");
1680 gamma_eta0->Fit(f_calo_l,
"RM0");
1682 gamma_eta0->SetLineColor(kRed + 1);
1683 gamma_eta0->SetMarkerColor(kRed + 1);
1684 gamma_eta0->SetLineWidth(2);
1685 gamma_eta0->SetMarkerStyle(kFullSquare);
1686 gamma_eta0->SetMarkerSize(2);
1687 f_calo->SetLineColor(kRed + 1);
1688 f_calo->SetLineWidth(2);
1689 f_calo_l->SetLineColor(kRed + 1);
1690 f_calo_l->SetLineWidth(2);
1691 f_calo_l->SetLineStyle(kDashed);
1693 f_calo->Draw(
"same");
1694 f_calo_l->Draw(
"same");
1695 gamma_eta0->Draw(
"p");
1697 lg->AddEntry(gamma_eta0,
1698 Form(
"Electrons, #eta = 0.3-0.4", f_calo->GetParameter(0),
1699 f_calo->GetParameter(1)),
"p");
1700 lg2->AddEntry(f_calo,
1701 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1702 f_calo->GetParameter(1)),
"l");
1703 TLegendEntry *
entry = lg2->AddEntry(f_calo_l,
1704 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1705 f_calo_l->GetParameter(1)),
"l");
1706 entry->SetTextColor(kGray + 1);
1708 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1710 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1712 gamma_eta0_1d->Fit(f_calo,
"RM0");
1713 gamma_eta0_1d->Fit(f_calo_l,
"RM0");
1715 gamma_eta0_1d->SetLineColor(kBlue + 1);
1716 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
1717 gamma_eta0_1d->SetLineWidth(2);
1718 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
1719 gamma_eta0_1d->SetMarkerSize(2);
1720 f_calo->SetLineColor(kBlue + 1);
1721 f_calo->SetLineWidth(2);
1722 f_calo_l->SetLineColor(kBlue + 1);
1723 f_calo_l->SetLineWidth(2);
1724 f_calo_l->SetLineStyle(kDashed);
1726 f_calo->Draw(
"same");
1727 f_calo_l->Draw(
"same");
1728 gamma_eta0_1d->Draw(
"p");
1730 TString ltitle = Form(
"Photons, #eta = 0.3-0.4", f_calo->GetParameter(0),
1731 f_calo->GetParameter(1));
1732 lg->AddEntry(gamma_eta0_1d, ltitle.Data(),
"p");
1733 lg2->AddEntry(f_calo,
1734 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1735 f_calo->GetParameter(1)),
"l");
1736 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1737 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1738 f_calo_l->GetParameter(1)),
"l");
1739 entry->SetTextColor(kGray + 1);
1744 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
1749 const TString base =
1750 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/",
1751 const TString
config =
"")
1753 gStyle->SetOptStat(0);
1754 gStyle->SetOptFit(0);
1778 base +
"/nosvtx/spacal2d/fieldmap/G4Hits_sPHENIX",
"e-_eta0",
false);
1780 base +
"/nosvtx/spacal2d/fieldmap/G4Hits_sPHENIX",
"e-_eta0.90",
false);
1783 base +
"/nosvtx/spacal2d/fieldmap/G4Hits_sPHENIX",
"gamma_eta0",
false);
1785 base +
"/nosvtx/spacal2d/fieldmap/G4Hits_sPHENIX",
"gamma_eta0.90",
1787 TCanvas *c1 =
new TCanvas(
"DrawCluster_Res_2Fit_2DSpacalNoSVX",
1788 "DrawCluster_Res_2Fit_2DSpacalNoSVX", 1100, 900);
1793 p = (TPad *) c1->cd(idx++);
1799 p->DrawFrame(0, 0, 35, 20
e-2,
1800 ";Incoming Energy (GeV);Relative energy resolution, #DeltaE/E");
1802 TLegend * lg =
new TLegend(2, 9.6
e-2, 17, 19.6
e-2, NULL,
"br");
1803 TLegend * lg2 =
new TLegend(16, 9
e-2, 33, 19
e-2, NULL,
"br");
1805 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1807 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0",
"([0]+[1]/sqrt(x))/100", 0.5,
1809 gamma_eta0->Fit(f_calo,
"RM0");
1810 gamma_eta0->Fit(f_calo_l,
"RM0");
1812 gamma_eta0->SetLineColor(kRed + 1);
1813 gamma_eta0->SetMarkerColor(kRed + 1);
1814 gamma_eta0->SetLineWidth(2);
1815 gamma_eta0->SetMarkerStyle(kFullSquare);
1816 gamma_eta0->SetMarkerSize(2);
1817 f_calo->SetLineColor(kRed + 1);
1818 f_calo->SetLineWidth(2);
1819 f_calo_l->SetLineColor(kRed + 1);
1820 f_calo_l->SetLineWidth(2);
1821 f_calo_l->SetLineStyle(kDashed);
1823 f_calo->Draw(
"same");
1824 f_calo_l->Draw(
"same");
1825 gamma_eta0->Draw(
"p");
1827 lg->AddEntry(gamma_eta0,
1828 Form(
"Electrons, #eta = 0.0-0.1", f_calo->GetParameter(0),
1829 f_calo->GetParameter(1)),
"p");
1830 lg2->AddEntry(f_calo,
1831 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1832 f_calo->GetParameter(1)),
"l");
1833 TLegendEntry *
entry = lg2->AddEntry(f_calo_l,
1834 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1835 f_calo_l->GetParameter(1)),
"l");
1836 entry->SetTextColor(kGray + 1);
1838 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1840 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta9",
"([0]+[1]/sqrt(x))/100", 0.5,
1842 gamma_eta9->Fit(f_calo,
"RM0");
1843 gamma_eta9->Fit(f_calo_l,
"RM0");
1845 gamma_eta9->SetLineColor(kRed + 3);
1846 gamma_eta9->SetMarkerColor(kRed + 3);
1847 gamma_eta9->SetLineWidth(2);
1848 gamma_eta9->SetMarkerStyle(kFullCircle);
1849 gamma_eta9->SetMarkerSize(2);
1850 f_calo->SetLineColor(kRed + 3);
1851 f_calo->SetLineWidth(2);
1852 f_calo_l->SetLineColor(kRed + 3);
1853 f_calo_l->SetLineWidth(2);
1854 f_calo_l->SetLineStyle(kDashed);
1856 f_calo->Draw(
"same");
1857 f_calo_l->Draw(
"same");
1858 gamma_eta9->Draw(
"p");
1860 TString ltitle = Form(
"Electrons, #eta = 0.9-1.0", f_calo->GetParameter(0),
1861 f_calo->GetParameter(1));
1862 lg->AddEntry(gamma_eta9, ltitle.Data(),
"p");
1863 lg2->AddEntry(f_calo,
1864 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1865 f_calo->GetParameter(1)),
"l");
1866 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1867 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1868 f_calo_l->GetParameter(1)),
"l");
1869 entry->SetTextColor(kGray + 1);
1870 cout <<
"Title = " << ltitle << endl;
1872 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1874 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1876 gamma_eta0_1d->Fit(f_calo,
"RM0");
1877 gamma_eta0_1d->Fit(f_calo_l,
"RM0");
1879 gamma_eta0_1d->SetLineColor(kBlue + 1);
1880 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
1881 gamma_eta0_1d->SetLineWidth(2);
1882 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
1883 gamma_eta0_1d->SetMarkerSize(2);
1884 f_calo->SetLineColor(kBlue + 1);
1885 f_calo->SetLineWidth(2);
1886 f_calo_l->SetLineColor(kBlue + 1);
1887 f_calo_l->SetLineWidth(2);
1888 f_calo_l->SetLineStyle(kDashed);
1890 f_calo->Draw(
"same");
1891 f_calo_l->Draw(
"same");
1892 gamma_eta0_1d->Draw(
"p");
1894 TString ltitle = Form(
"Photons, #eta = 0.0-0.1", f_calo->GetParameter(0),
1895 f_calo->GetParameter(1));
1896 lg->AddEntry(gamma_eta0_1d, ltitle.Data(),
"p");
1897 lg2->AddEntry(f_calo,
1898 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1899 f_calo->GetParameter(1)),
"l");
1900 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1901 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1902 f_calo_l->GetParameter(1)),
"l");
1903 entry->SetTextColor(kGray + 1);
1905 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1907 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
1909 gamma_eta9_1d->Fit(f_calo,
"RM0");
1910 gamma_eta9_1d->Fit(f_calo_l,
"RM0");
1912 gamma_eta9_1d->SetLineColor(kBlue + 3);
1913 gamma_eta9_1d->SetMarkerColor(kBlue + 3);
1914 gamma_eta9_1d->SetLineWidth(2);
1915 gamma_eta9_1d->SetMarkerStyle(kOpenCircle);
1916 gamma_eta9_1d->SetMarkerSize(2);
1917 f_calo->SetLineColor(kBlue + 3);
1918 f_calo->SetLineWidth(2);
1919 f_calo_l->SetLineColor(kBlue + 3);
1920 f_calo_l->SetLineWidth(2);
1921 f_calo_l->SetLineStyle(kDashed);
1923 f_calo->Draw(
"same");
1924 f_calo_l->Draw(
"same");
1925 gamma_eta9_1d->Draw(
"p");
1927 TString ltitle = Form(
"Photons, #eta = 0.9-1.0", f_calo->GetParameter(0),
1928 f_calo->GetParameter(1));
1929 lg->AddEntry(gamma_eta9_1d, ltitle.Data(),
"p");
1930 lg2->AddEntry(f_calo,
1931 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
1932 f_calo->GetParameter(1)),
"l");
1933 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
1934 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
1935 f_calo_l->GetParameter(1)),
"l");
1936 entry->SetTextColor(kGray + 1);
1937 cout <<
"Title = " << ltitle << endl;
1942 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
1947 const TString base =
1948 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/single_particle/",
1949 const TString
config =
"")
1951 gStyle->SetOptStat(0);
1952 gStyle->SetOptFit(0);
1955 base +
"/spacal2d/zerofield/G4Hits_sPHENIX",
"gamma_eta0",
false);
1957 base +
"/spacal2d/zerofield/G4Hits_sPHENIX",
"gamma_eta0.90",
false);
1960 base +
"/spacal1d_1dtower/zerofield/G4Hits_sPHENIX",
"gamma_eta0",
false);
1962 base +
"/spacal1d_1dtower/zerofield/G4Hits_sPHENIX",
"gamma_eta0.90",
1965 TCanvas *c1 =
new TCanvas(
"DrawCluster_Res",
"DrawCluster_Res", 1100, 900);
1970 p = (TPad *) c1->cd(idx++);
1976 p->DrawFrame(0, 0, 35, 20
e-2,
1977 ";Incoming Energy (GeV);Relative energy resolution, #DeltaE/E");
1979 TLegend * lg =
new TLegend(2, 10
e-2, 33, 18
e-2, NULL,
"br");
1981 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"sqrt([0]*[0]+[1]*[1]/x)/100",
1983 gamma_eta0->Fit(f_calo,
"RM0");
1985 gamma_eta0->SetLineColor(kRed + 1);
1986 gamma_eta0->SetMarkerColor(kRed + 1);
1987 gamma_eta0->SetLineWidth(2);
1988 gamma_eta0->SetMarkerStyle(kFullSquare);
1989 gamma_eta0->SetMarkerSize(2);
1990 f_calo->SetLineColor(kRed + 1);
1991 f_calo->SetLineWidth(2);
1993 gamma_eta0->Draw(
"p");
1994 f_calo->Draw(
"same");
1996 TString ltitle = Form(
1997 "2D-proj., #eta = 0.0-0.1, #DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}",
1998 f_calo->GetParameter(0), f_calo->GetParameter(1));
1999 lg->AddEntry(gamma_eta0, ltitle.Data(),
"pl");
2001 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2003 gamma_eta9->Fit(f_calo,
"RM0");
2005 gamma_eta9->SetLineColor(kRed + 3);
2006 gamma_eta9->SetMarkerColor(kRed + 3);
2007 gamma_eta9->SetLineWidth(2);
2008 gamma_eta9->SetMarkerStyle(kFullCircle);
2009 gamma_eta9->SetMarkerSize(2);
2010 f_calo->SetLineColor(kRed + 3);
2011 f_calo->SetLineWidth(2);
2013 gamma_eta9->Draw(
"p");
2014 f_calo->Draw(
"same");
2016 TString ltitle = Form(
2017 "2D-proj., #eta = 0.9-1.0, #DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}",
2018 f_calo->GetParameter(0), f_calo->GetParameter(1));
2019 lg->AddEntry(gamma_eta9, ltitle.Data(),
"pl");
2020 cout <<
"Title = " << ltitle << endl;
2022 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2024 gamma_eta0_1d->Fit(f_calo,
"RM0");
2026 gamma_eta0_1d->SetLineColor(kBlue + 1);
2027 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
2028 gamma_eta0_1d->SetLineWidth(2);
2029 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
2030 gamma_eta0_1d->SetMarkerSize(2);
2031 f_calo->SetLineColor(kBlue + 1);
2032 f_calo->SetLineWidth(2);
2034 gamma_eta0_1d->Draw(
"p");
2035 f_calo->Draw(
"same");
2037 TString ltitle = Form(
2038 "1D-proj., #eta = 0.0-0.1, #DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}",
2039 f_calo->GetParameter(0), f_calo->GetParameter(1));
2040 lg->AddEntry(gamma_eta0_1d, ltitle.Data(),
"pl");
2042 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2044 gamma_eta9_1d->Fit(f_calo,
"RM0");
2046 gamma_eta9_1d->SetLineColor(kBlue + 3);
2047 gamma_eta9_1d->SetMarkerColor(kBlue + 3);
2048 gamma_eta9_1d->SetLineWidth(2);
2049 gamma_eta9_1d->SetMarkerStyle(kOpenCircle);
2050 gamma_eta9_1d->SetMarkerSize(2);
2051 f_calo->SetLineColor(kBlue + 3);
2052 f_calo->SetLineWidth(2);
2054 gamma_eta9_1d->Draw(
"p");
2055 f_calo->Draw(
"same");
2057 TString ltitle = Form(
2058 "1D-proj., #eta = 0.9-1.0, #DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}",
2059 f_calo->GetParameter(0), f_calo->GetParameter(1));
2060 lg->AddEntry(gamma_eta9_1d, ltitle.Data(),
"pl");
2061 cout <<
"Title = " << ltitle << endl;
2065 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
2072 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/single_particle/spacal1d_1dtower/zerofield/G4Hits_sPHENIX",
2073 const TString
particle =
"gamma_eta0.90",
bool mean_or_res =
false)
2088 { 1, 2, 4, 8, 10, 16, 24, 32, 40, 50 };
2091 double mean_err[100] =
2095 double res_err[100] =
2099 c1->Print(
config +
".pdf[");
2101 for (
int i = 0;
i <
N; ++
i)
2108 mean_err[
i] = fit[1];
2109 res[
i] = fit[2] / mean[
i];
2110 res_err[
i] = fit[3] / mean[
i];
2112 c1->Print(
config +
".pdf]");
2113 cout <<
"DrawCluster_AnaP - save to " <<
config <<
".pdf" << endl;
2117 TGraphErrors * ge =
new TGraphErrors(N, es, mean, 0, mean_err);
2123 TGraphErrors * ge =
new TGraphErrors(N, es, res, 0, res_err);
2133 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/single_particle/spacal2d/zerofield/G4Hits_sPHENIX",
2134 const TString
particle =
"gamma_eta0",
const double e = 8)
2138 const TString e_GeV = Form(
"%.0fGeV",
e);
2141 +
".root_g4cemc_eval.root";
2143 cout <<
"DrawCluster_SingleE - lead " << file_name << endl;
2145 TFile *
f =
new TFile(file_name);
2147 TTree * ntp_cluster = (TTree *) f->GetObjectChecked(
"ntp_cluster",
"TTree");
2150 const TString h_cluster_E_name = TString(
"h_cluster_E_") +
particle + e_GeV;
2151 TH1F * h_cluster_E =
new TH1F(h_cluster_E_name, file_name, 200, 0,
e * 1.5);
2153 TCanvas *c1 =
new TCanvas(file_name, file_name);
2154 ntp_cluster->Draw(
"e>>" + h_cluster_E_name,
"gparticleID==1 && e>0.2");
2156 const double mean = h_cluster_E->GetMean();
2157 const double rms = h_cluster_E->GetRMS();
2161 TF1 * f_gaus_pilot =
new TF1(
"f_gaus_pilot" + h_cluster_E_name,
"gaus",
2163 f_gaus_pilot->SetParameters(1, mean, rms);
2164 f_gaus_pilot->SetLineColor(kRed);
2165 h_cluster_E->Fit(f_gaus_pilot,
"MRQS0");
2166 f_gaus_pilot->Draw(
"same");
2168 TF1 * f_gaus =
new TF1(
"f_gaus" + h_cluster_E_name,
"gaus",
2169 f_gaus_pilot->GetParameter(1) - 1.5 * f_gaus_pilot->GetParameter(2),
2170 f_gaus_pilot->GetParameter(1) + 4 * f_gaus_pilot->GetParameter(2));
2171 f_gaus->SetParameters(f_gaus_pilot->GetParameter(0),
2172 f_gaus_pilot->GetParameter(1), f_gaus_pilot->GetParameter(2));
2174 h_cluster_E->Fit(f_gaus,
"MRQS0");
2175 f_gaus->Draw(
"same");
2177 cout <<
"load_SF - result = " << f_gaus->GetParameter(1) <<
"+/-"
2178 << f_gaus->GetParError(1) << endl;
2181 ret[0] = f_gaus->GetParameter(1);
2182 ret[1] = f_gaus->GetParError(1);
2183 ret[2] = f_gaus->GetParameter(2);
2184 ret[3] = f_gaus->GetParError(2);
2186 c1->Print(
config +
".pdf");
2193 const TString base =
2194 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/",
2195 const TString
config =
"")
2197 gStyle->SetOptStat(0);
2198 gStyle->SetOptFit(0);
2201 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"e-_eta0",
false);
2203 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"e-_eta0.90",
false);
2206 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"gamma_eta0",
false);
2208 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"gamma_eta0.90",
2211 TCanvas *c1 =
new TCanvas(
"DrawTowerSum_Res_2Fit_1DSpacalNoSVX",
2212 "DrawTowerSum_Res_2Fit_1DSpacalNoSVX", 1100, 900);
2217 p = (TPad *) c1->cd(idx++);
2223 p->DrawFrame(0, 0, 35, 20
e-2,
2224 ";Incoming Energy (GeV);Relative energy resolution, #DeltaE/E");
2226 TLegend * lg =
new TLegend(2, 9.6
e-2, 17, 19.6
e-2, NULL,
"br");
2227 TLegend * lg2 =
new TLegend(16, 9
e-2, 33, 19
e-2, NULL,
"br");
2229 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2231 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0",
"([0]+[1]/sqrt(x))/100", 0.5,
2233 gamma_eta0->Fit(f_calo,
"RM0");
2234 gamma_eta0->Fit(f_calo_l,
"RM0");
2236 gamma_eta0->SetLineColor(kRed + 1);
2237 gamma_eta0->SetMarkerColor(kRed + 1);
2238 gamma_eta0->SetLineWidth(2);
2239 gamma_eta0->SetMarkerStyle(kFullSquare);
2240 gamma_eta0->SetMarkerSize(2);
2241 f_calo->SetLineColor(kRed + 1);
2242 f_calo->SetLineWidth(2);
2243 f_calo_l->SetLineColor(kRed + 1);
2244 f_calo_l->SetLineWidth(2);
2245 f_calo_l->SetLineStyle(kDashed);
2247 f_calo->Draw(
"same");
2248 f_calo_l->Draw(
"same");
2249 gamma_eta0->Draw(
"p");
2251 lg->AddEntry(gamma_eta0,
2252 Form(
"Electrons, #eta = 0.0-0.1", f_calo->GetParameter(0),
2253 f_calo->GetParameter(1)),
"p");
2254 lg2->AddEntry(f_calo,
2255 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
2256 f_calo->GetParameter(1)),
"l");
2257 TLegendEntry *
entry = lg2->AddEntry(f_calo_l,
2258 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
2259 f_calo_l->GetParameter(1)),
"l");
2260 entry->SetTextColor(kGray + 1);
2262 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta9",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2264 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta9",
"([0]+[1]/sqrt(x))/100", 0.5,
2266 gamma_eta9->Fit(f_calo,
"RM0");
2267 gamma_eta9->Fit(f_calo_l,
"RM0");
2269 gamma_eta9->SetLineColor(kRed + 3);
2270 gamma_eta9->SetMarkerColor(kRed + 3);
2271 gamma_eta9->SetLineWidth(2);
2272 gamma_eta9->SetMarkerStyle(kFullCircle);
2273 gamma_eta9->SetMarkerSize(2);
2274 f_calo->SetLineColor(kRed + 3);
2275 f_calo->SetLineWidth(2);
2276 f_calo_l->SetLineColor(kRed + 3);
2277 f_calo_l->SetLineWidth(2);
2278 f_calo_l->SetLineStyle(kDashed);
2280 f_calo->Draw(
"same");
2281 f_calo_l->Draw(
"same");
2282 gamma_eta9->Draw(
"p");
2284 TString ltitle = Form(
"Electrons, #eta = 0.9-1.0", f_calo->GetParameter(0),
2285 f_calo->GetParameter(1));
2286 lg->AddEntry(gamma_eta9, ltitle.Data(),
"p");
2287 lg2->AddEntry(f_calo,
2288 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
2289 f_calo->GetParameter(1)),
"l");
2290 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
2291 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
2292 f_calo_l->GetParameter(1)),
"l");
2293 entry->SetTextColor(kGray + 1);
2294 cout <<
"Title = " << ltitle << endl;
2296 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2298 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
2300 gamma_eta0_1d->Fit(f_calo,
"RM0");
2301 gamma_eta0_1d->Fit(f_calo_l,
"RM0");
2303 gamma_eta0_1d->SetLineColor(kBlue + 1);
2304 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
2305 gamma_eta0_1d->SetLineWidth(2);
2306 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
2307 gamma_eta0_1d->SetMarkerSize(2);
2308 f_calo->SetLineColor(kBlue + 1);
2309 f_calo->SetLineWidth(2);
2310 f_calo_l->SetLineColor(kBlue + 1);
2311 f_calo_l->SetLineWidth(2);
2312 f_calo_l->SetLineStyle(kDashed);
2314 f_calo->Draw(
"same");
2315 f_calo_l->Draw(
"same");
2316 gamma_eta0_1d->Draw(
"p");
2318 TString ltitle = Form(
"Photons, #eta = 0.0-0.1", f_calo->GetParameter(0),
2319 f_calo->GetParameter(1));
2320 lg->AddEntry(gamma_eta0_1d, ltitle.Data(),
"p");
2321 lg2->AddEntry(f_calo,
2322 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
2323 f_calo->GetParameter(1)),
"l");
2324 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
2325 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
2326 f_calo_l->GetParameter(1)),
"l");
2327 entry->SetTextColor(kGray + 1);
2329 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2331 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
2333 gamma_eta9_1d->Fit(f_calo,
"RM0");
2334 gamma_eta9_1d->Fit(f_calo_l,
"RM0");
2336 gamma_eta9_1d->SetLineColor(kBlue + 3);
2337 gamma_eta9_1d->SetMarkerColor(kBlue + 3);
2338 gamma_eta9_1d->SetLineWidth(2);
2339 gamma_eta9_1d->SetMarkerStyle(kOpenCircle);
2340 gamma_eta9_1d->SetMarkerSize(2);
2341 f_calo->SetLineColor(kBlue + 3);
2342 f_calo->SetLineWidth(2);
2343 f_calo_l->SetLineColor(kBlue + 3);
2344 f_calo_l->SetLineWidth(2);
2345 f_calo_l->SetLineStyle(kDashed);
2347 f_calo->Draw(
"same");
2348 f_calo_l->Draw(
"same");
2349 gamma_eta9_1d->Draw(
"p");
2351 TString ltitle = Form(
"Photons, #eta = 0.9-1.0", f_calo->GetParameter(0),
2352 f_calo->GetParameter(1));
2353 lg->AddEntry(gamma_eta9_1d, ltitle.Data(),
"p");
2354 lg2->AddEntry(f_calo,
2355 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
2356 f_calo->GetParameter(1)),
"l");
2357 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
2358 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
2359 f_calo_l->GetParameter(1)),
"l");
2360 entry->SetTextColor(kGray + 1);
2361 cout <<
"Title = " << ltitle << endl;
2366 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
2371 const TString base =
2372 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/",
2373 const TString
config =
"")
2375 gStyle->SetOptStat(0);
2376 gStyle->SetOptFit(0);
2379 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"e-_eta0.30",
false);
2384 base +
"/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
"gamma_eta0.30",
2390 TCanvas *c1 =
new TCanvas(
"DrawTowerSum_Res_2Fit_1DSpacalNoSVX_Eta3",
2391 "DrawTowerSum_Res_2Fit_1DSpacalNoSVX_Eta3", 1100, 900);
2396 p = (TPad *) c1->cd(idx++);
2402 p->DrawFrame(0, 0, 35, 20
e-2,
2403 ";Incoming Energy (GeV);Relative energy resolution, #DeltaE/E");
2405 TLegend * lg =
new TLegend(2, 9.6
e-2, 17, 19.6
e-2, NULL,
"br");
2406 TLegend * lg2 =
new TLegend(16, 9
e-2, 33, 19
e-2, NULL,
"br");
2408 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2410 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0",
"([0]+[1]/sqrt(x))/100", 0.5,
2412 gamma_eta0->Fit(f_calo,
"RM0");
2413 gamma_eta0->Fit(f_calo_l,
"RM0");
2415 gamma_eta0->SetLineColor(kRed + 1);
2416 gamma_eta0->SetMarkerColor(kRed + 1);
2417 gamma_eta0->SetLineWidth(2);
2418 gamma_eta0->SetMarkerStyle(kFullSquare);
2419 gamma_eta0->SetMarkerSize(2);
2420 f_calo->SetLineColor(kRed + 1);
2421 f_calo->SetLineWidth(2);
2422 f_calo_l->SetLineColor(kRed + 1);
2423 f_calo_l->SetLineWidth(2);
2424 f_calo_l->SetLineStyle(kDashed);
2426 f_calo->Draw(
"same");
2427 f_calo_l->Draw(
"same");
2428 gamma_eta0->Draw(
"p");
2430 lg->AddEntry(gamma_eta0,
2431 Form(
"Electrons, #eta = 0.3-0.4", f_calo->GetParameter(0),
2432 f_calo->GetParameter(1)),
"p");
2433 lg2->AddEntry(f_calo,
2434 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
2435 f_calo->GetParameter(1)),
"l");
2436 TLegendEntry *
entry = lg2->AddEntry(f_calo_l,
2437 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
2438 f_calo_l->GetParameter(1)),
"l");
2439 entry->SetTextColor(kGray + 1);
2441 TF1 * f_calo =
new TF1(
"f_calo_gamma_eta0_1d",
"sqrt([0]*[0]+[1]*[1]/x)/100",
2443 TF1 * f_calo_l =
new TF1(
"f_calo_l_gamma_eta0_1d",
"([0]+[1]/sqrt(x))/100",
2445 gamma_eta0_1d->Fit(f_calo,
"RM0");
2446 gamma_eta0_1d->Fit(f_calo_l,
"RM0");
2448 gamma_eta0_1d->SetLineColor(kBlue + 1);
2449 gamma_eta0_1d->SetMarkerColor(kBlue + 1);
2450 gamma_eta0_1d->SetLineWidth(2);
2451 gamma_eta0_1d->SetMarkerStyle(kOpenSquare);
2452 gamma_eta0_1d->SetMarkerSize(2);
2453 f_calo->SetLineColor(kBlue + 1);
2454 f_calo->SetLineWidth(2);
2455 f_calo_l->SetLineColor(kBlue + 1);
2456 f_calo_l->SetLineWidth(2);
2457 f_calo_l->SetLineStyle(kDashed);
2459 f_calo->Draw(
"same");
2460 f_calo_l->Draw(
"same");
2461 gamma_eta0_1d->Draw(
"p");
2463 TString ltitle = Form(
"Photons, #eta = 0.3-0.4", f_calo->GetParameter(0),
2464 f_calo->GetParameter(1));
2465 lg->AddEntry(gamma_eta0_1d, ltitle.Data(),
"p");
2466 lg2->AddEntry(f_calo,
2467 Form(
"#DeltaE/E = %.1f%% #oplus %.1f%%/#sqrt{E}", f_calo->GetParameter(0),
2468 f_calo->GetParameter(1)),
"l");
2469 TLegendEntry * entry = lg2->AddEntry(f_calo_l,
2470 Form(
"#DeltaE/E = %.1f%% + %.1f%%/#sqrt{E}", f_calo_l->GetParameter(0),
2471 f_calo_l->GetParameter(1)),
"l");
2472 entry->SetTextColor(kGray + 1);
2477 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
2483 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
2484 const TString
particle =
"e-_eta0",
bool mean_or_res =
false)
2499 { 1, 2, 4, 8, 10, 16, 24, 32, 40, 50 };
2502 double mean_err[100] =
2506 double res_err[100] =
2510 c1->Print(
config +
".pdf[");
2512 for (
int i = 0;
i <
N; ++
i)
2519 mean_err[
i] = fit[1];
2520 res[
i] = fit[2] / mean[
i];
2521 res_err[
i] = fit[3] / mean[
i];
2523 c1->Print(
config +
".pdf]");
2524 cout <<
"DrawTowerSum_AnaP - save to " <<
config <<
".pdf" << endl;
2528 TGraphErrors * ge =
new TGraphErrors(N, es, mean, 0, mean_err);
2534 TGraphErrors * ge =
new TGraphErrors(N, es, res, 0, res_err);
2544 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/production_analysis/emcstudies/nosvtx/spacal1d/fieldmap/G4Hits_sPHENIX",
2545 const TString
particle =
"e-_eta0",
const double e = 8)
2549 const TString e_GeV = Form(
"%.0fGeV",
e);
2552 +
".root_DSTReader.root";
2553 cout <<
"DrawTowerSum_SingleE - lead " << file_name << endl;
2555 TFile *
f =
new TFile(file_name);
2557 TTree *
T = (TTree *) f->GetObjectChecked(
"T",
"TTree");
2560 const TString h_cluster_E_name = TString(
"h_cluster_E_") +
particle + e_GeV;
2561 TH1F * h_cluster_E =
new TH1F(h_cluster_E_name, file_name, 200, 0,
e * 1.5);
2563 TCanvas *c1 =
new TCanvas(file_name, file_name);
2564 T->Draw(
"Sum$(TOWER_SIM_CEMC.energy)/ 2.36081e-02>>" + h_cluster_E_name,
"");
2566 const double mean = h_cluster_E->GetMean();
2567 const double rms = h_cluster_E->GetRMS();
2571 TF1 * f_gaus_pilot =
new TF1(
"f_gaus_pilot" + h_cluster_E_name,
"gaus",
2573 f_gaus_pilot->SetParameters(1, mean, rms);
2574 f_gaus_pilot->SetLineColor(kRed);
2575 h_cluster_E->Fit(f_gaus_pilot,
"MRQS0");
2576 f_gaus_pilot->Draw(
"same");
2578 TF1 * f_gaus =
new TF1(
"f_gaus" + h_cluster_E_name,
"gaus",
2579 f_gaus_pilot->GetParameter(1) - 1.5 * f_gaus_pilot->GetParameter(2),
2580 f_gaus_pilot->GetParameter(1) + 4 * f_gaus_pilot->GetParameter(2));
2581 f_gaus->SetParameters(f_gaus_pilot->GetParameter(0),
2582 f_gaus_pilot->GetParameter(1), f_gaus_pilot->GetParameter(2));
2584 h_cluster_E->Fit(f_gaus,
"MRQS0");
2585 f_gaus->Draw(
"same");
2587 cout <<
"load_SF - result = " << f_gaus->GetParameter(1) <<
"+/-"
2588 << f_gaus->GetParError(1) << endl;
2591 ret[0] = f_gaus->GetParameter(1);
2592 ret[1] = f_gaus->GetParError(1);
2593 ret[2] = f_gaus->GetParameter(2);
2594 ret[3] = f_gaus->GetParError(2);
2596 c1->Print(
config +
".pdf");
2603 const TString base =
2604 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/single_particle/",
2605 const TString
config =
"")
2607 gStyle->SetOptStat(0);
2608 gStyle->SetOptFit(0);
2610 TCanvas *c1 =
new TCanvas(
"DrawSF",
"DrawSF", 1800, 900);
2615 p = (TPad *) c1->cd(idx++);
2621 p->DrawFrame(-0.1, 2
e-2, 1.2, 3.0
e-2,
2622 ";Pseudorapidity;EMCal Sampling fraction");
2624 TLegend * lg =
new TLegend(0, 2.55
e-2, 0.6, 2.9
e-2, NULL,
"br");
2627 base +
"/spacal2d/zerofield/G4Hits_sPHENIX_gamma",
"24GeV");
2628 ge->SetLineColor(kRed + 3);
2629 ge->SetMarkerColor(kRed + 3);
2630 ge->SetLineWidth(2);
2631 ge->SetMarkerStyle(kFullSquare);
2632 ge->SetMarkerSize(2);
2634 lg->AddEntry(ge,
"24 GeV #gamma in 2D-proj. SPACAL",
"lp");
2637 base +
"/spacal1d/zerofield/G4Hits_sPHENIX_gamma",
"24GeV");
2638 ge->SetLineColor(kBlue + 3);
2639 ge->SetMarkerColor(kBlue + 3);
2640 ge->SetLineStyle(kDashed);
2641 ge->SetLineWidth(2);
2642 ge->SetMarkerStyle(kOpenSquare);
2643 ge->SetMarkerSize(2);
2645 lg->AddEntry(ge,
"24 GeV #gamma in 1D-proj. SPACAL",
"lp");
2648 base +
"/spacal2d/zerofield/G4Hits_sPHENIX_e-",
"4GeV");
2649 ge->SetLineColor(kRed + 3);
2650 ge->SetMarkerColor(kRed + 3);
2651 ge->SetLineWidth(2);
2652 ge->SetMarkerStyle(kFullCircle);
2653 ge->SetMarkerSize(2);
2655 lg->AddEntry(ge,
"4 GeV e^{-} in 2D-proj. SPACAL",
"lp");
2658 base +
"/spacal1d/zerofield/G4Hits_sPHENIX_e-",
"4GeV");
2659 ge->SetLineColor(kBlue + 3);
2660 ge->SetMarkerColor(kBlue + 3);
2661 ge->SetLineStyle(kDashed);
2662 ge->SetLineWidth(2);
2663 ge->SetMarkerStyle(kOpenCircle);
2664 ge->SetMarkerSize(2);
2666 lg->AddEntry(ge,
"4 GeV e^{-} in 1D-proj. SPACAL",
"lp");
2670 SaveCanvas(c1, base +
"DrawEcal_" + TString(c1->GetName()),
true);
2676 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/single_particle/spacal2d/zerofield/G4Hits_sPHENIX_gamma",
2677 const TString
energy =
"24GeV")
2683 double SF_Errs[100] =
2695 etas[
n] = 0.3 + 0.05;
2701 etas[
n] = 0.6 + 0.05;
2707 etas[
n] = 0.9 + 0.05;
2713 TGraphErrors * ge =
new TGraphErrors(n, etas, SFs, 0, SF_Errs);
2722 "/direct/phenix+sim02/phnxreco/ePHENIX/jinhuang/sPHENIX_work/single_particle/spacal1d/zerofield/G4Hits_sPHENIX_gamma",
2723 const TString
energy =
"24GeV")
2734 const TString file_name =
config +
"_" + eta_bin +
"_" +
energy
2735 +
".root_EMCalAna.root";
2736 cout <<
"load_SF - lead " << file_name << endl;
2738 TFile *
f =
new TFile(file_name);
2740 TH1F * EMCalAna_h_CEMC_SF = (TH1F *) f->GetObjectChecked(
"EMCalAna_h_CEMC_SF",
2742 assert(EMCalAna_h_CEMC_SF);
2744 const double mean = EMCalAna_h_CEMC_SF->GetMean();
2745 const double rms = EMCalAna_h_CEMC_SF->GetRMS();
2747 TF1 * f_gaus =
new TF1(
"f_gaus" + eta_bin,
"gaus", mean - 2 * rms,
2749 f_gaus->SetParameters(1, mean, rms);
2751 EMCalAna_h_CEMC_SF->Fit(f_gaus,
"MRQS0");
2753 cout <<
"load_SF - result = " << f_gaus->GetParameter(1) <<
"+/-"
2754 << f_gaus->GetParError(1) << endl;
2757 ret[0] = f_gaus->GetParameter(1);
2758 ret[1] = f_gaus->GetParError(1);