17 #include <TGraphErrors.h>
32 const TString
infile =
"/phenix/u/jinhuang/links/sPHENIX_work/Prototype_2016/Production_0715_EMCalSet2_HCalPR12/beam_00002237-0000_DSTReader.root",
33 bool plot_all =
false,
const double momentum = -16)
38 gStyle->SetOptStat(0);
39 gStyle->SetOptFit(1111);
40 TVirtualFitter::SetDefaultFitter(
"Minuit2");
41 gSystem->Load(
"libg4eval.so");
42 gSystem->Load(
"libqa_modules.so");
43 gSystem->Load(
"libPrototype2.so");
49 TString chian_str =
infile;
50 chian_str.ReplaceAll(
"ALL",
"*");
52 TChain *
t =
new TChain(
"T");
53 const int n = t->Add(chian_str);
55 cout <<
"Loaded " << n <<
" root files with " << chian_str << endl;
66 T->SetAlias(
"ActiveTower_LG",
67 "TOWER_LG_CEMC[].get_binphi()<8 && TOWER_LG_CEMC[].get_bineta()<8");
68 T->SetAlias(
"EnergySum_LG",
69 "1*Sum$(TOWER_LG_CEMC[].get_energy() * ActiveTower_LG)");
71 T->SetAlias(
"ActiveTower_HG",
72 "TOWER_HG_CEMC[].get_binphi()<8 && TOWER_HG_CEMC[].get_bineta()<8");
73 T->SetAlias(
"EnergySum_HG",
74 "1*Sum$(TOWER_HG_CEMC[].get_energy() * ActiveTower_HG)");
77 T->SetAlias(
"C2_Inner_e",
"1*abs(TOWER_RAW_C2[2].energy)");
78 T->SetAlias(
"C2_Outer_e",
"1*abs(TOWER_RAW_C2[3].energy)");
79 T->SetAlias(
"C2_Sum_e",
"C2_Inner_e + C2_Outer_e");
83 T->SetAlias(
"Average_column",
84 "Sum$(TOWER_CALIB_CEMC.get_column() * TOWER_CALIB_CEMC.get_energy())/Sum$(TOWER_CALIB_CEMC.get_energy())");
85 T->SetAlias(
"Average_row",
86 "Sum$(TOWER_CALIB_CEMC.get_row() * TOWER_CALIB_CEMC.get_energy())/Sum$(TOWER_CALIB_CEMC.get_energy())");
88 T->SetAlias(
"Average_HODO_VERTICAL",
89 "Sum$(TOWER_CALIB_HODO_VERTICAL.towerid * (abs(TOWER_CALIB_HODO_VERTICAL.energy)>30) * abs(TOWER_CALIB_HODO_VERTICAL.energy))/Sum$((abs(TOWER_CALIB_HODO_VERTICAL.energy)>30) * abs(TOWER_CALIB_HODO_VERTICAL.energy))");
90 T->SetAlias(
"Valid_HODO_VERTICAL",
91 "Sum$(abs(TOWER_CALIB_HODO_VERTICAL.energy)>30) > 0");
93 T->SetAlias(
"Average_HODO_HORIZONTAL",
94 "Sum$(TOWER_CALIB_HODO_HORIZONTAL.towerid * (abs(TOWER_CALIB_HODO_HORIZONTAL.energy)>30) * abs(TOWER_CALIB_HODO_HORIZONTAL.energy))/Sum$((abs(TOWER_CALIB_HODO_HORIZONTAL.energy)>30) * abs(TOWER_CALIB_HODO_HORIZONTAL.energy))");
95 T->SetAlias(
"Valid_HODO_HORIZONTAL",
96 "Sum$(abs(TOWER_CALIB_HODO_HORIZONTAL.energy)>30) > 0");
98 T->SetAlias(
"No_Triger_VETO",
99 "Sum$(abs(TOWER_RAW_TRIGGER_VETO.energy)>15)==0");
101 T->SetAlias(
"Energy_Sum_col1_row2_3x3",
102 "Sum$( (abs(TOWER_CALIB_CEMC.get_column()-1)<=1 && abs(TOWER_CALIB_CEMC.get_row()-2)<=1 ) * TOWER_CALIB_CEMC.get_energy())");
103 T->SetAlias(
"Energy_Sum_col1_row2_5x5",
104 "Sum$( (abs(TOWER_CALIB_CEMC.get_column()-1)<=2 && abs(TOWER_CALIB_CEMC.get_row()-2)<=2 ) * TOWER_CALIB_CEMC.get_energy())");
105 T->SetAlias(
"Energy_Sum_col2_row2_5x5",
106 "Sum$( (abs(TOWER_CALIB_CEMC.get_column()-2)<=2 && abs(TOWER_CALIB_CEMC.get_row()-2)<=2 ) * TOWER_CALIB_CEMC.get_energy())");
107 T->SetAlias(
"Energy_Sum_CEMC",
"1*Sum$(TOWER_CALIB_CEMC.get_energy())");
118 T->SetAlias(
"Energy_Sum_Hadron_CEMC",
119 "1.14*12./8.71776e+00*Sum$(TOWER_CALIB_CEMC.get_energy())");
122 T->SetAlias(
"CEMC_MIP",
"Energy_Sum_Hadron_CEMC<0.7");
137 T->SetAlias(
"Energy_Sum_Hadron_HCALIN",
138 "12./6.99727e+00*Sum$(TOWER_CALIB_LG_HCALIN.get_energy())");
139 T->SetAlias(
"HCALIN_MIP",
"Energy_Sum_Hadron_HCALIN<0.5");
140 T->SetAlias(
"Energy_Sum_Hadron_HCALOUT",
141 "12./9.50430e+00*Sum$(TOWER_CALIB_LG_HCALOUT.get_energy())");
143 T->SetAlias(
"MIP_Count_Col2",
144 "Sum$( abs( TOWER_RAW_CEMC.get_energy() )>20 && abs( TOWER_RAW_CEMC.get_energy() )<200 && TOWER_CALIB_CEMC.get_column() == 2 )");
145 T->SetAlias(
"Pedestal_Count_AllCEMC",
146 "Sum$( abs( TOWER_RAW_CEMC.get_energy() )<20)");
158 "Valid_HODO_HORIZONTAL && Valid_HODO_VERTICAL && No_Triger_VETO";
159 cuts =
"_Valid_HODO_Trigger_VETO";
168 cout <<
"Build event selection of " << (
const char *) event_sel << endl;
170 T->Draw(
">>EventListRunCut", event_sel);
171 TEventList * elist = gDirectory->GetObjectChecked(
"EventListRunCut",
173 cout << elist->GetN() <<
" / " <<
T->GetEntriesFast()
174 <<
" events selected" << endl;
175 T->SetEventList(elist);
183 "Valid_HODO_HORIZONTAL && Valid_HODO_VERTICAL && No_Triger_VETO";
184 cuts =
"_Valid_HODO_Trigger_VETO";
212 cout <<
"Build event selection of " << (
const char *) event_sel << endl;
214 T->Draw(
">>EventList", event_sel);
215 TEventList * elist = gDirectory->GetObjectChecked(
"EventList",
"TEventList");
216 cout << elist->GetN() <<
" / " <<
T->GetEntriesFast() <<
" events selected"
219 T->SetEventList(elist);
228 gDirectory->mkdir(Form(
"dir_%d", rnd));
229 gDirectory->cd(Form(
"dir_%d", rnd));
234 gDirectory->mkdir(Form(
"dir_%d", rnd));
235 gDirectory->cd(Form(
"dir_%d", rnd));
240 gDirectory->mkdir(Form(
"dir_%d", rnd));
241 gDirectory->cd(Form(
"dir_%d", rnd));
246 gDirectory->mkdir(Form(
"dir_%d", rnd));
247 gDirectory->cd(Form(
"dir_%d", rnd));
252 gDirectory->mkdir(Form(
"dir_%d", rnd));
253 gDirectory->cd(Form(
"dir_%d", rnd));
258 gDirectory->mkdir(Form(
"dir_%d", rnd));
259 gDirectory->cd(Form(
"dir_%d", rnd));
264 gDirectory->mkdir(Form(
"dir_%d", rnd));
265 gDirectory->cd(Form(
"dir_%d", rnd));
270 gDirectory->mkdir(Form(
"dir_%d", rnd));
271 gDirectory->cd(Form(
"dir_%d", rnd));
276 gDirectory->mkdir(Form(
"dir_%d", rnd));
277 gDirectory->cd(Form(
"dir_%d", rnd));
291 gStyle->SetOptStat(0);
292 gStyle->SetOptFit(1111);
294 TH1F * h1_HCalOut =
new TH1F(
"h1_HCalOut",
295 "(CEMC MIP && HCal_{IN} MIP);EMCal + HCal_{IN} + HCal_{OUT} (GeV)", 100,
298 TH2 * h2_HCalOut_HCalIn =
299 new TH2F(
"h2_HCalOut_HCalIn",
300 "Energy Balance HCal_{OUT} and HCal_{IN} (CEMC MIP && NOT HCal_{IN} MIP);(HCal_{OUT} - HCal_{IN})/HCal Sum;EMCal + HCal_{IN} + HCal_{OUT} (GeV)",
303 TH2 * h2_HCal_EMCal =
304 new TH2F(
"h2_HCal_EMCal",
305 "Energy Balance HCal_{SUM} and EMCal (NOT CEMC MIP);(HCal_{SUM} - EMCal)/Sum;EMCal + HCal_{IN} + HCal_{OUT} (GeV)",
309 TCanvas *c1 =
new TCanvas(
"EMCDistribution_HCalCalibration" +
cuts,
310 "EMCDistribution_HCalCalibration" +
cuts, 1800, 600);
315 p = (TPad *) c1->cd(idx++);
319 "Energy_Sum_Hadron_CEMC + Energy_Sum_Hadron_HCALIN + Energy_Sum_Hadron_HCALOUT:(Energy_Sum_Hadron_HCALOUT - Energy_Sum_Hadron_HCALIN)/(Energy_Sum_Hadron_HCALIN+Energy_Sum_Hadron_HCALOUT)>>h2_HCalOut_HCalIn",
320 "(!HCALIN_MIP) && CEMC_MIP",
"goff");
321 h2_HCalOut_HCalIn->FitSlicesY();
323 TH1 * h2_HCalOut_HCalIn_1 = (TH1 *) gDirectory->GetObjectChecked(
324 "h2_HCalOut_HCalIn_1",
"TH1D");
325 assert(h2_HCalOut_HCalIn_1);
326 h2_HCalOut_HCalIn_1->SetMarkerStyle(kFullCircle);
328 TF1 * f_HCalOut_HCalIn =
new TF1(
"f_HCalOut_HCalIn",
329 "[0] * (x+1)/2 + [1]*(1-x)/2", -.8, 0.8);
330 f_HCalOut_HCalIn->SetLineColor(kMagenta);
331 f_HCalOut_HCalIn->SetLineWidth(3);
332 h2_HCalOut_HCalIn_1->Fit(f_HCalOut_HCalIn,
"MR0");
334 h2_HCalOut_HCalIn->DrawClone(
"colz");
335 h2_HCalOut_HCalIn_1->DrawClone(
"SAME");
336 f_HCalOut_HCalIn->DrawClone(
"same");
338 p = (TPad *) c1->cd(idx++);
342 "Energy_Sum_Hadron_CEMC + Energy_Sum_Hadron_HCALIN + Energy_Sum_Hadron_HCALOUT:(Energy_Sum_Hadron_HCALIN + Energy_Sum_Hadron_HCALOUT - Energy_Sum_Hadron_CEMC)/(Energy_Sum_Hadron_CEMC + Energy_Sum_Hadron_HCALIN + Energy_Sum_Hadron_HCALOUT)>>h2_HCal_EMCal",
343 "! CEMC_MIP",
"goff");
344 h2_HCal_EMCal->FitSlicesY();
346 TH1 * h2_HCal_EMCal_1 = (TH1 *) gDirectory->GetObjectChecked(
347 "h2_HCal_EMCal_1",
"TH1D");
349 h2_HCal_EMCal_1->SetMarkerStyle(kFullCircle);
351 TF1 * f_HCal_EMCal =
new TF1(
"f_HCal_EMCal",
"[0] * (x+1)/2 + [1]*(1-x)/2",
353 f_HCal_EMCal->SetLineColor(kMagenta);
354 f_HCal_EMCal->SetLineWidth(3);
355 h2_HCal_EMCal_1->Fit(f_HCal_EMCal,
"MR0");
357 h2_HCal_EMCal->DrawClone(
"colz");
358 h2_HCal_EMCal_1->DrawClone(
"SAME");
359 f_HCal_EMCal->DrawClone(
"same");
361 p = (TPad *) c1->cd(idx++);
365 "Energy_Sum_Hadron_CEMC + Energy_Sum_Hadron_HCALIN + Energy_Sum_Hadron_HCALOUT>>h1_HCalOut",
366 "HCALIN_MIP && CEMC_MIP",
"goff");
368 TH1 * h2_HCal_EMCal_ProjY = (TH1 *) h2_HCal_EMCal->ProjectionY(
369 "h2_HCal_EMCal_ProjY",2,9)->DrawClone();
370 TH1 * h2_HCalOut_HCalIn_ProjY = (TH1 *) h2_HCalOut_HCalIn->ProjectionY(
371 "h2_HCalOut_HCalIn_ProjY")->DrawClone(
"same");
372 h1_HCalOut->Draw(
"same");
374 h2_HCal_EMCal_ProjY->SetTitle(
"Red: 3 Calo shower, Blue: MIP EMCal, Green: MIP EMCal & HCal_{IN}");
376 h2_HCal_EMCal_ProjY->SetLineColor(kRed + 2);
377 h2_HCal_EMCal_ProjY->SetLineWidth(3);
378 h2_HCalOut_HCalIn_ProjY->SetLineColor(kBlue + 2);
379 h2_HCalOut_HCalIn_ProjY->SetLineWidth(2);
380 h1_HCalOut->SetLineColor(kGreen+3);
381 h1_HCalOut->SetLineWidth(3);
384 TString(
_file0->GetName()) + TString(
"_DrawPrototype2EMCalTower_")
385 + TString(c1->GetName()),
false);
391 const double che_cut = 100)
393 TString cut_pass = CherenkovSignal + Form(
">%.1f", che_cut);
394 TString cut_rej = CherenkovSignal + Form(
"<%.1f", che_cut);
396 const double event_pass =
T->GetEntries(cut_pass);
397 const double event_rej =
T->GetEntries(cut_rej);
399 TH2 * EnergyDist_pass =
new TH2F(
"EnergyDist_pass",
400 cut_pass +
";Column;Row;<Energy> / Event / Tower", 8, -.5, 7.5, 8, -.5,
402 TH2 * EnergyDist_rej =
new TH2F(
"EnergyDist_rej",
403 cut_rej +
";Column;Row;<Energy> / Event / Tower", 8, -.5, 7.5, 8, -.5,
406 TH1 * Che_full =
new TH1F(
"Che_full",
407 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 2000);
408 TH1 * Che_pass =
new TH1F(
"Che_pass",
409 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 2000);
410 TH1 * Che_rej =
new TH1F(
"Che_rej",
411 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 2000);
413 Che_full->SetLineColor(kBlue + 3);
414 Che_full->SetLineWidth(2);
415 Che_pass->SetLineColor(kGreen + 3);
416 Che_pass->SetLineWidth(2);
417 Che_pass->SetFillColor(kGreen + 3);
418 Che_pass->SetFillStyle(1);
419 Che_rej->SetLineColor(kBlue + 3);
420 Che_rej->SetLineWidth(2);
421 Che_rej->SetFillColor(kBlue + 3);
422 Che_rej->SetFillStyle(1);
425 "TOWER_CALIB_CEMC[].get_binphi():TOWER_CALIB_CEMC[].get_bineta()>>EnergyDist_pass",
426 Form(
"(%s) * (TOWER_CALIB_CEMC[].get_energy())", cut_pass.Data()),
429 "TOWER_CALIB_CEMC[].get_binphi():TOWER_CALIB_CEMC[].get_bineta()>>EnergyDist_rej",
430 Form(
"(%s) * (TOWER_CALIB_CEMC[].get_energy())", cut_rej.Data()),
"goff");
432 T->Draw(CherenkovSignal +
">>Che_full", NULL,
"goff");
433 T->Draw(CherenkovSignal +
">>Che_pass", cut_pass,
"goff");
434 T->Draw(CherenkovSignal +
">>Che_rej", cut_rej,
"goff");
436 EnergyDist_pass->Scale(1. / event_pass);
437 EnergyDist_rej->Scale(1. / event_rej);
440 TCanvas *c1 =
new TCanvas(
"EMCDistribution_ShowShape" +
cuts,
441 "EMCDistribution_ShowShape" +
cuts, 1800, 600);
446 p = (TPad *) c1->cd(idx++);
452 Che_full->DrawClone();
453 Che_pass->DrawClone(
"same");
454 Che_rej->DrawClone(
"same");
456 p = (TPad *) c1->cd(idx++);
460 EnergyDist_pass->DrawClone(
"LEGO2Z");
462 p = (TPad *) c1->cd(idx++);
468 EnergyDist_rej->DrawClone(
"LEGO2Z");
471 TString(
_file0->GetName()) + TString(
"_DrawPrototype2EMCalTower_")
472 + TString(c1->GetName()),
false);
478 TString CherenkovSignal =
"C2_Inner")
480 TH1 * EnergySum_LG_full =
new TH1F(
"EnergySum_LG_full",
481 ";Full range Tower Energy Sum (GeV);Count / bin", 300, 0, 40);
482 TH1 * EnergySum_LG =
new TH1F(
"EnergySum_LG",
483 ";Full range Tower Energy Sum (GeV);Count / bin", 300, 0, 40);
487 TH1 * C2_Inner_full =
new TH1F(
"C2_Inner_full",
488 CherenkovSignal +
";Cherenkov Signal (ADC);Count / bin", 200, 0, 2000);
489 TH1 * C2_Inner =
new TH1F(
"C2_Inner",
490 CherenkovSignal +
";Cherenkov Inner Signal (ADC);Count / bin", 200, 0,
493 EnergySum_LG_full->SetLineColor(kBlue + 3);
494 EnergySum_LG_full->SetLineWidth(2);
496 EnergySum_LG->SetLineColor(kGreen + 3);
497 EnergySum_LG->SetLineWidth(3);
498 EnergySum_LG->SetMarkerColor(kGreen + 3);
500 C2_Inner_full->SetLineColor(kBlue + 3);
501 C2_Inner_full->SetLineWidth(2);
503 C2_Inner->SetLineColor(kGreen + 3);
504 C2_Inner->SetLineWidth(3);
505 C2_Inner->SetMarkerColor(kGreen + 3);
507 TCut
c2 = CherenkovSignal +
">100";
509 T->Draw(sTOWER +
">>EnergySum_LG_full",
"",
"goff");
510 T->Draw(sTOWER +
">>EnergySum_LG", c2,
"goff");
511 T->Draw(CherenkovSignal +
">>C2_Inner_full",
"",
"goff");
512 T->Draw(CherenkovSignal +
">>C2_Inner", c2,
"goff");
515 TCanvas *c1 =
new TCanvas(
516 "EMCDistribution_SUM_" + sTOWER +
"_" + CherenkovSignal +
cuts,
517 "EMCDistribution_SUM_" + sTOWER +
"_" + CherenkovSignal +
cuts, 1800,
523 p = (TPad *) c1->cd(idx++);
529 C2_Inner_full->DrawClone();
530 C2_Inner->DrawClone(
"same");
532 p = (TPad *) c1->cd(idx++);
538 TH1 *
h = (TH1 *) EnergySum_LG_full->DrawClone();
539 h->GetXaxis()->SetRangeUser(0, h->GetMean() + 5 * h->GetRMS());
540 (TH1 *) EnergySum_LG->DrawClone(
"same");
542 p = (TPad *) c1->cd(idx++);
548 TH1 * h_full = (TH1 *) EnergySum_LG_full->DrawClone();
549 TH1 * h = (TH1 *) EnergySum_LG->DrawClone(
"same");
551 TF1 * fgaus_g =
new TF1(
"fgaus_LG_g",
"gaus", h->GetMean() - 1 * h->GetRMS(),
552 h->GetMean() + 4 * h->GetRMS());
553 fgaus_g->SetParameters(1, h->GetMean() - 2 * h->GetRMS(),
554 h->GetMean() + 2 * h->GetRMS());
555 h->Fit(fgaus_g,
"MR0N");
557 TF1 * fgaus =
new TF1(
"fgaus_LG",
"gaus",
558 fgaus_g->GetParameter(1) - 1 * fgaus_g->GetParameter(2),
559 fgaus_g->GetParameter(1) + 4 * fgaus_g->GetParameter(2));
560 fgaus->SetParameters(fgaus_g->GetParameter(0), fgaus_g->GetParameter(1),
561 fgaus_g->GetParameter(2));
566 h_full->GetXaxis()->SetRangeUser(h->GetMean() - 4 * h->GetRMS(),
567 h->GetMean() + 4 * h->GetRMS());
570 h->SetMarkerStyle(kFullCircle);
573 Form(
"#DeltaE/<E> = %.1f%%",
574 100 * fgaus->GetParameter(2) / fgaus->GetParameter(1)));
615 TString(
_file0->GetName()) + TString(
"_DrawPrototype2EMCalTower_")
616 + TString(c1->GetName()),
false);
623 TString hname =
"EMCDistribution_" +
gain
624 + TString(full_gain ?
"_FullGain" :
"") +
cuts;
627 if (
gain.Contains(
"CALIB"))
632 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 100, .05,
639 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 260, -.2,
643 "TOWER_" +
gain +
"_CEMC[].get_bineta() + 8* TOWER_" +
gain
644 +
"_CEMC[].get_binphi():TOWER_" +
gain +
"_CEMC[].get_energy()>>"
645 + hname,
"",
"goff");
647 else if (
gain.Contains(
"RAW"))
652 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 100,
653 .05 * 100, 25 * 100, 64, -.5, 63.5);
659 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 260,
660 -.2 * 100, 5 * 100, 64, -.5, 63.5);
663 "TOWER_" +
gain +
"_CEMC[].get_bineta() + 8* TOWER_" +
gain
664 +
"_CEMC[].get_binphi():TOWER_" +
gain
665 +
"_CEMC[].get_energy()*(-1)>>" + hname,
"",
"goff");
669 TCanvas *c1 =
new TCanvas(
670 "EMCDistribution_" +
gain + TString(full_gain ?
"_FullGain" :
"") + cuts,
671 "EMCDistribution_" +
gain + TString(full_gain ?
"_FullGain" :
"") + cuts,
673 c1->Divide(8, 8, 0., 0.01);
677 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
679 for (
int ieta = 0; ieta < 8; ieta++)
681 p = (TPad *) c1->cd(idx++);
692 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi)
693 + TString(full_gain ?
"_FullGain" :
"");
695 TH1 *
h = h2->ProjectionX(hname, ieta + 8 * iphi + 1,
696 ieta + 8 * iphi + 1);
699 h->SetLineColor(kBlue + 3);
700 h->SetFillColor(kBlue + 3);
702 h->GetXaxis()->SetTitleSize(.09);
703 h->GetXaxis()->SetLabelSize(.08);
704 h->GetYaxis()->SetLabelSize(.08);
709 h->Fit(
"x*gaus",
"M");
711 h->Fit(
"landau",
"M");
715 TF1 *
fit = ((TF1 *) (h->GetListOfFunctions()->At(0)));
719 fit->SetLineColor(kRed);
720 peak = fit->GetParameter(1);
724 cout << Form(
"Finished <Col%d Row%d> = %.1f", ieta, iphi, peak)
727 TText *t =
new TText(.9, .9,
728 Form(
"<Col%d Row%d> = %.1f", ieta, iphi, peak));
737 TString(
_file0->GetName()) + TString(
"_DrawPrototype2EMCalTower_")
738 + TString(c1->GetName()),
false);
746 const TString
gain =
"RAW";
748 TString hname =
"EMCDistribution_" + gain
749 + TString(full_gain ?
"_FullGain" :
"") +
cuts;
756 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 100,
757 .05 * 100, 25 * 100, 64, -.5, 63.5);
763 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 260,
764 -.2 * 100, 5 * 100, 64, -.5, 63.5);
767 "TOWER_" + gain +
"_CEMC[].get_bineta() + 8* TOWER_" + gain
768 +
"_CEMC[].get_binphi():(TOWER_RAW_CEMC[].signal_samples[10] - TOWER_RAW_CEMC[].signal_samples[0])*(-1)>>" + hname,
"",
"goff");
772 TCanvas *c1 =
new TCanvas(
773 "EMCDistribution_PeakSample_Fast_" + TString(full_gain ?
"_FullGain" :
"") + cuts,
774 "EMCDistribution_PeakSample_Fast_" + TString(full_gain ?
"_FullGain" :
"") + cuts,
776 c1->Divide(8, 8, 0., 0.01);
780 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
782 for (
int ieta = 0; ieta < 8; ieta++)
784 p = (TPad *) c1->cd(idx++);
795 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi)
796 + TString(full_gain ?
"_FullGain" :
"");
798 TH1 *
h = h2->ProjectionX(hname, ieta + 8 * iphi + 1,
799 ieta + 8 * iphi + 1);
802 h->SetLineColor(kBlue + 3);
803 h->SetFillColor(kBlue + 3);
805 h->GetXaxis()->SetTitleSize(.09);
806 h->GetXaxis()->SetLabelSize(.08);
807 h->GetYaxis()->SetLabelSize(.08);
812 h->Fit(
"x*gaus",
"M");
814 h->Fit(
"landau",
"M");
818 TF1 *
fit = ((TF1 *) (h->GetListOfFunctions()->At(0)));
822 fit->SetLineColor(kRed);
823 peak = fit->GetParameter(1);
827 cout << Form(
"Finished <Col%d Row%d> = %.1f", ieta, iphi, peak)
830 TText *t =
new TText(.9, .9,
831 Form(
"<Col%d Row%d> = %.1f", ieta, iphi, peak));
840 TString(
_file0->GetName()) + TString(
"_DrawPrototype2EMCalTower_")
841 + TString(c1->GetName()),
false);
852 TCanvas *c1 =
new TCanvas(
853 "EMCDistribution_" +
gain + TString(log_scale ?
"_Log" :
"") +
cuts,
854 "EMCDistribution_" +
gain + TString(log_scale ?
"_Log" :
"") +
cuts, 1800,
856 c1->Divide(8, 8, 0., 0.01);
860 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
862 for (
int ieta = 0; ieta < 8; ieta++)
864 p = (TPad *) c1->cd(idx++);
871 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi)
872 + TString(log_scale ?
"_Log" :
"");
878 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 300,
885 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 596,
889 h->SetLineColor(kBlue + 3);
890 h->SetFillColor(kBlue + 3);
891 h->GetXaxis()->SetTitleSize(.09);
892 h->GetXaxis()->SetLabelSize(.08);
893 h->GetYaxis()->SetLabelSize(.08);
899 "TOWER_" +
gain +
"_CEMC[].get_energy_power_law_exp()>>" + hname,
901 "TOWER_%s_CEMC[].get_bineta()==%d && TOWER_%s_CEMC[].get_binphi()==%d",
902 gain.Data(), ieta,
gain.Data(), iphi),
"");
904 TText *t =
new TText(.9, .9, Form(
"Col%d Row%d", ieta, iphi));
915 TString(
_file0->GetName()) + TString(
"_DrawPrototype2EMCalTower_")
916 + TString(c1->GetName()),
false);
923 TString
gain =
"RAW";
926 TCanvas *c1 =
new TCanvas(
927 "EMCDistribution_ADC_" + gain + TString(log_scale ?
"_Log" :
"") +
cuts,
928 "EMCDistribution_ADC_" + gain + TString(log_scale ?
"_Log" :
"") +
cuts,
930 c1->Divide(8, 8, 0., 0.01);
934 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
936 for (
int ieta = 0; ieta < 8; ieta++)
938 p = (TPad *) c1->cd(idx++);
948 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi)
949 + TString(log_scale ?
"_Log" :
"");
955 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 24, -.5,
965 h->SetLineColor(kBlue + 3);
966 h->SetFillColor(kBlue + 3);
967 h->GetXaxis()->SetTitleSize(.09);
968 h->GetXaxis()->SetLabelSize(.08);
969 h->GetYaxis()->SetLabelSize(.08);
974 TString sdraw =
"TOWER_" + gain
975 +
"_CEMC[].signal_samples[]:fmod(Iteration$,24)>>" + hname;
978 "TOWER_%s_CEMC[].get_bineta()==%d && TOWER_%s_CEMC[].get_binphi()==%d",
979 gain.Data(), ieta, gain.Data(), iphi);
981 cout <<
"T->Draw(\"" << sdraw <<
"\",\"" << scut <<
"\");" << endl;
983 T->Draw(sdraw, scut,
"colz");
985 TText *t =
new TText(.9, .9, Form(
"Col%d Row%d", ieta, iphi));
996 TString(
_file0->GetName()) + TString(
"_DrawPrototype2EMCalTower_")
997 + TString(c1->GetName()),
false);