11 string inputdir =
"Cosmic_orig";
15 string inputfile_in = Form(
"./OutPut/SampleFrac/%s/Proto4SampleFrac_HCALIN.root",inputdir.c_str());
16 TFile *File_HCALIN = TFile::Open(inputfile_in.c_str());
17 TH2F *h_in_cal = (TH2F*)File_HCALIN->Get(
"h_QAG4Sim_HCALIN_G4Hit_XY_cal");
18 TH2F *h_in_abs = (TH2F*)File_HCALIN->Get(
"h_QAG4Sim_HCALIN_G4Hit_XY_abs");
19 TH1F *h_in_sf = (TH1F*)File_HCALIN->Get(
"h_QAG4Sim_HCALIN_G4Hit_SF");
21 string inputfile_out = Form(
"./OutPut/SampleFrac/%s/Proto4SampleFrac_HCALOUT.root",inputdir.c_str());
22 TFile *File_HCALOUT = TFile::Open(inputfile_out.c_str());
23 TH2F *h_out_cal = (TH2F*)File_HCALOUT->Get(
"h_QAG4Sim_HCALOUT_G4Hit_XY_cal");
24 TH2F *h_out_abs = (TH2F*)File_HCALOUT->Get(
"h_QAG4Sim_HCALOUT_G4Hit_XY_abs");
25 TH1F *h_out_sf = (TH1F*)File_HCALOUT->Get(
"h_QAG4Sim_HCALOUT_G4Hit_SF");
27 TH2F *h_cal = (TH2F*)h_in_cal->Clone(
"h_cal");
28 h_cal->Add(h_out_cal,1.0);
30 TH2F *h_abs = (TH2F*)h_in_abs->Clone(
"h_abs");
31 h_abs->Add(h_out_abs,1.0);
33 TH1F *h_play =
new TH1F(
"h_play",
"h_play",500,0,500);
34 for(
int i_bin = 0; i_bin < 500; ++i_bin)
36 h_play->SetBinContent(i_bin+1,-10000.0);
37 h_play->SetBinError(i_bin+1,1.0);
41 h_play->GetYaxis()->SetRangeUser(-100,100);
42 h_play->GetXaxis()->SetRangeUser(50,350);
44 TCanvas *c_cal =
new TCanvas(
"c_cal",
"c_cal",10,10,1500,500);
46 for(
int i_pad = 0; i_pad < 3; ++i_pad)
48 c_cal->cd(i_pad+1)->SetLeftMargin(0.15);
49 c_cal->cd(i_pad+1)->SetBottomMargin(0.15);
50 c_cal->cd(i_pad+1)->SetGrid(0,0);
51 c_cal->cd(i_pad+1)->SetTicks(1,1);
55 h_play->SetTitle(
"Cal G4Hit Display");
56 h_play->DrawCopy(
"pE");
59 h_cal->Draw(
"colz same");
62 h_play->SetTitle(
"Abs G4Hit Display");
63 h_play->DrawCopy(
"pE");
66 h_abs->Draw(
"colz same");
69 h_out_sf->SetTitle(
"Sampling Fraction");
70 h_out_sf->SetStats(0);
71 h_out_sf->GetXaxis()->SetTitle(
"Sampling Fraction");
72 h_out_sf->GetXaxis()->CenterTitle();
73 h_out_sf->SetLineColor(2);
74 h_out_sf->SetLineWidth(2);
76 std::string sf_out = Form(
"sf_out = %1.4f",h_out_sf->GetMean());
78 h_in_sf->SetLineColor(1);
79 h_in_sf->SetLineWidth(2);
80 h_in_sf->Draw(
"same");
81 std::string sf_in = Form(
"sf_in = %1.4f",h_in_sf->GetMean());
83 TLegend *
leg =
new TLegend(0.5,0.5,0.8,0.7);
84 leg->SetFillColor(10);
85 leg->AddEntry(h_in_sf,sf_in.c_str(),
"l");
86 leg->AddEntry(h_out_sf,sf_out.c_str(),
"l");
89 string output_fig = Form(
"./figures/c_G4Hit_%s.eps",inputdir.c_str());
90 c_cal->SaveAs(output_fig.c_str());