12 #include <TGraphErrors.h>
31 const TString
infile =
"/phenix/u/jinhuang/links/sPHENIX_work/Prototype_2017/Production_0216_UpdateCalib/beam_00003672-0000_DSTReader.root",
32 bool plot_all =
false,
const double momentum = -16)
37 gStyle->SetOptStat(0);
38 gStyle->SetOptFit(1111);
39 TVirtualFitter::SetDefaultFitter(
"Minuit2");
40 gSystem->Load(
"libg4eval.so");
41 gSystem->Load(
"libqa_modules.so");
42 gSystem->Load(
"libPrototype3.so");
48 TString chian_str =
infile;
49 chian_str.ReplaceAll(
"ALL",
"*");
51 TChain *
t =
new TChain(
"T");
52 const int n = t->Add(chian_str);
54 cout <<
"Loaded " << n <<
" root files with " << chian_str << endl;
65 T->SetAlias(
"ActiveTower_LG",
66 "TOWER_LG_CEMC[].get_binphi()<8 && TOWER_LG_CEMC[].get_bineta()<8");
67 T->SetAlias(
"EnergySum_LG",
68 "1*Sum$(TOWER_LG_CEMC[].get_energy() * ActiveTower_LG)");
70 T->SetAlias(
"ActiveTower_HG",
71 "TOWER_HG_CEMC[].get_binphi()<8 && TOWER_HG_CEMC[].get_bineta()<8");
72 T->SetAlias(
"EnergySum_HG",
73 "1*Sum$(TOWER_HG_CEMC[].get_energy() * ActiveTower_HG)");
76 T->SetAlias(
"C2_Inner_e",
"1*(TOWER_CALIB_C2[2].energy)");
77 T->SetAlias(
"C2_Outer_e",
"1*(TOWER_CALIB_C2[3].energy)");
78 T->SetAlias(
"C2_Sum_e",
"C2_Inner_e + C2_Outer_e");
79 T->SetAlias(
"C1",
"0 + TOWER_CALIB_C1[0].energy");
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())");
108 T->SetAlias(
"Energy_Sum_RAW_CEMC",
"1*Sum$(TOWER_RAW_CEMC.get_energy())");
119 T->SetAlias(
"Energy_Sum_Hadron_CEMC",
120 "1.14*12./8.71776e+00*Sum$(TOWER_CALIB_CEMC.get_energy())");
123 T->SetAlias(
"CEMC_MIP",
"Energy_Sum_Hadron_CEMC<0.7");
138 T->SetAlias(
"Energy_Sum_Hadron_HCALIN",
139 "12./6.99727e+00*Sum$(TOWER_CALIB_LG_HCALIN.get_energy())");
140 T->SetAlias(
"HCALIN_MIP",
"Energy_Sum_Hadron_HCALIN<0.5");
141 T->SetAlias(
"Energy_Sum_Hadron_HCALOUT",
142 "12./9.50430e+00*Sum$(TOWER_CALIB_LG_HCALOUT.get_energy())");
144 T->SetAlias(
"MIP_Count_Col2",
145 "Sum$( abs( TOWER_RAW_CEMC.get_energy() )>20 && abs( TOWER_RAW_CEMC.get_energy() )<200 && TOWER_CALIB_CEMC.get_column() == 2 )");
146 T->SetAlias(
"Pedestal_Count_AllCEMC",
147 "Sum$( abs( TOWER_RAW_CEMC.get_energy() )<20)");
159 "Valid_HODO_HORIZONTAL && Valid_HODO_VERTICAL && No_Triger_VETO";
160 cuts =
"_Valid_HODO_Trigger_VETO";
169 cout <<
"Build event selection of " << (
const char *) event_sel
172 T->Draw(
">>EventListRunCut", event_sel);
173 TEventList *elist = gDirectory->GetObjectChecked(
"EventListRunCut",
175 cout << elist->GetN() <<
" / " <<
T->GetEntriesFast()
176 <<
" events selected" << endl;
177 T->SetEventList(elist);
185 "Valid_HODO_HORIZONTAL && Valid_HODO_VERTICAL && No_Triger_VETO";
186 cuts =
"_Valid_HODO_Trigger_VETO";
214 cout <<
"Build event selection of " << (
const char *) event_sel << endl;
216 T->Draw(
">>EventList", event_sel);
217 TEventList *elist = gDirectory->GetObjectChecked(
"EventList",
"TEventList");
218 cout << elist->GetN() <<
" / " <<
T->GetEntriesFast() <<
" events selected"
221 T->SetEventList(elist);
230 gDirectory->mkdir(Form(
"dir_%d", rnd));
231 gDirectory->cd(Form(
"dir_%d", rnd));
236 gDirectory->mkdir(Form(
"dir_%d", rnd));
237 gDirectory->cd(Form(
"dir_%d", rnd));
241 gDirectory->mkdir(Form(
"dir_%d", rnd));
242 gDirectory->cd(Form(
"dir_%d", rnd));
247 gDirectory->mkdir(Form(
"dir_%d", rnd));
248 gDirectory->cd(Form(
"dir_%d", rnd));
253 gDirectory->mkdir(Form(
"dir_%d", rnd));
254 gDirectory->cd(Form(
"dir_%d", rnd));
259 gDirectory->mkdir(Form(
"dir_%d", rnd));
260 gDirectory->cd(Form(
"dir_%d", rnd));
265 gDirectory->mkdir(Form(
"dir_%d", rnd));
266 gDirectory->cd(Form(
"dir_%d", rnd));
277 gDirectory->mkdir(Form(
"dir_%d", rnd));
278 gDirectory->cd(Form(
"dir_%d", rnd));
283 gDirectory->mkdir(Form(
"dir_%d", rnd));
284 gDirectory->cd(Form(
"dir_%d", rnd));
297 gStyle->SetOptStat(0);
298 gStyle->SetOptFit(1111);
300 TH1F *h1_HCalOut =
new TH1F(
"h1_HCalOut",
301 "(CEMC MIP && HCal_{IN} MIP);EMCal + HCal_{IN} + HCal_{OUT} (GeV)", 100,
304 TH2 *h2_HCalOut_HCalIn =
305 new TH2F(
"h2_HCalOut_HCalIn",
306 "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)",
310 new TH2F(
"h2_HCal_EMCal",
311 "Energy Balance HCal_{SUM} and EMCal (NOT CEMC MIP);(HCal_{SUM} - EMCal)/Sum;EMCal + HCal_{IN} + HCal_{OUT} (GeV)",
315 TCanvas *c1 =
new TCanvas(
"EMCDistribution_HCalCalibration" +
cuts,
316 "EMCDistribution_HCalCalibration" +
cuts, 1800, 600);
321 p = (TPad *) c1->cd(idx++);
325 "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",
326 "(!HCALIN_MIP) && CEMC_MIP",
"goff");
327 h2_HCalOut_HCalIn->FitSlicesY();
329 TH1 *h2_HCalOut_HCalIn_1 = (TH1 *) gDirectory->GetObjectChecked(
330 "h2_HCalOut_HCalIn_1",
"TH1D");
331 assert(h2_HCalOut_HCalIn_1);
332 h2_HCalOut_HCalIn_1->SetMarkerStyle(kFullCircle);
334 TF1 *f_HCalOut_HCalIn =
new TF1(
"f_HCalOut_HCalIn",
335 "[0] * (x+1)/2 + [1]*(1-x)/2", -.8, 0.8);
336 f_HCalOut_HCalIn->SetLineColor(kMagenta);
337 f_HCalOut_HCalIn->SetLineWidth(3);
338 h2_HCalOut_HCalIn_1->Fit(f_HCalOut_HCalIn,
"MR0");
340 h2_HCalOut_HCalIn->DrawClone(
"colz");
341 h2_HCalOut_HCalIn_1->DrawClone(
"SAME");
342 f_HCalOut_HCalIn->DrawClone(
"same");
344 p = (TPad *) c1->cd(idx++);
348 "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",
349 "! CEMC_MIP",
"goff");
350 h2_HCal_EMCal->FitSlicesY();
352 TH1 *h2_HCal_EMCal_1 = (TH1 *) gDirectory->GetObjectChecked(
353 "h2_HCal_EMCal_1",
"TH1D");
355 h2_HCal_EMCal_1->SetMarkerStyle(kFullCircle);
357 TF1 *f_HCal_EMCal =
new TF1(
"f_HCal_EMCal",
"[0] * (x+1)/2 + [1]*(1-x)/2",
359 f_HCal_EMCal->SetLineColor(kMagenta);
360 f_HCal_EMCal->SetLineWidth(3);
361 h2_HCal_EMCal_1->Fit(f_HCal_EMCal,
"MR0");
363 h2_HCal_EMCal->DrawClone(
"colz");
364 h2_HCal_EMCal_1->DrawClone(
"SAME");
365 f_HCal_EMCal->DrawClone(
"same");
367 p = (TPad *) c1->cd(idx++);
371 "Energy_Sum_Hadron_CEMC + Energy_Sum_Hadron_HCALIN + Energy_Sum_Hadron_HCALOUT>>h1_HCalOut",
372 "HCALIN_MIP && CEMC_MIP",
"goff");
374 TH1 *h2_HCal_EMCal_ProjY = (TH1 *) h2_HCal_EMCal->ProjectionY(
375 "h2_HCal_EMCal_ProjY", 2, 9)
377 TH1 *h2_HCalOut_HCalIn_ProjY = (TH1 *) h2_HCalOut_HCalIn->ProjectionY(
378 "h2_HCalOut_HCalIn_ProjY")
380 h1_HCalOut->Draw(
"same");
382 h2_HCal_EMCal_ProjY->SetTitle(
383 "Red: 3 Calo shower, Blue: MIP EMCal, Green: MIP EMCal & HCal_{IN}");
385 h2_HCal_EMCal_ProjY->SetLineColor(kRed + 2);
386 h2_HCal_EMCal_ProjY->SetLineWidth(3);
387 h2_HCalOut_HCalIn_ProjY->SetLineColor(kBlue + 2);
388 h2_HCalOut_HCalIn_ProjY->SetLineWidth(2);
389 h1_HCalOut->SetLineColor(kGreen + 3);
390 h1_HCalOut->SetLineWidth(3);
393 TString(
_file0->GetName()) + TString(
"_DrawPrototype3EMCalTower_") + TString(c1->GetName()),
false);
397 const double che_cut = 10)
399 TString cut_pass = CherenkovSignal + Form(
">%.1f", che_cut);
400 TString cut_rej = CherenkovSignal + Form(
"<%.1f", che_cut);
402 const double event_pass =
T->GetEntries(cut_pass);
403 const double event_rej =
T->GetEntries(cut_rej);
405 TH2 *EnergyDist_pass =
new TH2F(
"EnergyDist_pass",
406 cut_pass +
";Column;Row;<Energy> / Event / Tower", 8, -.5, 7.5, 8, -.5,
408 TH2 *EnergyDist_rej =
new TH2F(
"EnergyDist_rej",
409 cut_rej +
";Column;Row;<Energy> / Event / Tower", 8, -.5, 7.5, 8, -.5,
411 TH2 *Hodoscope_dist =
new TH2F(
"Hodoscope_dist",
412 cut_rej +
";7 - Horizontal Hodoscope (5 mm);7 - Vertical Hodoscope (5 mm); Event / finger^2", 8, -.5, 7.5, 8, -.5,
415 TH1 *Che_full =
new TH1F(
"Che_full",
416 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 2000);
417 TH1 *Che_pass =
new TH1F(
"Che_pass",
418 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 2000);
419 TH1 *Che_rej =
new TH1F(
"Che_rej",
420 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 2000);
422 Che_full->SetLineColor(kBlue + 3);
423 Che_full->SetLineWidth(2);
424 Che_pass->SetLineColor(kGreen + 3);
425 Che_pass->SetLineWidth(2);
426 Che_pass->SetFillColor(kGreen + 3);
427 Che_pass->SetFillStyle(1);
428 Che_rej->SetLineColor(kBlue + 3);
429 Che_rej->SetLineWidth(2);
430 Che_rej->SetFillColor(kBlue + 3);
431 Che_rej->SetFillStyle(1);
434 "TOWER_CALIB_CEMC[].get_binphi():TOWER_CALIB_CEMC[].get_bineta()>>EnergyDist_pass",
435 Form(
"(%s) * (TOWER_CALIB_CEMC[].get_energy())", cut_pass.Data()),
438 "TOWER_CALIB_CEMC[].get_binphi():TOWER_CALIB_CEMC[].get_bineta()>>EnergyDist_rej",
439 Form(
"(%s) * (TOWER_CALIB_CEMC[].get_energy())", cut_rej.Data()),
"goff");
441 "7 - Average_HODO_VERTICAL:7 - Average_HODO_HORIZONTAL>>Hodoscope_dist",
"1",
"goff");
443 T->Draw(CherenkovSignal +
">>Che_full", NULL,
"goff");
444 T->Draw(CherenkovSignal +
">>Che_pass", cut_pass,
"goff");
445 T->Draw(CherenkovSignal +
">>Che_rej", cut_rej,
"goff");
447 EnergyDist_pass->Scale(1. / event_pass);
448 EnergyDist_rej->Scale(1. / event_rej);
451 TCanvas *c1 =
new TCanvas(
"EMCDistribution_ShowShape" +
cuts,
452 "EMCDistribution_ShowShape" +
cuts, 1100, 950);
457 p = (TPad *) c1->cd(idx++);
463 Che_full->DrawClone();
464 Che_pass->DrawClone(
"same");
465 Che_rej->DrawClone(
"same");
467 p = (TPad *) c1->cd(idx++);
471 EnergyDist_pass->DrawClone(
"colz");
473 p = (TPad *) c1->cd(idx++);
479 EnergyDist_rej->DrawClone(
"colz");
481 p = (TPad *) c1->cd(idx++);
487 Hodoscope_dist->DrawClone(
"colz");
490 TString(
_file0->GetName()) + TString(
"_DrawPrototype3EMCalTower_") + TString(c1->GetName()),
false);
494 TString CherenkovSignal =
"C2_Inner")
496 TH1 *EnergySum_LG_full =
new TH1F(
"EnergySum_LG_full",
497 ";Full range Tower Energy Sum (GeV);Count / bin", 900, 0, 120);
498 TH1 *EnergySum_LG =
new TH1F(
"EnergySum_LG",
499 ";Full range Tower Energy Sum (GeV);Count / bin", 900, 0, 120);
503 TH1 *C2_Inner_full =
new TH1F(
"C2_Inner_full",
504 CherenkovSignal +
";Cherenkov Signal (ADC);Count / bin", 1000, 0, 2000);
505 TH1 *C2_Inner =
new TH1F(
"C2_Inner",
506 CherenkovSignal +
";Cherenkov Inner Signal (ADC);Count / bin", 200, 0,
509 EnergySum_LG_full->SetLineColor(kBlue + 3);
510 EnergySum_LG_full->SetLineWidth(2);
512 EnergySum_LG->SetLineColor(kGreen + 3);
513 EnergySum_LG->SetLineWidth(3);
514 EnergySum_LG->SetMarkerColor(kGreen + 3);
516 C2_Inner_full->SetLineColor(kBlue + 3);
517 C2_Inner_full->SetLineWidth(2);
519 C2_Inner->SetLineColor(kGreen + 3);
520 C2_Inner->SetLineWidth(3);
521 C2_Inner->SetMarkerColor(kGreen + 3);
523 TCut
c2 = CherenkovSignal +
">240";
525 T->Draw(sTOWER +
">>EnergySum_LG_full",
"",
"goff");
526 T->Draw(sTOWER +
">>EnergySum_LG", c2,
"goff");
527 T->Draw(CherenkovSignal +
">>C2_Inner_full",
"",
"goff");
528 T->Draw(CherenkovSignal +
">>C2_Inner", c2,
"goff");
531 TCanvas *c1 =
new TCanvas(
532 "EMCDistribution_SUM_" + sTOWER +
"_" + CherenkovSignal +
cuts,
533 "EMCDistribution_SUM_" + sTOWER +
"_" + CherenkovSignal +
cuts, 1800,
539 p = (TPad *) c1->cd(idx++);
545 C2_Inner_full->DrawClone();
546 C2_Inner->DrawClone(
"same");
548 p = (TPad *) c1->cd(idx++);
554 TH1 *
h = (TH1 *) EnergySum_LG_full->DrawClone();
555 h->GetXaxis()->SetRangeUser(0, h->GetMean() + 5 * h->GetRMS());
556 (TH1 *) EnergySum_LG->DrawClone(
"same");
558 p = (TPad *) c1->cd(idx++);
564 TH1 *h_full = (TH1 *) EnergySum_LG_full->DrawClone();
565 TH1 *h = (TH1 *) EnergySum_LG->DrawClone(
"same");
567 TF1 *fgaus_g =
new TF1(
"fgaus_LG_g",
"gaus", h->GetMean() - 1 * h->GetRMS(),
568 h->GetMean() + 4 * h->GetRMS());
569 fgaus_g->SetParameters(1, h->GetMean() - 2 * h->GetRMS(),
570 h->GetMean() + 2 * h->GetRMS());
571 h->Fit(fgaus_g,
"MR0N");
573 TF1 *fgaus =
new TF1(
"fgaus_LG",
"gaus",
574 fgaus_g->GetParameter(1) - 1 * fgaus_g->GetParameter(2),
575 fgaus_g->GetParameter(1) + 4 * fgaus_g->GetParameter(2));
576 fgaus->SetParameters(fgaus_g->GetParameter(0), fgaus_g->GetParameter(1),
577 fgaus_g->GetParameter(2));
582 h_full->GetXaxis()->SetRangeUser(h->GetMean() - 4 * h->GetRMS(),
583 h->GetMean() + 4 * h->GetRMS());
586 h->SetMarkerStyle(kFullCircle);
589 Form(
"#DeltaE/<E> = %.1f%%",
590 100 * fgaus->GetParameter(2) / fgaus->GetParameter(1)));
631 TString(
_file0->GetName()) + TString(
"_DrawPrototype3EMCalTower_") + TString(c1->GetName()),
false);
635 TString CherenkovSignal =
"C2_Inner")
637 TH1 *EnergySum_LG_full =
new TH1F(
"EnergySum_LG_full",
638 ";Tower Energy Sum (ADC);Count / bin", 260, -100, 2500);
639 TH1 *EnergySum_LG =
new TH1F(
"EnergySum_LG",
640 ";Tower Energy Sum (ADC);Count / bin", 260, -100, 2500);
644 TH1 *C2_Inner_full =
new TH1F(
"C2_Inner_full",
645 CherenkovSignal +
";Cherenkov Signal (ADC);Count / bin", 1000, 0, 2000);
646 TH1 *C2_Inner =
new TH1F(
"C2_Inner",
647 CherenkovSignal +
";Cherenkov Inner Signal (ADC);Count / bin", 1000, 0, 2000);
649 EnergySum_LG_full->SetLineColor(kBlue + 3);
650 EnergySum_LG_full->SetLineWidth(2);
652 EnergySum_LG->SetLineColor(kGreen + 3);
653 EnergySum_LG->SetLineWidth(3);
654 EnergySum_LG->SetMarkerColor(kGreen + 3);
656 C2_Inner_full->SetLineColor(kBlue + 3);
657 C2_Inner_full->SetLineWidth(2);
659 C2_Inner->SetLineColor(kGreen + 3);
660 C2_Inner->SetLineWidth(3);
661 C2_Inner->SetMarkerColor(kGreen + 3);
663 TCut
c2 = CherenkovSignal +
">240";
665 T->Draw(sTOWER +
">>EnergySum_LG_full",
"",
"goff");
666 T->Draw(sTOWER +
">>EnergySum_LG", c2,
"goff");
667 T->Draw(CherenkovSignal +
">>C2_Inner_full",
"",
"goff");
668 T->Draw(CherenkovSignal +
">>C2_Inner", c2,
"goff");
671 TCanvas *c1 =
new TCanvas(
672 "EMCDistribution_SUM_RawADC_" + sTOWER +
"_" + CherenkovSignal +
cuts,
673 "EMCDistribution_SUM_RawADC_" + sTOWER +
"_" + CherenkovSignal +
cuts, 1800,
679 p = (TPad *) c1->cd(idx++);
685 C2_Inner_full->DrawClone();
686 C2_Inner->DrawClone(
"same");
688 p = (TPad *) c1->cd(idx++);
694 TH1 *
h = (TH1 *) EnergySum_LG_full->DrawClone();
696 (TH1 *) EnergySum_LG->DrawClone(
"same");
698 p = (TPad *) c1->cd(idx++);
704 TH1 *h_full = (TH1 *) EnergySum_LG_full->DrawClone();
705 TH1 *h = (TH1 *) EnergySum_LG->DrawClone(
"same");
707 TF1 *fgaus_g =
new TF1(
"fgaus_LG_g",
"gaus", h->GetMean() - 1 * h->GetRMS(),
708 h->GetMean() + 4 * h->GetRMS());
709 fgaus_g->SetParameters(1, h->GetMean() - 2 * h->GetRMS(),
710 h->GetMean() + 2 * h->GetRMS());
711 h->Fit(fgaus_g,
"MR0N");
713 TF1 *fgaus =
new TF1(
"fgaus_LG",
"gaus",
714 fgaus_g->GetParameter(1) - 1 * fgaus_g->GetParameter(2),
715 fgaus_g->GetParameter(1) + 4 * fgaus_g->GetParameter(2));
716 fgaus->SetParameters(fgaus_g->GetParameter(0), fgaus_g->GetParameter(1),
717 fgaus_g->GetParameter(2));
722 h_full->GetXaxis()->SetRangeUser(h->GetMean() - 4 * h->GetRMS(),
723 h->GetMean() + 4 * h->GetRMS());
726 h->SetMarkerStyle(kFullCircle);
729 Form(
"#DeltaE/<E> = %.1f%%",
730 100 * fgaus->GetParameter(2) / fgaus->GetParameter(1)));
771 TString(
_file0->GetName()) + TString(
"_DrawPrototype3EMCalTower_") + TString(c1->GetName()),
false);
776 TString hname =
"EMCDistribution_" +
gain + TString(full_gain ?
"_FullGain" :
"") +
cuts;
779 if (
gain.Contains(
"CALIB"))
784 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 100, .05,
791 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 260, -.2,
795 "TOWER_" +
gain +
"_CEMC[].get_bineta() + 8* TOWER_" +
gain +
"_CEMC[].get_binphi():TOWER_" +
gain +
"_CEMC[].get_energy()>>" + hname,
"",
"goff");
797 else if (
gain.Contains(
"RAW"))
802 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 100,
803 .05 * 100, 25 * 100, 64, -.5, 63.5);
809 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 260,
810 -.2 * 100, 5 * 100, 64, -.5, 63.5);
813 "TOWER_" +
gain +
"_CEMC[].get_bineta() + 8* TOWER_" +
gain +
"_CEMC[].get_binphi():TOWER_" +
gain +
"_CEMC[].get_energy()>>" + hname,
"",
"goff");
817 TCanvas *c1 =
new TCanvas(
818 "EMCDistribution_" +
gain + TString(full_gain ?
"_FullGain" :
"") + cuts,
819 "EMCDistribution_" +
gain + TString(full_gain ?
"_FullGain" :
"") + cuts,
821 c1->Divide(8, 8, 0., 0.01);
825 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
827 for (
int ieta = 0; ieta < 8; ieta++)
829 p = (TPad *) c1->cd(idx++);
840 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi) + TString(full_gain ?
"_FullGain" :
"");
842 TH1 *
h = h2->ProjectionX(hname, ieta + 8 * iphi + 1,
843 ieta + 8 * iphi + 1);
846 h->SetLineColor(kBlue + 3);
847 h->SetFillColor(kBlue + 3);
849 h->GetXaxis()->SetTitleSize(.09);
850 h->GetXaxis()->SetLabelSize(.08);
851 h->GetYaxis()->SetLabelSize(.08);
856 h->Fit(
"x*gaus",
"M");
858 h->Fit(
"landau",
"M");
862 TF1 *
fit = ((TF1 *) (h->GetListOfFunctions()->At(0)));
865 fit->SetLineColor(kRed);
866 peak = fit->GetParameter(1);
869 cout << Form(
"Finished <Col%d Row%d> = %.1f", ieta, iphi, peak)
872 TText *t =
new TText(.9, .9,
873 Form(
"<Col%d Row%d> = %.1f", ieta, iphi, peak));
882 TString(
_file0->GetName()) + TString(
"_DrawPrototype3EMCalTower_") + TString(c1->GetName()),
false);
887 const TString
gain =
"RAW";
889 TString hname =
"EMCDistribution_" + gain + TString(full_gain ?
"_FullGain" :
"") +
cuts;
896 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 100,
897 .05 * 100, 25 * 100, 64, -.5, 63.5);
903 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 260,
904 -.2 * 100, 5 * 100, 64, -.5, 63.5);
907 "TOWER_" + gain +
"_CEMC[].get_bineta() + 8* TOWER_" + gain +
"_CEMC[].get_binphi():(TOWER_RAW_CEMC[].signal_samples[10] - TOWER_RAW_CEMC[].signal_samples[0])*(-1)>>" + hname,
"",
"goff");
911 TCanvas *c1 =
new TCanvas(
912 "EMCDistribution_PeakSample_Fast_" + TString(full_gain ?
"_FullGain" :
"") + cuts,
913 "EMCDistribution_PeakSample_Fast_" + TString(full_gain ?
"_FullGain" :
"") + cuts, 1800, 950);
914 c1->Divide(8, 8, 0., 0.01);
918 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
920 for (
int ieta = 0; ieta < 8; ieta++)
922 p = (TPad *) c1->cd(idx++);
933 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi) + TString(full_gain ?
"_FullGain" :
"");
935 TH1 *
h = h2->ProjectionX(hname, ieta + 8 * iphi + 1,
936 ieta + 8 * iphi + 1);
939 h->SetLineColor(kBlue + 3);
940 h->SetFillColor(kBlue + 3);
942 h->GetXaxis()->SetTitleSize(.09);
943 h->GetXaxis()->SetLabelSize(.08);
944 h->GetYaxis()->SetLabelSize(.08);
949 h->Fit(
"x*gaus",
"M");
951 h->Fit(
"landau",
"M");
955 TF1 *
fit = ((TF1 *) (h->GetListOfFunctions()->At(0)));
958 fit->SetLineColor(kRed);
959 peak = fit->GetParameter(1);
962 cout << Form(
"Finished <Col%d Row%d> = %.1f", ieta, iphi, peak)
965 TText *t =
new TText(.9, .9,
966 Form(
"<Col%d Row%d> = %.1f", ieta, iphi, peak));
975 TString(
_file0->GetName()) + TString(
"_DrawPrototype3EMCalTower_") + TString(c1->GetName()),
false);
981 TCanvas *c1 =
new TCanvas(
982 "EMCDistribution_" +
gain + TString(log_scale ?
"_Log" :
"") +
cuts,
983 "EMCDistribution_" +
gain + TString(log_scale ?
"_Log" :
"") +
cuts, 1800,
985 c1->Divide(8, 8, 0., 0.01);
989 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
991 for (
int ieta = 0; ieta < 8; ieta++)
993 p = (TPad *) c1->cd(idx++);
1000 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi) + TString(log_scale ?
"_Log" :
"");
1006 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 300,
1013 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 596,
1017 h->SetLineColor(kBlue + 3);
1018 h->SetFillColor(kBlue + 3);
1019 h->GetXaxis()->SetTitleSize(.09);
1020 h->GetXaxis()->SetLabelSize(.08);
1021 h->GetYaxis()->SetLabelSize(.08);
1027 "TOWER_" +
gain +
"_CEMC[].get_energy_power_law_exp()>>" + hname,
1029 "TOWER_%s_CEMC[].get_bineta()==%d && TOWER_%s_CEMC[].get_binphi()==%d",
1030 gain.Data(), ieta,
gain.Data(), iphi),
1033 TText *t =
new TText(.9, .9, Form(
"Col%d Row%d", ieta, iphi));
1034 t->SetTextAlign(33);
1035 t->SetTextSize(.15);
1044 TString(
_file0->GetName()) + TString(
"_DrawPrototype3EMCalTower_") + TString(c1->GetName()),
false);
1049 TString
gain =
"RAW";
1052 TCanvas *c1 =
new TCanvas(
1053 "EMCDistribution_ADC_" + gain + TString(log_scale ?
"_Log" :
"") +
cuts,
1054 "EMCDistribution_ADC_" + gain + TString(log_scale ?
"_Log" :
"") +
cuts,
1056 c1->Divide(8, 8, 0., 0.01);
1060 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
1062 for (
int ieta = 0; ieta < 8; ieta++)
1064 p = (TPad *) c1->cd(idx++);
1074 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi) + TString(log_scale ?
"_Log" :
"");
1080 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 24, -.5,
1090 h->SetLineColor(kBlue + 3);
1091 h->SetFillColor(kBlue + 3);
1092 h->GetXaxis()->SetTitleSize(.09);
1093 h->GetXaxis()->SetLabelSize(.08);
1094 h->GetYaxis()->SetLabelSize(.08);
1095 h->GetYaxis()->SetRangeUser(0, 4096);
1100 TString sdraw =
"TOWER_" + gain +
"_CEMC[].signal_samples[]:fmod(Iteration$,24)>>" + hname;
1103 "TOWER_%s_CEMC[].get_bineta()==%d && TOWER_%s_CEMC[].get_binphi()==%d",
1104 gain.Data(), ieta, gain.Data(), iphi);
1106 cout <<
"T->Draw(\"" << sdraw <<
"\",\"" << scut <<
"\");" << endl;
1108 T->Draw(sdraw, scut,
"colz");
1110 TText *t =
new TText(.9, .9, Form(
"Col%d Row%d", ieta, iphi));
1111 t->SetTextAlign(33);
1112 t->SetTextSize(.15);
1121 TString(
_file0->GetName()) + TString(
"_DrawPrototype3EMCalTower_") + TString(c1->GetName()),
false);