1 #include <calobase/TowerInfoDefs.h>
2 R__LOAD_LIBRARY(libcalo_io.so)
5 TFile
input(inputFile.c_str());
7 bool style_eta_phi =
true;
8 auto c1 =
new TCanvas();
14 c1->SetCanvasSize(1500, 1000);
16 c1->SetLeftMargin(.1);
17 c1->SetRightMargin(.05);
20 string outputFile =
outputDir +
"/plots-" + run +
".pdf";
21 c1->Print((outputFile +
"[").c_str(),
"pdf portrait");
25 auto h1 = (TH1D*)(
input.Get(
"hTime"))->Clone();
26 h1->SetTitle((
"Run: " + run +
", Peak Location").c_str());
32 auto st = (TPaveStats*)
h1->GetListOfFunctions()->FindObject(
"stats");
39 c1->Print((outputFile).c_str(),
"pdf portrait");
43 h1 = (TH1D*)(
input.Get(
"hADC"))->Clone();
44 h1->SetTitle((
"Run: " + run +
", ADC").c_str());
48 c1->Print((outputFile).c_str(),
"pdf portrait");
52 h1 = (TH1D*)(
input.Get(
"hadc"))->Clone();
53 h1->SetTitle((
"Run: " + run +
", adc").c_str());
57 c1->Print((outputFile).c_str(),
"pdf portrait");
61 h1 = (TH1D*)(
input.Get(
"hPed"))->Clone();
62 h1->SetTitle((
"Run: " + run +
", Pedestal").c_str());
66 c1->Print((outputFile).c_str(),
"pdf portrait");
85 c1->SetLeftMargin(.11);
86 c1->SetRightMargin(.03);
88 auto h2 = (TH2D*)(
input.Get(
"h2ADCVsChannel"))->Clone();
100 h1 = (TH1D*)
h2->ProfileX()->Clone();
101 h1->SetTitle((
"Run: " + run +
", Average ADC vs Channel; Channel; ADC").c_str());
102 h1->SetMarkerStyle(6);
103 h1->SetMarkerColor(kRed);
106 c1->Print((outputFile).c_str(),
"pdf portrait");
109 h1 = (TH1D*)((TH2*)
input.Get(
"h2ADCVsChannel"))->ProfileX();
112 h2 =
new TH2D(
"h2AvgAdc",
"Average ADC; Towerid #eta; Towerid #phi", 96, 0-0.5, 96-0.5, 256, 0-0.5, 256-0.5);
113 h2_missing =
new TH2D(
"h2AvgAdcMissing",
"Average ADC (Zeros); Towerid #eta; Towerid #phi", 96, 0-0.5, 96-0.5, 256, 0-0.5, 256-0.5);
116 h2 =
new TH2D(
"h2AvgAdc",
"Average ADC; Towerid #phi; Towerid #eta", 256, 0-0.5, 256-0.5, 96, 0-0.5, 96-0.5);
117 h2_missing =
new TH2D(
"h2AvgAdcMissing",
"Average ADC (Zeros); Towerid #phi; Towerid #eta", 256, 0-0.5, 256-0.5, 96, 0-0.5, 96-0.5);
125 Double_t avg_adc =
h1->GetBinContent(
channel+1);
129 h2->SetBinContent(etabin+1, phibin+1, avg_adc);
130 if(avg_adc == 0) h2_missing->SetBinContent(etabin+1, phibin+1, 1);
133 h2->SetBinContent(phibin+1, etabin+1, avg_adc);
134 if(avg_adc == 0) h2_missing->SetBinContent(phibin+1, etabin+1, 1);
139 c1->SetRightMargin(.12);
141 h2->SetTitle((
"Run: " + run +
", Average ADC").c_str());
145 auto tline =
new TLine();
148 for (UInt_t
i = 0;
i < 32; ++
i) {
149 tline->DrawLine(-0.5, 8*
i-0.5, 95.5, 8*
i-0.5);
151 for (UInt_t
i = 0;
i < 12; ++
i) {
152 tline->DrawLine(8*
i-0.5, -0.5, 8*
i-0.5, 255.5);
156 for (UInt_t
i = 0;
i < 32; ++
i) {
157 tline->DrawLine(8*
i-0.5, -0.5, 8*
i-0.5, 95.5);
159 for (UInt_t
i = 0;
i < 12; ++
i) {
160 tline->DrawLine(-0.5, 8*
i-0.5, 255.5, 8*
i-0.5);
164 c1->Print((outputFile).c_str(),
"pdf portrait");
169 h2_missing->SetStats(0);
170 h2_missing->SetTitle((
"Run: " + run +
", Average ADC (zeros)").c_str());
172 h2_missing->Draw(
"COLZ1");
177 for (UInt_t
i = 0;
i < 32; ++
i) {
178 tline->DrawLine(-0.5, 8*
i-0.5, 95.5, 8*
i-0.5);
180 for (UInt_t
i = 0;
i < 12; ++
i) {
181 tline->DrawLine(8*
i-0.5, -0.5, 8*
i-0.5, 255.5);
185 for (UInt_t
i = 0;
i < 32; ++
i) {
186 tline->DrawLine(8*
i-0.5, -0.5, 8*
i-0.5, 95.5);
188 for (UInt_t
i = 0;
i < 12; ++
i) {
189 tline->DrawLine(-0.5, 8*
i-0.5, 255.5, 8*
i-0.5);
193 c1->Print((outputFile).c_str(),
"pdf portrait");
195 c1->SetRightMargin(.1);
196 c1->SetLeftMargin(.1);
200 c1->SetLeftMargin(.12);
201 c1->SetRightMargin(.04);
202 h2 = (TH2D*)(
input.Get(
"h2PedVsChannel"))->Clone();
204 h2->SetMarkerStyle(8);
205 h2->SetMarkerColor(kRed);
206 h2->SetFillColor(kRed);
211 h1 = (TH1D*)
h2->ProfileX()->Clone();
212 h1->SetTitle((
"Run: " + run +
", Average Pedestal vs Channel; Channel; Pedestal").c_str());
215 c1->Print((outputFile).c_str(),
"pdf portrait");
219 c1->SetLeftMargin(.1);
221 h2 = (TH2D*)(
input.Get(
"h2PedVsChannel"))->Clone();
222 h1 = (TH1D*)
h2->ProfileX()->Clone();
225 h2 =
new TH2D(
"h2AvgPed",
"Average Pedestal; Towerid #eta; Towerid #phi", 96, 0-0.5, 96-0.5, 256, 0-0.5, 256-0.5);
228 h2 =
new TH2D(
"h2AvgPed",
"Average Pedestal; Towerid #phi; Towerid #eta", 256, 0-0.5, 256-0.5, 96, 0-0.5, 96-0.5);
236 Double_t avg_ped =
h1->GetBinContent(
channel+1);
238 if(style_eta_phi)
h2->SetBinContent(etabin+1, phibin+1, avg_ped);
239 else h2->SetBinContent(phibin+1, etabin+1, avg_ped);
243 c1->SetRightMargin(.12);
245 h2->SetTitle((
"Run: " + run +
", Average Pedestal").c_str());
252 for (UInt_t
i = 0;
i < 32; ++
i) {
253 tline->DrawLine(-0.5, 8*
i-0.5, 95.5, 8*
i-0.5);
255 for (UInt_t
i = 0;
i < 12; ++
i) {
256 tline->DrawLine(8*
i-0.5, -0.5, 8*
i-0.5, 255.5);
260 for (UInt_t
i = 0;
i < 32; ++
i) {
261 tline->DrawLine(8*
i-0.5, -0.5, 8*
i-0.5, 95.5);
263 for (UInt_t
i = 0;
i < 12; ++
i) {
264 tline->DrawLine(-0.5, 8*
i-0.5, 255.5, 8*
i-0.5);
268 c1->Print((outputFile).c_str(),
"pdf portrait");
304 c1->Print((outputFile +
"]").c_str(),
"pdf portrait");
309 gStyle->SetPalette(kThermometer);
311 outputFile =
outputDir +
"/adcVsTime-" + run +
".pdf";
317 auto h2_pos_global =
new TH2F(
"h2_pos_global",
"Towers; Towerid #phi; Towerid #eta", 256, 0-0.5, 256-0.5, 96, 0-0.5, 96-0.5);
318 h2_pos_global->SetFillColor(kGreen);
319 for(Int_t
i = 0;
i < i_max; ++
i) {
320 for (Int_t
j = 0;
j < j_max; ++
j) {
322 for (Int_t phibin =
j*8; phibin <
j*8+8; ++phibin) {
325 h2 = (TH2D*)(
input.Get((
"adcVsTime/h2adcVsTime_"+
to_string(channel)).c_str()));
326 if(
h2) h2_pos_global->SetBinContent(phibin+1,
etabin+1, 1);
334 c1->Print((outputFile +
"[").c_str(),
"pdf portrait");
335 for(Int_t
i = 0;
i < i_max; ++
i) {
336 for (Int_t
j = 0;
j < j_max; ++
j) {
337 if((
i*j_max+
j)%3 == 0) cout <<
"Progress: " << (
i*j_max+
j)*100./(i_max*j_max) <<
" %" << endl;
340 c1->SetCanvasSize(1500, 1000);
341 auto pad1 =
new TPad(
"pad1",
"pad1", 0.01, 0.01, 0.8, 1);
342 auto pad2 =
new TPad(
"pad2",
"pad2", 0.8, 0.8, 1, 1);
344 auto h2_pos =
new TH2F(
"h2_pos",
"Towers; Towerid #phi; Towerid #eta", 256, 0-0.5, 256-0.5, 96, 0-0.5, 96-0.5);
345 pad1->DivideSquare(64,0,0);
349 bool contains_channels =
false;
352 for (Int_t phibin =
j*8; phibin <
j*8+8; ++phibin) {
355 h2 = (TH2D*)(
input.Get((
"adcVsTime/h2adcVsTime_"+
to_string(channel)).c_str()));
357 h2_pos->SetBinContent(phibin+1,
etabin+1, 1);
360 contains_channels =
true;
362 h2 = (TH2D*)
h2->Clone();
381 auto pt =
new TPaveText(.7,.7,.95,.9,
"NDC");
390 if(contains_channels) {
395 h2_pos_global->SetStats(0);
396 h2_pos_global->Draw(
"BOX");
397 h2_pos->Draw(
"BOX same");
399 c1->Print((outputFile).c_str(),
"pdf portrait");
409 c1->Print((outputFile +
"]").c_str(),
"pdf portrait");