CbmRoot
Loading...
Searching...
No Matches
CbmTofUnpackMonitor.cxx
Go to the documentation of this file.
1/* Copyright (C) 2022 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
6
8#include "CriGet4Mess001.h"
9#include "MicrosliceDescriptor.hpp"
10
11#include <FairRun.h>
12#include <FairRunOnline.h>
13#include <Logger.h>
14
15#include <RtypesCore.h>
16#include <TCanvas.h>
17#include <TFile.h>
18#include <TH1.h>
19#include <TH2.h>
20#include <THttpServer.h>
21#include <TMath.h>
22#include <TPaveStats.h>
23#include <TProfile.h>
24#include <TROOT.h>
25
26#include <cmath>
27#include <iomanip>
28#include <iostream>
29#include <memory>
30#include <string>
31
33{
34 // Miscroslice component properties histos
35 for (UInt_t component = 0; component < kuMaxNbFlibLinks; component++) {
36 fvhMsSize[component] = nullptr;
37 fvhMsSizeTime[component] = nullptr;
38 }
39}
40
42{
43 for (auto iter = fvpAllHistoPointers.begin(); iter != fvpAllHistoPointers.end();) {
44 if (iter->first != nullptr) {
45 delete iter->first;
46 }
47 iter = fvpAllHistoPointers.erase(iter);
48 }
49 for (auto iter = fvpAllCanvasPointers.begin(); iter != fvpAllCanvasPointers.end();) {
50 if (iter->first != nullptr) {
51 delete iter->first;
52 }
53 iter = fvpAllCanvasPointers.erase(iter);
54 }
55}
56
57void CbmTofUnpackMonitor::SetBmonChannelMap(std::vector<uint32_t> vChanMapIn)
58{
59 uint32_t uNbCh = vChanMapIn.size();
60 if (8 != uNbCh && 16 != uNbCh) {
61 LOG(fatal) << "Wrong number of channels in call to CbmTofUnpackMonitor::SetBmonChannelMap, "
62 << "only 8 and 16 supported, input here was " << uNbCh;
63 }
64 for (UInt_t uChan = 0; uChan < uNbCh; ++uChan) {
65 fuBmonChanMap[uChan] = vChanMapIn[uChan];
66 }
67}
68
70{
72 std::string sSystem = "tof";
73 if (fBmonMode) {
74 //
75 sSystem = "bmon";
76 }
77
78 // clang-format off
79 fhGet4MessType = new TH2I(Form("%sGet4MessType", sSystem.data()),
80 "Nb of message for each type per GET4; GET4 chip # ; Type",
82 4, 0., 4.);
83 fhGet4MessType->GetYaxis()->SetBinLabel(1, "DATA 32b");
84 fhGet4MessType->GetYaxis()->SetBinLabel(2, "EPOCH");
85 fhGet4MessType->GetYaxis()->SetBinLabel(3, "S.C.M");
86 fhGet4MessType->GetYaxis()->SetBinLabel(4, "ERROR");
87 // fhGet4MessType->GetYaxis()->SetBinLabel( 5, "DATA 24b");
88 // fhGet4MessType->GetYaxis()->SetBinLabel( 6, "STAR Trigger");
89
90 fhGet4EpochFlags = new TH2I(Form("%sGet4EpochFlags", sSystem.data()),
91 "Epoch flags per GET4; GET4 chip # ; Type",
93 4, 0., 4.);
94 fhGet4EpochFlags->GetYaxis()->SetBinLabel(1, "SYNC");
95 fhGet4EpochFlags->GetYaxis()->SetBinLabel(2, "Ep LOSS");
96 fhGet4EpochFlags->GetYaxis()->SetBinLabel(3, "Da LOSS");
97 fhGet4EpochFlags->GetYaxis()->SetBinLabel(4, "MISSMAT");
98
99 fhGet4ScmType = new TH2I(Form("%sGet4ScmType", sSystem.data()),
100 "SC messages per GET4 channel; GET4 channel # ; SC type",
102 5, 0., 5.);
103 fhGet4ScmType->GetYaxis()->SetBinLabel(1, "Hit Scal");
104 fhGet4ScmType->GetYaxis()->SetBinLabel(2, "Deadtime");
105 fhGet4ScmType->GetYaxis()->SetBinLabel(3, "SPI");
106 fhGet4ScmType->GetYaxis()->SetBinLabel(4, "SEU Scal");
107 fhGet4ScmType->GetYaxis()->SetBinLabel(5, "START");
108
109 fhGet4SysMessType = new TH2I(Form("%sGet4SysMessType", sSystem.data()),
110 "Nb of system message for each type per Get4; Get4; System Type",
113 fhGet4SysMessType->GetYaxis()->SetBinLabel(1 + critof001::SYS_GET4_ERROR, "GET4 ERROR");
114 fhGet4SysMessType->GetYaxis()->SetBinLabel(1 + critof001::SYS_GDPB_UNKWN, "UNKW GET4 MSG");
115 fhGet4SysMessType->GetYaxis()->SetBinLabel(1 + critof001::SYS_GET4_SYNC_MISS, "SYS_GET4_SYNC_MISS");
116 fhGet4SysMessType->GetYaxis()->SetBinLabel(1 + critof001::SYS_PATTERN, "SYS_PATTERN");
117
118 fhGet4ErrorsType = new TH2I(Form("%sGet4ErrorsType", sSystem.data()),
119 "Error messages per GET4 channel; GET4 channel # ; Error",
121 22, 0., 22.);
122 fhGet4ErrorsType->GetYaxis()->SetBinLabel(1, "0x00: Readout Init ");
123 fhGet4ErrorsType->GetYaxis()->SetBinLabel(2, "0x01: Sync ");
124 fhGet4ErrorsType->GetYaxis()->SetBinLabel(3, "0x02: Epoch count sync");
125 fhGet4ErrorsType->GetYaxis()->SetBinLabel(4, "0x03: Epoch ");
126 fhGet4ErrorsType->GetYaxis()->SetBinLabel(5, "0x04: FIFO Write ");
127 fhGet4ErrorsType->GetYaxis()->SetBinLabel(6, "0x05: Lost event ");
128 fhGet4ErrorsType->GetYaxis()->SetBinLabel(7, "0x06: Channel state ");
129 fhGet4ErrorsType->GetYaxis()->SetBinLabel(8, "0x07: Token Ring state");
130 fhGet4ErrorsType->GetYaxis()->SetBinLabel(9, "0x08: Token ");
131 fhGet4ErrorsType->GetYaxis()->SetBinLabel(10, "0x09: Error Readout ");
132 fhGet4ErrorsType->GetYaxis()->SetBinLabel(11, "0x0a: SPI ");
133 fhGet4ErrorsType->GetYaxis()->SetBinLabel(12, "0x0b: DLL Lock error "); // <- From GET4 v1.2
134 fhGet4ErrorsType->GetYaxis()->SetBinLabel(13, "0x0c: DLL Reset invoc."); // <- From GET4 v1.2
135 fhGet4ErrorsType->GetYaxis()->SetBinLabel(14, "0x11: Overwrite ");
136 fhGet4ErrorsType->GetYaxis()->SetBinLabel(15, "0x12: ToT out of range");
137 fhGet4ErrorsType->GetYaxis()->SetBinLabel(16, "0x13: Event Discarded ");
138 fhGet4ErrorsType->GetYaxis()->SetBinLabel(17, "0x14: Add. Rising edge"); // <- From GET4 v1.3
139 fhGet4ErrorsType->GetYaxis()->SetBinLabel(18, "0x15: Unpaired Falling"); // <- From GET4 v1.3
140 fhGet4ErrorsType->GetYaxis()->SetBinLabel(19, "0x16: Sequence error "); // <- From GET4 v1.3
141 fhGet4ErrorsType->GetYaxis()->SetBinLabel(20, "0x7f: Unknown ");
142 fhGet4ErrorsType->GetYaxis()->SetBinLabel(21, "Corrupt/unsuprtd error");
143
145 std::string sFolder = "Get4InSys";
151
152 for (UInt_t uComp = 0; uComp < fuNbOfComps; ++uComp) {
153 UInt_t uCompIndex = uComp;
154
155 std::string sFolderComp = Form("c%02u", uCompIndex);
156
158 fvhCompGet4MessType.push_back(
159 new TH2I(Form("%sCompGet4MessType_c%02u", sSystem.data(), uComp),
160 Form("Nb of message for each type per GET4 in Comp %02u; GET4 chip # ; Type", uCompIndex),
162 4, 0., 4.));
163 fvhCompGet4MessType[uComp]->GetYaxis()->SetBinLabel(1, "DATA 32b");
164 fvhCompGet4MessType[uComp]->GetYaxis()->SetBinLabel(2, "EPOCH");
165 fvhCompGet4MessType[uComp]->GetYaxis()->SetBinLabel(3, "S.C. M");
166 fvhCompGet4MessType[uComp]->GetYaxis()->SetBinLabel(4, "ERROR");
167
168 fvhCompGet4ChScm.push_back(
169 new TH2I(Form("%sCompGet4ChanScm_c%02u", sSystem.data(), uComp),
170 Form("SC messages per GET4 channel in Comp %02u; GET4 channel # ; SC type", uCompIndex),
172 5, 0., 5.));
173 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(1, "Hit Scal");
174 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(2, "Deadtime");
175 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(3, "SPI");
176 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(4, "SEU Scal");
177 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(5, "START");
178
179 fvhCompGet4ChErrors.push_back(
180 new TH2I(Form("%sCompGet4ChanErrors_c%02u", sSystem.data(), uComp),
181 Form("Error messages per GET4 channel in Comp %02u; GET4 channel # ; Error", uCompIndex),
183 22, 0., 22.));
184 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(1, "0x00: Readout Init ");
185 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(2, "0x01: Sync ");
186 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(3, "0x02: Epoch count sync");
187 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(4, "0x03: Epoch ");
188 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(5, "0x04: FIFO Write ");
189 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(6, "0x05: Lost event ");
190 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(7, "0x06: Channel state ");
191 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(8, "0x07: Token Ring state");
192 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(9, "0x08: Token ");
193 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(10, "0x09: Error Readout ");
194 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(11, "0x0a: SPI ");
195 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(12, "0x0b: DLL Lock error "); // <- From GET4 v1.2
196 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(13, "0x0c: DLL Reset invoc."); // <- From GET4 v1.2
197 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(14, "0x11: Overwrite "); // <- From GET4 v1.0 to 1.3
198 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(15, "0x12: ToT out of range");
199 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(16, "0x13: Event Discarded ");
200 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(17, "0x14: Add. Rising edge"); // <- From GET4 v1.3
201 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(18, "0x15: Unpaired Falling"); // <- From GET4 v1.3
202 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(19, "0x16: Sequence error "); // <- From GET4 v1.3
203 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(20, "0x17: Epoch Overflow "); // <- From GET4 v2.0
204 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(21, "0x7f: Unknown ");
205 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(22, "Corrupt/unsuprtd error");
206
208
209 fvhCompRawChCount.push_back(new TH1I(Form("%sCompRawChCount_c%02u", sSystem.data(), uCompIndex),
210 Form("Channel counts comp. %02u raw; Channel; Hits",
211 uCompIndex),
213
214 fvhCompRawChRate.push_back(new TH2D(Form("%sCompRawChRate_c%02u", sSystem.data(), uCompIndex),
215 Form("Raw channel rate comp. %02u; Time in run [s]; Channel; "
216 "Rate [1/s]",
217 uCompIndex),
220
221 fvhCompRawChTot.push_back(new TH2I(Form("%sCompRawChTot_c%02u", sSystem.data(), uCompIndex),
222 Form("Raw TOT comp. %02u, raw channel; Channel; TOT [bin]", uCompIndex),
224 256, 0, 256));
225
227 fvhCompRemapChCount.push_back(new TH1I(Form("%sCompRemapChCount_c%02u", sSystem.data(), uCompIndex),
228 Form("PADI Channel counts comp. %02u, remapped; PADI channel; Hits",
229 uCompIndex),
231
232 fvhCompRemapChRate.push_back(new TH2D(Form("%sCompRemapChRate_c%02u", sSystem.data(), uCompIndex),
233 Form("PADI channel rate comp. %02u, remapped; Time in run [s]; PADI channel; "
234 "Rate [1/s]",
235 uCompIndex),
238
239 fvhCompRemapChTot.push_back(new TH2I(Form("%sCompRemapChTot_c%02u", sSystem.data(), uCompIndex),
240 Form("Raw TOT comp. %02u, remapped; PADI channel; TOT [bin]", uCompIndex),
242 256, 0, 256));
243
244 // clang-format on
245
248 AddHistoToVector(fvhCompGet4MessType[uComp], sFolderComp);
249 AddHistoToVector(fvhCompGet4ChScm[uComp], sFolderComp);
250 AddHistoToVector(fvhCompGet4ChErrors[uComp], sFolderComp);
252 AddHistoToVector(fvhCompRawChCount[uComp], sFolderComp);
253 AddHistoToVector(fvhCompRawChRate[uComp], sFolderComp);
254 AddHistoToVector(fvhCompRawChTot[uComp], sFolderComp);
256 AddHistoToVector(fvhCompRemapChCount[uComp], sFolderComp);
257 AddHistoToVector(fvhCompRemapChRate[uComp], sFolderComp);
258 AddHistoToVector(fvhCompRemapChTot[uComp], sFolderComp);
259 } // for( UInt_t uComp = 0; uComp < fuNbOfComps; ++uComp )
260
261 return kTRUE;
262}
263
265{
267 std::string sSystem = "tof";
268 if (fBmonMode) {
269 //
270 sSystem = "bmon";
271 }
272
275 new TCanvas(Form("c%sSummaryGet4s", sSystem.data()), Form("GET4s message stats, %s", sSystem.data()));
276 fcSummaryGet4s->Divide(3, 2);
277
278 fcSummaryGet4s->cd(1);
279 gPad->SetGridx();
280 gPad->SetGridy();
281 gPad->SetLogz();
282 fhGet4MessType->Draw("colz");
283
284 fcSummaryGet4s->cd(2);
285 gPad->SetGridx();
286 gPad->SetGridy();
287 gPad->SetLogz();
288 fhGet4EpochFlags->Draw("colz");
289
290 fcSummaryGet4s->cd(3);
291 gPad->SetGridx();
292 gPad->SetGridy();
293 gPad->SetLogz();
294 fhGet4ScmType->Draw("colz");
295
296 fcSummaryGet4s->cd(4);
297 gPad->SetGridx();
298 gPad->SetGridy();
299 gPad->SetLogz();
300 fhGet4SysMessType->Draw("colz");
301
302 fcSummaryGet4s->cd(5);
303 gPad->SetGridx();
304 gPad->SetGridy();
305 gPad->SetLogz();
306 fhGet4ErrorsType->Draw("colz");
307
308 std::string sFolder = "canvases";
311
312 for (UInt_t uComp = 0; uComp < fuNbOfComps; ++uComp) {
313
314 fvcSumComp.push_back(new TCanvas(Form("c%sSumComp%02u", sSystem.data(), uComp),
315 Form("Component %2u summary, %s", uComp, sSystem.data())));
316 fvcSumComp[uComp]->Divide(3, 3);
317
319 fvcSumComp[uComp]->cd(1);
320 gPad->SetGridx();
321 gPad->SetGridy();
322 gPad->SetLogz();
323 fvhCompGet4MessType[uComp]->Draw("colz");
324
325 fvcSumComp[uComp]->cd(2);
326 gPad->SetGridx();
327 gPad->SetGridy();
328 gPad->SetLogz();
329 fvhCompGet4ChScm[uComp]->Draw("colz");
330
331 fvcSumComp[uComp]->cd(3);
332 gPad->SetGridx();
333 gPad->SetGridy();
334 gPad->SetLogz();
335 fvhCompGet4ChErrors[uComp]->Draw("colz");
336
338 fvcSumComp[uComp]->cd(4);
339 gPad->SetGridx();
340 gPad->SetGridy();
341 gPad->SetLogz();
342 fvhCompRawChCount[uComp]->Draw("colz");
343
344 fvcSumComp[uComp]->cd(5);
345 gPad->SetGridx();
346 gPad->SetGridy();
347 gPad->SetLogz();
348 fvhCompRawChRate[uComp]->Draw("colz");
349
350 fvcSumComp[uComp]->cd(6);
351 gPad->SetGridx();
352 gPad->SetGridy();
353 gPad->SetLogz();
354 fvhCompRawChTot[uComp]->Draw("colz");
355
357 fvcSumComp[uComp]->cd(7);
358 gPad->SetGridx();
359 gPad->SetGridy();
360 gPad->SetLogz();
361 fvhCompRemapChCount[uComp]->Draw("colz");
362
363 fvcSumComp[uComp]->cd(8);
364 gPad->SetGridx();
365 gPad->SetGridy();
366 gPad->SetLogz();
367 fvhCompRemapChRate[uComp]->Draw("colz");
368
369 fvcSumComp[uComp]->cd(9);
370 gPad->SetGridx();
371 gPad->SetGridy();
372 gPad->SetLogz();
373 fvhCompRemapChTot[uComp]->Draw("colz");
374
375 AddCanvasToVector(fvcSumComp[uComp], sFolder);
376 }
377}
378
380{
381 if (nullptr == fvhMsSize[component]) {
382 TString sMsSizeName = Form("MsSize_c%02u", component);
383 TString sMsSizeTitle = Form("Size of MS for component %02u; Ms Size [bytes]", component);
384 fvhMsSize[component] = new TH1F(sMsSizeName.Data(), sMsSizeTitle.Data(), 30000, 0., 30000.);
385 fvhMsSize[component]->SetCanExtend(TH2::kAllAxes);
386 AddHistoToVector(fvhMsSize[component], "MsSzComp");
387 }
388 if (nullptr == fvhMsSizeTime[component]) {
389 TString sMsSizeName = Form("MsSizeTime_c%02u", component);
390 TString sMsSizeTitle = Form("Size of MS vs time for component %02u; Time[s] ; Ms Size [bytes]", component);
391 fvhMsSizeTime[component] = new TProfile(sMsSizeName.Data(), sMsSizeTitle.Data(), 15000, 0., 300.);
392 fvhMsSizeTime[component]->SetCanExtend(TH2::kAllAxes);
393 AddHistoToVector(fvhMsSizeTime[component], "MsSzComp");
394 }
395 return kTRUE;
396}
397
399{
400 if (nullptr != fvhMsSize[component]) {
401 fvhMsSize[component]->Reset();
402 }
403 if (nullptr != fvhMsSizeTime[component]) {
404 fvhMsSizeTime[component]->Reset();
405 }
406 return kTRUE;
407}
408
410{
411 fhGet4MessType->Reset();
412 fhGet4ScmType->Reset();
413 fhGet4ErrorsType->Reset();
414 fhGet4EpochFlags->Reset();
416 for (UInt_t uComp = 0; uComp < fuNbOfComps; ++uComp) {
417 fvhCompGet4MessType[uComp]->Reset();
418 fvhCompGet4ChScm[uComp]->Reset();
419 fvhCompGet4ChErrors[uComp]->Reset();
421 fvhCompRawChCount[uComp]->Reset();
422 fvhCompRawChRate[uComp]->Reset();
423 fvhCompRawChTot[uComp]->Reset();
425 fvhCompRemapChCount[uComp]->Reset();
426 fvhCompRemapChRate[uComp]->Reset();
427 fvhCompRemapChTot[uComp]->Reset();
428 }
429
430 return kTRUE;
431}
432
434{
438 fvhBmonMsgCntEvoChan.resize(fuNbChanBmon, nullptr);
440 fvhBmonHitCntEvoChan.resize(fuNbChanBmon, nullptr);
442 fvhBmonErrorCntEvoChan.resize(fuNbChanBmon, nullptr);
444 fvhBmonEvtLostCntEvoChan.resize(fuNbChanBmon, nullptr);
446 fvhBmonErrorFractEvoChan.resize(fuNbChanBmon, nullptr);
450
452 uint32_t iNbBinsLog = 0;
454 std::vector<double> dBinsLogVector = GenerateLogBinArray(4, 9, 1, iNbBinsLog);
455 double* dBinsLog = dBinsLogVector.data();
456 // double * dBinsLog = GenerateLogBinArray( 4, 9, 1, iNbBinsLog );
457
458 // clang-format off
459
460 fhBmonCompMapAll = new TH1I("hBmonCompMapAll", "Map of hits on Bmon detector; Comp.; Hits Count []",
461 fuNbOfComps, -0.5, fuNbOfComps - 0.5);
462 fhBmonCompGet4 = new TH2I("hBmonCompGet4", "Map of hits on Bmon detector; Comp.; GET4; Counts []",
463 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5,
464 2*fuNbChanBmon, -0.5, 2*fuNbChanBmon - 0.5);
465 fhBmonGet4Map = new TH1I("hBmonGet4Map", "Map of hits on Bmon detector; GET4; Hits Count []",
466 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5);
467 fhBmonGet4MapEvo = new TH2I("hBmonGet4MapEvo",
468 "Map of hits on Bmon detector vs time in run; GET4; "
469 "Time in run [s]; Hits Count []",
471 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5);
472 fhBmonChannelMapAll = new TH1I("hChannelMapAll", "Map of hits on Bmon detector; Strip; Hits Count []",
473 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
474 fhBmonChannelTotAll = new TH2I("hChannelTotAll", "Tot of hits on Bmon detector per channel; Strip; Tot; Hits Count []",
475 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5, 256, -0.5, 255.5);
476 fhBmonHitMapEvoAll = new TH2I("hBmonHitMapEvoAll",
477 "Map of hits on Bmon detector vs time in run; Chan; "
478 "Time in run [s]; Hits Count []",
479 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5,
481 fhBmonHitTotEvoAll = new TH2I("hBmonHitTotEvoAll",
482 "Evolution of TOT in Bmon detector vs time in run; Time "
483 "in run [s]; TOT [ bin ]; Hits Count []",
484 fuHistoryHistoSize, 0, fuHistoryHistoSize, 256, -0.5, 255.5);
485 fhBmonChanHitMapAll = new TH1D("fhBmonChanHitMapAll", "Map of hits on Bmon detector; Strip; Hits Count []",
486 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
487 fhBmonChanHitMapEvoAll = new TH2I("hBmonChanHitMapEvoAll",
488 "Map of hits on Bmon detector vs time in run; "
489 "Strip; Time in run [s]; Hits Count []",
491
492
493 fhBmonCompMap = new TH1I("hBmonCompMap", "Map of hits on Bmon detector; Comp.; Hits Count []",
494 fuNbOfComps, -0.5, fuNbOfComps - 0.5);
495 fhBmonChannelMap = new TH1I("hChannelMap", "Map of hits on Bmon detector; Strip; Hits Count []",
496 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
497 fhBmonHitMapEvo = new TH2I("hBmonHitMapEvo",
498 "Map of hits on Bmon detector vs time in run; Chan; "
499 "Time in run [s]; Hits Count []",
501 fhBmonHitTotEvo = new TH2I("hBmonHitTotEvo",
502 "Evolution of TOT in Bmon detector vs time in run; Time "
503 "in run [s]; TOT [ bin ]; Hits Count []",
504 fuHistoryHistoSize, 0, fuHistoryHistoSize, 256, -0.5, 255.5);
505 fhBmonChanHitMap = new TH1D("fhBmonChanHitMap", "Map of hits on Bmon detector; Strip; Hits Count []",
506 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
507 fhBmonChanHitMapEvo = new TH2I("hBmonChanHitMapEvo",
508 "Map of hits on Bmon detector vs time in run; "
509 "Strip; Time in run [s]; Hits Count []",
511 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
512 fvhBmonCompMapSpill.push_back(
513 new TH1I(Form("hBmonCompMapSpill%02u", uSpill),
514 Form("Map of hits on Bmon detector in current spill %02u; Comp.; Hits Count []", uSpill),
515 fuNbOfComps, -0.5, fuNbOfComps - 0.5));
516 fvhBmonChannelMapSpill.push_back(new TH1I(Form("hBmonChannelMapSpill%02u", uSpill),
517 Form("Map of hits on Bmon detector in current spill %02u; Strip; "
518 "Hits Count []",
519 uSpill),
520 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5));
521 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
522 fhBmonHitsPerSpill = new TH1I("hBmonHitsPerSpill", "Hit count per spill; Spill; Hits Count []", 2000, 0., 2000);
523
524 fhBmonMsgCntEvo = new TH1I("hBmonMsgCntEvo",
525 "Evolution of Hit & error msgs counts vs time in run; "
526 "Time in run [s]; Msgs Count []",
528 fhBmonHitCntEvo = new TH1I("hBmonHitCntEvo",
529 "Evolution of Hit counts vs time in run; Time in run [s]; Hits Count []",
531 fhBmonErrorCntEvo = new TH1I("hBmonErrorCntEvo",
532 "Evolution of Error counts vs time in run; Time in run [s]; Error Count []",
534 fhBmonLostEvtCntEvo = new TH1I("hBmonLostEvtCntEvo",
535 "Evolution of LostEvent counts vs time in run; "
536 "Time in run [s]; LostEvent Count []",
538
539 fhBmonErrorFractEvo = new TProfile("hBmonErrorFractEvo",
540 "Evolution of Error Fraction vs time in run; "
541 "Time in run [s]; Error Fract []",
543 fhBmonLostEvtFractEvo = new TProfile("hBmonLostEvtFractEvo",
544 "Evolution of LostEvent Fraction vs time in "
545 "run; Time in run [s]; LostEvent Fract []",
547
548 fhBmonMsgCntPerMsEvo = new TH2I("hBmonMsgCntPerMsEvo",
549 "Evolution of Hit & error msgs counts, per MS vs time in run; "
550 "Time in run [s]; Hits Count/MS []; MS",
551 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
552 fhBmonHitCntPerMsEvo = new TH2I("hBmonHitCntPerMsEvo",
553 "Evolution of Hit counts, per MS vs time in run; "
554 "Time in run [s]; Hits Count/MS []; MS",
555 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
556 fhBmonErrorCntPerMsEvo = new TH2I("hBmonErrorCntPerMsEvo",
557 "Evolution of Error counts, per MS vs time in "
558 "run; Time in run [s]; Error Count/MS []; MS",
559 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
560 fhBmonLostEvtCntPerMsEvo = new TH2I("hBmonLostEvtCntPerMsEvo",
561 "Evolution of LostEvent, per MS counts vs time in run; Time in "
562 "run [s]; LostEvent Count/MS []; MS",
563 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
564
565 fhBmonErrorFractPerMsEvo = new TH2I("hBmonErrorFractPerMsEvo",
566 "Evolution of Error Fraction, per MS vs time in run; Time in run "
567 "[s]; Error Fract/MS []; MS",
568 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
569 fhBmonLostEvtFractPerMsEvo = new TH2I("hBmonLostEvtFractPerMsEvo",
570 "Evolution of LostEvent Fraction, per MS vs time in run; Time in "
571 "run [s]; LostEvent Fract/MS []; MS",
572 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
573
574 fhBmonChannelMapPulser = new TH1I("fhBmonChannelMapPulser", "Map of pulser hits on Bmon detector; Chan; Hits Count []",
576 fhBmonHitMapEvoPulser = new TH2I("fhBmonHitMapEvoPulser",
577 "Map of hits on Bmon detector vs time in run; "
578 "Chan; Time in run [s]; Hits Count []",
580 // clang-format on
581
583 std::string sFolder = "All";
594
595 sFolder = "NoPulser";
602 sFolder = "Spills";
603 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
604 AddHistoToVector(fvhBmonCompMapSpill[uSpill], sFolder);
606 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
608
609 sFolder = "GlobRates";
614
617
618 sFolder = "GlobRatesMs";
625
626 sFolder = "Pulser";
629
630 /*******************************************************************/
631 sFolder = "RatePerChan";
632 for (UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan) {
633 // clang-format off
634 fvhBmonMsgCntEvoChan[uChan] = new TH1I(Form("hBmonMsgCntEvoChan%02u", uChan),
635 Form("Evolution of Messages counts vs time in run for channel "
636 "%02u; Time in run [s]; Messages Count []",
637 uChan),
639 fvhBmonMsgCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonMsgCntPerMsEvoChan%02u", uChan),
640 Form("Evolution of Hit counts per MS vs time in run for channel "
641 "%02u; Time in run [s]; Hits Count/MS []; MS",
642 uChan),
643 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
644
645 fvhBmonHitCntEvoChan[uChan] = new TH1I(Form("hBmonHitCntEvoChan%02u", uChan),
646 Form("Evolution of Hit counts vs time in run for channel %02u; "
647 "Time in run [s]; Hits Count []",
648 uChan),
650 fvhBmonHitCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonHitCntPerMsEvoChan%02u", uChan),
651 Form("Evolution of Hit counts per MS vs time in run for channel "
652 "%02u; Time in run [s]; Hits Count/MS []; MS",
653 uChan),
654 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
655
656 fvhBmonErrorCntEvoChan[uChan] = new TH1I(Form("hBmonErrorCntEvoChan%02u", uChan),
657 Form("Evolution of Error counts vs time in run for channel "
658 "%02u; Time in run [s]; Error Count []",
659 uChan),
661 fvhBmonErrorCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonErrorCntPerMsEvoChan%02u", uChan),
662 Form("Evolution of Error counts per MS vs time in run for "
663 "channel %02u; Time in run [s]; Error Count/MS []; MS",
664 uChan),
665 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
666
667 fvhBmonEvtLostCntEvoChan[uChan] = new TH1I(Form("hBmonEvtLostCntEvoChan%02u", uChan),
668 Form("Evolution of LostEvent counts vs time in run for channel "
669 "%02u; Time in run [s]; LostEvent Count []",
670 uChan),
672 fvhBmonEvtLostCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonEvtLostCntPerMsEvoChan%02u", uChan),
673 Form("Evolution of LostEvent counts per MS vs time in run for "
674 "channel %02u; Time in run [s]; LostEvent Count/MS []; MS",
675 uChan),
676 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
677
678 fvhBmonErrorFractEvoChan[uChan] = new TProfile(Form("hBmonErrorFractEvoChan%02u", uChan),
679 Form("Evolution of Error Fraction vs time in run for "
680 "channel %02u; Time in run [s]; Error Fract []",
681 uChan),
683 fvhBmonErrorFractPerMsEvoChan[uChan] = new TH2I(Form("hBmonErrorFractPerMsEvoChan%02u", uChan),
684 Form("Evolution of Error Fraction, per MS vs time in run for "
685 "channel %02u; Time in run [s]; Error Fract/MS []; MS",
686 uChan),
687 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
688
689 fvhBmonEvtLostFractEvoChan[uChan] = new TProfile(Form("hBmonEvtLostFractEvoChan%02u", uChan),
690 Form("Evolution of LostEvent Fraction vs time in run for "
691 "channel %02u; Time in run [s]; LostEvent Fract []",
692 uChan),
695 new TH2I(Form("hBmonEvtLostFractPerMsEvoChan%02u", uChan),
696 Form("Evolution of LostEvent Fraction, per MS vs time in run for channel "
697 "%02u; Time in run [s]; LostEvent Fract/MS []; MS",
698 uChan),
699 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
700 // clang-format on
701
703 AddHistoToVector(fvhBmonMsgCntEvoChan[uChan], sFolder);
705 AddHistoToVector(fvhBmonHitCntEvoChan[uChan], sFolder);
715 } // for( UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan )
716
717 return kTRUE;
718}
719
721{
722 for (UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan) {
723 fvhBmonMsgCntEvoChan[uChan]->Reset();
724 fvhBmonMsgCntPerMsEvoChan[uChan]->Reset();
725
726 fvhBmonHitCntEvoChan[uChan]->Reset();
727 fvhBmonHitCntPerMsEvoChan[uChan]->Reset();
728
729 fvhBmonErrorCntEvoChan[uChan]->Reset();
730 fvhBmonErrorCntPerMsEvoChan[uChan]->Reset();
731
732 fvhBmonEvtLostCntEvoChan[uChan]->Reset();
733 fvhBmonEvtLostCntPerMsEvoChan[uChan]->Reset();
734
735 fvhBmonErrorFractEvoChan[uChan]->Reset();
736 fvhBmonErrorFractPerMsEvoChan[uChan]->Reset();
737
738 fvhBmonEvtLostFractEvoChan[uChan]->Reset();
739 fvhBmonEvtLostFractPerMsEvoChan[uChan]->Reset();
740 } // for( UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan )
741
742 fhBmonCompMap->Reset();
743 fhBmonCompGet4->Reset();
744 fhBmonGet4Map->Reset();
745 fhBmonGet4MapEvo->Reset();
746 fhBmonChannelMapAll->Reset();
747 fhBmonChannelTotAll->Reset();
748 fhBmonHitMapEvoAll->Reset();
749 fhBmonHitTotEvoAll->Reset();
750 fhBmonChanHitMapAll->Reset();
751 fhBmonChanHitMapEvoAll->Reset();
752
753 fhBmonCompMap->Reset();
754 fhBmonCompMap->Reset();
755 fhBmonChannelMap->Reset();
756 fhBmonHitMapEvo->Reset();
757 fhBmonHitTotEvo->Reset();
758 fhBmonChanHitMap->Reset();
759 fhBmonChanHitMapEvo->Reset();
760 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
761 fvhBmonCompMapSpill[uSpill]->Reset();
762 fvhBmonChannelMapSpill[uSpill]->Reset();
763 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
764 fhBmonHitsPerSpill->Reset();
765
766 fhBmonMsgCntEvo->Reset();
767 fhBmonHitCntEvo->Reset();
768 fhBmonErrorCntEvo->Reset();
769
770 fhBmonErrorFractEvo->Reset();
771 fhBmonLostEvtFractEvo->Reset();
772
773 fhBmonMsgCntPerMsEvo->Reset();
774 fhBmonHitCntPerMsEvo->Reset();
775 fhBmonErrorCntPerMsEvo->Reset();
779
780 fhBmonChannelMapPulser->Reset();
781 fhBmonHitMapEvoPulser->Reset();
782
783 if (kTRUE == bResetTime) {
785 fdStartTime = -1.0;
786
789 } // if( kTRUE == bResetTime )
790
791 return kTRUE;
792}
793
795{
796 std::string sFolder = "canvases";
797
798 /*******************************************************************/
800 fcBmonSummary = new TCanvas("cBmonSummary", "Hit maps, Hit rate, Error fraction");
801 fcBmonSummary->Divide(2, 2);
802
803 fcBmonSummary->cd(1);
804 gPad->SetGridx();
805 gPad->SetGridy();
806 gPad->SetLogy();
807 fhBmonChannelMap->Draw();
808
809 fcBmonSummary->cd(2);
810 gPad->SetGridx();
811 gPad->SetGridy();
812 gPad->SetLogz();
813 fhBmonHitMapEvo->Draw("colz");
814
815 fcBmonSummary->cd(3);
816 gPad->SetGridx();
817 gPad->SetGridy();
818 gPad->SetLogy();
819 fhBmonHitCntEvo->Draw();
820
821 fcBmonSummary->cd(4);
822 gPad->SetGridx();
823 gPad->SetGridy();
824 gPad->SetLogz();
825 fhBmonErrorFractEvo->Draw("hist");
826
828 /*******************************************************************/
829
830 /*******************************************************************/
832 fcBmonSummaryMap = new TCanvas("cBmonSummaryMap", "Hit maps, Hit rate, Error fraction");
833 fcBmonSummaryMap->Divide(2, 2);
834
835 fcBmonSummaryMap->cd(1);
836 gPad->SetGridx();
837 gPad->SetGridy();
838 gPad->SetLogy();
839 fhBmonChanHitMap->Draw();
840
841 fcBmonSummaryMap->cd(2);
842 gPad->SetGridx();
843 gPad->SetGridy();
844 gPad->SetLogz();
845 fhBmonChanHitMapEvo->Draw("colz");
846
847 fcBmonSummaryMap->cd(3);
848 gPad->SetGridx();
849 gPad->SetGridy();
850 gPad->SetLogy();
851 fhBmonHitCntEvo->Draw();
852
853 fcBmonSummaryMap->cd(4);
854 gPad->SetGridx();
855 gPad->SetGridy();
856 gPad->SetLogz();
857 fhBmonErrorFractEvo->Draw("hist");
858
860 /*******************************************************************/
861
862 /*******************************************************************/
864 fcBmonHitMaps = new TCanvas("cBmonHitMaps", "Hit maps");
865 fcBmonHitMaps->Divide(2);
866
867 fcBmonHitMaps->cd(1);
868 gPad->SetGridx();
869 gPad->SetGridy();
870 gPad->SetLogy();
871 fhBmonChannelMap->Draw();
872
873 fcBmonHitMaps->cd(2);
874 gPad->SetGridx();
875 gPad->SetGridy();
876 gPad->SetLogz();
877 fhBmonHitMapEvo->Draw("colz");
878
880 /*******************************************************************/
881
882 /*******************************************************************/
885 new TCanvas("cBmonGenCntsPerMs", "Messages and hit cnt per MS, Error and Evt Loss Fract. per MS ");
886 fcBmonGenCntsPerMs->Divide(2, 2);
887
888 fcBmonGenCntsPerMs->cd(1);
889 gPad->SetGridx();
890 gPad->SetGridy();
891 gPad->SetLogy();
892 gPad->SetLogz();
893 fhBmonMsgCntPerMsEvo->Draw("colz");
894
895 fcBmonGenCntsPerMs->cd(2);
896 gPad->SetGridx();
897 gPad->SetGridy();
898 gPad->SetLogy();
899 gPad->SetLogz();
900 fhBmonHitCntPerMsEvo->Draw("colz");
901
902 fcBmonGenCntsPerMs->cd(3);
903 gPad->SetGridx();
904 gPad->SetGridy();
905 gPad->SetLogy();
906 gPad->SetLogz();
907 fhBmonErrorFractPerMsEvo->Draw("colz");
908
909 fcBmonGenCntsPerMs->cd(4);
910 gPad->SetGridx();
911 gPad->SetGridy();
912 gPad->SetLogy();
913 gPad->SetLogz();
914 fhBmonLostEvtFractPerMsEvo->Draw("colz");
915
917 /*******************************************************************/
918
919 /*******************************************************************/
921 fcBmonSpillCounts = new TCanvas("cBmonSpillCounts", "Counts per spill, last 5 spills including current one");
923
924 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
925 fcBmonSpillCounts->cd(1 + uSpill);
926 gPad->SetGridx();
927 gPad->SetGridy();
928 gPad->SetLogy();
929 // fvhChannelMapSpill[ uSpill ]->SetStats( kTRUE );
930 fvhBmonChannelMapSpill[uSpill]->Draw();
931 gPad->Update();
932 TPaveStats* st = (TPaveStats*) fvhBmonChannelMapSpill[uSpill]->FindObject("stats");
933 st->SetOptStat(10);
934 st->SetX1NDC(0.25);
935 st->SetX2NDC(0.95);
936 st->SetY1NDC(0.90);
937 st->SetY2NDC(0.95);
938 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
939
941 /*******************************************************************/
942
943 /*******************************************************************/
945 fcBmonSpillCountsHori = new TCanvas("cBmonSpillCountsHori", "Counts per spill, last 5 spills including current one");
947
948 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
949 fcBmonSpillCountsHori->cd(1 + uSpill);
950 gPad->SetGridx();
951 gPad->SetGridy();
952 gPad->SetLogy();
953 fvhBmonChannelMapSpill[uSpill]->Draw();
954 gPad->Update();
955 TPaveStats* st = (TPaveStats*) fvhBmonChannelMapSpill[uSpill]->FindObject("stats");
956 st->SetOptStat(110);
957 st->SetX1NDC(0.25);
958 st->SetX2NDC(0.95);
959 st->SetY1NDC(0.90);
960 st->SetY2NDC(0.95);
961 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
962
964 /*******************************************************************/
965
966 /*******************************************************************/
969 new TCanvas("cBmonSpillCompCountsHori", "Counts in Comp. per spill, last 5 spills including current one");
971
972 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
973 fcBmonSpillCompCountsHori->cd(1 + uSpill);
974 gPad->SetGridx();
975 gPad->SetGridy();
976 gPad->SetLogy();
977 fvhBmonCompMapSpill[uSpill]->Draw();
978 gPad->Update();
979 TPaveStats* st = (TPaveStats*) fvhBmonCompMapSpill[uSpill]->FindObject("stats");
980 st->SetOptStat(110);
981 st->SetX1NDC(0.25);
982 st->SetX2NDC(0.95);
983 st->SetY1NDC(0.90);
984 st->SetY2NDC(0.95);
985 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
986
988 /*******************************************************************/
989}
990// -------------------------------------------------------------------------
991
992// -------------------------------------------------------------------------
994{
996 uint32_t uNbBinsLog = 0;
998 std::vector<double> dBinsLogVector = GenerateLogBinArray(6, 9, 10, uNbBinsLog, 1, true);
999 double* dBinsLog = dBinsLogVector.data();
1000
1001 uint32_t uNbBinsLogFract = 0;
1002 std::vector<double> dBinsLogVectorFract = GenerateLogBinArray(6, 9, 10, uNbBinsLogFract, -6, true);
1003 double* dBinsLogFract = dBinsLogVectorFract.data();
1004
1006 fArrHitCounts = std::make_unique<double[]>(fuBmonMicrospillsNbBinsTs);
1007 fArrErrCounts = std::make_unique<double[]>(fuBmonMicrospillsNbBinsTs);
1008
1009 // clang-format off
1010 // ==> Only internal, not for users
1011 fhBmonMicrospillsDistHits = new TH1I("hBmonMicrospillsDistHits", "Hits per 10 us; Time in spill [us]; Hits nb []",
1013 // ==> Only internal, not for users
1014 fhBmonMicrospillsDistErrs = new TH1I("hBmonMicrospillsDistErrs", "Erros per 10 us; Time in spill [us]; Errors nb []",
1016
1017 fhBmonMicrospillsTsBinCntHits = new TH2I("hBmonMicrospillsTsBinCntHits",
1018 "Nb 10 us bins with hit count per TS; TS []; Hits nb. []; 10 us bins []",
1019 1000, -0.5, 999.5,
1020 uNbBinsLog, dBinsLog);
1021 fhBmonMicrospillsTsBinCntErrs = new TH2I("hBmonMicrospillsTsBinCntErrs",
1022 "Nb 10 us bins with error count per TS; TS []; Errors nb. []; 10 us bins []",
1023 1000, -0.5, 999.5,
1024 uNbBinsLog, dBinsLog);
1025
1026 fhBmonMicrospillsTsMeanHits = new TH1I("hBmonMicrospillsTsMeanHits",
1027 "Mean nb hits per 10 us per TS; TS []; Hits nb. []",
1028 1000, -0.5, 999.5);
1029 fhBmonMicrospillsTsMeanErrs = new TH1I("hBmonMicrospillsTsMeanErrs",
1030 "Mean nb error per 10 us per TS; TS []; Errors nb. []",
1031 1000, -0.5, 999.5);
1032
1033
1034 fhBmonMicrospillsTsMedianHits = new TH1I("hBmonMicrospillsTsMedianHits",
1035 "Median nb hits per 10 us per TS; TS []; Hits nb. []",
1036 1000, -0.5, 999.5);
1037 fhBmonMicrospillsTsMedianErrs = new TH1I("hBmonMicrospillsTsMedianErrs",
1038 "Median nb error per 10 us per TS; TS []; Errors nb. []",
1039 1000, -0.5, 999.5);
1040
1041 fhBmonMicrospillsTsBinRatioHits = new TH2I("hBmonMicrospillsTsBinRatioHits",
1042 "Nb 10us bins with hit ratio to mean per TS; TS []; Ratio; 10 us bins []",
1043 1000, -0.5, 999.5,
1044 1000, -0.5, 499.5);
1045 fhBmonMicrospillsTsBinRatioErrs = new TH2I("hBmonMicrospillsTsBinRatioErrs",
1046 "Nb 10us bins with error ratio to mean per TS; TS []; Ratio; 10 us bins []",
1047 1000, -0.5, 999.5,
1048 1000, -0.5, 499.5);
1049
1050 fhBmonMicrospillsTsBinFractHits = new TH2I("hBmonMicrospillsTsBinFractHits",
1051 "Nb 10 us bins with hit fract. per TS; TS []; Fraction; 10 us bins []",
1052 1000, -0.5, 999.5,
1053 uNbBinsLogFract, dBinsLogFract);
1054 fhBmonMicrospillsTsBinFractErrs = new TH2I("hBmonMicrospillsTsBinFractErrs",
1055 "Nb 10 us bins with error count per TS; TS []; Fraction; 10 us bins []",
1056 1000, -0.5, 999.5,
1057 uNbBinsLogFract, dBinsLogFract);
1058 // clang-format on
1059
1061 std::string sFolder = "Microspills";
1062 // AddHistoToVector(fhBmonMicrospillsDistHits, sFolder);
1063 // AddHistoToVector(fhBmonMicrospillsDistErrs, sFolder);
1064
1067
1070
1073
1076
1079
1080 return kTRUE;
1081}
1082
1098
1100{
1101 std::string sFolder = "canvases";
1102
1103 /*******************************************************************/
1105 fcBmonMicrospillsBinCnts = new TCanvas("BmonMicrospillsBinCnts", "Nb 10 us bins with hit/err counts per TS");
1106 fcBmonMicrospillsBinCnts->Divide(2);
1107
1109 gPad->SetGridx();
1110 gPad->SetGridy();
1111 gPad->SetLogy();
1112 gPad->SetLogz();
1113 fhBmonMicrospillsTsBinCntHits->Draw("colz");
1114 fhBmonMicrospillsTsMeanHits->SetLineColor(kRed);
1115 fhBmonMicrospillsTsMeanHits->Draw("HIST same");
1116 fhBmonMicrospillsTsMedianHits->SetLineColor(kBlack);
1117 fhBmonMicrospillsTsMedianHits->Draw("HIST same");
1118
1120 gPad->SetGridx();
1121 gPad->SetGridy();
1122 gPad->SetLogy();
1123 gPad->SetLogz();
1124 fhBmonMicrospillsTsBinCntErrs->Draw("colz");
1125 fhBmonMicrospillsTsMeanErrs->SetLineColor(kRed);
1126 fhBmonMicrospillsTsMeanErrs->Draw("HIST same");
1127 fhBmonMicrospillsTsMedianErrs->SetLineColor(kBlack);
1128 fhBmonMicrospillsTsMedianErrs->Draw("HIST same");
1129
1131 /*******************************************************************/
1132
1133 /*******************************************************************/
1136 new TCanvas("BmonMicrospillsFraction", "Nb 10 us bins with fraction of hit/err counts per TS/Total count per TS");
1137 fcBmonMicrospillsFraction->Divide(2);
1138
1140 gPad->SetGridx();
1141 gPad->SetGridy();
1142 gPad->SetLogy();
1143 gPad->SetLogz();
1144 fhBmonMicrospillsTsBinFractHits->Draw("colz");
1145
1147 gPad->SetGridx();
1148 gPad->SetGridy();
1149 gPad->SetLogy();
1150 gPad->SetLogz();
1151 fhBmonMicrospillsTsBinFractErrs->Draw("colz");
1152
1154 /*******************************************************************/
1155
1156 /*******************************************************************/
1159 new TCanvas("BmonMicrospillsRatios", "Nb 10 us bins with ratio of hit/err counts per mean count per TS/bin");
1160 fcBmonMicrospillsRatios->Divide(2);
1161
1163 gPad->SetGridx();
1164 gPad->SetGridy();
1165 gPad->SetLogz();
1166 fhBmonMicrospillsTsBinRatioHits->Draw("colz");
1167
1169 gPad->SetGridx();
1170 gPad->SetGridy();
1171 gPad->SetLogz();
1172 fhBmonMicrospillsTsBinRatioErrs->Draw("colz");
1173
1175 /*******************************************************************/
1176}
1177// -------------------------------------------------------------------------
1178
1179// -------------------------------------------------------------------------
1181{
1182 std::string sFolder = "Q-Factors";
1183
1184 uint32_t uMinNbBins = 10;
1185 // uint32_t uMaxNbBins = 300000;
1186
1189
1190 std::vector<std::vector<uint32_t>> vuNbBinsHisto(fvdQfactorIntegrationNs.size(),
1191 std::vector<uint32_t>(fvdQfactorBinSizesNs.size(), 0));
1193
1194 fvhBmonQfactHisto.resize(fvdQfactorIntegrationNs.size(), std::vector<TH1*>(fvdQfactorBinSizesNs.size(), nullptr));
1195 fvhBmonQfactQval.resize(fvdQfactorIntegrationNs.size(), std::vector<TH1*>(fvdQfactorBinSizesNs.size(), nullptr));
1196 fvhBmonQfactMean.resize(fvdQfactorIntegrationNs.size(), std::vector<TH1*>(fvdQfactorBinSizesNs.size(), nullptr));
1197
1200
1201 for (uint32_t uHistSz = 0; uHistSz < fvdQfactorIntegrationNs.size(); ++uHistSz) {
1204
1205 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1207 vuNbBinsHisto[uHistSz][uBinSz] = fvdQfactorIntegrationNs[uHistSz] / fvdQfactorBinSizesNs[uBinSz];
1208 if (uMinNbBins <= vuNbBinsHisto[uHistSz][uBinSz] /*&& vuNbBinsHisto[uHistSz][uBinSz] <= uMaxNbBins*/) {
1209 fvhBmonQfactHisto[uHistSz][uBinSz] = new TH1D(
1210 Form("BmonQfactBinHist_%09.0f_%05.0f", fvdQfactorIntegrationNs[uHistSz], fvdQfactorBinSizesNs[uBinSz]),
1211 Form("Counts per %5.0f ns bin in cycle of range %9.0f ns, Bmon; Time in Cycle [ns]; Digis []",
1212 fvdQfactorBinSizesNs[uBinSz], fvdQfactorIntegrationNs[uHistSz]), //
1213 vuNbBinsHisto[uHistSz][uBinSz], 0.0, fvdQfactorIntegrationNs[uHistSz]);
1214
1215 double_t dBinOffset = 1.0 / (2.0 * fvuNbHistoCyclesPerTS[uHistSz]);
1216 fvhBmonQfactQval[uHistSz][uBinSz] =
1217 new TH1D(Form("BmonQFactorEvo_%09.0f_%05.0f", fvdQfactorIntegrationNs[uHistSz], fvdQfactorBinSizesNs[uBinSz]),
1218 Form("Q Factor, %5.0f ns bin, %9.0f ns range, Bmon; Time in Run [TS]; Q Factor []",
1219 fvdQfactorBinSizesNs[uBinSz], fvdQfactorIntegrationNs[uHistSz]), //
1220 fvuNbHistoCyclesPerTS[uHistSz] * fuQFactorMaxNbTs, 0.0 - dBinOffset, fuQFactorMaxNbTs - dBinOffset);
1221
1222 fvhBmonQfactMean[uHistSz][uBinSz] = new TH1D(
1223 Form("BmonQfactMeanEvo_%09.0f_%05.0f", fvdQfactorIntegrationNs[uHistSz], fvdQfactorBinSizesNs[uBinSz]),
1224 Form("Mean, %5.0f ns bin, %9.0f ns range, Bmon; Time in Run [TS]; Mean []", fvdQfactorBinSizesNs[uBinSz],
1225 fvdQfactorIntegrationNs[uHistSz]), //
1226 fvuNbHistoCyclesPerTS[uHistSz] * fuQFactorMaxNbTs, 0.0 - dBinOffset, fuQFactorMaxNbTs - dBinOffset);
1227
1229
1231 // AddHistoToVector(fvhBmonQfactHisto[uHistSz][uBinSz], sFolder);
1232 AddHistoToVector(fvhBmonQfactQval[uHistSz][uBinSz], sFolder);
1233 AddHistoToVector(fvhBmonQfactMean[uHistSz][uBinSz], sFolder);
1234 }
1235 }
1236 }
1237
1238 sFolder = "BinCounts";
1239 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1241 new TH1D(Form("BmonQfactBinCntDist_%5.0f", fvdQfactorBinSizesNs[uBinSz]),
1242 Form("Counts per %5.0f ns bin Bmon; Digis []; Bins []", fvdQfactorBinSizesNs[uBinSz]), //
1243 10000, -0.5, 9999.5);
1245
1247 new TH2D(Form("BmonQfactBinCntDistEvo_%5.0f", fvdQfactorBinSizesNs[uBinSz]),
1248 Form("Counts per %5.0f ns bin Bmon; Time in Run [TS];Digis []; Bins []", fvdQfactorBinSizesNs[uBinSz]),
1249 fuQFactorMaxNbTs, 0.0, fuQFactorMaxNbTs, 1000, -0.5, 999.5);
1251 }
1252
1253 return kTRUE;
1254}
1255
1257{
1258 // No reset possible as absolute time in run
1259 return kTRUE;
1260}
1261
1263{
1264 std::string sFolder = "canvases";
1265
1266 uint16_t nPadX = std::ceil(std::sqrt(fuQfactorNbPlots));
1267 uint16_t nPadY = std::ceil(1.0 * fuQfactorNbPlots / nPadX);
1268
1269 fcBmonQFactorVal = new TCanvas("cBmonQFactorVal", "Q-Factor values for various bins sizes and integration time");
1270 fcBmonQFactorVal->Divide(nPadX, nPadY);
1271
1272 fcBmonQFactorMean = new TCanvas("cBmonQFactorMean", "Mean bin counts for various bins sizes and integration time");
1273 fcBmonQFactorMean->Divide(nPadX, nPadY);
1274
1275 uint32_t uPadIdx = 1;
1276 for (uint32_t uHistSz = 0; uHistSz < fvdQfactorIntegrationNs.size(); ++uHistSz) {
1277 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1278 if (nullptr != fvhBmonQfactQval[uHistSz][uBinSz]) {
1279 fcBmonQFactorVal->cd(uPadIdx);
1280 gPad->SetGridx();
1281 gPad->SetGridy();
1282 fvhBmonQfactQval[uHistSz][uBinSz]->SetLineColor(kBlue);
1283 fvhBmonQfactQval[uHistSz][uBinSz]->SetLineWidth(2);
1284 fvhBmonQfactQval[uHistSz][uBinSz]->GetYaxis()->SetRangeUser(0., fvdQfactorHistMax[uBinSz]);
1285 fvhBmonQfactQval[uHistSz][uBinSz]->Draw("hist");
1286
1287 fcBmonQFactorMean->cd(uPadIdx);
1288 gPad->SetGridx();
1289 gPad->SetGridy();
1290 fvhBmonQfactMean[uHistSz][uBinSz]->SetLineColor(kBlue);
1291 fvhBmonQfactMean[uHistSz][uBinSz]->SetLineWidth(2);
1292 fvhBmonQfactMean[uHistSz][uBinSz]->Draw("hist");
1293
1294 uPadIdx++;
1295 }
1296 }
1297 }
1300
1301 nPadX = std::ceil(std::sqrt(fvdQfactorBinSizesNs.size()));
1302 nPadY = std::ceil(1.0 * fvdQfactorBinSizesNs.size() / nPadX);
1303 fcBmonQFactorBinCntDist = new TCanvas("fcBmonQFactorBinCntDist", "BMon Q-Factor BinCntDist");
1304 fcBmonQFactorBinCntDist->Divide(nPadX, nPadY);
1305 uPadIdx = 1;
1306 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1307 fcBmonQFactorBinCntDist->cd(uPadIdx);
1308 gPad->SetGridx();
1309 gPad->SetGridy();
1310 gPad->SetLogx();
1311 gPad->SetLogy();
1312 fvhBmonQfactBinCountDistribution[uBinSz]->Draw("hist");
1313
1314 uPadIdx++;
1315 }
1317}
1318// -------------------------------------------------------------------------
1319
1320// -------------------------------------------------------------------------
1321void CbmTofUnpackMonitor::FillHitMonitoringHistos(const double_t& dMsTime, const uint32_t& uCurrCompIdx,
1322 const uint32_t& uGet4Id, const uint32_t& uRawCh,
1323 const uint32_t& uRemapCh, const uint32_t& uTot,
1324 const double_t& /*dHitTime*/, const uint32_t& /*uFts*/,
1325 bool /*bDiamond*/)
1326{
1328 if (-1 == fdStartTime) {
1330 fdStartTime = dMsTime;
1331 }
1333 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1334 fhGet4MessType->Fill(uGet4InSys, 0);
1336 fvhCompGet4MessType[uCurrCompIdx]->Fill(uGet4Id, 0);
1338 fvhCompRawChCount[uCurrCompIdx]->Fill(uRawCh);
1339 fvhCompRawChRate[uCurrCompIdx]->Fill(dMsTime - fdStartTime, uRawCh);
1340 fvhCompRawChTot[uCurrCompIdx]->Fill(uRawCh, uTot);
1342 fvhCompRemapChCount[uCurrCompIdx]->Fill(uRemapCh);
1343 fvhCompRemapChRate[uCurrCompIdx]->Fill(dMsTime - fdStartTime, uRemapCh);
1344 fvhCompRemapChTot[uCurrCompIdx]->Fill(uRemapCh, uTot);
1345 }
1346}
1347void CbmTofUnpackMonitor::FillEpochMonitoringHistos(const uint32_t& uCurrCompIdx, const uint32_t& uGet4Id,
1348 const bool& bSyncFlag, // mess.getGdpbEpSync
1349 const bool& bDataLoss, // mess.getGdpbEpDataLoss()
1350 const bool& bEpochLoss, // mess.getGdpbEpEpochLoss()
1351 const bool& bMissmMatch // mess.getGdpbEpMissmatch()
1352)
1353{
1356 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1357 fhGet4MessType->Fill(uGet4InSys, 1);
1358 if (bSyncFlag) fhGet4EpochFlags->Fill(uGet4InSys, 0);
1359 if (bDataLoss) fhGet4EpochFlags->Fill(uGet4InSys, 1);
1360 if (bEpochLoss) fhGet4EpochFlags->Fill(uGet4InSys, 2);
1361 if (bMissmMatch) fhGet4EpochFlags->Fill(uGet4InSys, 3);
1363 fvhCompGet4MessType[uCurrCompIdx]->Fill(uGet4Id, 1);
1364 }
1365}
1366void CbmTofUnpackMonitor::FillScmMonitoringHistos(const uint32_t& uCurrCompIdx, const uint32_t& uGet4Id,
1367 const uint32_t& uCh, // mess.getGdpbSlcChan()
1368 const uint32_t& uEdge, // mess.getGdpbSlcEdge()
1369 const uint32_t& uType // mess.getGdpbSlcType()
1370)
1371{
1374 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1375 fhGet4MessType->Fill(uGet4InSys, 2);
1376
1378 fvhCompGet4MessType[uCurrCompIdx]->Fill(uGet4Id, 2);
1379 double_t uChInComp = uCh + 0.5 * uEdge + uGet4Id * fuNbOfChannelsPerGet4;
1380 if (uType == critof001::GET4_32B_SLC_START_SEU && 0 == uEdge) {
1382 fhGet4ScmType->Fill(uGet4InSys, uType + 1);
1383 fvhCompGet4ChScm[uCurrCompIdx]->Fill(uChInComp, uType + 1);
1384 } // if (uType == critof001::GET4_32B_SLC_START_SEU && 0 == uEdge)
1385 else {
1386 fhGet4ScmType->Fill(uGet4InSys, uType);
1387 fvhCompGet4ChScm[uCurrCompIdx]->Fill(uChInComp, uType);
1388 } // else of if (uType == critof001::GET4_32B_SLC_START_SEU && 0 == uEdge)
1389 }
1390}
1391void CbmTofUnpackMonitor::FillSysMonitoringHistos(const uint32_t& uCurrCompIdx, const uint32_t& uGet4Id,
1392 const uint32_t& uType // mess.getGdpbSysSubType()
1393)
1394{
1397 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1398 fhGet4SysMessType->Fill(uGet4InSys, uType);
1399 }
1400}
1401void CbmTofUnpackMonitor::FillErrMonitoringHistos(const uint32_t& uCurrCompIdx, const uint32_t& uGet4Id,
1402 const uint32_t& uCh, // mess.getGdpbSysErrChanId()
1403 const uint32_t& uType // mess.getGdpbSysErrData()
1404)
1405{
1408 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1409 fhGet4MessType->Fill(uGet4InSys, 3);
1411 fvhCompGet4MessType[uCurrCompIdx]->Fill(uGet4Id, 3);
1412
1413 uint32_t uChInComp = uCh + uGet4Id * fuNbOfChannelsPerGet4;
1414 switch (uType) {
1416 fhGet4ErrorsType->Fill(uGet4InSys, 0);
1417 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 0);
1418 break;
1419 } // case critof001::GET4_V2X_ERR_READ_INIT:
1421 fhGet4ErrorsType->Fill(uGet4InSys, 1);
1422 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 1);
1423 break;
1424 } // case critof001::GET4_V2X_ERR_SYNC:
1426 fhGet4ErrorsType->Fill(uGet4InSys, 2);
1427 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 2);
1428 break;
1429 } // case critof001::GET4_V2X_ERR_EP_CNT_SYNC:
1431 fhGet4ErrorsType->Fill(uGet4InSys, 3);
1432 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 3);
1433 break;
1434 } // case critof001::GET4_V2X_ERR_EP:
1436 fhGet4ErrorsType->Fill(uGet4InSys, 4);
1437 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 4);
1438 break;
1439 } // case critof001::GET4_V2X_ERR_FIFO_WRITE:
1441 fhGet4ErrorsType->Fill(uGet4InSys, 5);
1442 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 5);
1443 break;
1444 } // case critof001::GET4_V2X_ERR_LOST_EVT:
1446 fhGet4ErrorsType->Fill(uGet4InSys, 6);
1447 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 6);
1448 break;
1449 } // case critof001::GET4_V2X_ERR_CHAN_STATE:
1451 fhGet4ErrorsType->Fill(uGet4InSys, 7);
1452 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 7);
1453 break;
1454 } // case critof001::GET4_V2X_ERR_TOK_RING_ST:
1456 fhGet4ErrorsType->Fill(uGet4InSys, 8);
1457 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 8);
1458 break;
1459 } // case critof001::GET4_V2X_ERR_TOKEN:
1461 fhGet4ErrorsType->Fill(uGet4InSys, 9);
1462 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 9);
1463 break;
1464 } // case critof001::GET4_V2X_ERR_READOUT_ERR:
1466 fhGet4ErrorsType->Fill(uGet4InSys, 10);
1467 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 10);
1468 break;
1469 } // case critof001::GET4_V2X_ERR_SPI:
1471 fhGet4ErrorsType->Fill(uGet4InSys, 11);
1472 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 11);
1473 break;
1474 } // case critof001::GET4_V2X_ERR_DLL_LOCK:
1476 fhGet4ErrorsType->Fill(uGet4InSys, 12);
1477 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 12);
1478 break;
1479 } // case critof001::GET4_V2X_ERR_DLL_RESET:
1481 fhGet4ErrorsType->Fill(uGet4InSys, 13);
1482 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 13);
1483 break;
1484 } // case critof001::GET4_V2X_ERR_TOT_OVERWRT:
1486 fhGet4ErrorsType->Fill(uGet4InSys, 14);
1487 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 14);
1488 break;
1489 } // case critof001::GET4_V2X_ERR_TOT_RANGE:
1491 fhGet4ErrorsType->Fill(uGet4InSys, 15);
1492 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 15);
1493 break;
1494 } // case critof001::GET4_V2X_ERR_EVT_DISCARD:
1496 fhGet4ErrorsType->Fill(uGet4InSys, 16);
1497 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 16);
1498 break;
1499 } // case critof001::GET4_V2X_ERR_ADD_RIS_EDG:
1501 fhGet4ErrorsType->Fill(uGet4InSys, 17);
1502 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 17);
1503 break;
1504 } // case critof001::GET4_V2X_ERR_UNPAIR_FALL:
1506 fhGet4ErrorsType->Fill(uGet4InSys, 18);
1507 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 18);
1508 break;
1509 } // case critof001::GET4_V2X_ERR_SEQUENCE_ER:
1511 fhGet4ErrorsType->Fill(uGet4InSys, 19);
1512 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 19);
1513 break;
1514 } // case critof001::GET4_V2X_ERR_EPOCH_OVERF:
1516 fhGet4ErrorsType->Fill(uGet4InSys, 20);
1517 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 20);
1518 break;
1519 } // case critof001::GET4_V2X_ERR_UNKNOWN:
1520 default: // Corrupt error or not yet supported error
1521 {
1522 fhGet4ErrorsType->Fill(uGet4InSys, 21);
1523 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 21);
1524 break;
1525 } //
1526 } // Switch( mess.getGdpbSysErrData() )
1527 }
1528}
1529
1530
1531// -------------------------------------------------------------------------
1533{
1535 if (-1 == fdStartTime) {
1537 fdStartTime = dMsTime;
1538 }
1541 if (fdSpillCheckInterval < dMsTime - fdBmonLastInterTime) {
1545 fbSpillOn = kFALSE;
1548 fdStartTimeSpill = dMsTime;
1551 } // if( fbSpillOn && fuCountsLastInter < fuOffSpillCountLimit && same for non pulser)
1553 fbSpillOn = kTRUE;
1554 }
1555
1556 // LOG(debug) << Form("%6llu %6.4f %9u %9u %2d", fulCurrentTsIdx, dMsTime - fdLastInterTime, fuBmonCountsLastInter,
1557 // fuBmonNonPulserCountsLastInter, fuCurrentSpillIdx);
1558
1561 fdBmonLastInterTime = dMsTime;
1562 } // if( fdSpillCheckInterval < dMsTime - fdLastInterTime )
1563 }
1564}
1565void CbmTofUnpackMonitor::FillHitBmonMonitoringHistos(const double_t& dMsTime, const uint32_t& uCurrCompIdx,
1566 const uint32_t& uGet4Id, const uint32_t& uTot)
1567{
1569 if (-1 == fdStartTime) {
1571 fdStartTime = dMsTime;
1572 }
1573
1576 UInt_t uChannelBmon = (uGet4Id / 8) + 4 * uCurrCompIdx;
1577
1578 fhBmonGet4Map->Fill(uGet4Id + 80 * uCurrCompIdx);
1579 fhBmonGet4MapEvo->Fill(dMsTime - fdStartTime, uGet4Id + 80 * uCurrCompIdx);
1580 fhBmonCompGet4->Fill(uGet4Id + 80 * uCurrCompIdx, uChannelBmon);
1581 if (fuNbChanBmon <= uChannelBmon) return;
1582
1583 fhBmonCompMapAll->Fill(uCurrCompIdx);
1584 fhBmonChannelMapAll->Fill(uChannelBmon);
1585 fhBmonChannelTotAll->Fill(uChannelBmon, uTot);
1586 fhBmonHitMapEvoAll->Fill(uChannelBmon, dMsTime - fdStartTime);
1587 fhBmonHitTotEvoAll->Fill(dMsTime - fdStartTime, uTot);
1588 fhBmonChanHitMapAll->Fill(fuBmonChanMap[uChannelBmon]);
1589 fhBmonChanHitMapEvoAll->Fill(fuBmonChanMap[uChannelBmon], dMsTime - fdStartTime);
1590
1593
1594 fhBmonErrorFractEvo->Fill(dMsTime - fdStartTime, 0.0);
1595 fhBmonLostEvtFractEvo->Fill(dMsTime - fdStartTime, 0.0);
1596 fvhBmonErrorFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 0.0);
1597 fvhBmonEvtLostFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 0.0);
1598
1599 fhBmonMsgCntEvo->Fill(dMsTime - fdStartTime);
1600 fhBmonHitCntEvo->Fill(dMsTime - fdStartTime);
1601
1602 fvhBmonHitCntEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime);
1603
1604 fvuBmonHitCntChanMs[uChannelBmon]++;
1605
1608 if ((0 == uGet4Id / 8) && (fuMinTotPulser <= uTot) && (uTot <= fuMaxTotPulser)) {
1609 fhBmonChannelMapPulser->Fill(uChannelBmon);
1610 fhBmonHitMapEvoPulser->Fill(uChannelBmon, dMsTime - fdStartTime);
1611 } // if ( (0 == uGet4Id / 8) && (fuMinTotPulser <= uTot) && (uTot <= fuMaxTotPulser) )
1612 else {
1614
1615 fhBmonCompMap->Fill(uCurrCompIdx);
1616 fhBmonChannelMap->Fill(uChannelBmon);
1617 fhBmonHitMapEvo->Fill(uChannelBmon, dMsTime - fdStartTime);
1618 fhBmonHitTotEvo->Fill(dMsTime - fdStartTime, uTot);
1619 fhBmonChanHitMap->Fill(fuBmonChanMap[uChannelBmon]);
1620 fhBmonChanHitMapEvo->Fill(fuBmonChanMap[uChannelBmon], dMsTime - fdStartTime);
1621
1622 fvhBmonCompMapSpill[fuCurrentSpillPlot]->Fill(uCurrCompIdx);
1625 } // else of if ( (0 == uGet4Id / 8) && (fuMinTotPulser <= uTot) && (uTot <= fuMaxTotPulser) )
1626 }
1627}
1628
1629void CbmTofUnpackMonitor::FillErrBmonMonitoringHistos(const double_t& dMsTime, const uint32_t& uCurrCompIdx,
1630 const uint32_t& uGet4Id, const bool& bErrEvtLost)
1631{
1632 if (fBmonMicroSpillMode) { //
1633 if (-1 == fdStartTime) {
1635 fdStartTime = dMsTime;
1636 }
1637 fhBmonMicrospillsDistErrs->Fill((dMsTime - fdStartTime) * 1e6);
1638 }
1639 else if (fBmonQfactorsMode) { //
1640 return;
1641 }
1642 else {
1643 if (-1 == fdStartTime) {
1645 fdStartTime = dMsTime;
1646 }
1650 UInt_t uChannelBmon = (uGet4Id / 8) + 4 * uCurrCompIdx;
1651
1652 fhBmonErrorFractEvo->Fill(dMsTime - fdStartTime, 0.0);
1653 fhBmonLostEvtFractEvo->Fill(dMsTime - fdStartTime, 0.0);
1654 fvhBmonErrorFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 0.0);
1655 fvhBmonEvtLostFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 0.0);
1656
1657 fhBmonMsgCntEvo->Fill(dMsTime - fdStartTime);
1658 fhBmonErrorCntEvo->Fill(dMsTime - fdStartTime);
1659 fhBmonErrorFractEvo->Fill(dMsTime - fdStartTime, 1.0);
1660
1661 fvhBmonErrorCntEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime);
1662 fvhBmonErrorFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 1.0);
1663
1664 fvuBmonErrorCntChanMs[uChannelBmon]++;
1665 if (bErrEvtLost) {
1666 fhBmonLostEvtCntEvo->Fill(dMsTime - fdStartTime);
1667 fhBmonLostEvtFractEvo->Fill(dMsTime - fdStartTime, 1.0);
1668
1669 fvhBmonEvtLostCntEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime);
1670 fvhBmonEvtLostFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 1.0);
1671
1672 fvuBmonEvtLostCntChanMs[uChannelBmon]++;
1673 } // if( gdpbv100::GET4_V2X_ERR_LOST_EVT == mess.getGdpbSysErrData() )
1674 }
1675}
1676// -------------------------------------------------------------------------
1677
1678// -------------------------------------------------------------------------
1679void CbmTofUnpackMonitor::FillHitBmonMicroSpillHistos(const double_t& dMsTime, const double_t& dTime)
1680{
1681 if (fBmonMicroSpillMode) {
1682 if (-1 == fdStartTime) {
1684 fdStartTime = dMsTime;
1685 }
1686 fhBmonMicrospillsDistHits->Fill(dTime / 1e3);
1687 }
1688}
1689
1691{
1692 if (fBmonMicroSpillMode) {
1693 uint32_t uNbHitsTs = fhBmonMicrospillsDistHits->GetEntries();
1694 uint32_t uNbErrsTs = fhBmonMicrospillsDistErrs->GetEntries();
1695 double dMeanHitsBin = static_cast<double>(uNbHitsTs) / fuBmonMicrospillsNbBinsTs;
1696 double dMeanErrsBin = static_cast<double>(uNbErrsTs) / fuBmonMicrospillsNbBinsTs;
1699
1700 for (uint32_t uBin = 0; uBin < fuBmonMicrospillsNbBinsTs; ++uBin) {
1701 double dNbHitsInBin = fhBmonMicrospillsDistHits->GetBinContent(uBin + 1);
1702 double dNbErrsInBin = fhBmonMicrospillsDistErrs->GetBinContent(uBin + 1);
1703
1704 fArrHitCounts[uBin] = dNbHitsInBin;
1705 fArrErrCounts[uBin] = dNbErrsInBin;
1706
1709
1710 fhBmonMicrospillsTsBinRatioHits->Fill(fuNbTsMicrospills, dNbHitsInBin / dMeanHitsBin);
1711 fhBmonMicrospillsTsBinRatioErrs->Fill(fuNbTsMicrospills, dNbErrsInBin / dMeanErrsBin);
1712
1713 fhBmonMicrospillsTsBinFractHits->Fill(fuNbTsMicrospills, dNbHitsInBin / uNbHitsTs);
1714 fhBmonMicrospillsTsBinFractErrs->Fill(fuNbTsMicrospills, dNbErrsInBin / uNbErrsTs);
1715 }
1717 TMath::Median(fuBmonMicrospillsNbBinsTs, fArrHitCounts.get()));
1719 TMath::Median(fuBmonMicrospillsNbBinsTs, fArrErrCounts.get()));
1720
1723 fdStartTime = -1; // Make sure Error times are still set in "Time in TS", not compatible w/ standard moni histos!
1724
1726 }
1727}
1728// -------------------------------------------------------------------------
1729
1730// -------------------------------------------------------------------------
1732{
1733 // Q-Factor = Max Bin Content / Mean Content of all bin in range
1734 // => Tend toward 1 if bins are more identical
1735 double_t mean = ExtractMean(pHistoIn);
1736 if (0.0 < mean) {
1737 return (pHistoIn->GetBinContent(pHistoIn->GetMaximumBin())) / mean;
1738 }
1739 else {
1740 return 0.0;
1741 }
1742}
1744{
1745 // Mean bin content, special case for histo with single entries to avoid unrealistic Q-Factors
1746 if (pHistoIn->Integral() && 1 < pHistoIn->GetEntries()) {
1747 return (pHistoIn->Integral() / pHistoIn->GetNbinsX());
1748 }
1749 else {
1750 return 0.0;
1751 }
1752}
1753void CbmTofUnpackMonitor::FillHitBmonQfactorHistos(const double_t& dMsTime, const double_t& dTime)
1754{
1755 if (fBmonQfactorsMode) {
1756 if (-1 == fdStartTime) {
1758 fdStartTime = dMsTime;
1759 }
1760 if (dTime < 0) {
1761 // Digi with time before TS start
1762 return;
1763 }
1764 if (fdTsSizeNs * 1.01 < dTime) {
1765 // Digi with time before TS start
1766 return;
1767 }
1768 if (fuQFactorMaxNbTs < std::floor((dMsTime - fdStartTime) / fdTsSizeNs)) {
1769 // Beyond max TS in plots => do not update anymore!
1770 return;
1771 }
1772 for (uint32_t uHistSz = 0; uHistSz < fvdQfactorIntegrationNs.size(); ++uHistSz) {
1773 uint32_t uCurrentCycle = std::floor(dTime / fvdQfactorIntegrationNs[uHistSz]);
1774 if (fvuQfactorIdxHistoCycleinTS[uHistSz] < uCurrentCycle) {
1775 for (; fvuQfactorIdxHistoCycleinTS[uHistSz] < uCurrentCycle; ++fvuQfactorIdxHistoCycleinTS[uHistSz]) {
1776 double_t dTsFractional =
1778 + std::floor((dMsTime - fdStartTime) / fdTsSizeNs);
1779 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1780 if (nullptr != fvhBmonQfactQval[uHistSz][uBinSz]) {
1781 double_t dQFactor = ExtractQFactor(fvhBmonQfactHisto[uHistSz][uBinSz]);
1782 fvhBmonQfactQval[uHistSz][uBinSz]->Fill(dTsFractional, dQFactor);
1783 fvhBmonQfactMean[uHistSz][uBinSz]->Fill(dTsFractional, ExtractMean(fvhBmonQfactHisto[uHistSz][uBinSz]));
1784 for (int32_t iBin = 1; iBin <= fvhBmonQfactHisto[uHistSz][uBinSz]->GetNbinsX(); ++iBin) {
1785 fvhBmonQfactBinCountDistribution[uBinSz]->Fill(fvhBmonQfactHisto[uHistSz][uBinSz]->GetBinContent(iBin));
1787 dTsFractional, fvhBmonQfactHisto[uHistSz][uBinSz]->GetBinContent(iBin));
1788 }
1789
1790 if (0.0 < dQFactor) {
1791 fvhBmonQfactHisto[uHistSz][uBinSz]->Reset();
1792 }
1793 }
1794 }
1795 }
1796 }
1797
1798 double_t dTimeInCycle = std::fmod(dTime, fvdQfactorIntegrationNs[uHistSz]);
1799 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1800 if (nullptr != fvhBmonQfactQval[uHistSz][uBinSz]) {
1801 fvhBmonQfactHisto[uHistSz][uBinSz]->Fill(dTimeInCycle);
1802 }
1803 }
1804 }
1805 }
1806}
1807
1808void CbmTofUnpackMonitor::FinalizeTsBmonQfactorHistos(uint64_t uTsTimeNs, std::vector<CbmBmonDigi>* vDigis)
1809{
1810 if (fBmonQfactorsMode) {
1812 if (vDigis && 0 < vDigis->size()) {
1813 for (auto it = vDigis->begin(); it != vDigis->end(); ++it) {
1814 // Filter out pulser digis
1815 if ((0 != (*it).GetChannel() % 4) || ((*it).GetCharge() < fuMinTotPulser)
1816 || (fuMaxTotPulser < (*it).GetCharge())) {
1817 FillHitBmonQfactorHistos(uTsTimeNs, (*it).GetTime());
1818 }
1819 }
1820 }
1821
1823 for (uint32_t uHistSz = 0; uHistSz < fvdQfactorIntegrationNs.size(); ++uHistSz) {
1824 for (; fvuQfactorIdxHistoCycleinTS[uHistSz] < fvuNbHistoCyclesPerTS[uHistSz];
1825 ++fvuQfactorIdxHistoCycleinTS[uHistSz]) {
1826 double_t dTsFractional = (fvdQfactorIntegrationNs[uHistSz] * fvuQfactorIdxHistoCycleinTS[uHistSz]) / fdTsSizeNs
1827 + std::floor((uTsTimeNs - fdStartTime) / fdTsSizeNs);
1828 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1829 if (nullptr != fvhBmonQfactQval[uHistSz][uBinSz]) {
1830 double_t dQFactor = ExtractQFactor(fvhBmonQfactHisto[uHistSz][uBinSz]);
1831 fvhBmonQfactQval[uHistSz][uBinSz]->Fill(dTsFractional, dQFactor);
1832 fvhBmonQfactMean[uHistSz][uBinSz]->Fill(dTsFractional, ExtractMean(fvhBmonQfactHisto[uHistSz][uBinSz]));
1833 for (int32_t iBin = 1; iBin <= fvhBmonQfactHisto[uHistSz][uBinSz]->GetNbinsX(); ++iBin) {
1834 fvhBmonQfactBinCountDistribution[uBinSz]->Fill(fvhBmonQfactHisto[uHistSz][uBinSz]->GetBinContent(iBin));
1836 dTsFractional, fvhBmonQfactHisto[uHistSz][uBinSz]->GetBinContent(iBin));
1837 }
1838
1839 if (0.0 < dQFactor) {
1840 fvhBmonQfactHisto[uHistSz][uBinSz]->Reset();
1841 }
1842 }
1843 }
1844 }
1845 }
1846 }
1847}
1848// -------------------------------------------------------------------------
1849
1850// ---- Init ----
1852{
1853 // Get Infos from the parset
1854 fUnpackPar = parset;
1855
1856 fuNbOfComps = fUnpackPar->GetNrOfGdpbs();
1858 // FIXME: Start using again the parameter class accessors once a new CRI oriented class is brought into use
1859 fuNbOfGet4PerComp = 80;
1863
1865 TFile* oldFile = gFile;
1866 TDirectory* oldDir = gDirectory;
1867 gROOT->cd();
1868
1871 if (fBmonScvdMode) {
1874 }
1875 else {
1877 fuBmonChanMap = std::vector<UInt_t>(kuBmonChanMap, kuBmonChanMap + kuNbChanBmon);
1878 }
1879 }
1880
1882 if (fBmonMicroSpillMode) {
1885 }
1886 else if (fBmonQfactorsMode) {
1889 }
1890 else {
1892 DrawCanvases();
1893 if (fBmonMode) {
1896 }
1897 }
1898
1900 gFile = oldFile;
1901 gDirectory = oldDir;
1902
1904 std::vector<std::pair<TNamed*, std::string>> vHistos = GetHistoVector();
1905
1907 std::vector<std::pair<TCanvas*, std::string>> vCanvases = GetCanvasVector();
1908
1910 std::string sSystem = "tof";
1912 //
1913 sSystem = "bmon";
1914 }
1915
1916 if (fbInternalHttp) {
1917 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
1918 if (nullptr != server) {
1919 for (UInt_t uCanvas = 0; uCanvas < vCanvases.size(); ++uCanvas) {
1920 server->Register(Form("/%s/%s", sSystem.data(), vCanvases[uCanvas].second.data()), vCanvases[uCanvas].first);
1921 }
1922 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
1923 server->Register(Form("/%s/%s", sSystem.data(), vHistos[uHisto].second.data()), vHistos[uHisto].first);
1924 }
1925 /*
1926 server->RegisterCommand(Form("/Reset_%s_Hist", sSystem.data()), "bMcbm2018UnpackerTaskStsResetHistos=kTRUE");
1927 server->Restrict("/Reset_UnpSts_Hist", "allow=admin");
1928 */
1929 }
1930 }
1931
1932 return kTRUE;
1933}
1934
1935// ---- Finish ----
1937{
1939 std::vector<std::pair<TNamed*, std::string>> vHistos = GetHistoVector();
1940
1942 std::vector<std::pair<TCanvas*, std::string>> vCanvases = GetCanvasVector();
1943
1945 TFile* oldFile = gFile;
1946 TDirectory* oldDir = gDirectory;
1947 TFile* histoFile = nullptr;
1948
1949 // open separate histo file in recreate mode
1950 histoFile = new TFile(fHistoFileName, "RECREATE");
1951 histoFile->cd();
1952
1954 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
1956 TString sFolder = vHistos[uHisto].second.data();
1957 if (nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
1958 gDirectory->cd(sFolder);
1959
1961 vHistos[uHisto].first->Write();
1962
1963 histoFile->cd();
1964 }
1965
1967 for (UInt_t uCanvas = 0; uCanvas < vCanvases.size(); ++uCanvas) {
1969 TString sFolder = vCanvases[uCanvas].second.data();
1970 if (nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
1971 gDirectory->cd(sFolder);
1972
1974 vCanvases[uCanvas].first->Write();
1975
1976 histoFile->cd();
1977 }
1978
1980 gFile = oldFile;
1981 gDirectory = oldDir;
1982
1983 histoFile->Close();
1984 delete histoFile;
1985
1987 for (auto iter = fvpAllHistoPointers.begin(); iter != fvpAllHistoPointers.end();) {
1988 if (iter->first != nullptr) {
1989 delete iter->first;
1990 }
1991 iter = fvpAllHistoPointers.erase(iter);
1992 }
1993 for (auto iter = fvpAllCanvasPointers.begin(); iter != fvpAllCanvasPointers.end();) {
1994 if (iter->first != nullptr) {
1995 delete iter->first;
1996 }
1997 iter = fvpAllCanvasPointers.erase(iter);
1998 }
1999}
2000
2001
ClassImp(CbmConverterManager)
std::vector< double > GenerateLogBinArray(uint32_t uNbDecadesLog, uint32_t uNbStepsDecade, uint32_t uNbSubStepsInStep, uint32_t &uNbBinsLog, int32_t iStartExp, bool bAddZeroStart)
bool Bool_t
Bool_t fbSpillOn
Spill detection.
std::vector< TH1 * > fvhBmonChannelMapSpill
TH1 * fvhMsSize[kuMaxNbFlibLinks]
MS size histograms.
void CheckBmonSpillLimits(const double_t &dMsTime)
Fill BMon histograms.
std::vector< TH1 * > fvhBmonCompMapSpill
---> No Pulser cut + Spill detection
std::vector< std::pair< TNamed *, std::string > > fvpAllHistoPointers
TProfile * fvhMsSizeTime[kuMaxNbFlibLinks]
std::vector< TH1 * > fvhBmonErrorCntEvoChan
void FinalizeTsBmonQfactorHistos(uint64_t uTsTimeNs, std::vector< CbmBmonDigi > *vDigis)
Finalize Microspill histograms.
std::vector< TH1 * > fvhBmonEvtLostCntEvoChan
Bool_t ResetMsComponentSizeHistos(UInt_t component)
virtual Bool_t ResetHistograms()
static const UInt_t kuNbChanBmon
Bool_t ResetHistogramsQFactors(Bool_t bResetTime)
CbmMcbm2018TofPar * fUnpackPar
Settings from parameter file.
void AddHistoToVector(TNamed *pointer, std::string sFolder="")
static const UInt_t kuNbChanBmonScvd
std::vector< std::pair< TCanvas *, std::string > > GetCanvasVector()
static constexpr UInt_t kuBmonChanMap[kuNbChanBmon]
std::vector< double_t > fvdQfactorHistMax
Dimension: same as BinSizes vector!!
std::vector< TH1 * > fvhBmonHitCntEvoChan
std::vector< TH1 * > fvhCompRemapChCount
---> Per remapped (PADI) channel in Component
std::vector< uint32_t > fvuQfactorIdxHistoCycleinTS
virtual void FillSysMonitoringHistos(const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const uint32_t &uType)
std::vector< double_t > fvdQfactorIntegrationNs
Hint: keep fractions of TS size + multiples of bin size and above 10 us.
Bool_t CreateHistogramsQFactors(Bool_t bBmon=kTRUE)
std::vector< std::vector< TH1 * > > fvhBmonQfactHisto
void AddCanvasToVector(TCanvas *pointer, std::string sFolder="")
Bool_t ResetHistogramsMicroSpills(Bool_t bResetTime)
static constexpr UInt_t kuBmonChanMapScvd[kuNbChanBmonScvd]
2024 mapping: +4 channels scvd added
TCanvas * fcBmonQFactorVal
---> BMon Q-Factors monitoring
std::vector< TH2 * > fvhBmonQfactBinCountDistributionEvo
std::vector< std::pair< TNamed *, std::string > > GetHistoVector()
virtual void FillEpochMonitoringHistos(const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const bool &bSyncFlag, const bool &bDataLoss, const bool &bEpochLoss, const bool &bMissmMatch)
virtual void FillScmMonitoringHistos(const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const uint32_t &uCh, const uint32_t &uEdge, const uint32_t &uType)
std::vector< uint32_t > fvuNbHistoCyclesPerTS
std::vector< TH2 * > fvhCompGet4MessType
---> Per GET4 in Component
virtual void FillErrMonitoringHistos(const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const uint32_t &uCh, const uint32_t &uType)
TH1 * fhBmonCompMapAll
---> Channels maps without cuts
std::vector< TH1 * > fvhBmonMsgCntEvoChan
std::vector< TH2 * > fvhBmonErrorCntPerMsEvoChan
virtual void FillHitMonitoringHistos(const double_t &dMsTime, const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const uint32_t &uRawCh, const uint32_t &uRemapCh, const uint32_t &uTot, const double_t &dHitTime, const uint32_t &uFts, bool bDiamond=false)
Fill general histograms.
Bool_t CreateMsComponentSizeHistos(UInt_t component)
void FillHitBmonMonitoringHistos(const double_t &dMsTime, const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const uint32_t &uTot)
std::vector< UInt_t > fuBmonChanMap
std::unique_ptr< double[]> fArrErrCounts
std::vector< double_t > fvdQfactorBinSizesNs
void FinalizeTsBmonMicroSpillHistos()
Finalize BMon Microspill histograms.
Double_t fdStartTime
Total/maximum number of Get4 in system.
Bool_t ResetBmonHistograms(Bool_t bResetTime)
std::vector< UInt_t > fvuBmonErrorCntChanMs
std::vector< TH2 * > fvhBmonErrorFractPerMsEvoChan
double_t ExtractQFactor(TH1 *pHistoIn)
Q-Factor helper methods.
std::vector< TCanvas * > fvcSumComp
std::vector< TH2 * > fvhBmonMsgCntPerMsEvoChan
std::vector< TH2 * > fvhCompRawChRate
UInt_t fuNbOfComps
Readout chain dimensions and mapping.
std::vector< TH2 * > fvhCompRawChTot
TH1 * fhBmonCompMap
---> No Pulser cut
std::vector< UInt_t > fvuBmonEvtLostCntChanMs
TCanvas * fcBmonMicrospillsBinCnts
---> BMon Microspills monitoring
std::vector< TH2 * > fvhCompRemapChRate
void FillErrBmonMonitoringHistos(const double_t &dMsTime, const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const bool &bErrEvtLost)
std::vector< TH2 * > fvhCompGet4ChErrors
UInt_t fuNbChanBmon
Runtime values.
static const UInt_t kuNbSpillPlots
std::unique_ptr< double[]> fArrHitCounts
std::vector< TH2 * > fvhCompGet4ChScm
virtual Bool_t CreateHistograms()
UInt_t fuNbOfGet4PerComp
Total number of Components in the system.
std::vector< TH2 * > fvhCompRemapChTot
TCanvas * fcBmonSummary
---> BMon
TH1 * fhBmonMsgCntEvo
---> Global Rate
bool fBmonMode
Flag if debug mode is active or not.
std::vector< TH1 * > fvhBmonQfactBinCountDistribution
void SetBmonChannelMap(std::vector< uint32_t > vChanMapIn)
std::vector< TH2 * > fvhBmonEvtLostCntPerMsEvoChan
static const UInt_t kuMaxNbFlibLinks
---> Constants
std::vector< TH1 * > fvhCompRawChCount
---> Per raw channel in Component
void FillHitBmonQfactorHistos(const double_t &dMsTime, const double_t &dTime)
Fill Microspill histograms.
std::vector< TH2 * > fvhBmonEvtLostFractPerMsEvoChan
std::vector< TProfile * > fvhBmonErrorFractEvoChan
virtual Bool_t Init(CbmMcbm2018TofPar *digiParSet)
Init all required parameter informations and histograms.
std::vector< std::pair< TCanvas *, std::string > > fvpAllCanvasPointers
Vector of pointers to histograms + optional folder name.
UInt_t fuMinTotPulser
---> User settings: Data correction parameters
std::vector< TH2 * > fvhBmonHitCntPerMsEvoChan
TH2 * fhBmonMsgCntPerMsEvo
---> Global Rate per MS
UInt_t fuNbOfChannelsPerComp
Number of channels per Get4, constant.
std::vector< TProfile * > fvhBmonEvtLostFractEvoChan
TH1 * fhBmonChannelMapPulser
---> Pulser
void FillHitBmonMicroSpillHistos(const double_t &dMsTime, const double_t &dTime)
Fill BMon Microspill histograms.
void DrawCanvasesQFactors(Bool_t bBmon=kTRUE)
UInt_t fuNbOfChannelsPerGet4
Max number of Get4 per component.
void Finish()
Write all histograms and canvases to file.
double_t ExtractMean(TH1 *pHistoIn)
UInt_t fuNbOfGet4InSyst
Number of channels per Component, recalculated.
std::vector< UInt_t > fvuBmonHitCntChanMs
double_t fdBmonMicrospillsTsLengthSec
BMon micro-spills monitoring histograms.
std::vector< std::vector< TH1 * > > fvhBmonQfactQval
std::vector< std::vector< TH1 * > > fvhBmonQfactMean
@ GET4_V2X_ERR_UNPAIR_FALL
@ GET4_V2X_ERR_CHAN_STATE
@ GET4_V2X_ERR_ADD_RIS_EDG
@ GET4_V2X_ERR_SEQUENCE_ER
@ GET4_V2X_ERR_TOK_RING_ST
@ GET4_V2X_ERR_TOT_OVERWRT
@ GET4_V2X_ERR_FIFO_WRITE
@ GET4_V2X_ERR_EP_CNT_SYNC
@ GET4_V2X_ERR_EPOCH_OVERF
@ GET4_V2X_ERR_EVT_DISCARD
@ GET4_V2X_ERR_READOUT_ERR