8 int hbdchanIHC[4][4] = {{16, 12, 8, 4},
13 string inputfile =
"/sphenix/user/xusun/software/data/cosmic/TowerCalibAna/Proto4TowerInfoRAW_HCALIN_3.root";
14 TFile *File_InPut = TFile::Open(inputfile.c_str());
16 TH1F *h_hcal_tower_calib[16];
17 for(
int i_tower = 0; i_tower < 16; ++i_tower)
19 string HistName = Form(
"h_mHCALIN_RAW_twr_%d",i_tower);
20 h_hcal_tower_calib[i_tower] = (TH1F*)File_InPut->Get(HistName.c_str())->Clone();
21 h_hcal_tower_calib[i_tower]->Sumw2();
24 TCanvas *c_hcal =
new TCanvas(
"c_hcal",
"c_hcal",10,10,1600,1600);
26 for(
int i_row = 0; i_row < 4; ++i_row)
28 for(
int i_col = 0; i_col < 4; ++i_col)
30 int i_pad = 4*i_row+i_col+1;
31 int i_tower = hbdchanIHC[i_row][i_col]-1;
33 c_hcal->cd(i_pad)->SetLogy();
34 h_hcal_tower_calib[i_tower]->GetYaxis()->SetRangeUser(1.0,500.0);
35 h_hcal_tower_calib[i_tower]->Draw();
40 for(
int i_tower = 0; i_tower < 12; ++i_tower)
42 if(i_tower == 0) h_hcal_noise = (TH1F*)h_hcal_tower_calib[i_tower]->Clone();
43 else h_hcal_noise->Add(h_hcal_tower_calib[i_tower],1.0);
45 h_hcal_noise->Scale(1.0/12.0);
48 for(
int i_tower = 12; i_tower < 16; ++i_tower)
50 if(i_tower == 12) h_hcal_signal = (TH1F*)h_hcal_tower_calib[i_tower]->Clone();
51 else h_hcal_signal->Add(h_hcal_tower_calib[i_tower],1.0);
53 h_hcal_signal->Scale(1.0/4.0);
55 TCanvas *c_noise =
new TCanvas(
"c_noise",
"c_noise",10,10,1600,800);
57 for(
int i_pad = 0; i_pad < 2; ++i_pad)
60 c_noise->cd(i_pad+1)->SetLeftMargin(0.15);
61 c_noise->cd(i_pad+1)->SetBottomMargin(0.15);
62 c_noise->cd(i_pad+1)->SetTicks(1,1);
63 c_noise->cd(i_pad+1)->SetGrid(0,0);
64 c_noise->cd(i_pad+1)->SetLogy();
68 TH1F *h_play =
new TH1F(
"h_play",
"h_play",500,-0.5,99.5);
69 for(
int i_bin = 0; i_bin < 500; ++i_bin)
71 h_play->SetBinContent(i_bin+1,-10000.0);
72 h_play->SetBinError(i_bin+1,1.0);
75 h_play->SetTitle(
"cosmic signal");
76 h_play->SetLineColor(1);
77 h_play->GetXaxis()->SetTitle(
"energy (MeV)");
78 h_play->GetXaxis()->CenterTitle();
79 h_play->GetXaxis()->SetNdivisions(505);
80 h_play->GetYaxis()->SetRangeUser(1.0,500.0);
81 h_play->DrawCopy(
"h");
83 for(i_tower = 12; i_tower < 16; ++i_tower)
85 h_hcal_tower_calib[i_tower]->SetStats(0);
86 h_hcal_tower_calib[i_tower]->SetLineColor(i_tower-12+1);
87 h_hcal_tower_calib[i_tower]->GetXaxis()->SetTitle(
"energy (MeV)");
88 h_hcal_tower_calib[i_tower]->GetXaxis()->CenterTitle();
89 h_hcal_tower_calib[i_tower]->GetXaxis()->SetNdivisions(505);
90 h_hcal_tower_calib[i_tower]->DrawCopy(
"h same");
94 h_hcal_noise->SetStats(0);
95 h_hcal_noise->SetTitle(
"noise (averaged over all non-triggered towers)");
96 h_hcal_noise->SetLineColor(1);
97 h_hcal_noise->GetXaxis()->SetTitle(
"energy (MeV)");
98 h_hcal_noise->GetXaxis()->CenterTitle();
99 h_hcal_noise->GetXaxis()->SetNdivisions(505);
100 h_hcal_noise->GetYaxis()->SetRangeUser(1.0,500.0);
101 h_hcal_noise->DrawCopy(
"h");
103 TCanvas *c_noise_ave =
new TCanvas(
"c_noise_ave",
"c_noise_ave",10,10,1800,600);
104 c_noise_ave->Divide(3,1);
105 for(
int i_pad = 0; i_pad < 3; ++i_pad)
107 c_noise_ave->cd(i_pad+1);
108 c_noise_ave->cd(i_pad+1)->SetLeftMargin(0.15);
109 c_noise_ave->cd(i_pad+1)->SetBottomMargin(0.15);
110 c_noise_ave->cd(i_pad+1)->SetTicks(1,1);
111 c_noise_ave->cd(i_pad+1)->SetGrid(0,0);
112 c_noise_ave->cd(i_pad+1)->SetLogy();
116 h_hcal_signal->SetStats(0);
117 h_hcal_signal->SetTitle(
"signal (averaged over all triggered towers)");
118 h_hcal_signal->GetXaxis()->SetTitle(
"energy (MeV)");
119 h_hcal_signal->GetXaxis()->CenterTitle();
120 h_hcal_signal->GetXaxis()->SetNdivisions(505);
121 h_hcal_signal->GetYaxis()->SetRangeUser(1.0,500.0);
122 h_hcal_signal->SetLineColor(2);
123 h_hcal_signal->Draw(
"h same");
126 h_hcal_noise->SetStats(0);
127 h_hcal_noise->SetTitle(
"noise (averaged over all non-triggered towers)");
128 h_hcal_noise->SetLineColor(1);
129 h_hcal_noise->GetXaxis()->SetTitle(
"energy (MeV)");
130 h_hcal_noise->GetXaxis()->CenterTitle();
131 h_hcal_noise->GetXaxis()->SetNdivisions(505);
132 h_hcal_noise->GetYaxis()->SetRangeUser(1.0,500.0);
133 h_hcal_noise->Draw(
"h");
136 c_noise_ave->cd(3)->SetLogy(0);
137 TH1F *h_ratio = (TH1F*)h_hcal_noise->Clone(
"h_ratio");
138 h_ratio->SetTitle(
"noise/signal");
139 h_ratio->Divide(h_hcal_signal);
142 h_ratio->GetYaxis()->SetRangeUser(-0.2,0.6);
143 h_ratio->GetXaxis()->SetRangeUser(0.0,60.0);
144 h_ratio->SetMarkerStyle(20);
145 h_ratio->SetMarkerColor(1);
146 h_ratio->SetMarkerSize(0.8);
149 c_hcal->SaveAs(
"./figures/sPHENIX_CollMeeting/c_cosmic_hcalin.eps");
150 c_noise->SaveAs(
"./figures/sPHENIX_CollMeeting/c_noise_hcalin.eps");
151 c_noise_ave->SaveAs(
"./figures/sPHENIX_CollMeeting/c_noise_hcalin_averaged.eps");