25 name = fTitle +
"_h1d_ECells";
26 h1d_ECells =
new TH1F(name,
"Ndet signal in cells", 9, 1, 10);
27 h1d_ECells->GetXaxis()->SetTitle(
"Cell id");
28 h1d_ECells->GetXaxis()->SetTitleColor(kOrange + 10);
29 h1d_ECells->GetYaxis()->SetTitle(
"Average Signal");
30 h1d_ECells->GetYaxis()->SetTitleColor(kOrange + 10);
32 name = fTitle +
"_h2_grid";
33 h2_grid =
new TH2F(name,
"Ndet_Grid", 3, 1, 4, 3, 1, 4);
34 h2_grid->GetXaxis()->SetTitle(
"X position");
35 h2_grid->GetXaxis()->SetTitleColor(kOrange + 10);
36 h2_grid->GetYaxis()->SetTitle(
"Y position");
37 h2_grid->GetYaxis()->SetTitleColor(kOrange + 10);
38 h2_grid->GetZaxis()->SetNoExponent(kFALSE);
41 name = fTitle +
"_hProfCell";
42 for (UInt_t uCell = 1; uCell <= kTOTAL_CELLS; ++uCell) {
44 new TH1F(name + Form(
"_%02u", uCell), Form(
"Cell_%02u", uCell), kTOTAL_LAYRS, 1, kTOTAL_LAYRS + 1);
45 hProfCell.at(uCell)->GetXaxis()->SetTitle(
"Layer id");
46 hProfCell.at(uCell)->GetXaxis()->SetTitleColor(kOrange + 10);
47 hProfCell.at(uCell)->GetYaxis()->SetTitle(
"Average Signal");
48 hProfCell.at(uCell)->GetYaxis()->SetTitleColor(kOrange + 10);
51 name = fTitle +
"_h1d_ProfileSlice";
52 h1d_ProfileSlice =
new TH1F(name,
"Energy in detector slice", kTOTAL_LAYRS, 1, kTOTAL_LAYRS + 1);
53 h1d_ProfileSlice->GetXaxis()->SetTitle(
"Layer id");
54 h1d_ProfileSlice->GetXaxis()->SetTitleColor(kOrange + 10);
55 h1d_ProfileSlice->GetYaxis()->SetTitle(
"Events");
56 h1d_ProfileSlice->GetYaxis()->SetTitleColor(kOrange + 10);
58 name = fTitle +
"_h1d_timemin";
59 h1d_timemin =
new TH1F(name,
"Minimum timestamp in event", 1000, 0, 100);
60 h1d_timemin->GetXaxis()->SetTitle(
"time");
61 h1d_timemin->GetXaxis()->SetTitleColor(kOrange + 10);
62 h1d_timemin->GetYaxis()->SetTitle(
"Events");
63 h1d_timemin->GetYaxis()->SetTitleColor(kOrange + 10);
65 name = fTitle +
"CanvasAmplitudes";
73 canAmpsPads.at(0) = p1;
78 canAmpsPads.at(1) = p2;
79 NamesAmps.at(1) = p2->
current->GetName();
81 name = fTitle +
"CanvasProfiles";
83 canv_hProfCell->Divide(3, 3);
84 canv_hProfCellPads.resize(kTOTAL_CELLS);
85 NamesProfs.resize(kTOTAL_CELLS);
86 for (UInt_t uCell = 1; uCell <= kTOTAL_CELLS; ++uCell) {
88 canv_hProfCellPads.at(uCell - 1) = p;
89 p->
current = hProfCell.at(uCell);
91 NamesProfs.at(uCell - 1) = p->
current->GetName();
94 name = fTitle +
"CanvasSlice";
96 canv_Slice->Divide(2, 1);
97 canv_SlicePads.resize(2);
100 canv_SlicePads.at(0) = pS1;
101 pS1->
current = h1d_ProfileSlice;
103 NamesSlice.at(0) = pS1->
current->GetName();
105 canv_SlicePads.at(1) = pS2;
108 NamesSlice.at(1) = pS2->
current->GetName();
110 name = fTitle +
"_hChE";
111 hChE =
new TH1F(name, name, 500, 0, 35000);
113 name = fTitle +
"_wfmCh";
114 wfmCh =
new TH1F(name, name, 200, 0, 200);
115 wfmCh->SetMarkerStyle(31);
116 wfmCh->SetMarkerSize(0.5);
118 name = fTitle +
"CanvasSelection";
126 canSelectPads.at(0) = ps1;
127 NamesSelect.at(0) = ps1->
current->GetName();
130 ps2->
opt =
"hist lp";
131 canSelectPads.at(1) = ps2;
132 NamesSelect.at(1) = ps2->
current->GetName();
134 name = fTitle +
"_h2_Layer_Cell";
136 new TH2F(name,
"h2_Layer_Cell", kTOTAL_LAYRS + 2, 0, kTOTAL_LAYRS + 2, kTOTAL_CELLS + 2, 0, kTOTAL_CELLS + 2);
137 h2_Layer_Cell->GetXaxis()->SetTitle(
"Layer number");
138 h2_Layer_Cell->GetXaxis()->SetTitleColor(kOrange + 10);
139 h2_Layer_Cell->GetYaxis()->SetTitle(
"Cell number");
140 h2_Layer_Cell->GetYaxis()->SetTitleColor(kOrange + 10);
141 h2_Layer_Cell->GetZaxis()->SetNoExponent(kFALSE);
142 h2_Layer_Cell->SetOption(
"colz");
143 h2_Layer_Cell->SetStats(0);
145 name = fTitle +
"_h1_Cells";
146 h1_Cells =
new TH1F(name,
"h1_Cells", 135, 1, 136);
147 h1_Cells->GetXaxis()->SetTitle(
"Cell number");
148 h1_Cells->GetXaxis()->SetTitleColor(kOrange + 10);
149 h1_Cells->GetYaxis()->SetTitle(
"Number of hits / event");
150 h1_Cells->GetYaxis()->SetTitleColor(kOrange + 10);
151 h1_Cells->SetOption(
"hist");
153 name = fTitle +
"CanvasCells";
155 canv_Cells->Divide(1, 2);
156 canv_CellsPads.resize(2);
157 NamesCells.resize(2);
159 canv_CellsPads.at(0) = pC1;
163 canv_CellsPads.at(1) = pC2;
166 NamesCells.at(1) = pC2->
current->GetName();
168 name = fTitle +
"_h2_Layers_Ampl";
169 h2_lrampl =
new TH2F(name,
"h2_Layers_Ampl", 59, 0, 59, 3, 0, 3);
170 h2_lrampl->GetXaxis()->SetTitle(
"X position");
171 h2_lrampl->GetXaxis()->SetTitleColor(kOrange + 10);
172 h2_lrampl->GetYaxis()->SetTitle(
"Y position");
173 h2_lrampl->GetYaxis()->SetTitleColor(kOrange + 10);
174 h2_lrampl->GetZaxis()->SetNoExponent(kFALSE);
175 h2_lrampl->SetOption(
"colz");
176 h2_lrampl->SetStats(0);
178 name = fTitle +
"_h1_Cells_Ampl";
179 h1_CellsAmpl =
new TH1F(name,
"h1_Cells_Ampl", 135, 1, 136);
180 h1_CellsAmpl->GetXaxis()->SetTitle(
"Cell number");
181 h1_CellsAmpl->GetXaxis()->SetTitleColor(kOrange + 10);
182 h1_CellsAmpl->GetYaxis()->SetTitle(
"Average amplitude");
183 h1_CellsAmpl->GetYaxis()->SetTitleColor(kOrange + 10);
184 h1_CellsAmpl->SetOption(
"hist");
186 name = fTitle +
"CanvasAmpl";
188 canv_Ampl->Divide(1, 2);
189 canv_AmplPads.resize(2);
192 canv_AmplPads.at(0) = pA1;
196 canv_AmplPads.at(1) = pA2;
199 NamesAmpl.at(1) = pA2->
current->GetName();
201 name = fTitle +
"_h2_Layers_Time";
202 h2_lrtime =
new TH2F(name,
"h2_Layers_Time", 59, 0, 59, 3, 0, 3);
203 h2_lrtime->GetXaxis()->SetTitle(
"X position");
204 h2_lrtime->GetXaxis()->SetTitleColor(kOrange + 10);
205 h2_lrtime->GetYaxis()->SetTitle(
"Y position");
206 h2_lrtime->GetYaxis()->SetTitleColor(kOrange + 10);
207 h2_lrtime->GetZaxis()->SetNoExponent(kFALSE);
208 h2_lrtime->SetOption(
"colz");
209 h2_lrtime->SetStats(0);
211 name = fTitle +
"_h1_Cells_Time";
212 h1_CellsTime =
new TH1F(name,
"h1_Cells_Time", 135, 1, 136);
213 h1_CellsTime->GetXaxis()->SetTitle(
"Cell number");
214 h1_CellsTime->GetXaxis()->SetTitleColor(kOrange + 10);
215 h1_CellsTime->GetYaxis()->SetTitle(
"Average time");
216 h1_CellsTime->GetYaxis()->SetTitleColor(kOrange + 10);
217 h1_CellsTime->SetOption(
"hist");
219 name = fTitle +
"CanvasTime";
221 canv_Time->Divide(1, 2);
222 canv_TimePads.resize(2);
225 canv_TimePads.at(0) = pT1;
229 canv_TimePads.at(1) = pT2;
232 NamesTime.at(1) = pT2->
current->GetName();
237 name = fTitle +
"_hCellAmpEM";
239 for (UInt_t uCell = 1; uCell <= kEM_LAYRS * kTOTAL_CELLS; ++uCell) {
240 itemp = ilch * 9 + il;
241 hCellAmpEM.at(uCell) =
new TH1F(name + Form(
"_%02u", itemp), Form(
"Cell_%02u", itemp), 100, 0, 10);
242 hCellAmpEM.at(uCell)->GetXaxis()->SetTitle(
"Signal");
243 hCellAmpEM.at(uCell)->GetXaxis()->SetTitleColor(kOrange + 10);
245 if (uCell % 6 == 0) {
251 name = fTitle +
"CanvasCellAmpEM";
253 canv_hCellAmpEM->Divide(6, 9, 0.0001, 0.0001);
254 canv_hCellAmpEMPads.resize(kEM_LAYRS * kTOTAL_CELLS);
255 NamesCellAmpEM.resize(kEM_LAYRS * kTOTAL_CELLS);
256 for (UInt_t uCell = 1; uCell <= kEM_LAYRS * kTOTAL_CELLS; ++uCell) {
258 canv_hCellAmpEMPads.at(uCell - 1) = paEM;
259 paEM->
current = hCellAmpEM.at(uCell);
261 NamesCellAmpEM.at(uCell - 1) = paEM->
current->GetName();
267 name = fTitle +
"_hCellAmpH";
268 for (UInt_t uCell = 1; uCell <= kHAD_LAYRS * kTOTAL_CELLS; ++uCell) {
269 itemp = ilch * 9 + il + kEM_LAYRS * kTOTAL_CELLS;
270 hCellAmpH.at(uCell) =
new TH1F(name + Form(
"_%02u", itemp), Form(
"Cell_%02u", itemp), 100, 0, 10);
271 hCellAmpH.at(uCell)->GetXaxis()->SetTitle(
"Signal");
272 hCellAmpH.at(uCell)->GetXaxis()->SetTitleColor(kOrange + 10);
274 if (uCell % 9 == 0) {
280 name = fTitle +
"CanvasCellAmpH";
282 canv_hCellAmpH->Divide(9, 9, 0.0001, 0.0001);
283 canv_hCellAmpHPads.resize(kHAD_LAYRS * kTOTAL_CELLS);
284 NamesCellAmpH.resize(kHAD_LAYRS * kTOTAL_CELLS);
285 for (UInt_t uCell = 1; uCell <= kHAD_LAYRS * kTOTAL_CELLS; ++uCell) {
287 canv_hCellAmpHPads.at(uCell - 1) = paH;
288 paH->
current = hCellAmpH.at(uCell);
290 NamesCellAmpH.at(uCell - 1) = paH->
current->GetName();
296 name = fTitle +
"_hCellTimeEM";
297 for (UInt_t uCell = 1; uCell <= kEM_LAYRS * kTOTAL_CELLS; ++uCell) {
298 itemp = ilch * 9 + il;
299 hCellTimeEM.at(uCell) =
new TH1F(name + Form(
"_%02u", itemp), Form(
"Cell_%02u", itemp), 1000, -300, 300);
300 hCellTimeEM.at(uCell)->GetXaxis()->SetTitle(
"Time");
301 hCellTimeEM.at(uCell)->GetXaxis()->SetTitleColor(kOrange + 10);
303 if (uCell % 6 == 0) {
309 name = fTitle +
"CanvasCellTimeEM";
311 canv_hCellTimeEM->Divide(6, 9, 0.0001, 0.0001);
312 canv_hCellTimeEMPads.resize(kEM_LAYRS * kTOTAL_CELLS);
313 NamesCellTimeEM.resize(kEM_LAYRS * kTOTAL_CELLS);
314 for (UInt_t uCell = 1; uCell <= kEM_LAYRS * kTOTAL_CELLS; ++uCell) {
316 canv_hCellTimeEMPads.at(uCell - 1) = ptEM;
317 ptEM->
current = hCellTimeEM.at(uCell);
319 NamesCellTimeEM.at(uCell - 1) = ptEM->
current->GetName();
325 name = fTitle +
"_hCellTimeH";
326 for (UInt_t uCell = 1; uCell <= kHAD_LAYRS * kTOTAL_CELLS; ++uCell) {
327 itemp = ilch * 9 + il + kEM_LAYRS * kTOTAL_CELLS;
328 hCellTimeH.at(uCell) =
new TH1F(name + Form(
"_%02u", itemp), Form(
"Cell_%02u", itemp), 1000, -300, 300);
329 hCellTimeH.at(uCell)->GetXaxis()->SetTitle(
"Time");
330 hCellTimeH.at(uCell)->GetXaxis()->SetTitleColor(kOrange + 10);
332 if (uCell % 9 == 0) {
338 name = fTitle +
"CanvasCellTimeH";
340 canv_hCellTimeH->Divide(9, 9, 0.0001, 0.0001);
341 canv_hCellTimeHPads.resize(kHAD_LAYRS * kTOTAL_CELLS);
342 NamesCellTimeH.resize(kHAD_LAYRS * kTOTAL_CELLS);
343 for (UInt_t uCell = 1; uCell <= kHAD_LAYRS * kTOTAL_CELLS; ++uCell) {
345 canv_hCellTimeHPads.at(uCell - 1) = ptH;
346 ptH->
current = hCellTimeH.at(uCell);
348 NamesCellTimeH.at(uCell - 1) = ptH->
current->GetName();
351 name = fTitle +
"_h2_hits";
352 h2_hits =
new TH2F(name,
"h2_hits", 9, 1, 10, 16, 0, 16);
353 h2_hits->GetXaxis()->SetTitle(
"module");
354 h2_hits->GetXaxis()->SetTitleColor(kOrange + 10);
355 h2_hits->GetYaxis()->SetTitle(
"Channel");
356 h2_hits->GetYaxis()->SetTitleColor(kOrange + 10);
357 h2_hits->GetZaxis()->SetNoExponent(kFALSE);
358 h2_hits->SetOption(
"colz");
359 h2_hits->SetStats(0);
361 name = fTitle +
"_h2_mean_amp";
362 h2_mean_amp =
new TH2F(name,
"h2_mean_amp", 9, 1, 10, 16, 0, 16);
363 h2_mean_amp->GetXaxis()->SetTitle(
"module");
364 h2_mean_amp->GetXaxis()->SetTitleColor(kOrange + 10);
365 h2_mean_amp->GetYaxis()->SetTitle(
"Channel");
366 h2_mean_amp->GetYaxis()->SetTitleColor(kOrange + 10);
367 h2_mean_amp->GetZaxis()->SetNoExponent(kFALSE);
368 h2_mean_amp->SetOption(
"colz");
369 h2_mean_amp->SetStats(0);
371 name = fTitle +
"CanvasHits";
373 canv_hits->Divide(1, 2);
374 canv_hitsPads.resize(2);
377 canv_hitsPads.at(0) = pB1;
381 canv_hitsPads.at(1) = pB2;
384 NamesHits.at(1) = pB2->
current->GetName();
505 TClonesArray* digits = fDigiArrays->
ndet;
509 h1d_ECells->Scale(fEventCounter);
510 h2_grid->Scale(fEventCounter);
511 h1d_ProfileSlice->Scale(fEventCounter);
512 h2_Layer_Cell->Scale(fEventCounter);
513 h1_Cells->Scale(fEventCounter);
514 for (UInt_t uCell = 1; uCell <= kTOTAL_CELLS; ++uCell)
515 hProfCell.at(uCell)->Scale(fEventCounter);
517 double trigtimeshift = 0.0;
518 for (Int_t iDig = 0; iDig < digits->GetEntriesFast(); iDig++) {
521 trigtimeshift = digi->
GetTime();
525 double mintime = std::numeric_limits<float>::max();
526 for (Int_t iDig = 0; iDig < digits->GetEntriesFast(); iDig++) {
529 double time = 200 - trigtimeshift + digi->
GetTime();
532 auto cell = (row - 1) * 3 + col;
547 unsigned int channel = cell;
548 h1d_ECells->Fill(channel, signal);
549 h2_grid->Fill(col, row, signal);
550 h2_Layer_Cell->Fill(layer, channel, signal);
552 int chan_adc = ((col - 1) * 3 + (3 - row)) + (layer - 1) * kTQDC_MAX_MODULES + 1;
553 int lr_adc = (chan_adc - 1) / kTQDC_MAX_CHAN + 1;
554 int cell_adc = (chan_adc - 1) % kTQDC_MAX_CHAN;
555 h2_hits->Fill(lr_adc, cell_adc);
569 bool isSelected = ((Int_t)cell == fSelectedCell) && ((Int_t)digi->
GetLayerId() == fSelectedLayer);
571 if ((TrigPattern >> fSelectedTrigger) & 1) {
572 hChE->Fill(digi->
fAmpl);
573 auto Wfm = digi->
GetWfm();
574 std::vector<float> points(Wfm.size());
575 std::iota(std::begin(points), std::end(points), 0);
577 wfmCh->GetXaxis()->SetRangeUser(0, Wfm.size());
578 for (UInt_t wfm_iter = 0; wfm_iter < Wfm.size(); wfm_iter++)
579 wfmCh->Fill(wfm_iter, Wfm.at(wfm_iter));
583 hProfCell.at(channel)->Fill(digi->
GetLayerId(), signal);
584 h1d_ProfileSlice->Fill(digi->
GetLayerId(), signal);
586 int ch_flat_idx = channel + (layer - 1) * kTOTAL_CELLS;
587 h1_Cells->Fill(ch_flat_idx, 1);
588 meanamp.at(ch_flat_idx - 1) = (meanamp.at(ch_flat_idx - 1) * ch_entries.at(ch_flat_idx - 1) + signal)
589 / (ch_entries.at(ch_flat_idx - 1) + 1);
590 meantime.at(ch_flat_idx - 1) = (meantime.at(ch_flat_idx - 1) * ch_entries.at(ch_flat_idx - 1) + time)
591 / (ch_entries.at(ch_flat_idx - 1) + 1);
592 meanamp_test.at(lr_adc - 1).at(cell_adc) =
593 (meanamp_test.at(lr_adc - 1).at(cell_adc) * ch_entries_test.at(lr_adc - 1).at(cell_adc) + signal)
594 / (ch_entries_test.at(lr_adc - 1).at(cell_adc) + 1);
596 ch_entries.at(ch_flat_idx - 1) += 1.0;
597 ch_entries_test.at(lr_adc - 1).at(cell_adc) += 1.0;
599 int ix = col + (layer - 1) * 3 + (layer - 1);
600 h2_lrampl->SetBinContent(ix, row, meanamp.at(ch_flat_idx - 1));
601 h1_CellsAmpl->SetBinContent(ch_flat_idx, meanamp.at(ch_flat_idx - 1));
602 h2_lrtime->SetBinContent(ix, row, meantime.at(ch_flat_idx - 1));
603 h1_CellsTime->SetBinContent(ch_flat_idx, meantime.at(ch_flat_idx - 1));
604 h2_mean_amp->SetBinContent(lr_adc, cell_adc + 1, meanamp_test.at(lr_adc - 1).at(cell_adc));
609 if (ch_flat_idx <= kEM_LAYRS * kTOTAL_CELLS) {
610 int itempEM = ((ch_flat_idx - 1) % 9) * 6 + layer;
611 hCellAmpEM.at(itempEM)->Fill(signal);
612 hCellTimeEM.at(itempEM)->Fill(time);
614 int itempH = ((ch_flat_idx - kEM_LAYRS * kTOTAL_CELLS - 1) % 9) * 9 + layer - 6;
615 hCellAmpH.at(itempH)->Fill(signal);
616 hCellTimeH.at(itempH)->Fill(time);
621 h1d_ECells->Scale(1. / fEventCounter);
622 h2_grid->Scale(1. / fEventCounter);
623 h1d_ProfileSlice->Scale(1. / fEventCounter);
624 for (UInt_t uCell = 1; uCell <= kTOTAL_CELLS; ++uCell)
625 hProfCell.at(uCell)->Scale(1. / fEventCounter);
626 h2_Layer_Cell->Scale(1. / fEventCounter);
627 h1_Cells->Scale(1. / fEventCounter);
629 h1d_timemin->Fill(mintime);