25 name = fTitle +
"_h1d_Emodules";
26 h1d_Emodules =
new TH1F(name,
"FHCal signal in modules", kTOTAL_MODULES, 1, kTOTAL_MODULES + 1);
27 h1d_Emodules->GetXaxis()->SetTitle(
"Module id");
28 h1d_Emodules->GetXaxis()->SetTitleColor(kOrange + 10);
29 h1d_Emodules->GetYaxis()->SetTitle(
"Average Signal [MIP]");
30 h1d_Emodules->GetYaxis()->SetTitleColor(kOrange + 10);
31 h1d_Emodules->SetStats(0);
33 name = fTitle +
"_h2_calo";
34 h2_calo =
new TH2F(name,
"FHCal_Grid", 32, -80, 80, 25, -60, 60);
35 h2_calo->GetXaxis()->SetTitle(
"X position [mm]");
36 h2_calo->GetXaxis()->SetTitleColor(kOrange + 10);
37 h2_calo->GetYaxis()->SetTitle(
"Y position [mm]");
38 h2_calo->GetYaxis()->SetTitleColor(kOrange + 10);
39 h2_calo->GetZaxis()->SetNoExponent(kFALSE);
42 name = fTitle +
"_h2_calo_text";
43 h2_calo_text = (TH2F*)h2_calo->Clone(name.Data());
44 h2_calo_text->SetMarkerColor(kBlack);
45 h2_calo_text->SetStats(0);
47 name = fTitle +
"_hModuleProfile";
48 for (UInt_t uMod = 1; uMod <= kTOTAL_MODULES; ++uMod) {
49 hModuleProfile.at(uMod) =
new TH1F(fTitle + Form(
"_Profile_Mod_%02u", uMod), Form(
"Mod_%02u", uMod), 10, 1, 11);
50 hModuleProfile.at(uMod)->SetTitle(Form(
"Mod %03u", uMod));
51 hModuleProfile.at(uMod)->SetTitleSize(0.9,
"t");
52 hModuleProfile.at(uMod)->GetXaxis()->SetTitle(
"Section id");
53 hModuleProfile.at(uMod)->GetXaxis()->SetTitleColor(kOrange + 10);
54 hModuleProfile.at(uMod)->GetYaxis()->SetTitle(
"Average Signal [MIP]");
55 hModuleProfile.at(uMod)->GetYaxis()->SetTitleColor(kOrange + 10);
56 hModuleProfile.at(uMod)->SetStats(0);
59 name = fTitle +
"CanvasAmplitudes";
65 p1->
aux = {h2_calo, h2_calo_text};
66 p1->
auxOpt = {
"colz logz",
"text"};
67 canAmpsPads.at(0) = p1;
71 canAmpsPads.at(1) = p2;
72 NamesAmps.at(1) = p2->
current->GetName();
74 canProfsPads.resize(kTOTAL_MODULES + 1,
nullptr);
75 NamesProfs.resize(kTOTAL_MODULES + 1,
nullptr);
77 name = fTitle +
"CanvasProfilesSmall";
79 canProfsSmall->Divide(5, 7);
81 int ModToPadSmall[35] = {
82 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1,
83 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34};
84 for (UInt_t iPad = 0; iPad < 35; ++iPad) {
86 canProfsPads.at(iPad) = p;
87 if (ModToPadSmall[iPad] < 0)
89 UInt_t uMod = (UInt_t)ModToPadSmall[iPad];
90 hModuleProfile.at(uMod)->GetXaxis()->SetRangeUser(1, 8);
91 p->
current = hModuleProfile.at(uMod);
93 NamesProfs.at(iPad) = p->
current->GetName();
96 name = fTitle +
"CanvasProfilesBig";
98 canProfsBig->Divide(4, 5);
99 int ModToPadBig[20] = {35, 36, 45, 46, 37, 38, 47, 48, 39, 40, 49, 50, 41, 42, 51, 52, 43, 44, 53, 54};
100 for (UInt_t iPad = 0; iPad < 20; ++iPad) {
102 canProfsPads.at(iPad + 35) = p;
103 UInt_t uMod = (UInt_t)ModToPadBig[iPad];
104 p->
current = hModuleProfile.at(uMod);
106 NamesProfs.at(iPad + 35) = p->
current->GetName();
109 name = fTitle +
"_hSecE";
110 hSecE =
new TH1F(name, name, 300, 0, 35000);
112 hSecE->GetYaxis()->SetTitle(
"Counts");
113 hSecE->GetXaxis()->SetTitle(
"Apml");
115 name = fTitle +
"_wfmSec";
116 wfmSec =
new TH1F(name, name, 200, 0, 200);
117 wfmSec->SetMarkerStyle(31);
118 wfmSec->SetMarkerSize(0.5);
121 name = fTitle +
"CanvasSelection";
123 canSelect->Divide(1, 2);
124 canSelectPads.resize(1 * 2);
125 NamesSelect.resize(1 * 2);
129 canSelectPads.at(0) = ps1;
130 NamesSelect.at(0) = ps1->
current->GetName();
133 ps2->
opt =
"hist lp";
134 canSelectPads.at(1) = ps2;
135 NamesSelect.at(1) = ps2->
current->GetName();
137 name = fTitle +
"_h2_mod_sec";
138 h2_mod_sec =
new TH2F(name,
"FHCal - Module vs Section", 12, 0, 11, 55, 0, 55);
139 h2_mod_sec->GetXaxis()->SetTitle(
"Section Id");
140 h2_mod_sec->GetXaxis()->SetTitleColor(kOrange + 10);
141 h2_mod_sec->GetYaxis()->SetTitle(
"Module Id");
142 h2_mod_sec->GetYaxis()->SetTitleColor(kOrange + 10);
143 h2_mod_sec->GetZaxis()->SetNoExponent(kFALSE);
144 h2_mod_sec->SetStats(0);
145 name = fTitle +
"Canvas_mod_sec";
146 can_mod_sec =
new TCanvas(name, name, 1, 1);
147 can_mod_sec->Divide(1, 1);
148 can_mod_secPads.resize(1 * 1);
149 Names_mod_sec.resize(1 * 1);
152 pms->
opt =
"colz logz";
153 can_mod_secPads.at(0) = pms;
155 name = fTitle +
"_h1_totalE";
156 h1_totalE =
new TH1F(name,
"FHCal total energy", 700, 0, 2100);
157 h1_totalE->GetXaxis()->SetTitle(
"Reconstructed energy [MIP]");
158 h1_totalE->GetXaxis()->SetTitleColor(kOrange + 10);
159 h1_totalE->GetYaxis()->SetTitle(
"Counts / events");
160 h1_totalE->GetYaxis()->SetTitleColor(kOrange + 10);
161 h1_totalE->SetStats(0);
162 name = fTitle +
"Canvas_totalE";
163 can_totalE =
new TCanvas(name, name, 1, 1);
164 can_totalE->Divide(1, 1);
165 can_totalEPads.resize(1 * 1);
166 Names_totalE.resize(1 * 1);
170 can_totalEPads.at(0) = pte;
172 name = fTitle +
"_h2_totalE_hodoZ2_BT";
173 h2_totalE_hodoZ2_BT =
new TH2F(name,
"FHCal total energy vs Hodo Z^2 BT", 70, 0, 2100000, 50, 0, 3000);
174 h2_totalE_hodoZ2_BT->GetXaxis()->SetTitle(
"fIntegral");
175 h2_totalE_hodoZ2_BT->GetXaxis()->SetTitleColor(kOrange + 10);
176 h2_totalE_hodoZ2_BT->GetYaxis()->SetTitle(
"Hodo Z^2");
177 h2_totalE_hodoZ2_BT->GetYaxis()->SetTitleColor(kOrange + 10);
178 h2_totalE_hodoZ2_BT->SetStats(0);
179 name = fTitle +
"_h2_totalE_hodoZ2_CCT2";
180 h2_totalE_hodoZ2_CCT2 =
new TH2F(name,
"FHCal total energy vs Hodo Z^2 CCT2", 70, 0, 2100000, 50, 0, 3000);
181 h2_totalE_hodoZ2_CCT2->GetXaxis()->SetTitle(
"fIntegral");
182 h2_totalE_hodoZ2_CCT2->GetXaxis()->SetTitleColor(kOrange + 10);
183 h2_totalE_hodoZ2_CCT2->GetYaxis()->SetTitle(
"Hodo Z^2");
184 h2_totalE_hodoZ2_CCT2->GetYaxis()->SetTitleColor(kOrange + 10);
185 h2_totalE_hodoZ2_CCT2->SetStats(0);
186 name = fTitle +
"Canvas_totalE_hodoZ2";
188 can_totalE_hodoZ2->Divide(2, 1);
189 can_totalE_hodoZ2Pads.resize(2 * 1);
190 Names_totalE_hodoZ2.resize(2 * 1);
192 pfh1->
current = h2_totalE_hodoZ2_BT;
193 pfh1->
opt =
"colz logz";
194 can_totalE_hodoZ2Pads.at(0) = pfh1;
195 Names_totalE_hodoZ2.at(0) = pfh1->
current->GetName();
197 pfh2->
current = h2_totalE_hodoZ2_CCT2;
198 pfh2->
opt =
"colz logz";
199 can_totalE_hodoZ2Pads.at(1) = pfh2;
200 Names_totalE_hodoZ2.at(1) = pfh2->
current->GetName();
202 name = fTitle +
"_h2_ZL_nEvent";
203 h2_ZL_nEvent =
new TH2F(name,
"FHCal - ZL - nEvent", 500, 0, 10000, 50, -50, 50);
204 h2_ZL_nEvent->GetYaxis()->SetTitle(
"fZL");
205 h2_ZL_nEvent->GetYaxis()->SetTitleColor(kOrange + 10);
206 h2_ZL_nEvent->GetXaxis()->SetTitle(
"nEvent");
207 h2_ZL_nEvent->GetXaxis()->SetTitleColor(kOrange + 10);
208 h2_ZL_nEvent->GetZaxis()->SetNoExponent(kFALSE);
209 h2_ZL_nEvent->SetStats(0);
210 name = fTitle +
"Canvas_ZL_nEvent";
211 can_ZL_nEvent =
new TCanvas(name, name, 1, 1);
212 can_ZL_nEvent->Divide(1, 1);
213 can_ZL_nEventPads.resize(1 * 1);
214 Names_ZL_nEvent.resize(1 * 1);
217 pzl->
opt =
"colz logz";
218 can_ZL_nEventPads.at(0) = pzl;
220 name = fTitle +
"_h2_mod_ZL_nEvent";
221 for (UInt_t uMod = 1; uMod <= kTOTAL_MODULES; ++uMod) {
222 h2_mod_ZL_nEvent.at(uMod) =
223 new TH2F(fTitle + Form(
"_ZL_Mod_%02u", uMod), Form(
"ZL_Mod_%02u", uMod), 500, 0, 10000, 50, -50, 50);
224 h2_mod_ZL_nEvent.at(uMod)->SetTitle(Form(
"Mod %03u", uMod));
225 h2_mod_ZL_nEvent.at(uMod)->SetTitleSize(0.9,
"t");
226 h2_mod_ZL_nEvent.at(uMod)->GetXaxis()->SetTitle(
"nEvent");
227 h2_mod_ZL_nEvent.at(uMod)->GetXaxis()->SetTitleColor(kOrange + 10);
228 h2_mod_ZL_nEvent.at(uMod)->GetYaxis()->SetTitle(
"fZL");
229 h2_mod_ZL_nEvent.at(uMod)->GetYaxis()->SetTitleColor(kOrange + 10);
230 h2_mod_ZL_nEvent.at(uMod)->GetZaxis()->SetNoExponent(kFALSE);
231 h2_mod_ZL_nEvent.at(uMod)->SetStats(0);
234 canZLPads.resize(kTOTAL_MODULES + 1,
nullptr);
235 NamesZL.resize(kTOTAL_MODULES + 1,
nullptr);
237 name = fTitle +
"CanvasZLSmall";
239 canZLSmall->Divide(5, 7);
240 for (UInt_t iPad = 0; iPad < 35; ++iPad) {
242 canZLPads.at(iPad) = p;
243 if (ModToPadSmall[iPad] < 0)
245 UInt_t uMod = (UInt_t)ModToPadSmall[iPad];
246 p->
current = h2_mod_ZL_nEvent.at(uMod);
247 p->
opt =
"colz logz";
248 NamesZL.at(iPad) = p->
current->GetName();
251 name = fTitle +
"CanvasZLBig";
253 canZLBig->Divide(4, 5);
254 for (UInt_t iPad = 0; iPad < 20; ++iPad) {
256 canZLPads.at(iPad + 35) = p;
257 UInt_t uMod = (UInt_t)ModToPadBig[iPad];
258 p->
current = h2_mod_ZL_nEvent.at(uMod);
259 p->
opt =
"colz logz";
260 NamesZL.at(iPad + 35) = p->
current->GetName();
370 TClonesArray* digits = fDigiArrays->
fhcal;
384 h1d_Emodules->Scale(fEventCounter);
385 h2_calo->Scale(fEventCounter);
386 h2_mod_sec->Scale(fEventCounter);
387 h1_totalE->Scale(fEventCounter);
388 h2_totalE_hodoZ2_BT->Scale(fEventCounter);
389 h2_totalE_hodoZ2_CCT2->Scale(fEventCounter);
390 for (UInt_t uMod = 1; uMod <= kTOTAL_MODULES; ++uMod)
391 hModuleProfile.at(uMod)->Scale(fEventCounter);
393 for (Int_t iDig = 0; iDig < digits->GetEntriesFast(); iDig++) {
399 auto it = positionMap.find(digi->
GetAddress());
400 if (it == positionMap.end())
402 float realXpos = it->second.first.X();
403 float realYpos = it->second.first.Y();
405 h2_calo->Fill(realXpos, realYpos, signal);
410 h2_ZL_nEvent->Fill(fEventCounterZL, digi->
fZL);
411 h2_mod_ZL_nEvent.at(digi->
GetModuleId())->Fill(fEventCounterZL, digi->
fZL);
414 int bin_x = h2_calo_text->GetXaxis()->FindBin(realXpos);
415 int bin_y = h2_calo_text->GetYaxis()->FindBin(realYpos);
416 int BC = h2_calo_text->GetBinContent(bin_x, bin_y);
418 h2_calo_text->Fill(realXpos, realYpos, digi->
GetModuleId());
433 if ((TrigPattern >> fSelectedTrigger) & 1) {
434 hSecE->Fill(digi->
fAmpl);
435 auto Wfm = digi->
GetWfm();
436 std::vector<float> points(Wfm.size());
437 std::iota(std::begin(points), std::end(points), 0);
439 wfmSec->GetXaxis()->SetRangeUser(0, Wfm.size());
440 for (UInt_t wfm_iter = 0; wfm_iter < Wfm.size(); wfm_iter++)
441 wfmSec->Fill(wfm_iter, Wfm.at(wfm_iter));
450 h1_totalE->Fill(sumE);
451 h1_totalE->Scale(1. / fEventCounter);
452 h1d_Emodules->Scale(1. / fEventCounter);
453 h2_calo->Scale(1. / fEventCounter);
454 h2_mod_sec->Scale(1. / fEventCounter);
455 for (UInt_t uMod = 1; uMod <= kTOTAL_MODULES; ++uMod)
456 hModuleProfile.at(uMod)->Scale(1. / fEventCounter);
457 if (fEventCounterZL >= 10000) {
458 h2_ZL_nEvent->Reset();
459 for (UInt_t uMod = 1; uMod <= kTOTAL_MODULES; ++uMod) {
460 h2_mod_ZL_nEvent.at(uMod)->Reset();
464 TClonesArray* digits_hodo = fDigiArrays->
hodo;
468 float responses[kNstrips + 1][kNsides];
469 memset(responses, 0,
sizeof(responses[0][0]) * (kNstrips + 1) * kNsides);
470 for (Int_t iDig = 0; iDig < digits_hodo->GetEntriesFast(); iDig++) {
477 responses[strip][side] = signal;
485 if (z2 > 0.5 && sumInt > 0.5) {
487 auto bitBT = (TrigPattern >> 2) & 1;
489 auto bitMBT = (TrigPattern >> 6) & 1;
491 auto bitCCT1 = (TrigPattern >> 5) & 1;
492 auto bitCCT2 = (TrigPattern >> 8) & 1;
493 auto bitCCT3 = (TrigPattern >> 12) & 1;
494 auto bitFHCAL = (TrigPattern >> 9) & 1;
496 (bitBT == 1) && (bitMBT == 0) && (bitCCT1 == 0) && (bitCCT2 == 0) && (bitCCT3 == 0) && (bitFHCAL == 0);
499 bool trigCCT2 = (bitCCT2 == 1);
501 h2_totalE_hodoZ2_BT->Fill(sumInt, z2);
503 h2_totalE_hodoZ2_CCT2->Fill(sumInt, z2);
505 h2_totalE_hodoZ2_BT->Scale(1. / fEventCounter);
506 h2_totalE_hodoZ2_CCT2->Scale(1. / fEventCounter);