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 <cstdint>
28#include <iomanip>
29#include <iostream>
30#include <memory>
31#include <string>
32#include <vector>
33
34CbmTofUnpackMonitor::CbmTofUnpackMonitor(/* args */) : fvpAllHistoPointers()
35{
36 // Miscroslice component properties histos
37 for (UInt_t component = 0; component < kuMaxNbFlibLinks; component++) {
38 fvhMsSize[component] = nullptr;
39 fvhMsSizeTime[component] = nullptr;
40 }
41}
42
44{
45 for (auto iter = fvpAllHistoPointers.begin(); iter != fvpAllHistoPointers.end();) {
46 if (iter->first != nullptr) {
47 delete iter->first;
48 }
49 iter = fvpAllHistoPointers.erase(iter);
50 }
51 for (auto iter = fvpAllCanvasPointers.begin(); iter != fvpAllCanvasPointers.end();) {
52 if (iter->first != nullptr) {
53 delete iter->first;
54 }
55 iter = fvpAllCanvasPointers.erase(iter);
56 }
57}
58
59void CbmTofUnpackMonitor::SetBmonChannelMap(std::vector<uint32_t> vChanMapIn)
60{
61 uint32_t uNbCh = vChanMapIn.size();
62 if (8 != uNbCh && 16 != uNbCh) {
63 LOG(fatal) << "Wrong number of channels in call to CbmTofUnpackMonitor::SetBmonChannelMap, "
64 << "only 8 and 16 supported, input here was " << uNbCh;
65 }
66 for (UInt_t uChan = 0; uChan < uNbCh; ++uChan) {
67 fuBmonChanMap[uChan] = vChanMapIn[uChan];
68 }
69}
70
72{
74 std::string sSystem = "tof";
75 if (fBmonMode) {
76 //
77 sSystem = "bmon";
78 }
79
80 // clang-format off
81 fhGet4MessType = new TH2I(Form("%sGet4MessType", sSystem.data()),
82 "Nb of message for each type per GET4; GET4 chip # ; Type",
84 4, 0., 4.);
85 fhGet4MessType->GetYaxis()->SetBinLabel(1, "DATA 32b");
86 fhGet4MessType->GetYaxis()->SetBinLabel(2, "EPOCH");
87 fhGet4MessType->GetYaxis()->SetBinLabel(3, "S.C.M");
88 fhGet4MessType->GetYaxis()->SetBinLabel(4, "ERROR");
89 // fhGet4MessType->GetYaxis()->SetBinLabel( 5, "DATA 24b");
90 // fhGet4MessType->GetYaxis()->SetBinLabel( 6, "STAR Trigger");
91
92 fhGet4EpochFlags = new TH2I(Form("%sGet4EpochFlags", sSystem.data()),
93 "Epoch flags per GET4; GET4 chip # ; Type",
95 4, 0., 4.);
96 fhGet4EpochFlags->GetYaxis()->SetBinLabel(1, "SYNC");
97 fhGet4EpochFlags->GetYaxis()->SetBinLabel(2, "Ep LOSS");
98 fhGet4EpochFlags->GetYaxis()->SetBinLabel(3, "Da LOSS");
99 fhGet4EpochFlags->GetYaxis()->SetBinLabel(4, "MISSMAT");
100
101 fhGet4ScmType = new TH2I(Form("%sGet4ScmType", sSystem.data()),
102 "SC messages per GET4 channel; GET4 channel # ; SC type",
104 5, 0., 5.);
105 fhGet4ScmType->GetYaxis()->SetBinLabel(1, "Hit Scal");
106 fhGet4ScmType->GetYaxis()->SetBinLabel(2, "Deadtime");
107 fhGet4ScmType->GetYaxis()->SetBinLabel(3, "SPI");
108 fhGet4ScmType->GetYaxis()->SetBinLabel(4, "SEU Scal");
109 fhGet4ScmType->GetYaxis()->SetBinLabel(5, "START");
110
111 fhGet4SysMessType = new TH2I(Form("%sGet4SysMessType", sSystem.data()),
112 "Nb of system message for each type per Get4; Get4; System Type",
115 fhGet4SysMessType->GetYaxis()->SetBinLabel(1 + critof001::SYS_GET4_ERROR, "GET4 ERROR");
116 fhGet4SysMessType->GetYaxis()->SetBinLabel(1 + critof001::SYS_GDPB_UNKWN, "UNKW GET4 MSG");
117 fhGet4SysMessType->GetYaxis()->SetBinLabel(1 + critof001::SYS_GET4_SYNC_MISS, "SYS_GET4_SYNC_MISS");
118 fhGet4SysMessType->GetYaxis()->SetBinLabel(1 + critof001::SYS_PATTERN, "SYS_PATTERN");
119
120 fhGet4ErrorsType = new TH2I(Form("%sGet4ErrorsType", sSystem.data()),
121 "Error messages per GET4 channel; GET4 channel # ; Error",
123 22, 0., 22.);
124 fhGet4ErrorsType->GetYaxis()->SetBinLabel(1, "0x00: Readout Init ");
125 fhGet4ErrorsType->GetYaxis()->SetBinLabel(2, "0x01: Sync ");
126 fhGet4ErrorsType->GetYaxis()->SetBinLabel(3, "0x02: Epoch count sync");
127 fhGet4ErrorsType->GetYaxis()->SetBinLabel(4, "0x03: Epoch ");
128 fhGet4ErrorsType->GetYaxis()->SetBinLabel(5, "0x04: FIFO Write ");
129 fhGet4ErrorsType->GetYaxis()->SetBinLabel(6, "0x05: Lost event ");
130 fhGet4ErrorsType->GetYaxis()->SetBinLabel(7, "0x06: Channel state ");
131 fhGet4ErrorsType->GetYaxis()->SetBinLabel(8, "0x07: Token Ring state");
132 fhGet4ErrorsType->GetYaxis()->SetBinLabel(9, "0x08: Token ");
133 fhGet4ErrorsType->GetYaxis()->SetBinLabel(10, "0x09: Error Readout ");
134 fhGet4ErrorsType->GetYaxis()->SetBinLabel(11, "0x0a: SPI ");
135 fhGet4ErrorsType->GetYaxis()->SetBinLabel(12, "0x0b: DLL Lock error "); // <- From GET4 v1.2
136 fhGet4ErrorsType->GetYaxis()->SetBinLabel(13, "0x0c: DLL Reset invoc."); // <- From GET4 v1.2
137 fhGet4ErrorsType->GetYaxis()->SetBinLabel(14, "0x11: Overwrite ");
138 fhGet4ErrorsType->GetYaxis()->SetBinLabel(15, "0x12: ToT out of range");
139 fhGet4ErrorsType->GetYaxis()->SetBinLabel(16, "0x13: Event Discarded ");
140 fhGet4ErrorsType->GetYaxis()->SetBinLabel(17, "0x14: Add. Rising edge"); // <- From GET4 v1.3
141 fhGet4ErrorsType->GetYaxis()->SetBinLabel(18, "0x15: Unpaired Falling"); // <- From GET4 v1.3
142 fhGet4ErrorsType->GetYaxis()->SetBinLabel(19, "0x16: Sequence error "); // <- From GET4 v1.3
143 fhGet4ErrorsType->GetYaxis()->SetBinLabel(20, "0x7f: Unknown ");
144 fhGet4ErrorsType->GetYaxis()->SetBinLabel(21, "Corrupt/unsuprtd error");
145
147 std::string sFolder = "Get4InSys";
153
154 for (UInt_t uComp = 0; uComp < fuNbOfComps; ++uComp) {
155 UInt_t uCompIndex = uComp;
156
157 std::string sFolderComp = Form("c%02u", uCompIndex);
158
160 fvhCompGet4MessType.push_back(
161 new TH2I(Form("%sCompGet4MessType_c%02u", sSystem.data(), uComp),
162 Form("Nb of message for each type per GET4 in Comp %02u; GET4 chip # ; Type", uCompIndex),
164 4, 0., 4.));
165 fvhCompGet4MessType[uComp]->GetYaxis()->SetBinLabel(1, "DATA 32b");
166 fvhCompGet4MessType[uComp]->GetYaxis()->SetBinLabel(2, "EPOCH");
167 fvhCompGet4MessType[uComp]->GetYaxis()->SetBinLabel(3, "S.C. M");
168 fvhCompGet4MessType[uComp]->GetYaxis()->SetBinLabel(4, "ERROR");
169
170 fvhCompGet4ChScm.push_back(
171 new TH2I(Form("%sCompGet4ChanScm_c%02u", sSystem.data(), uComp),
172 Form("SC messages per GET4 channel in Comp %02u; GET4 channel # ; SC type", uCompIndex),
174 5, 0., 5.));
175 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(1, "Hit Scal");
176 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(2, "Deadtime");
177 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(3, "SPI");
178 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(4, "SEU Scal");
179 fvhCompGet4ChScm[uComp]->GetYaxis()->SetBinLabel(5, "START");
180
181 fvhCompGet4ChErrors.push_back(
182 new TH2I(Form("%sCompGet4ChanErrors_c%02u", sSystem.data(), uComp),
183 Form("Error messages per GET4 channel in Comp %02u; GET4 channel # ; Error", uCompIndex),
185 22, 0., 22.));
186 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(1, "0x00: Readout Init ");
187 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(2, "0x01: Sync ");
188 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(3, "0x02: Epoch count sync");
189 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(4, "0x03: Epoch ");
190 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(5, "0x04: FIFO Write ");
191 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(6, "0x05: Lost event ");
192 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(7, "0x06: Channel state ");
193 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(8, "0x07: Token Ring state");
194 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(9, "0x08: Token ");
195 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(10, "0x09: Error Readout ");
196 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(11, "0x0a: SPI ");
197 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(12, "0x0b: DLL Lock error "); // <- From GET4 v1.2
198 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(13, "0x0c: DLL Reset invoc."); // <- From GET4 v1.2
199 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(14, "0x11: Overwrite "); // <- From GET4 v1.0 to 1.3
200 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(15, "0x12: ToT out of range");
201 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(16, "0x13: Event Discarded ");
202 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(17, "0x14: Add. Rising edge"); // <- From GET4 v1.3
203 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(18, "0x15: Unpaired Falling"); // <- From GET4 v1.3
204 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(19, "0x16: Sequence error "); // <- From GET4 v1.3
205 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(20, "0x17: Epoch Overflow "); // <- From GET4 v2.0
206 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(21, "0x7f: Unknown ");
207 fvhCompGet4ChErrors[uComp]->GetYaxis()->SetBinLabel(22, "Corrupt/unsuprtd error");
208
210
211 fvhCompRawChCount.push_back(new TH1I(Form("%sCompRawChCount_c%02u", sSystem.data(), uCompIndex),
212 Form("Channel counts comp. %02u raw; Channel; Hits",
213 uCompIndex),
215
216 fvhCompRawChRate.push_back(new TH2D(Form("%sCompRawChRate_c%02u", sSystem.data(), uCompIndex),
217 Form("Raw channel rate comp. %02u; Time in run [s]; Channel; "
218 "Rate [1/s]",
219 uCompIndex),
222
223 fvhCompRawChTot.push_back(new TH2I(Form("%sCompRawChTot_c%02u", sSystem.data(), uCompIndex),
224 Form("Raw TOT comp. %02u, raw channel; Channel; TOT [bin]", uCompIndex),
226 256, 0, 256));
227
229 fvhCompRemapChCount.push_back(new TH1I(Form("%sCompRemapChCount_c%02u", sSystem.data(), uCompIndex),
230 Form("PADI Channel counts comp. %02u, remapped; PADI channel; Hits",
231 uCompIndex),
233
234 fvhCompRemapChRate.push_back(new TH2D(Form("%sCompRemapChRate_c%02u", sSystem.data(), uCompIndex),
235 Form("PADI channel rate comp. %02u, remapped; Time in run [s]; PADI channel; "
236 "Rate [1/s]",
237 uCompIndex),
240
241 fvhCompRemapChTot.push_back(new TH2I(Form("%sCompRemapChTot_c%02u", sSystem.data(), uCompIndex),
242 Form("Raw TOT comp. %02u, remapped; PADI channel; TOT [bin]", uCompIndex),
244 256, 0, 256));
245
246 // clang-format on
247
250 AddHistoToVector(fvhCompGet4MessType[uComp], sFolderComp);
251 AddHistoToVector(fvhCompGet4ChScm[uComp], sFolderComp);
252 AddHistoToVector(fvhCompGet4ChErrors[uComp], sFolderComp);
254 AddHistoToVector(fvhCompRawChCount[uComp], sFolderComp);
255 AddHistoToVector(fvhCompRawChRate[uComp], sFolderComp);
256 AddHistoToVector(fvhCompRawChTot[uComp], sFolderComp);
258 AddHistoToVector(fvhCompRemapChCount[uComp], sFolderComp);
259 AddHistoToVector(fvhCompRemapChRate[uComp], sFolderComp);
260 AddHistoToVector(fvhCompRemapChTot[uComp], sFolderComp);
261 } // for( UInt_t uComp = 0; uComp < fuNbOfComps; ++uComp )
262
263 return kTRUE;
264}
265
267{
269 std::string sSystem = "tof";
270 if (fBmonMode) {
271 //
272 sSystem = "bmon";
273 }
274
277 new TCanvas(Form("c%sSummaryGet4s", sSystem.data()), Form("GET4s message stats, %s", sSystem.data()));
278 fcSummaryGet4s->Divide(3, 2);
279
280 fcSummaryGet4s->cd(1);
281 gPad->SetGridx();
282 gPad->SetGridy();
283 gPad->SetLogz();
284 fhGet4MessType->Draw("colz");
285
286 fcSummaryGet4s->cd(2);
287 gPad->SetGridx();
288 gPad->SetGridy();
289 gPad->SetLogz();
290 fhGet4EpochFlags->Draw("colz");
291
292 fcSummaryGet4s->cd(3);
293 gPad->SetGridx();
294 gPad->SetGridy();
295 gPad->SetLogz();
296 fhGet4ScmType->Draw("colz");
297
298 fcSummaryGet4s->cd(4);
299 gPad->SetGridx();
300 gPad->SetGridy();
301 gPad->SetLogz();
302 fhGet4SysMessType->Draw("colz");
303
304 fcSummaryGet4s->cd(5);
305 gPad->SetGridx();
306 gPad->SetGridy();
307 gPad->SetLogz();
308 fhGet4ErrorsType->Draw("colz");
309
310 std::string sFolder = "canvases";
313
314 for (UInt_t uComp = 0; uComp < fuNbOfComps; ++uComp) {
315
316 fvcSumComp.push_back(new TCanvas(Form("c%sSumComp%02u", sSystem.data(), uComp),
317 Form("Component %2u summary, %s", uComp, sSystem.data())));
318 fvcSumComp[uComp]->Divide(3, 3);
319
321 fvcSumComp[uComp]->cd(1);
322 gPad->SetGridx();
323 gPad->SetGridy();
324 gPad->SetLogz();
325 fvhCompGet4MessType[uComp]->Draw("colz");
326
327 fvcSumComp[uComp]->cd(2);
328 gPad->SetGridx();
329 gPad->SetGridy();
330 gPad->SetLogz();
331 fvhCompGet4ChScm[uComp]->Draw("colz");
332
333 fvcSumComp[uComp]->cd(3);
334 gPad->SetGridx();
335 gPad->SetGridy();
336 gPad->SetLogz();
337 fvhCompGet4ChErrors[uComp]->Draw("colz");
338
340 fvcSumComp[uComp]->cd(4);
341 gPad->SetGridx();
342 gPad->SetGridy();
343 gPad->SetLogz();
344 fvhCompRawChCount[uComp]->Draw("colz");
345
346 fvcSumComp[uComp]->cd(5);
347 gPad->SetGridx();
348 gPad->SetGridy();
349 gPad->SetLogz();
350 fvhCompRawChRate[uComp]->Draw("colz");
351
352 fvcSumComp[uComp]->cd(6);
353 gPad->SetGridx();
354 gPad->SetGridy();
355 gPad->SetLogz();
356 fvhCompRawChTot[uComp]->Draw("colz");
357
359 fvcSumComp[uComp]->cd(7);
360 gPad->SetGridx();
361 gPad->SetGridy();
362 gPad->SetLogz();
363 fvhCompRemapChCount[uComp]->Draw("colz");
364
365 fvcSumComp[uComp]->cd(8);
366 gPad->SetGridx();
367 gPad->SetGridy();
368 gPad->SetLogz();
369 fvhCompRemapChRate[uComp]->Draw("colz");
370
371 fvcSumComp[uComp]->cd(9);
372 gPad->SetGridx();
373 gPad->SetGridy();
374 gPad->SetLogz();
375 fvhCompRemapChTot[uComp]->Draw("colz");
376
377 AddCanvasToVector(fvcSumComp[uComp], sFolder);
378 }
379}
380
382{
383 if (nullptr == fvhMsSize[component]) {
384 TString sMsSizeName = Form("MsSize_c%02u", component);
385 TString sMsSizeTitle = Form("Size of MS for component %02u; Ms Size [bytes]", component);
386 fvhMsSize[component] = new TH1F(sMsSizeName.Data(), sMsSizeTitle.Data(), 30000, 0., 30000.);
387 fvhMsSize[component]->SetCanExtend(TH2::kAllAxes);
388 AddHistoToVector(fvhMsSize[component], "MsSzComp");
389 }
390 if (nullptr == fvhMsSizeTime[component]) {
391 TString sMsSizeName = Form("MsSizeTime_c%02u", component);
392 TString sMsSizeTitle = Form("Size of MS vs time for component %02u; Time[s] ; Ms Size [bytes]", component);
393 fvhMsSizeTime[component] = new TProfile(sMsSizeName.Data(), sMsSizeTitle.Data(), 15000, 0., 300.);
394 fvhMsSizeTime[component]->SetCanExtend(TH2::kAllAxes);
395 AddHistoToVector(fvhMsSizeTime[component], "MsSzComp");
396 }
397 return kTRUE;
398}
399
401{
402 if (nullptr != fvhMsSize[component]) {
403 fvhMsSize[component]->Reset();
404 }
405 if (nullptr != fvhMsSizeTime[component]) {
406 fvhMsSizeTime[component]->Reset();
407 }
408 return kTRUE;
409}
410
412{
413 fhGet4MessType->Reset();
414 fhGet4ScmType->Reset();
415 fhGet4ErrorsType->Reset();
416 fhGet4EpochFlags->Reset();
418 for (UInt_t uComp = 0; uComp < fuNbOfComps; ++uComp) {
419 fvhCompGet4MessType[uComp]->Reset();
420 fvhCompGet4ChScm[uComp]->Reset();
421 fvhCompGet4ChErrors[uComp]->Reset();
423 fvhCompRawChCount[uComp]->Reset();
424 fvhCompRawChRate[uComp]->Reset();
425 fvhCompRawChTot[uComp]->Reset();
427 fvhCompRemapChCount[uComp]->Reset();
428 fvhCompRemapChRate[uComp]->Reset();
429 fvhCompRemapChTot[uComp]->Reset();
430 }
431
432 return kTRUE;
433}
434
436{
440 fvhBmonMsgCntEvoChan.resize(fuNbChanBmon, nullptr);
442 fvhBmonHitCntEvoChan.resize(fuNbChanBmon, nullptr);
444 fvhBmonErrorCntEvoChan.resize(fuNbChanBmon, nullptr);
446 fvhBmonEvtLostCntEvoChan.resize(fuNbChanBmon, nullptr);
448 fvhBmonErrorFractEvoChan.resize(fuNbChanBmon, nullptr);
452
454 uint32_t iNbBinsLog = 0;
456 std::vector<double> dBinsLogVector = GenerateLogBinArray(4, 9, 1, iNbBinsLog);
457 double* dBinsLog = dBinsLogVector.data();
458 // double * dBinsLog = GenerateLogBinArray( 4, 9, 1, iNbBinsLog );
459
460 // clang-format off
461
462 fhBmonCompMapAll = new TH1I("hBmonCompMapAll", "Map of hits on Bmon detector; Comp.; Hits Count []",
463 fuNbOfComps, -0.5, fuNbOfComps - 0.5);
464 fhBmonCompGet4 = new TH2I("hBmonCompGet4", "Map of hits on Bmon detector; Comp.; GET4; Counts []",
465 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5,
466 2*fuNbChanBmon, -0.5, 2*fuNbChanBmon - 0.5);
467 fhBmonGet4Map = new TH1I("hBmonGet4Map", "Map of hits on Bmon detector; GET4; Hits Count []",
468 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5);
469 fhBmonGet4MapEvo = new TH2I("hBmonGet4MapEvo",
470 "Map of hits on Bmon detector vs time in run; GET4; "
471 "Time in run [s]; Hits Count []",
473 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5);
474 fhBmonChannelMapAll = new TH1I("hChannelMapAll", "Map of hits on Bmon detector; Strip; Hits Count []",
475 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
476 fhBmonChannelTotAll = new TH2I("hChannelTotAll", "Tot of hits on Bmon detector per channel; Strip; Tot; Hits Count []",
477 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5, 256, -0.5, 255.5);
478 fhBmonHitMapEvoAll = new TH2I("hBmonHitMapEvoAll",
479 "Map of hits on Bmon detector vs time in run; Chan; "
480 "Time in run [s]; Hits Count []",
481 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5,
483 fhBmonHitTotEvoAll = new TH2I("hBmonHitTotEvoAll",
484 "Evolution of TOT in Bmon detector vs time in run; Time "
485 "in run [s]; TOT [ bin ]; Hits Count []",
486 fuHistoryHistoSize, 0, fuHistoryHistoSize, 256, -0.5, 255.5);
487 fhBmonChanHitMapAll = new TH1D("fhBmonChanHitMapAll", "Map of hits on Bmon detector; Strip; Hits Count []",
488 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
489 fhBmonChanHitMapEvoAll = new TH2I("hBmonChanHitMapEvoAll",
490 "Map of hits on Bmon detector vs time in run; "
491 "Strip; Time in run [s]; Hits Count []",
493
494
495 fhBmonCompMap = new TH1I("hBmonCompMap", "Map of hits on Bmon detector; Comp.; Hits Count []",
496 fuNbOfComps, -0.5, fuNbOfComps - 0.5);
497 fhBmonChannelMap = new TH1I("hChannelMap", "Map of hits on Bmon detector; Strip; Hits Count []",
498 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
499 fhBmonHitMapEvo = new TH2I("hBmonHitMapEvo",
500 "Map of hits on Bmon detector vs time in run; Chan; "
501 "Time in run [s]; Hits Count []",
503 fhBmonHitTotEvo = new TH2I("hBmonHitTotEvo",
504 "Evolution of TOT in Bmon detector vs time in run; Time "
505 "in run [s]; TOT [ bin ]; Hits Count []",
506 fuHistoryHistoSize, 0, fuHistoryHistoSize, 256, -0.5, 255.5);
507 fhBmonChanHitMap = new TH1D("fhBmonChanHitMap", "Map of hits on Bmon detector; Strip; Hits Count []",
508 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
509 fhBmonChanHitMapEvo = new TH2I("hBmonChanHitMapEvo",
510 "Map of hits on Bmon detector vs time in run; "
511 "Strip; Time in run [s]; Hits Count []",
513 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
514 fvhBmonCompMapSpill.push_back(
515 new TH1I(Form("hBmonCompMapSpill%02u", uSpill),
516 Form("Map of hits on Bmon detector in current spill %02u; Comp.; Hits Count []", uSpill),
517 fuNbOfComps, -0.5, fuNbOfComps - 0.5));
518 fvhBmonChannelMapSpill.push_back(new TH1I(Form("hBmonChannelMapSpill%02u", uSpill),
519 Form("Map of hits on Bmon detector in current spill %02u; Strip; "
520 "Hits Count []",
521 uSpill),
522 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5));
523 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
524 fhBmonHitsPerSpill = new TH1I("hBmonHitsPerSpill", "Hit count per spill; Spill; Hits Count []", 2000, 0., 2000);
525
526 fhBmonMsgCntEvo = new TH1I("hBmonMsgCntEvo",
527 "Evolution of Hit & error msgs counts vs time in run; "
528 "Time in run [s]; Msgs Count []",
530 fhBmonHitCntEvo = new TH1I("hBmonHitCntEvo",
531 "Evolution of Hit counts vs time in run; Time in run [s]; Hits Count []",
533 fhBmonErrorCntEvo = new TH1I("hBmonErrorCntEvo",
534 "Evolution of Error counts vs time in run; Time in run [s]; Error Count []",
536 fhBmonLostEvtCntEvo = new TH1I("hBmonLostEvtCntEvo",
537 "Evolution of LostEvent counts vs time in run; "
538 "Time in run [s]; LostEvent Count []",
540
541 fhBmonErrorFractEvo = new TProfile("hBmonErrorFractEvo",
542 "Evolution of Error Fraction vs time in run; "
543 "Time in run [s]; Error Fract []",
545 fhBmonLostEvtFractEvo = new TProfile("hBmonLostEvtFractEvo",
546 "Evolution of LostEvent Fraction vs time in "
547 "run; Time in run [s]; LostEvent Fract []",
549
550 fhBmonMsgCntPerMsEvo = new TH2I("hBmonMsgCntPerMsEvo",
551 "Evolution of Hit & error msgs counts, per MS vs time in run; "
552 "Time in run [s]; Hits Count/MS []; MS",
553 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
554 fhBmonHitCntPerMsEvo = new TH2I("hBmonHitCntPerMsEvo",
555 "Evolution of Hit counts, per MS vs time in run; "
556 "Time in run [s]; Hits Count/MS []; MS",
557 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
558 fhBmonErrorCntPerMsEvo = new TH2I("hBmonErrorCntPerMsEvo",
559 "Evolution of Error counts, per MS vs time in "
560 "run; Time in run [s]; Error Count/MS []; MS",
561 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
562 fhBmonLostEvtCntPerMsEvo = new TH2I("hBmonLostEvtCntPerMsEvo",
563 "Evolution of LostEvent, per MS counts vs time in run; Time in "
564 "run [s]; LostEvent Count/MS []; MS",
565 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
566
567 fhBmonErrorFractPerMsEvo = new TH2I("hBmonErrorFractPerMsEvo",
568 "Evolution of Error Fraction, per MS vs time in run; Time in run "
569 "[s]; Error Fract/MS []; MS",
570 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
571 fhBmonLostEvtFractPerMsEvo = new TH2I("hBmonLostEvtFractPerMsEvo",
572 "Evolution of LostEvent Fraction, per MS vs time in run; Time in "
573 "run [s]; LostEvent Fract/MS []; MS",
574 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
575
576 fhBmonChannelMapPulser = new TH1I("fhBmonChannelMapPulser", "Map of pulser hits on Bmon detector; Chan; Hits Count []",
578 fhBmonHitMapEvoPulser = new TH2I("fhBmonHitMapEvoPulser",
579 "Map of hits on Bmon detector vs time in run; "
580 "Chan; Time in run [s]; Hits Count []",
582 // clang-format on
583
585 std::string sFolder = "All";
596
597 sFolder = "NoPulser";
604 sFolder = "Spills";
605 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
606 AddHistoToVector(fvhBmonCompMapSpill[uSpill], sFolder);
608 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
610
611 sFolder = "GlobRates";
616
619
620 sFolder = "GlobRatesMs";
627
628 sFolder = "Pulser";
631
632 /*******************************************************************/
633 sFolder = "RatePerChan";
634 for (UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan) {
635 // clang-format off
636 fvhBmonMsgCntEvoChan[uChan] = new TH1I(Form("hBmonMsgCntEvoChan%02u", uChan),
637 Form("Evolution of Messages counts vs time in run for channel "
638 "%02u; Time in run [s]; Messages Count []",
639 uChan),
641 fvhBmonMsgCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonMsgCntPerMsEvoChan%02u", uChan),
642 Form("Evolution of Hit counts per MS vs time in run for channel "
643 "%02u; Time in run [s]; Hits Count/MS []; MS",
644 uChan),
645 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
646
647 fvhBmonHitCntEvoChan[uChan] = new TH1I(Form("hBmonHitCntEvoChan%02u", uChan),
648 Form("Evolution of Hit counts vs time in run for channel %02u; "
649 "Time in run [s]; Hits Count []",
650 uChan),
652 fvhBmonHitCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonHitCntPerMsEvoChan%02u", uChan),
653 Form("Evolution of Hit counts per MS vs time in run for channel "
654 "%02u; Time in run [s]; Hits Count/MS []; MS",
655 uChan),
656 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
657
658 fvhBmonErrorCntEvoChan[uChan] = new TH1I(Form("hBmonErrorCntEvoChan%02u", uChan),
659 Form("Evolution of Error counts vs time in run for channel "
660 "%02u; Time in run [s]; Error Count []",
661 uChan),
663 fvhBmonErrorCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonErrorCntPerMsEvoChan%02u", uChan),
664 Form("Evolution of Error counts per MS vs time in run for "
665 "channel %02u; Time in run [s]; Error Count/MS []; MS",
666 uChan),
667 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
668
669 fvhBmonEvtLostCntEvoChan[uChan] = new TH1I(Form("hBmonEvtLostCntEvoChan%02u", uChan),
670 Form("Evolution of LostEvent counts vs time in run for channel "
671 "%02u; Time in run [s]; LostEvent Count []",
672 uChan),
674 fvhBmonEvtLostCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonEvtLostCntPerMsEvoChan%02u", uChan),
675 Form("Evolution of LostEvent counts per MS vs time in run for "
676 "channel %02u; Time in run [s]; LostEvent Count/MS []; MS",
677 uChan),
678 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
679
680 fvhBmonErrorFractEvoChan[uChan] = new TProfile(Form("hBmonErrorFractEvoChan%02u", uChan),
681 Form("Evolution of Error Fraction vs time in run for "
682 "channel %02u; Time in run [s]; Error Fract []",
683 uChan),
685 fvhBmonErrorFractPerMsEvoChan[uChan] = new TH2I(Form("hBmonErrorFractPerMsEvoChan%02u", uChan),
686 Form("Evolution of Error Fraction, per MS vs time in run for "
687 "channel %02u; Time in run [s]; Error Fract/MS []; MS",
688 uChan),
689 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
690
691 fvhBmonEvtLostFractEvoChan[uChan] = new TProfile(Form("hBmonEvtLostFractEvoChan%02u", uChan),
692 Form("Evolution of LostEvent Fraction vs time in run for "
693 "channel %02u; Time in run [s]; LostEvent Fract []",
694 uChan),
697 new TH2I(Form("hBmonEvtLostFractPerMsEvoChan%02u", uChan),
698 Form("Evolution of LostEvent Fraction, per MS vs time in run for channel "
699 "%02u; Time in run [s]; LostEvent Fract/MS []; MS",
700 uChan),
701 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
702 // clang-format on
703
705 AddHistoToVector(fvhBmonMsgCntEvoChan[uChan], sFolder);
707 AddHistoToVector(fvhBmonHitCntEvoChan[uChan], sFolder);
717 } // for( UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan )
718
719 return kTRUE;
720}
721
723{
724 for (UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan) {
725 fvhBmonMsgCntEvoChan[uChan]->Reset();
726 fvhBmonMsgCntPerMsEvoChan[uChan]->Reset();
727
728 fvhBmonHitCntEvoChan[uChan]->Reset();
729 fvhBmonHitCntPerMsEvoChan[uChan]->Reset();
730
731 fvhBmonErrorCntEvoChan[uChan]->Reset();
732 fvhBmonErrorCntPerMsEvoChan[uChan]->Reset();
733
734 fvhBmonEvtLostCntEvoChan[uChan]->Reset();
735 fvhBmonEvtLostCntPerMsEvoChan[uChan]->Reset();
736
737 fvhBmonErrorFractEvoChan[uChan]->Reset();
738 fvhBmonErrorFractPerMsEvoChan[uChan]->Reset();
739
740 fvhBmonEvtLostFractEvoChan[uChan]->Reset();
741 fvhBmonEvtLostFractPerMsEvoChan[uChan]->Reset();
742 } // for( UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan )
743
744 fhBmonCompMap->Reset();
745 fhBmonCompGet4->Reset();
746 fhBmonGet4Map->Reset();
747 fhBmonGet4MapEvo->Reset();
748 fhBmonChannelMapAll->Reset();
749 fhBmonChannelTotAll->Reset();
750 fhBmonHitMapEvoAll->Reset();
751 fhBmonHitTotEvoAll->Reset();
752 fhBmonChanHitMapAll->Reset();
753 fhBmonChanHitMapEvoAll->Reset();
754
755 fhBmonCompMap->Reset();
756 fhBmonCompMap->Reset();
757 fhBmonChannelMap->Reset();
758 fhBmonHitMapEvo->Reset();
759 fhBmonHitTotEvo->Reset();
760 fhBmonChanHitMap->Reset();
761 fhBmonChanHitMapEvo->Reset();
762 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
763 fvhBmonCompMapSpill[uSpill]->Reset();
764 fvhBmonChannelMapSpill[uSpill]->Reset();
765 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
766 fhBmonHitsPerSpill->Reset();
767
768 fhBmonMsgCntEvo->Reset();
769 fhBmonHitCntEvo->Reset();
770 fhBmonErrorCntEvo->Reset();
771
772 fhBmonErrorFractEvo->Reset();
773 fhBmonLostEvtFractEvo->Reset();
774
775 fhBmonMsgCntPerMsEvo->Reset();
776 fhBmonHitCntPerMsEvo->Reset();
777 fhBmonErrorCntPerMsEvo->Reset();
781
782 fhBmonChannelMapPulser->Reset();
783 fhBmonHitMapEvoPulser->Reset();
784
785 if (kTRUE == bResetTime) {
787 fdStartTime = -1.0;
788
791 } // if( kTRUE == bResetTime )
792
793 return kTRUE;
794}
795
797{
798 std::string sFolder = "canvases";
799
800 /*******************************************************************/
802 fcBmonSummary = new TCanvas("cBmonSummary", "Hit maps, Hit rate, Error fraction");
803 fcBmonSummary->Divide(2, 2);
804
805 fcBmonSummary->cd(1);
806 gPad->SetGridx();
807 gPad->SetGridy();
808 gPad->SetLogy();
809 fhBmonChannelMap->Draw();
810
811 fcBmonSummary->cd(2);
812 gPad->SetGridx();
813 gPad->SetGridy();
814 gPad->SetLogz();
815 fhBmonHitMapEvo->Draw("colz");
816
817 fcBmonSummary->cd(3);
818 gPad->SetGridx();
819 gPad->SetGridy();
820 gPad->SetLogy();
821 fhBmonHitCntEvo->Draw();
822
823 fcBmonSummary->cd(4);
824 gPad->SetGridx();
825 gPad->SetGridy();
826 gPad->SetLogz();
827 fhBmonErrorFractEvo->Draw("hist");
828
830 /*******************************************************************/
831
832 /*******************************************************************/
834 fcBmonSummaryMap = new TCanvas("cBmonSummaryMap", "Hit maps, Hit rate, Error fraction");
835 fcBmonSummaryMap->Divide(2, 2);
836
837 fcBmonSummaryMap->cd(1);
838 gPad->SetGridx();
839 gPad->SetGridy();
840 gPad->SetLogy();
841 fhBmonChanHitMap->Draw();
842
843 fcBmonSummaryMap->cd(2);
844 gPad->SetGridx();
845 gPad->SetGridy();
846 gPad->SetLogz();
847 fhBmonChanHitMapEvo->Draw("colz");
848
849 fcBmonSummaryMap->cd(3);
850 gPad->SetGridx();
851 gPad->SetGridy();
852 gPad->SetLogy();
853 fhBmonHitCntEvo->Draw();
854
855 fcBmonSummaryMap->cd(4);
856 gPad->SetGridx();
857 gPad->SetGridy();
858 gPad->SetLogz();
859 fhBmonErrorFractEvo->Draw("hist");
860
862 /*******************************************************************/
863
864 /*******************************************************************/
866 fcBmonHitMaps = new TCanvas("cBmonHitMaps", "Hit maps");
867 fcBmonHitMaps->Divide(2);
868
869 fcBmonHitMaps->cd(1);
870 gPad->SetGridx();
871 gPad->SetGridy();
872 gPad->SetLogy();
873 fhBmonChannelMap->Draw();
874
875 fcBmonHitMaps->cd(2);
876 gPad->SetGridx();
877 gPad->SetGridy();
878 gPad->SetLogz();
879 fhBmonHitMapEvo->Draw("colz");
880
882 /*******************************************************************/
883
884 /*******************************************************************/
887 new TCanvas("cBmonGenCntsPerMs", "Messages and hit cnt per MS, Error and Evt Loss Fract. per MS ");
888 fcBmonGenCntsPerMs->Divide(2, 2);
889
890 fcBmonGenCntsPerMs->cd(1);
891 gPad->SetGridx();
892 gPad->SetGridy();
893 gPad->SetLogy();
894 gPad->SetLogz();
895 fhBmonMsgCntPerMsEvo->Draw("colz");
896
897 fcBmonGenCntsPerMs->cd(2);
898 gPad->SetGridx();
899 gPad->SetGridy();
900 gPad->SetLogy();
901 gPad->SetLogz();
902 fhBmonHitCntPerMsEvo->Draw("colz");
903
904 fcBmonGenCntsPerMs->cd(3);
905 gPad->SetGridx();
906 gPad->SetGridy();
907 gPad->SetLogy();
908 gPad->SetLogz();
909 fhBmonErrorFractPerMsEvo->Draw("colz");
910
911 fcBmonGenCntsPerMs->cd(4);
912 gPad->SetGridx();
913 gPad->SetGridy();
914 gPad->SetLogy();
915 gPad->SetLogz();
916 fhBmonLostEvtFractPerMsEvo->Draw("colz");
917
919 /*******************************************************************/
920
921 /*******************************************************************/
923 fcBmonSpillCounts = new TCanvas("cBmonSpillCounts", "Counts per spill, last 5 spills including current one");
925
926 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
927 fcBmonSpillCounts->cd(1 + uSpill);
928 gPad->SetGridx();
929 gPad->SetGridy();
930 gPad->SetLogy();
931 // fvhChannelMapSpill[ uSpill ]->SetStats( kTRUE );
932 fvhBmonChannelMapSpill[uSpill]->Draw();
933 gPad->Update();
934 TPaveStats* st = (TPaveStats*) fvhBmonChannelMapSpill[uSpill]->FindObject("stats");
935 st->SetOptStat(10);
936 st->SetX1NDC(0.25);
937 st->SetX2NDC(0.95);
938 st->SetY1NDC(0.90);
939 st->SetY2NDC(0.95);
940 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
941
943 /*******************************************************************/
944
945 /*******************************************************************/
947 fcBmonSpillCountsHori = new TCanvas("cBmonSpillCountsHori", "Counts per spill, last 5 spills including current one");
949
950 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
951 fcBmonSpillCountsHori->cd(1 + uSpill);
952 gPad->SetGridx();
953 gPad->SetGridy();
954 gPad->SetLogy();
955 fvhBmonChannelMapSpill[uSpill]->Draw();
956 gPad->Update();
957 TPaveStats* st = (TPaveStats*) fvhBmonChannelMapSpill[uSpill]->FindObject("stats");
958 st->SetOptStat(110);
959 st->SetX1NDC(0.25);
960 st->SetX2NDC(0.95);
961 st->SetY1NDC(0.90);
962 st->SetY2NDC(0.95);
963 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
964
966 /*******************************************************************/
967
968 /*******************************************************************/
971 new TCanvas("cBmonSpillCompCountsHori", "Counts in Comp. per spill, last 5 spills including current one");
973
974 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
975 fcBmonSpillCompCountsHori->cd(1 + uSpill);
976 gPad->SetGridx();
977 gPad->SetGridy();
978 gPad->SetLogy();
979 fvhBmonCompMapSpill[uSpill]->Draw();
980 gPad->Update();
981 TPaveStats* st = (TPaveStats*) fvhBmonCompMapSpill[uSpill]->FindObject("stats");
982 st->SetOptStat(110);
983 st->SetX1NDC(0.25);
984 st->SetX2NDC(0.95);
985 st->SetY1NDC(0.90);
986 st->SetY2NDC(0.95);
987 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
988
990 /*******************************************************************/
991}
992// -------------------------------------------------------------------------
993
994// -------------------------------------------------------------------------
996{
998 uint32_t uNbBinsLog = 0;
1000 std::vector<double> dBinsLogVector = GenerateLogBinArray(6, 9, 10, uNbBinsLog, 1, true);
1001 double* dBinsLog = dBinsLogVector.data();
1002
1003 uint32_t uNbBinsLogFract = 0;
1004 std::vector<double> dBinsLogVectorFract = GenerateLogBinArray(6, 9, 10, uNbBinsLogFract, -6, true);
1005 double* dBinsLogFract = dBinsLogVectorFract.data();
1006
1008 fArrHitCounts = std::make_unique<double[]>(fuBmonMicrospillsNbBinsTs);
1009 fArrErrCounts = std::make_unique<double[]>(fuBmonMicrospillsNbBinsTs);
1010
1011 // clang-format off
1012 // ==> Only internal, not for users
1013 fhBmonMicrospillsDistHits = new TH1I("hBmonMicrospillsDistHits", "Hits per 10 us; Time in spill [us]; Hits nb []",
1015 // ==> Only internal, not for users
1016 fhBmonMicrospillsDistErrs = new TH1I("hBmonMicrospillsDistErrs", "Erros per 10 us; Time in spill [us]; Errors nb []",
1018
1019 fhBmonMicrospillsTsBinCntHits = new TH2I("hBmonMicrospillsTsBinCntHits",
1020 "Nb 10 us bins with hit count per TS; TS []; Hits nb. []; 10 us bins []",
1021 1000, -0.5, 999.5,
1022 uNbBinsLog, dBinsLog);
1023 fhBmonMicrospillsTsBinCntErrs = new TH2I("hBmonMicrospillsTsBinCntErrs",
1024 "Nb 10 us bins with error count per TS; TS []; Errors nb. []; 10 us bins []",
1025 1000, -0.5, 999.5,
1026 uNbBinsLog, dBinsLog);
1027
1028 fhBmonMicrospillsTsMeanHits = new TH1I("hBmonMicrospillsTsMeanHits",
1029 "Mean nb hits per 10 us per TS; TS []; Hits nb. []",
1030 1000, -0.5, 999.5);
1031 fhBmonMicrospillsTsMeanErrs = new TH1I("hBmonMicrospillsTsMeanErrs",
1032 "Mean nb error per 10 us per TS; TS []; Errors nb. []",
1033 1000, -0.5, 999.5);
1034
1035
1036 fhBmonMicrospillsTsMedianHits = new TH1I("hBmonMicrospillsTsMedianHits",
1037 "Median nb hits per 10 us per TS; TS []; Hits nb. []",
1038 1000, -0.5, 999.5);
1039 fhBmonMicrospillsTsMedianErrs = new TH1I("hBmonMicrospillsTsMedianErrs",
1040 "Median nb error per 10 us per TS; TS []; Errors nb. []",
1041 1000, -0.5, 999.5);
1042
1043 fhBmonMicrospillsTsBinRatioHits = new TH2I("hBmonMicrospillsTsBinRatioHits",
1044 "Nb 10us bins with hit ratio to mean per TS; TS []; Ratio; 10 us bins []",
1045 1000, -0.5, 999.5,
1046 1000, -0.5, 499.5);
1047 fhBmonMicrospillsTsBinRatioErrs = new TH2I("hBmonMicrospillsTsBinRatioErrs",
1048 "Nb 10us bins with error ratio to mean per TS; TS []; Ratio; 10 us bins []",
1049 1000, -0.5, 999.5,
1050 1000, -0.5, 499.5);
1051
1052 fhBmonMicrospillsTsBinFractHits = new TH2I("hBmonMicrospillsTsBinFractHits",
1053 "Nb 10 us bins with hit fract. per TS; TS []; Fraction; 10 us bins []",
1054 1000, -0.5, 999.5,
1055 uNbBinsLogFract, dBinsLogFract);
1056 fhBmonMicrospillsTsBinFractErrs = new TH2I("hBmonMicrospillsTsBinFractErrs",
1057 "Nb 10 us bins with error count per TS; TS []; Fraction; 10 us bins []",
1058 1000, -0.5, 999.5,
1059 uNbBinsLogFract, dBinsLogFract);
1060 // clang-format on
1061
1063 std::string sFolder = "Microspills";
1064 // AddHistoToVector(fhBmonMicrospillsDistHits, sFolder);
1065 // AddHistoToVector(fhBmonMicrospillsDistErrs, sFolder);
1066
1069
1072
1075
1078
1081
1082 return kTRUE;
1083}
1084
1100
1102{
1103 std::string sFolder = "canvases";
1104
1105 /*******************************************************************/
1107 fcBmonMicrospillsBinCnts = new TCanvas("BmonMicrospillsBinCnts", "Nb 10 us bins with hit/err counts per TS");
1108 fcBmonMicrospillsBinCnts->Divide(2);
1109
1111 gPad->SetGridx();
1112 gPad->SetGridy();
1113 gPad->SetLogy();
1114 gPad->SetLogz();
1115 fhBmonMicrospillsTsBinCntHits->Draw("colz");
1116 fhBmonMicrospillsTsMeanHits->SetLineColor(kRed);
1117 fhBmonMicrospillsTsMeanHits->Draw("HIST same");
1118 fhBmonMicrospillsTsMedianHits->SetLineColor(kBlack);
1119 fhBmonMicrospillsTsMedianHits->Draw("HIST same");
1120
1122 gPad->SetGridx();
1123 gPad->SetGridy();
1124 gPad->SetLogy();
1125 gPad->SetLogz();
1126 fhBmonMicrospillsTsBinCntErrs->Draw("colz");
1127 fhBmonMicrospillsTsMeanErrs->SetLineColor(kRed);
1128 fhBmonMicrospillsTsMeanErrs->Draw("HIST same");
1129 fhBmonMicrospillsTsMedianErrs->SetLineColor(kBlack);
1130 fhBmonMicrospillsTsMedianErrs->Draw("HIST same");
1131
1133 /*******************************************************************/
1134
1135 /*******************************************************************/
1138 new TCanvas("BmonMicrospillsFraction", "Nb 10 us bins with fraction of hit/err counts per TS/Total count per TS");
1139 fcBmonMicrospillsFraction->Divide(2);
1140
1142 gPad->SetGridx();
1143 gPad->SetGridy();
1144 gPad->SetLogy();
1145 gPad->SetLogz();
1146 fhBmonMicrospillsTsBinFractHits->Draw("colz");
1147
1149 gPad->SetGridx();
1150 gPad->SetGridy();
1151 gPad->SetLogy();
1152 gPad->SetLogz();
1153 fhBmonMicrospillsTsBinFractErrs->Draw("colz");
1154
1156 /*******************************************************************/
1157
1158 /*******************************************************************/
1161 new TCanvas("BmonMicrospillsRatios", "Nb 10 us bins with ratio of hit/err counts per mean count per TS/bin");
1162 fcBmonMicrospillsRatios->Divide(2);
1163
1165 gPad->SetGridx();
1166 gPad->SetGridy();
1167 gPad->SetLogz();
1168 fhBmonMicrospillsTsBinRatioHits->Draw("colz");
1169
1171 gPad->SetGridx();
1172 gPad->SetGridy();
1173 gPad->SetLogz();
1174 fhBmonMicrospillsTsBinRatioErrs->Draw("colz");
1175
1177 /*******************************************************************/
1178}
1179// -------------------------------------------------------------------------
1180
1181// -------------------------------------------------------------------------
1183{
1184 std::string sFolder = "Q-Factors";
1185
1186 uint32_t uMinNbBins = 10;
1187 uint32_t uMaxNbBins = 300000;
1188
1191
1192 std::vector<std::vector<uint32_t>> vuNbBinsHisto(fvdQfactorIntegrationNs.size(),
1193 std::vector<uint32_t>(fvdQfactorBinSizesNs.size(), 0));
1195
1196 fvhBmonQfactHisto.resize(fvdQfactorIntegrationNs.size(), std::vector<TH1*>(fvdQfactorBinSizesNs.size(), nullptr));
1197 fvhBmonQfactQval.resize(fvdQfactorIntegrationNs.size(), std::vector<TH1*>(fvdQfactorBinSizesNs.size(), nullptr));
1198 fvhBmonQfactMean.resize(fvdQfactorIntegrationNs.size(), std::vector<TH1*>(fvdQfactorBinSizesNs.size(), nullptr));
1199
1202
1203 for (uint32_t uHistSz = 0; uHistSz < fvdQfactorIntegrationNs.size(); ++uHistSz) {
1206
1207 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1209 vuNbBinsHisto[uHistSz][uBinSz] = fvdQfactorIntegrationNs[uHistSz] / fvdQfactorBinSizesNs[uBinSz];
1210 if (uMinNbBins <= vuNbBinsHisto[uHistSz][uBinSz] /*&& vuNbBinsHisto[uHistSz][uBinSz] <= uMaxNbBins*/) {
1211 fvhBmonQfactHisto[uHistSz][uBinSz] = new TH1D(
1212 Form("BmonQfactBinHist_%09.0f_%05.0f", fvdQfactorIntegrationNs[uHistSz], fvdQfactorBinSizesNs[uBinSz]),
1213 Form("Counts per %5.0f ns bin in cycle of range %9.0f ns, Bmon; Time in Cycle [ns]; Digis []",
1214 fvdQfactorBinSizesNs[uBinSz], fvdQfactorIntegrationNs[uHistSz]), //
1215 vuNbBinsHisto[uHistSz][uBinSz], 0.0, fvdQfactorIntegrationNs[uHistSz]);
1216
1217 double_t dBinOffset = 1.0 / (2.0 * fvuNbHistoCyclesPerTS[uHistSz]);
1218 fvhBmonQfactQval[uHistSz][uBinSz] =
1219 new TH1D(Form("BmonQFactorEvo_%09.0f_%05.0f", fvdQfactorIntegrationNs[uHistSz], fvdQfactorBinSizesNs[uBinSz]),
1220 Form("Q Factor, %5.0f ns bin, %9.0f ns range, Bmon; Time in Run [TS]; Q Factor []",
1221 fvdQfactorBinSizesNs[uBinSz], fvdQfactorIntegrationNs[uHistSz]), //
1222 fvuNbHistoCyclesPerTS[uHistSz] * fuQFactorMaxNbTs, 0.0 - dBinOffset, fuQFactorMaxNbTs - dBinOffset);
1223
1224 fvhBmonQfactMean[uHistSz][uBinSz] = new TH1D(
1225 Form("BmonQfactMeanEvo_%09.0f_%05.0f", fvdQfactorIntegrationNs[uHistSz], fvdQfactorBinSizesNs[uBinSz]),
1226 Form("Mean, %5.0f ns bin, %9.0f ns range, Bmon; Time in Run [TS]; Mean []", fvdQfactorBinSizesNs[uBinSz],
1227 fvdQfactorIntegrationNs[uHistSz]), //
1228 fvuNbHistoCyclesPerTS[uHistSz] * fuQFactorMaxNbTs, 0.0 - dBinOffset, fuQFactorMaxNbTs - dBinOffset);
1229
1231
1233 // AddHistoToVector(fvhBmonQfactHisto[uHistSz][uBinSz], sFolder);
1234 AddHistoToVector(fvhBmonQfactQval[uHistSz][uBinSz], sFolder);
1235 AddHistoToVector(fvhBmonQfactMean[uHistSz][uBinSz], sFolder);
1236 }
1237 }
1238 }
1239
1240 sFolder = "BinCounts";
1241 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1243 new TH1D(Form("BmonQfactBinCntDist_%5.0f", fvdQfactorBinSizesNs[uBinSz]),
1244 Form("Counts per %5.0f ns bin Bmon; Digis []; Bins []", fvdQfactorBinSizesNs[uBinSz]), //
1245 10000, -0.5, 9999.5);
1247
1249 new TH2D(Form("BmonQfactBinCntDistEvo_%5.0f", fvdQfactorBinSizesNs[uBinSz]),
1250 Form("Counts per %5.0f ns bin Bmon; Time in Run [TS];Digis []; Bins []", fvdQfactorBinSizesNs[uBinSz]),
1251 fuQFactorMaxNbTs, 0.0, fuQFactorMaxNbTs, 1000, -0.5, 999.5);
1253 }
1254
1255 return kTRUE;
1256}
1257
1259{
1260 // No reset possible as absolute time in run
1261 return kTRUE;
1262}
1263
1265{
1266 std::string sFolder = "canvases";
1267
1268 uint16_t nPadX = std::ceil(std::sqrt(fuQfactorNbPlots));
1269 uint16_t nPadY = std::ceil(1.0 * fuQfactorNbPlots / nPadX);
1270
1271 fcBmonQFactorVal = new TCanvas("cBmonQFactorVal", "Q-Factor values for various bins sizes and integration time");
1272 fcBmonQFactorVal->Divide(nPadX, nPadY);
1273
1274 fcBmonQFactorMean = new TCanvas("cBmonQFactorMean", "Mean bin counts for various bins sizes and integration time");
1275 fcBmonQFactorMean->Divide(nPadX, nPadY);
1276
1277 uint32_t uPadIdx = 1;
1278 for (uint32_t uHistSz = 0; uHistSz < fvdQfactorIntegrationNs.size(); ++uHistSz) {
1279 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1280 if (nullptr != fvhBmonQfactQval[uHistSz][uBinSz]) {
1281 fcBmonQFactorVal->cd(uPadIdx);
1282 gPad->SetGridx();
1283 gPad->SetGridy();
1284 fvhBmonQfactQval[uHistSz][uBinSz]->SetLineColor(kBlue);
1285 fvhBmonQfactQval[uHistSz][uBinSz]->SetLineWidth(2);
1286 fvhBmonQfactQval[uHistSz][uBinSz]->GetYaxis()->SetRangeUser(0., fvdQfactorHistMax[uBinSz]);
1287 fvhBmonQfactQval[uHistSz][uBinSz]->Draw("hist");
1288
1289 fcBmonQFactorMean->cd(uPadIdx);
1290 gPad->SetGridx();
1291 gPad->SetGridy();
1292 fvhBmonQfactMean[uHistSz][uBinSz]->SetLineColor(kBlue);
1293 fvhBmonQfactMean[uHistSz][uBinSz]->SetLineWidth(2);
1294 fvhBmonQfactMean[uHistSz][uBinSz]->Draw("hist");
1295
1296 uPadIdx++;
1297 }
1298 }
1299 }
1302
1303 nPadX = std::ceil(std::sqrt(fvdQfactorBinSizesNs.size()));
1304 nPadY = std::ceil(1.0 * fvdQfactorBinSizesNs.size() / nPadX);
1305 fcBmonQFactorBinCntDist = new TCanvas("fcBmonQFactorBinCntDist", "BMon Q-Factor BinCntDist");
1306 fcBmonQFactorBinCntDist->Divide(nPadX, nPadY);
1307 uPadIdx = 1;
1308 for (uint32_t uBinSz = 0; uBinSz < fvdQfactorBinSizesNs.size(); ++uBinSz) {
1309 fcBmonQFactorBinCntDist->cd(uPadIdx);
1310 gPad->SetGridx();
1311 gPad->SetGridy();
1312 gPad->SetLogx();
1313 gPad->SetLogy();
1314 fvhBmonQfactBinCountDistribution[uBinSz]->Draw("hist");
1315
1316 uPadIdx++;
1317 }
1319}
1320// -------------------------------------------------------------------------
1321
1322// -------------------------------------------------------------------------
1323void CbmTofUnpackMonitor::FillHitMonitoringHistos(const double_t& dMsTime, const uint32_t& uCurrCompIdx,
1324 const uint32_t& uGet4Id, const uint32_t& uRawCh,
1325 const uint32_t& uRemapCh, const uint32_t& uTot)
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 (uint32_t uBin = 1; uBin <= fvhBmonQfactHisto[uHistSz][uBinSz]->GetNbinsX(); ++uBin) {
1785 fvhBmonQfactBinCountDistribution[uBinSz]->Fill(fvhBmonQfactHisto[uHistSz][uBinSz]->GetBinContent(uBin));
1787 dTsFractional, fvhBmonQfactHisto[uHistSz][uBinSz]->GetBinContent(uBin));
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 (uint32_t uBin = 1; uBin <= fvhBmonQfactHisto[uHistSz][uBinSz]->GetNbinsX(); ++uBin) {
1834 fvhBmonQfactBinCountDistribution[uBinSz]->Fill(fvhBmonQfactHisto[uHistSz][uBinSz]->GetBinContent(uBin));
1836 dTsFractional, fvhBmonQfactHisto[uHistSz][uBinSz]->GetBinContent(uBin));
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
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
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
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)
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
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.
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)
Fill general histograms.
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()
void FillEpochMonitoringHistos(const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const bool &bSyncFlag, const bool &bDataLoss, const bool &bEpochLoss, const bool &bMissmMatch)
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
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
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
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
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