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_Mat_XY_cal");
18 TH2F *h_in_abs = (TH2F*)File_HCALIN->Get(
"h_QAG4Sim_HCALIN_G4Hit_Mat_XY_abs");
20 string inputfile_out = Form(
"./OutPut/SampleFrac/%s/Proto4SampleFrac_HCALOUT.root",inputdir.c_str());
21 TFile *File_HCALOUT = TFile::Open(inputfile_out.c_str());
22 TH2F *h_out_cal = (TH2F*)File_HCALOUT->Get(
"h_QAG4Sim_HCALOUT_G4Hit_Mat_XY_cal");
23 TH2F *h_out_abs = (TH2F*)File_HCALOUT->Get(
"h_QAG4Sim_HCALOUT_G4Hit_Mat_XY_abs");
25 TH2F *h_cal = (TH2F*)h_in_cal->Clone(
"h_cal");
26 h_cal->Add(h_out_cal,1.0);
28 TH2F *h_abs = (TH2F*)h_in_abs->Clone(
"h_abs");
29 h_abs->Add(h_out_abs,1.0);
31 TH1F *h_play =
new TH1F(
"h_play",
"h_play",500,0,500);
32 for(
int i_bin = 0; i_bin < 500; ++i_bin)
34 h_play->SetBinContent(i_bin+1,-10000.0);
35 h_play->SetBinError(i_bin+1,1.0);
39 h_play->GetYaxis()->SetRangeUser(-100,100);
40 h_play->GetXaxis()->SetRangeUser(50,350);
42 TCanvas *c_cal =
new TCanvas(
"c_cal",
"c_cal",10,10,1600,800);
44 for(
int i_pad = 0; i_pad < 2; ++i_pad)
46 c_cal->cd(i_pad+1)->SetLeftMargin(0.15);
47 c_cal->cd(i_pad+1)->SetBottomMargin(0.15);
48 c_cal->cd(i_pad+1)->SetGrid(0,0);
49 c_cal->cd(i_pad+1)->SetTicks(1,1);
53 h_play->SetTitle(
"Cal G4Hit Display");
54 h_play->DrawCopy(
"pE");
57 h_cal->Draw(
"colz same");
60 h_play->SetTitle(
"Abs G4Hit Display");
61 h_play->DrawCopy(
"pE");
64 h_abs->Draw(
"colz same");
66 string output_fig = Form(
"./figures/c_G4Hit_%s_Mat.eps",inputdir.c_str());
67 c_cal->SaveAs(output_fig.c_str());