12 #include <TGraphErrors.h>
34 const TString
infile =
"data/beam_00001214.root_DSTReader.root",
35 bool plot_all =
false,
const double momentum = -16)
40 gStyle->SetOptStat(0);
41 gStyle->SetOptFit(1111);
42 TVirtualFitter::SetDefaultFitter(
"Minuit2");
43 gSystem->Load(
"libg4eval.so");
44 gSystem->Load(
"libqa_modules.so");
45 gSystem->Load(
"libPrototype4.so");
51 TString chian_str =
infile;
52 chian_str.ReplaceAll(
"ALL",
"*");
54 TChain *
t =
new TChain(
"T");
55 const int n = t->Add(chian_str);
57 cout <<
"Loaded " << n <<
" root files with " << chian_str << endl;
68 T->SetAlias(
"ActiveTower_LG",
69 "TOWER_LG_CEMC[].get_binphi()<8 && TOWER_LG_CEMC[].get_bineta()<8");
70 T->SetAlias(
"EnergySum_LG",
71 "1*Sum$(TOWER_LG_CEMC[].get_energy() * ActiveTower_LG)");
73 T->SetAlias(
"ActiveTower_HG",
74 "TOWER_HG_CEMC[].get_binphi()<8 && TOWER_HG_CEMC[].get_bineta()<8");
75 T->SetAlias(
"EnergySum_HG",
76 "1*Sum$(TOWER_HG_CEMC[].get_energy() * ActiveTower_HG)");
79 T->SetAlias(
"C2_Inner_e",
"1*(TOWER_CALIB_C2[0].energy)");
80 T->SetAlias(
"C2_Outer_e",
"1*(TOWER_CALIB_C2[1].energy)");
81 T->SetAlias(
"C2_Sum_e",
"C2_Inner_e + C2_Outer_e");
82 T->SetAlias(
"C1",
"0 + TOWER_CALIB_C1[0].energy");
86 T->SetAlias(
"Average_column",
87 "Sum$(TOWER_CALIB_CEMC.get_column() * TOWER_CALIB_CEMC.get_energy())/Sum$(TOWER_CALIB_CEMC.get_energy())");
88 T->SetAlias(
"Average_row",
89 "Sum$(TOWER_CALIB_CEMC.get_row() * TOWER_CALIB_CEMC.get_energy())/Sum$(TOWER_CALIB_CEMC.get_energy())");
91 T->SetAlias(
"Average_HODO_VERTICAL",
92 "Sum$(TOWER_CALIB_HODO_VERTICAL.towerid * (abs(TOWER_CALIB_HODO_VERTICAL.energy)>0.5) * abs(TOWER_CALIB_HODO_VERTICAL.energy))/Sum$((abs(TOWER_CALIB_HODO_VERTICAL.energy)>0.5) * abs(TOWER_CALIB_HODO_VERTICAL.energy))");
93 T->SetAlias(
"Valid_HODO_VERTICAL",
"Sum$((TOWER_CALIB_HODO_VERTICAL.energy)>0.5) > 0");
95 T->SetAlias(
"Average_HODO_HORIZONTAL",
96 "Sum$(TOWER_CALIB_HODO_HORIZONTAL.towerid * (abs(TOWER_CALIB_HODO_HORIZONTAL.energy)>0.5) * abs(TOWER_CALIB_HODO_HORIZONTAL.energy))/Sum$((abs(TOWER_CALIB_HODO_HORIZONTAL.energy)>0.5) * abs(TOWER_CALIB_HODO_HORIZONTAL.energy))");
97 T->SetAlias(
"Valid_HODO_HORIZONTAL",
"Sum$((TOWER_CALIB_HODO_HORIZONTAL.energy)>0.5) > 0");
99 T->SetAlias(
"No_Triger_VETO",
100 "Sum$((TOWER_CALIB_TRIGGER_VETO.energy)>0.2)==0");
102 T->SetAlias(
"Energy_Sum_col1_row2_3x3",
103 "Sum$( (abs(TOWER_CALIB_CEMC.get_column()-1)<=1 && abs(TOWER_CALIB_CEMC.get_row()-2)<=1 ) * TOWER_CALIB_CEMC.get_energy())");
104 T->SetAlias(
"Energy_Sum_col1_row2_5x5",
105 "Sum$( (abs(TOWER_CALIB_CEMC.get_column()-1)<=2 && abs(TOWER_CALIB_CEMC.get_row()-2)<=2 ) * TOWER_CALIB_CEMC.get_energy())");
106 T->SetAlias(
"Energy_Sum_col2_row2_5x5",
107 "Sum$( (abs(TOWER_CALIB_CEMC.get_column()-2)<=2 && abs(TOWER_CALIB_CEMC.get_row()-2)<=2 ) * TOWER_CALIB_CEMC.get_energy())");
108 T->SetAlias(
"Energy_Sum_CEMC",
"1*Sum$(TOWER_CALIB_CEMC.get_energy())");
109 T->SetAlias(
"Energy_Sum_RAW_CEMC",
"1*Sum$(TOWER_RAW_CEMC.get_energy())");
120 T->SetAlias(
"Energy_Sum_Hadron_CEMC",
121 "1.14*12./8.71776e+00*Sum$(TOWER_CALIB_CEMC.get_energy())");
124 T->SetAlias(
"CEMC_MIP",
"Energy_Sum_Hadron_CEMC<0.7");
139 T->SetAlias(
"Energy_Sum_Hadron_HCALIN",
140 "12./6.99727e+00*Sum$(TOWER_CALIB_LG_HCALIN.get_energy())");
141 T->SetAlias(
"HCALIN_MIP",
"Energy_Sum_Hadron_HCALIN<0.5");
142 T->SetAlias(
"Energy_Sum_Hadron_HCALOUT",
143 "12./9.50430e+00*Sum$(TOWER_CALIB_LG_HCALOUT.get_energy())");
145 T->SetAlias(
"MIP_Count_Col2",
146 "Sum$( abs( TOWER_RAW_CEMC.get_energy() )>20 && abs( TOWER_RAW_CEMC.get_energy() )<200 && TOWER_CALIB_CEMC.get_column() == 2 )");
147 T->SetAlias(
"Pedestal_Count_AllCEMC",
148 "Sum$( abs( TOWER_RAW_CEMC.get_energy() )<20)");
160 "Valid_HODO_HORIZONTAL && Valid_HODO_VERTICAL && No_Triger_VETO";
161 cuts =
"_Valid_HODO_Trigger_VETO";
170 cout <<
"Build event selection of " << (
const char *) event_sel
173 T->Draw(
">>EventListRunCut", event_sel);
174 TEventList *elist = gDirectory->GetObjectChecked(
"EventListRunCut",
176 cout << elist->GetN() <<
" / " <<
T->GetEntriesFast()
177 <<
" events selected" << endl;
178 T->SetEventList(elist);
188 "Valid_HODO_HORIZONTAL && Valid_HODO_VERTICAL && No_Triger_VETO";
189 cuts =
"_Valid_HODO_Trigger_VETO";
205 cout <<
"Build event selection of " << (
const char *) event_sel << endl;
207 T->Draw(
">>EventList", event_sel);
208 TEventList *elist = gDirectory->GetObjectChecked(
"EventList",
"TEventList");
209 cout << elist->GetN() <<
" / " <<
T->GetEntriesFast() <<
" events selected"
212 T->SetEventList(elist);
221 gDirectory->mkdir(Form(
"dir_%d", rnd));
222 gDirectory->cd(Form(
"dir_%d", rnd));
227 gDirectory->mkdir(Form(
"dir_%d", rnd));
228 gDirectory->cd(Form(
"dir_%d", rnd));
233 gDirectory->mkdir(Form(
"dir_%d", rnd));
234 gDirectory->cd(Form(
"dir_%d", rnd));
239 gDirectory->mkdir(Form(
"dir_%d", rnd));
240 gDirectory->cd(Form(
"dir_%d", rnd));
245 gDirectory->mkdir(Form(
"dir_%d", rnd));
246 gDirectory->cd(Form(
"dir_%d", rnd));
251 gDirectory->mkdir(Form(
"dir_%d", rnd));
252 gDirectory->cd(Form(
"dir_%d", rnd));
257 gDirectory->mkdir(Form(
"dir_%d", rnd));
258 gDirectory->cd(Form(
"dir_%d", rnd));
263 gDirectory->mkdir(Form(
"dir_%d", rnd));
264 gDirectory->cd(Form(
"dir_%d", rnd));
275 gDirectory->mkdir(Form(
"dir_%d", rnd));
276 gDirectory->cd(Form(
"dir_%d", rnd));
281 gDirectory->mkdir(Form(
"dir_%d", rnd));
282 gDirectory->cd(Form(
"dir_%d", rnd));
295 TString cut_C(Cherenkov_Choice +
" > 1000");
296 TString
cuts = Cherenkov_Choice;
298 gStyle->SetOptStat(0);
299 gStyle->SetOptFit(1111);
301 TH1F *h1_HCalOut =
new TH1F(
"h1_HCalOut",
302 "(CEMC MIP && HCal_{IN} MIP);EMCal + HCal_{IN} + HCal_{OUT} (GeV)", 100,
306 new TH2F(
"h2_hodo_v_h",
307 "Hodoscope hit distribution;Average Horizontal Hodoscope Idx;Average Vertical Hodoscope Idx",
308 8, -.5, 7.5, 8, -.5, 7.5);
311 new TH2F(
"h2_hodoE_v_h",
312 "Event-Averaged Tower-Summed EMCal Energy [A.U.];Average Horizontal Hodoscope Idx;Average Vertical Hodoscope Idx",
313 8, -.5, 7.5, 8, -.5, 7.5);
314 TH2 *h2_hodoE_v_h_norm =
315 new TH2F(
"h2_hodoE_v_h_norm",
316 "Event-Averaged Tower-Summed EMCal Energy [A.U.];Average Horizontal Hodoscope Idx;Average Vertical Hodoscope Idx",
317 8, -.5, 7.5, 8, -.5, 7.5);
320 new TH2F(
"h2_hodo_c_h",
321 "Column VS Horizontal Hodoscope;Average Horizontal Hodoscope Idx;Average EMCal Column",
322 24, -.5, 7.5, 24, -.5, 7.5);
324 new TH2F(
"h2_hodo_r_v",
325 "Row VS Vertical Hodoscope;Average Vertical Hodoscope Idx;Average EMCal Row",
326 24, -.5, 7.5, 24, -.5, 7.5);
329 new TH2F(
"h2_hodoE_h",
330 "Total EMCal Energy VS Horizontal Hodoscope;Average Horizontal Hodoscope Idx;Total EMCal Energy [A.U.]",
331 8, -.5, 7.5, 80, -.5, 70);
333 new TH2F(
"h2_hodoE_v",
334 "Total EMCal Energy VS Vertical Hodoscope;Average Vertical Hodoscope Idx;Total EMCal Energy [A.U.]",
335 8, -.5, 7.5, 80, -.5, 70);
338 TCanvas *c1 =
new TCanvas(
"EMC_HodoScope_Calibration" + cuts,
339 "EMC_HodoScope_Calibration" + cuts, 1800, 1100);
344 p = (TPad *) c1->cd(idx++);
347 T->Draw(
"Average_HODO_VERTICAL:Average_HODO_HORIZONTAL>>h2_hodo_v_h", cut_C,
"colz");
349 p = (TPad *) c1->cd(idx++);
353 T->Draw(
"Average_column:Average_HODO_HORIZONTAL>>h2_hodo_c_h", cut_C,
"colz");
355 p = (TPad *) c1->cd(idx++);
358 T->Draw(
"Energy_Sum_RAW_CEMC:Average_HODO_HORIZONTAL>>h2_hodoE_h", cut_C,
"colz");
360 p = (TPad *) c1->cd(idx++);
363 T->Draw(
"Average_HODO_VERTICAL:Average_HODO_HORIZONTAL>>h2_hodoE_v_h",
"(" + cut_C +
")*(Energy_Sum_RAW_CEMC) * (Energy_Sum_RAW_CEMC>0.1)",
"goff");
364 T->Draw(
"Average_HODO_VERTICAL:Average_HODO_HORIZONTAL>>h2_hodoE_v_h_norm",
"(" + cut_C +
" ) && (Energy_Sum_RAW_CEMC>0.1)",
"goff");
365 h2_hodoE_v_h->Divide(h2_hodoE_v_h_norm);
366 h2_hodoE_v_h->Draw(
"colz");
368 p = (TPad *) c1->cd(idx++);
372 T->Draw(
"Average_row:Average_HODO_VERTICAL>>h2_hodo_r_v", cut_C,
"colz");
374 p = (TPad *) c1->cd(idx++);
377 T->Draw(
"Energy_Sum_RAW_CEMC:Average_HODO_VERTICAL>>h2_hodoE_v", cut_C,
"colz");
380 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);
385 gStyle->SetOptStat(0);
386 gStyle->SetOptFit(1111);
388 TH1F *h1_HCalOut =
new TH1F(
"h1_HCalOut",
389 "(CEMC MIP && HCal_{IN} MIP);EMCal + HCal_{IN} + HCal_{OUT} (GeV)", 100,
392 TH2 *h2_HCalOut_HCalIn =
393 new TH2F(
"h2_HCalOut_HCalIn",
394 "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)",
398 new TH2F(
"h2_HCal_EMCal",
399 "Energy Balance HCal_{SUM} and EMCal (NOT CEMC MIP);(HCal_{SUM} - EMCal)/Sum;EMCal + HCal_{IN} + HCal_{OUT} (GeV)",
403 TCanvas *c1 =
new TCanvas(
"EMCDistribution_HCalCalibration" +
cuts,
404 "EMCDistribution_HCalCalibration" +
cuts, 1800, 600);
409 p = (TPad *) c1->cd(idx++);
413 "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",
414 "(!HCALIN_MIP) && CEMC_MIP",
"goff");
415 h2_HCalOut_HCalIn->FitSlicesY();
417 TH1 *h2_HCalOut_HCalIn_1 = (TH1 *) gDirectory->GetObjectChecked(
418 "h2_HCalOut_HCalIn_1",
"TH1D");
419 assert(h2_HCalOut_HCalIn_1);
420 h2_HCalOut_HCalIn_1->SetMarkerStyle(kFullCircle);
422 TF1 *f_HCalOut_HCalIn =
new TF1(
"f_HCalOut_HCalIn",
423 "[0] * (x+1)/2 + [1]*(1-x)/2", -.8, 0.8);
424 f_HCalOut_HCalIn->SetLineColor(kMagenta);
425 f_HCalOut_HCalIn->SetLineWidth(3);
426 h2_HCalOut_HCalIn_1->Fit(f_HCalOut_HCalIn,
"MR0");
428 h2_HCalOut_HCalIn->DrawClone(
"colz");
429 h2_HCalOut_HCalIn_1->DrawClone(
"SAME");
430 f_HCalOut_HCalIn->DrawClone(
"same");
432 p = (TPad *) c1->cd(idx++);
436 "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",
437 "! CEMC_MIP",
"goff");
438 h2_HCal_EMCal->FitSlicesY();
440 TH1 *h2_HCal_EMCal_1 = (TH1 *) gDirectory->GetObjectChecked(
441 "h2_HCal_EMCal_1",
"TH1D");
443 h2_HCal_EMCal_1->SetMarkerStyle(kFullCircle);
445 TF1 *f_HCal_EMCal =
new TF1(
"f_HCal_EMCal",
"[0] * (x+1)/2 + [1]*(1-x)/2",
447 f_HCal_EMCal->SetLineColor(kMagenta);
448 f_HCal_EMCal->SetLineWidth(3);
449 h2_HCal_EMCal_1->Fit(f_HCal_EMCal,
"MR0");
451 h2_HCal_EMCal->DrawClone(
"colz");
452 h2_HCal_EMCal_1->DrawClone(
"SAME");
453 f_HCal_EMCal->DrawClone(
"same");
455 p = (TPad *) c1->cd(idx++);
459 "Energy_Sum_Hadron_CEMC + Energy_Sum_Hadron_HCALIN + Energy_Sum_Hadron_HCALOUT>>h1_HCalOut",
460 "HCALIN_MIP && CEMC_MIP",
"goff");
462 TH1 *h2_HCal_EMCal_ProjY = (TH1 *) h2_HCal_EMCal->ProjectionY(
463 "h2_HCal_EMCal_ProjY", 2, 9)
465 TH1 *h2_HCalOut_HCalIn_ProjY = (TH1 *) h2_HCalOut_HCalIn->ProjectionY(
466 "h2_HCalOut_HCalIn_ProjY")
468 h1_HCalOut->Draw(
"same");
470 h2_HCal_EMCal_ProjY->SetTitle(
471 "Red: 3 Calo shower, Blue: MIP EMCal, Green: MIP EMCal & HCal_{IN}");
473 h2_HCal_EMCal_ProjY->SetLineColor(kRed + 2);
474 h2_HCal_EMCal_ProjY->SetLineWidth(3);
475 h2_HCalOut_HCalIn_ProjY->SetLineColor(kBlue + 2);
476 h2_HCalOut_HCalIn_ProjY->SetLineWidth(2);
477 h1_HCalOut->SetLineColor(kGreen + 3);
478 h1_HCalOut->SetLineWidth(3);
481 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);
485 const double che_cut = 2000)
487 TString cut_pass = CherenkovSignal + Form(
">%.1f", che_cut);
488 TString cut_rej = CherenkovSignal + Form(
"<%.1f", che_cut);
490 const double event_pass =
T->GetEntries(cut_pass);
491 const double event_rej =
T->GetEntries(cut_rej);
493 TH2 *EnergyDist_pass =
new TH2F(
"EnergyDist_pass",
494 cut_pass +
";Column;Row;<Energy> / Event / Tower", 8, -.5, 7.5, 8, -.5,
496 TH2 *EnergyDist_rej =
new TH2F(
"EnergyDist_rej",
497 cut_rej +
";Column;Row;<Energy> / Event / Tower", 8, -.5, 7.5, 8, -.5,
499 TH2 *Hodoscope_dist =
new TH2F(
"Hodoscope_dist",
500 cut_rej +
";7 - Horizontal Hodoscope (5 mm);7 - Vertical Hodoscope (5 mm); Event / finger^2", 8, -.5, 7.5, 8, -.5,
503 TH1 *Che_full =
new TH1F(
"Che_full",
504 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 17000);
505 TH1 *Che_pass =
new TH1F(
"Che_pass",
506 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 17000);
507 TH1 *Che_rej =
new TH1F(
"Che_rej",
508 ";" + CherenkovSignal +
" Signal (ADC);Count / bin", 200, 0, 17000);
510 Che_full->SetLineColor(kBlue + 3);
511 Che_full->SetLineWidth(2);
512 Che_pass->SetLineColor(kGreen + 3);
513 Che_pass->SetLineWidth(2);
514 Che_pass->SetFillColor(kGreen + 3);
515 Che_pass->SetFillStyle(1);
516 Che_rej->SetLineColor(kBlue + 3);
517 Che_rej->SetLineWidth(2);
518 Che_rej->SetFillColor(kBlue + 3);
519 Che_rej->SetFillStyle(1);
522 "TOWER_CALIB_CEMC[].get_binphi():TOWER_CALIB_CEMC[].get_bineta()>>EnergyDist_pass",
523 Form(
"(%s) * (TOWER_CALIB_CEMC[].get_energy())", cut_pass.Data()),
526 "TOWER_CALIB_CEMC[].get_binphi():TOWER_CALIB_CEMC[].get_bineta()>>EnergyDist_rej",
527 Form(
"(%s) * (TOWER_CALIB_CEMC[].get_energy())", cut_rej.Data()),
"goff");
529 "7 - Average_HODO_VERTICAL:7 - Average_HODO_HORIZONTAL>>Hodoscope_dist",
"1",
"goff");
531 T->Draw(CherenkovSignal +
">>Che_full", NULL,
"goff");
532 T->Draw(CherenkovSignal +
">>Che_pass", cut_pass,
"goff");
533 T->Draw(CherenkovSignal +
">>Che_rej", cut_rej,
"goff");
535 EnergyDist_pass->Scale(1. / event_pass);
536 EnergyDist_rej->Scale(1. / event_rej);
539 TCanvas *c1 =
new TCanvas(
"EMCDistribution_ShowShape" +
cuts,
540 "EMCDistribution_ShowShape" +
cuts, 1100, 950);
545 p = (TPad *) c1->cd(idx++);
551 Che_full->DrawClone();
552 Che_pass->DrawClone(
"same");
553 Che_rej->DrawClone(
"same");
555 p = (TPad *) c1->cd(idx++);
559 EnergyDist_pass->DrawClone(
"colz");
561 p = (TPad *) c1->cd(idx++);
567 EnergyDist_rej->DrawClone(
"colz");
569 p = (TPad *) c1->cd(idx++);
575 Hodoscope_dist->DrawClone(
"colz");
578 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);
582 TString CherenkovSignal =
"C2_Inner")
584 TH1 *EnergySum_LG_full =
new TH1F(
"EnergySum_LG_full",
585 ";Full range Tower Energy Sum (GeV);Count / bin", 900, -5, 120);
586 TH1 *EnergySum_LG =
new TH1F(
"EnergySum_LG",
587 ";Full range Tower Energy Sum (GeV);Count / bin", 900, -5, 120);
591 TH1 *C2_Inner_full =
new TH1F(
"C2_Inner_full",
592 CherenkovSignal +
";Cherenkov Signal (ADC);Count / bin", 180, -1000, 17000);
593 TH1 *C2_Inner =
new TH1F(
"C2_Inner",
594 CherenkovSignal +
";Cherenkov Inner Signal (ADC);Count / bin", 180, -1000,
597 EnergySum_LG_full->SetLineColor(kBlue + 3);
598 EnergySum_LG_full->SetLineWidth(2);
600 EnergySum_LG->SetLineColor(kGreen + 3);
601 EnergySum_LG->SetLineWidth(3);
602 EnergySum_LG->SetMarkerColor(kGreen + 3);
604 C2_Inner_full->SetLineColor(kBlue + 3);
605 C2_Inner_full->SetLineWidth(2);
607 C2_Inner->SetLineColor(kGreen + 3);
608 C2_Inner->SetLineWidth(3);
609 C2_Inner->SetMarkerColor(kGreen + 3);
611 TCut
c2 = CherenkovSignal +
">2000";
613 T->Draw(sTOWER +
">>EnergySum_LG_full",
"",
"goff");
614 T->Draw(sTOWER +
">>EnergySum_LG", c2,
"goff");
615 T->Draw(CherenkovSignal +
">>C2_Inner_full",
"",
"goff");
616 T->Draw(CherenkovSignal +
">>C2_Inner", c2,
"goff");
619 TCanvas *c1 =
new TCanvas(
620 "EMCDistribution_SUM_" + sTOWER +
"_" + CherenkovSignal +
cuts,
621 "EMCDistribution_SUM_" + sTOWER +
"_" + CherenkovSignal +
cuts, 1800,
627 p = (TPad *) c1->cd(idx++);
633 C2_Inner_full->DrawClone();
634 C2_Inner->DrawClone(
"same");
636 p = (TPad *) c1->cd(idx++);
642 TH1 *
h = (TH1 *) EnergySum_LG_full->DrawClone();
643 h->GetXaxis()->SetRangeUser(-1, h->GetMean() + 5 * h->GetRMS());
644 (TH1 *) EnergySum_LG->DrawClone(
"same");
646 p = (TPad *) c1->cd(idx++);
652 TH1 *h_full = (TH1 *) EnergySum_LG_full->DrawClone();
654 TH1 *h = (TH1 *) EnergySum_LG->DrawClone(
"same");
656 TF1 *fgaus_g =
new TF1(
"fgaus_LG_g",
"gaus", h->GetMean() - 1 * h->GetRMS(),
657 h->GetMean() + 4 * h->GetRMS());
658 fgaus_g->SetParameters(1, h->GetMean() - 2 * h->GetRMS(),
659 h->GetMean() + 2 * h->GetRMS());
660 h->Fit(fgaus_g,
"MR0N");
662 TF1 *fgaus =
new TF1(
"fgaus_LG",
"gaus",
663 fgaus_g->GetParameter(1) - 1 * fgaus_g->GetParameter(2),
664 fgaus_g->GetParameter(1) + 4 * fgaus_g->GetParameter(2));
665 fgaus->SetParameters(fgaus_g->GetParameter(0), fgaus_g->GetParameter(1),
666 fgaus_g->GetParameter(2));
671 h_full->GetXaxis()->SetRangeUser(h->GetMean() - 4 * h->GetRMS(),
672 h->GetMean() + 4 * h->GetRMS());
673 h_full->GetYaxis()->SetRangeUser(0,
674 fgaus_g->GetParameter(0) * 4);
677 h->SetMarkerStyle(kFullCircle);
680 Form(
"#DeltaE/<E> = %.1f%%",
681 100 * fgaus->GetParameter(2) / fgaus->GetParameter(1)));
722 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);
726 TString CherenkovSignal =
"C2_Inner")
728 TH1 *EnergySum_LG_full =
new TH1F(
"EnergySum_LG_full",
729 ";Tower Energy Sum (ADC);Count / bin", 210, -1000, 20000);
730 TH1 *EnergySum_LG =
new TH1F(
"EnergySum_LG",
731 ";Tower Energy Sum (ADC);Count / bin", 210, -1000, 20000);
735 TH1 *C2_Inner_full =
new TH1F(
"C2_Inner_full",
736 CherenkovSignal +
";Cherenkov Signal (ADC);Count / bin", 180, -1000, 17000);
737 TH1 *C2_Inner =
new TH1F(
"C2_Inner",
738 CherenkovSignal +
";Cherenkov Inner Signal (ADC);Count / bin", 180, -1000,
741 EnergySum_LG_full->SetLineColor(kBlue + 3);
742 EnergySum_LG_full->SetLineWidth(2);
744 EnergySum_LG->SetLineColor(kGreen + 3);
745 EnergySum_LG->SetLineWidth(3);
746 EnergySum_LG->SetMarkerColor(kGreen + 3);
748 C2_Inner_full->SetLineColor(kBlue + 3);
749 C2_Inner_full->SetLineWidth(2);
751 C2_Inner->SetLineColor(kGreen + 3);
752 C2_Inner->SetLineWidth(3);
753 C2_Inner->SetMarkerColor(kGreen + 3);
755 TCut
c2 = CherenkovSignal +
">2000";
757 T->Draw(sTOWER +
">>EnergySum_LG_full",
"",
"goff");
758 T->Draw(sTOWER +
">>EnergySum_LG", c2,
"goff");
759 T->Draw(CherenkovSignal +
">>C2_Inner_full",
"",
"goff");
760 T->Draw(CherenkovSignal +
">>C2_Inner", c2,
"goff");
763 TCanvas *c1 =
new TCanvas(
764 "EMCDistribution_SUM_RawADC_" + sTOWER +
"_" + CherenkovSignal +
cuts,
765 "EMCDistribution_SUM_RawADC_" + sTOWER +
"_" + CherenkovSignal +
cuts, 1800,
771 p = (TPad *) c1->cd(idx++);
777 C2_Inner_full->DrawClone();
778 C2_Inner->DrawClone(
"same");
780 p = (TPad *) c1->cd(idx++);
786 TH1 *
h = (TH1 *) EnergySum_LG_full->DrawClone();
788 (TH1 *) EnergySum_LG->DrawClone(
"same");
790 p = (TPad *) c1->cd(idx++);
796 TH1 *h_full = (TH1 *) EnergySum_LG_full->DrawClone();
798 TH1 *h = (TH1 *) EnergySum_LG->DrawClone(
"same");
800 TF1 *fgaus_g =
new TF1(
"fgaus_LG_g",
"gaus", h->GetMean() - 1 * h->GetRMS(),
801 h->GetMean() + 4 * h->GetRMS());
802 fgaus_g->SetParameters(1, h->GetMean() - 2 * h->GetRMS(),
803 h->GetMean() + 2 * h->GetRMS());
804 h->Fit(fgaus_g,
"MR0N");
806 TF1 *fgaus =
new TF1(
"fgaus_LG",
"gaus",
807 fgaus_g->GetParameter(1) - 1 * fgaus_g->GetParameter(2),
808 fgaus_g->GetParameter(1) + 4 * fgaus_g->GetParameter(2));
809 fgaus->SetParameters(fgaus_g->GetParameter(0), fgaus_g->GetParameter(1),
810 fgaus_g->GetParameter(2));
815 h_full->GetXaxis()->SetRangeUser(h->GetMean() - 4 * h->GetRMS(),
816 h->GetMean() + 4 * h->GetRMS());
817 h_full->GetYaxis()->SetRangeUser(0,
818 fgaus_g->GetParameter(0) * 4);
821 h->SetMarkerStyle(kFullCircle);
824 Form(
"#DeltaE/<E> = %.1f%%",
825 100 * fgaus->GetParameter(2) / fgaus->GetParameter(1)));
866 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);
871 TString hname =
"EMCDistribution_" +
gain + TString(full_gain ?
"_FullGain" :
"") +
cuts;
874 if (
gain.Contains(
"CALIB"))
879 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 100, -1,
886 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 260, -.2,
890 "TOWER_" +
gain +
"_CEMC[].get_bineta() + 8* TOWER_" +
gain +
"_CEMC[].get_binphi():TOWER_" +
gain +
"_CEMC[].get_energy()>>" + hname,
"",
"goff");
892 else if (
gain.Contains(
"RAW"))
897 Form(
";Tower Peak Amp (ADC);Count / bin"), 1 << 8,
898 -3000, 17000, 64, -.5, 63.5);
904 Form(
";Tower Peak Amp (ADC);Count / bin"), 1 << 8,
905 0, 1 << 14, 64, -.5, 63.5);
908 "TOWER_" +
gain +
"_CEMC[].get_bineta() + 8* TOWER_" +
gain +
"_CEMC[].get_binphi():TOWER_" +
gain +
"_CEMC[].get_energy()>>" + hname,
"",
"goff");
912 TCanvas *c1 =
new TCanvas(
913 "EMCDistribution_" +
gain + TString(full_gain ?
"_FullGain" :
"") + cuts,
914 "EMCDistribution_" +
gain + TString(full_gain ?
"_FullGain" :
"") + cuts,
916 c1->Divide(8, 8, 0., 0.01);
920 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
922 for (
int ieta = 0; ieta < 8; ieta++)
924 p = (TPad *) c1->cd(idx++);
935 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi) + TString(full_gain ?
"_FullGain" :
"");
937 TH1 *
h = h2->ProjectionX(hname, ieta + 8 * iphi + 1,
938 ieta + 8 * iphi + 1);
941 h->SetLineColor(kBlue + 3);
942 h->SetFillColor(kBlue + 3);
944 h->GetXaxis()->SetTitleSize(.09);
945 h->GetXaxis()->SetLabelSize(.08);
946 h->GetYaxis()->SetLabelSize(.08);
951 h->Fit(
"x*gaus",
"M");
953 h->Fit(
"landau",
"M");
957 TF1 *
fit = ((TF1 *) (h->GetListOfFunctions()->At(0)));
960 fit->SetLineColor(kRed);
961 peak = fit->GetParameter(1);
964 cout << Form(
"Finished <Col%d Row%d> = %.1f", ieta, iphi, peak)
967 TText *t =
new TText(.9, .9,
968 Form(
"<Col%d Row%d> = %.1f", ieta, iphi, peak));
977 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);
982 const TString
gain =
"RAW";
984 TString hname =
"EMCDistribution_" + gain + TString(full_gain ?
"_FullGain" :
"") +
cuts;
991 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 100,
992 .05 * 100, 25 * 100, 64, -.5, 63.5);
998 Form(
";Calibrated Tower Energy Sum (ADC);Count / bin"), 260,
999 -.2 * 100, 5 * 100, 64, -.5, 63.5);
1002 "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");
1006 TCanvas *c1 =
new TCanvas(
1007 "EMCDistribution_PeakSample_Fast_" + TString(full_gain ?
"_FullGain" :
"") + cuts,
1008 "EMCDistribution_PeakSample_Fast_" + TString(full_gain ?
"_FullGain" :
"") + cuts, 1800, 950);
1009 c1->Divide(8, 8, 0., 0.01);
1013 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
1015 for (
int ieta = 0; ieta < 8; ieta++)
1017 p = (TPad *) c1->cd(idx++);
1028 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi) + TString(full_gain ?
"_FullGain" :
"");
1030 TH1 *
h = h2->ProjectionX(hname, ieta + 8 * iphi + 1,
1031 ieta + 8 * iphi + 1);
1034 h->SetLineColor(kBlue + 3);
1035 h->SetFillColor(kBlue + 3);
1037 h->GetXaxis()->SetTitleSize(.09);
1038 h->GetXaxis()->SetLabelSize(.08);
1039 h->GetYaxis()->SetLabelSize(.08);
1044 h->Fit(
"x*gaus",
"M");
1046 h->Fit(
"landau",
"M");
1050 TF1 *
fit = ((TF1 *) (h->GetListOfFunctions()->At(0)));
1053 fit->SetLineColor(kRed);
1054 peak = fit->GetParameter(1);
1057 cout << Form(
"Finished <Col%d Row%d> = %.1f", ieta, iphi, peak)
1060 TText *t =
new TText(.9, .9,
1061 Form(
"<Col%d Row%d> = %.1f", ieta, iphi, peak));
1062 t->SetTextAlign(33);
1063 t->SetTextSize(.15);
1070 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);
1076 TCanvas *c1 =
new TCanvas(
1077 "EMCDistribution_" +
gain + TString(log_scale ?
"_Log" :
"") +
cuts,
1078 "EMCDistribution_" +
gain + TString(log_scale ?
"_Log" :
"") +
cuts, 1800,
1080 c1->Divide(8, 8, 0., 0.01);
1084 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
1086 for (
int ieta = 0; ieta < 8; ieta++)
1088 p = (TPad *) c1->cd(idx++);
1095 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi) + TString(log_scale ?
"_Log" :
"");
1101 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 300,
1108 Form(
";Calibrated Tower Energy Sum (GeV);Count / bin"), 596,
1112 h->SetLineColor(kBlue + 3);
1113 h->SetFillColor(kBlue + 3);
1114 h->GetXaxis()->SetTitleSize(.09);
1115 h->GetXaxis()->SetLabelSize(.08);
1116 h->GetYaxis()->SetLabelSize(.08);
1122 "TOWER_" +
gain +
"_CEMC[].get_energy_power_law_exp()>>" + hname,
1124 "TOWER_%s_CEMC[].get_bineta()==%d && TOWER_%s_CEMC[].get_binphi()==%d",
1125 gain.Data(), ieta,
gain.Data(), iphi),
1128 TText *t =
new TText(.9, .9, Form(
"Col%d Row%d", ieta, iphi));
1129 t->SetTextAlign(33);
1130 t->SetTextSize(.15);
1139 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);
1144 TString
gain =
"RAW";
1147 TCanvas *c1 =
new TCanvas(
1148 "EMCDistribution_ADC_" + gain + TString(log_scale ?
"_Log" :
"") +
cuts,
1149 "EMCDistribution_ADC_" + gain + TString(log_scale ?
"_Log" :
"") +
cuts,
1151 c1->Divide(8, 8, 0., 0.01);
1155 for (
int iphi = 8 - 1; iphi >= 0; iphi--)
1157 for (
int ieta = 0; ieta < 8; ieta++)
1159 p = (TPad *) c1->cd(idx++);
1169 TString hname = Form(
"hEnergy_ieta%d_iphi%d", ieta, iphi) + TString(log_scale ?
"_Log" :
"");
1175 Form(
";Sample ID;ADC"), 31, -.5,
1178 1 << 10, 0, 1 << 14);
1185 h->SetLineColor(kBlue + 3);
1186 h->SetFillColor(kBlue + 3);
1187 h->GetXaxis()->SetTitleSize(.09);
1188 h->GetXaxis()->SetLabelSize(.08);
1189 h->GetYaxis()->SetLabelSize(.08);
1195 TString sdraw =
"TOWER_" + gain +
"_CEMC[].signal_samples[]:fmod(Iteration$,31)>>" + hname;
1198 "TOWER_%s_CEMC[].get_bineta()==%d && TOWER_%s_CEMC[].get_binphi()==%d",
1199 gain.Data(), ieta, gain.Data(), iphi);
1201 cout <<
"T->Draw(\"" << sdraw <<
"\",\"" << scut <<
"\");" << endl;
1203 T->Draw(sdraw, scut,
"colz");
1205 TText *t =
new TText(.9, .9, Form(
"Col%d Row%d", ieta, iphi));
1206 t->SetTextAlign(33);
1207 t->SetTextSize(.15);
1216 TString(
_file0->GetName()) + TString(
"_DrawPrototype4EMCalTower_") + TString(c1->GetName()),
false);