12 #include <TGraphAsymmErrors.h>
13 #include <TGraphErrors.h>
21 #include "sPhenixStyle.C"
27 "/phenix/u/jinhuang/links/sPHENIX_work/prod_analysis/EMCal_photon_calib/EMCalAna.root")
30 TVirtualFitter::SetDefaultFitter(
"Minuit2");
38 TH1* EMCalAna_h_CEMC_BLOCK_ETotal = f->Get(
"EMCalAna_h_CEMC_BLOCK_ETotal");
39 assert(EMCalAna_h_CEMC_BLOCK_ETotal);
40 TH1* EMCalAna_h_CEMC_BLOCK_EVis = f->Get(
"EMCalAna_h_CEMC_BLOCK_EVis");
41 assert(EMCalAna_h_CEMC_BLOCK_EVis);
43 TH1* hSamplingFraction =
44 EMCalAna_h_CEMC_BLOCK_EVis->Clone(
"hSamplingFraction");
46 hSamplingFraction->Divide(EMCalAna_h_CEMC_BLOCK_ETotal);
48 hSamplingFraction->SetTitle(
"CEMC visible sampling fraction, 4 GeV photon, |z|<10 cm; EMCal block ID; Sampling Fraction");
49 hSamplingFraction->GetXaxis()->SetRangeUser(-.5, 47.5);
50 hSamplingFraction->GetYaxis()->SetRangeUser(0.01, 0.03);
51 hSamplingFraction->SetFillColor(kBlue - 3);
52 hSamplingFraction->SetFillStyle(1001);
54 TCanvas* c1 =
new TCanvas(
"DrawEcal_BlockCalibration",
"DrawEcal_BlockCalibration", 900, 600);
59 p = (TPad*) c1->cd(idx++);
62 hSamplingFraction->Draw();
64 TLegend*
leg =
new TLegend(.0, .7, .95, .93);
66 leg->AddEntry(
"",
"#it{#bf{sPHENIX}} Geant4 Simulation",
"");
67 leg->AddEntry(
"",
"CEMC visible sampling fraction for 4 GeV photon, |z|<10 cm",
"");
70 leg->AddEntry(
"",
"2017 projective SPACAL design",
"");
71 leg->AddEntry(
"",
"1-D projective blocks for #21-26, rest are 2-D projective blocks",
"");
77 gSystem->Load(
"libg4detectors.so");
83 "2017 projective SPACAL design, Calibration based on CEMC visible sampling fraction for 4 GeV photon, source file: %s",
89 const double calib_const_scale = 0.02;
98 const int block_eta_id =
eta / 2;
100 string calib_const_name(Form(
"calib_const_eta%d_phi%d",
eta,
phi));
102 calib_const_scale / hSamplingFraction->GetBinContent(hSamplingFraction->GetXaxis()->FindBin(block_eta_id)));
106 param->
WriteToFile(
"xml",
"/phenix/u/jinhuang/links/sPHENIX_work/prod_analysis/EMCal_photon_calib/");