7 #include <TGraphAsymmErrors.h>
13 string input_2018_ohcal =
"/sphenix/user/xusun/TestBeam/ShowerCalibAna/T1044_2018_pion_hcalout.root";
14 TFile *File_2018_ohcal = TFile::Open(input_2018_ohcal.c_str());
15 TGraphAsymmErrors *g_resolution_2018_pion_hcalout = (TGraphAsymmErrors*)File_2018_ohcal->Get(
"g_resolution_2018_pion_hcalout");
18 string input_2018_electron =
"/sphenix/user/xusun/TestBeam/ShowerCalibAna/T1044_2018_electron.root";
19 TFile *File_2018_electron = TFile::Open(input_2018_electron.c_str());
20 TGraphAsymmErrors *g_resolution_2018_electron = (TGraphAsymmErrors*)File_2018_electron->Get(
"g_resolution_2018_electron");
23 string input_2018_pion =
"/sphenix/user/xusun/TestBeam/ShowerCalibAna/T1044_2018_pion.root";
24 TFile *File_2018_pion = TFile::Open(input_2018_pion.c_str());
25 TGraphAsymmErrors *g_resolution_2018_pion = (TGraphAsymmErrors*)File_2018_pion->Get(
"g_resolution_2018_pion");
28 string input_2017_pion =
"/sphenix/user/xusun/TestBeam/ShowerCalibAna/T1044_2017_pion.root";
29 TFile *File_2017_pion = TFile::Open(input_2017_pion.c_str());
30 TGraphAsymmErrors *g_resolution_2017_pion = (TGraphAsymmErrors*)File_2017_pion->Get(
"g_resolution_2017_pion");
32 TCanvas *c_Resolution =
new TCanvas(
"c_Resolution",
"c_Resolution",10,10,800,800);
34 c_Resolution->cd()->SetLeftMargin(0.15);
35 c_Resolution->cd()->SetBottomMargin(0.15);
36 c_Resolution->cd()->SetTicks(1,1);
37 c_Resolution->cd()->SetGrid(0,0);
39 TH1F *h_play =
new TH1F(
"h_play",
"h_play",100,0.0,100.0);
40 for(
int i_bin = 0; i_bin < 100; ++i_bin)
42 h_play->SetBinContent(i_bin+1,-10.0);
43 h_play->SetBinError(i_bin+1,1.0);
47 h_play->GetXaxis()->SetTitle(
"input Energy (GeV)");
48 h_play->GetXaxis()->CenterTitle();
49 h_play->GetXaxis()->SetNdivisions(505);
50 h_play->GetXaxis()->SetRangeUser(0.0,40.0);
52 h_play->GetYaxis()->SetTitle(
"#DeltaE/<E>");
53 h_play->GetYaxis()->CenterTitle();
54 h_play->GetYaxis()->SetRangeUser(0.0,0.8);
55 h_play->DrawCopy(
"pE");
57 TLine *l_unity =
new TLine(1.0,1.0,39.0,39.0);
58 l_unity->SetLineColor(4);
59 l_unity->SetLineStyle(2);
60 l_unity->SetLineWidth(2);
61 l_unity->Draw(
"l same");
63 g_resolution_2017_pion->SetMarkerStyle(21);
64 g_resolution_2017_pion->SetMarkerColor(2);
65 g_resolution_2017_pion->SetMarkerSize(2.0);
66 g_resolution_2017_pion->Draw(
"pE same");
68 g_resolution_2018_pion->SetMarkerStyle(20);
69 g_resolution_2018_pion->SetMarkerColor(kGray+2);
70 g_resolution_2018_pion->SetMarkerSize(2.0);
71 g_resolution_2018_pion->Draw(
"pE same");
73 g_resolution_2018_pion_hcalout->SetMarkerStyle(34);
74 g_resolution_2018_pion_hcalout->SetMarkerColor(6);
75 g_resolution_2018_pion_hcalout->SetMarkerSize(2.0);
76 g_resolution_2018_pion_hcalout->Draw(
"pE same");
78 g_resolution_2018_electron->SetMarkerStyle(20);
79 g_resolution_2018_electron->SetMarkerColor(4);
80 g_resolution_2018_electron->SetMarkerSize(2.0);
81 g_resolution_2018_electron->Draw(
"pE same");
83 TLegend *leg_linear =
new TLegend(0.5,0.6,0.8,0.8);
84 leg_linear->SetBorderSize(0);
85 leg_linear->SetFillColor(0);
86 leg_linear->AddEntry(g_resolution_2017_pion,
"#pi- T1044-2017",
"p");
87 leg_linear->AddEntry(g_resolution_2018_pion,
"#pi- T1044-2018",
"p");
88 leg_linear->AddEntry(g_resolution_2018_pion_hcalout,
"#pi- T1044-2018 & OHCal",
"p");
89 leg_linear->AddEntry(g_resolution_2018_electron,
"e- T1044-2018",
"p");
90 leg_linear->AddEntry(l_unity,
"unity",
"l");
91 leg_linear->Draw(
"same");
93 c_Resolution->SaveAs(
"../figures/HCAL_ShowerCalib/c_Resolution.eps");