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{
437 if (fBmonScvdMode) {
440 }
441 else {
443 fuBmonChanMap = std::vector<UInt_t>(kuBmonChanMap, kuBmonChanMap + kuNbChanBmon);
444 }
448 fvhBmonMsgCntEvoChan.resize(fuNbChanBmon, nullptr);
450 fvhBmonHitCntEvoChan.resize(fuNbChanBmon, nullptr);
452 fvhBmonErrorCntEvoChan.resize(fuNbChanBmon, nullptr);
454 fvhBmonEvtLostCntEvoChan.resize(fuNbChanBmon, nullptr);
456 fvhBmonErrorFractEvoChan.resize(fuNbChanBmon, nullptr);
460
462 uint32_t iNbBinsLog = 0;
464 std::vector<double> dBinsLogVector = GenerateLogBinArray(4, 9, 1, iNbBinsLog);
465 double* dBinsLog = dBinsLogVector.data();
466 // double * dBinsLog = GenerateLogBinArray( 4, 9, 1, iNbBinsLog );
467
468 // clang-format off
469
470 fhBmonCompMapAll = new TH1I("hBmonCompMapAll", "Map of hits on Bmon detector; Comp.; Hits Count []",
471 fuNbOfComps, -0.5, fuNbOfComps - 0.5);
472 fhBmonCompGet4 = new TH2I("hBmonCompGet4", "Map of hits on Bmon detector; Comp.; GET4; Counts []",
473 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5,
474 2*fuNbChanBmon, -0.5, 2*fuNbChanBmon - 0.5);
475 fhBmonGet4Map = new TH1I("hBmonGet4Map", "Map of hits on Bmon detector; GET4; Hits Count []",
476 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5);
477 fhBmonGet4MapEvo = new TH2I("hBmonGet4MapEvo",
478 "Map of hits on Bmon detector vs time in run; GET4; "
479 "Time in run [s]; Hits Count []",
481 fuNbOfComps*80, -0.5, fuNbOfComps*80 - 0.5);
482 fhBmonChannelMapAll = new TH1I("hChannelMapAll", "Map of hits on Bmon detector; Strip; Hits Count []",
483 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
484 fhBmonChannelTotAll = new TH2I("hChannelTotAll", "Tot of hits on Bmon detector per channel; Strip; Tot; Hits Count []",
485 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5, 256, -0.5, 255.5);
486 fhBmonHitMapEvoAll = new TH2I("hBmonHitMapEvoAll",
487 "Map of hits on Bmon detector vs time in run; Chan; "
488 "Time in run [s]; Hits Count []",
489 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5,
491 fhBmonHitTotEvoAll = new TH2I("hBmonHitTotEvoAll",
492 "Evolution of TOT in Bmon detector vs time in run; Time "
493 "in run [s]; TOT [ bin ]; Hits Count []",
494 fuHistoryHistoSize, 0, fuHistoryHistoSize, 256, -0.5, 255.5);
495 fhBmonChanHitMapAll = new TH1D("fhBmonChanHitMapAll", "Map of hits on Bmon detector; Strip; Hits Count []",
496 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
497 fhBmonChanHitMapEvoAll = new TH2I("hBmonChanHitMapEvoAll",
498 "Map of hits on Bmon detector vs time in run; "
499 "Strip; Time in run [s]; Hits Count []",
501
502
503 fhBmonCompMap = new TH1I("hBmonCompMap", "Map of hits on Bmon detector; Comp.; Hits Count []",
504 fuNbOfComps, -0.5, fuNbOfComps - 0.5);
505 fhBmonChannelMap = new TH1I("hChannelMap", "Map of hits on Bmon detector; Strip; Hits Count []",
506 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
507 fhBmonHitMapEvo = new TH2I("hBmonHitMapEvo",
508 "Map of hits on Bmon detector vs time in run; Chan; "
509 "Time in run [s]; Hits Count []",
511 fhBmonHitTotEvo = new TH2I("hBmonHitTotEvo",
512 "Evolution of TOT in Bmon detector vs time in run; Time "
513 "in run [s]; TOT [ bin ]; Hits Count []",
514 fuHistoryHistoSize, 0, fuHistoryHistoSize, 256, -0.5, 255.5);
515 fhBmonChanHitMap = new TH1D("fhBmonChanHitMap", "Map of hits on Bmon detector; Strip; Hits Count []",
516 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5);
517 fhBmonChanHitMapEvo = new TH2I("hBmonChanHitMapEvo",
518 "Map of hits on Bmon detector vs time in run; "
519 "Strip; Time in run [s]; Hits Count []",
521 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
522 fvhBmonCompMapSpill.push_back(
523 new TH1I(Form("hBmonCompMapSpill%02u", uSpill),
524 Form("Map of hits on Bmon detector in current spill %02u; Comp.; Hits Count []", uSpill),
525 fuNbOfComps, -0.5, fuNbOfComps - 0.5));
526 fvhBmonChannelMapSpill.push_back(new TH1I(Form("hBmonChannelMapSpill%02u", uSpill),
527 Form("Map of hits on Bmon detector in current spill %02u; Strip; "
528 "Hits Count []",
529 uSpill),
530 fuNbChanBmon, -0.5, fuNbChanBmon - 0.5));
531 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
532 fhBmonHitsPerSpill = new TH1I("hBmonHitsPerSpill", "Hit count per spill; Spill; Hits Count []", 2000, 0., 2000);
533
534 fhBmonMsgCntEvo = new TH1I("hBmonMsgCntEvo",
535 "Evolution of Hit & error msgs counts vs time in run; "
536 "Time in run [s]; Msgs Count []",
538 fhBmonHitCntEvo = new TH1I("hBmonHitCntEvo",
539 "Evolution of Hit counts vs time in run; Time in run [s]; Hits Count []",
541 fhBmonErrorCntEvo = new TH1I("hBmonErrorCntEvo",
542 "Evolution of Error counts vs time in run; Time in run [s]; Error Count []",
544 fhBmonLostEvtCntEvo = new TH1I("hBmonLostEvtCntEvo",
545 "Evolution of LostEvent counts vs time in run; "
546 "Time in run [s]; LostEvent Count []",
548
549 fhBmonErrorFractEvo = new TProfile("hBmonErrorFractEvo",
550 "Evolution of Error Fraction vs time in run; "
551 "Time in run [s]; Error Fract []",
553 fhBmonLostEvtFractEvo = new TProfile("hBmonLostEvtFractEvo",
554 "Evolution of LostEvent Fraction vs time in "
555 "run; Time in run [s]; LostEvent Fract []",
557
558 fhBmonMsgCntPerMsEvo = new TH2I("hBmonMsgCntPerMsEvo",
559 "Evolution of Hit & error msgs counts, per MS vs time in run; "
560 "Time in run [s]; Hits Count/MS []; MS",
561 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
562 fhBmonHitCntPerMsEvo = new TH2I("hBmonHitCntPerMsEvo",
563 "Evolution of Hit counts, per MS vs time in run; "
564 "Time in run [s]; Hits Count/MS []; MS",
565 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
566 fhBmonErrorCntPerMsEvo = new TH2I("hBmonErrorCntPerMsEvo",
567 "Evolution of Error counts, per MS vs time in "
568 "run; Time in run [s]; Error Count/MS []; MS",
569 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
570 fhBmonLostEvtCntPerMsEvo = new TH2I("hBmonLostEvtCntPerMsEvo",
571 "Evolution of LostEvent, per MS counts vs time in run; Time in "
572 "run [s]; LostEvent Count/MS []; MS",
573 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
574
575 fhBmonErrorFractPerMsEvo = new TH2I("hBmonErrorFractPerMsEvo",
576 "Evolution of Error Fraction, per MS vs time in run; Time in run "
577 "[s]; Error Fract/MS []; MS",
578 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
579 fhBmonLostEvtFractPerMsEvo = new TH2I("hBmonLostEvtFractPerMsEvo",
580 "Evolution of LostEvent Fraction, per MS vs time in run; Time in "
581 "run [s]; LostEvent Fract/MS []; MS",
582 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
583
584 fhBmonChannelMapPulser = new TH1I("fhBmonChannelMapPulser", "Map of pulser hits on Bmon detector; Chan; Hits Count []",
586 fhBmonHitMapEvoPulser = new TH2I("fhBmonHitMapEvoPulser",
587 "Map of hits on Bmon detector vs time in run; "
588 "Chan; Time in run [s]; Hits Count []",
590 // clang-format on
591
593 std::string sFolder = "All";
604
605 sFolder = "NoPulser";
612 sFolder = "Spills";
613 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
614 AddHistoToVector(fvhBmonCompMapSpill[uSpill], sFolder);
616 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
618
619 sFolder = "GlobRates";
624
627
628 sFolder = "GlobRatesMs";
635
636 sFolder = "Pulser";
639
640 /*******************************************************************/
641 sFolder = "RatePerChan";
642 for (UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan) {
643 // clang-format off
644 fvhBmonMsgCntEvoChan[uChan] = new TH1I(Form("hBmonMsgCntEvoChan%02u", uChan),
645 Form("Evolution of Messages counts vs time in run for channel "
646 "%02u; Time in run [s]; Messages Count []",
647 uChan),
649 fvhBmonMsgCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonMsgCntPerMsEvoChan%02u", uChan),
650 Form("Evolution of Hit counts per MS vs time in run for channel "
651 "%02u; Time in run [s]; Hits Count/MS []; MS",
652 uChan),
653 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
654
655 fvhBmonHitCntEvoChan[uChan] = new TH1I(Form("hBmonHitCntEvoChan%02u", uChan),
656 Form("Evolution of Hit counts vs time in run for channel %02u; "
657 "Time in run [s]; Hits Count []",
658 uChan),
660 fvhBmonHitCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonHitCntPerMsEvoChan%02u", uChan),
661 Form("Evolution of Hit counts per MS vs time in run for channel "
662 "%02u; Time in run [s]; Hits Count/MS []; MS",
663 uChan),
664 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
665
666 fvhBmonErrorCntEvoChan[uChan] = new TH1I(Form("hBmonErrorCntEvoChan%02u", uChan),
667 Form("Evolution of Error counts vs time in run for channel "
668 "%02u; Time in run [s]; Error Count []",
669 uChan),
671 fvhBmonErrorCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonErrorCntPerMsEvoChan%02u", uChan),
672 Form("Evolution of Error counts per MS vs time in run for "
673 "channel %02u; Time in run [s]; Error Count/MS []; MS",
674 uChan),
675 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
676
677 fvhBmonEvtLostCntEvoChan[uChan] = new TH1I(Form("hBmonEvtLostCntEvoChan%02u", uChan),
678 Form("Evolution of LostEvent counts vs time in run for channel "
679 "%02u; Time in run [s]; LostEvent Count []",
680 uChan),
682 fvhBmonEvtLostCntPerMsEvoChan[uChan] = new TH2I(Form("hBmonEvtLostCntPerMsEvoChan%02u", uChan),
683 Form("Evolution of LostEvent counts per MS vs time in run for "
684 "channel %02u; Time in run [s]; LostEvent Count/MS []; MS",
685 uChan),
686 fuHistoryHistoSize, 0, fuHistoryHistoSize, iNbBinsLog, dBinsLog);
687
688 fvhBmonErrorFractEvoChan[uChan] = new TProfile(Form("hBmonErrorFractEvoChan%02u", uChan),
689 Form("Evolution of Error Fraction vs time in run for "
690 "channel %02u; Time in run [s]; Error Fract []",
691 uChan),
693 fvhBmonErrorFractPerMsEvoChan[uChan] = new TH2I(Form("hBmonErrorFractPerMsEvoChan%02u", uChan),
694 Form("Evolution of Error Fraction, per MS vs time in run for "
695 "channel %02u; Time in run [s]; Error Fract/MS []; MS",
696 uChan),
697 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
698
699 fvhBmonEvtLostFractEvoChan[uChan] = new TProfile(Form("hBmonEvtLostFractEvoChan%02u", uChan),
700 Form("Evolution of LostEvent Fraction vs time in run for "
701 "channel %02u; Time in run [s]; LostEvent Fract []",
702 uChan),
705 new TH2I(Form("hBmonEvtLostFractPerMsEvoChan%02u", uChan),
706 Form("Evolution of LostEvent Fraction, per MS vs time in run for channel "
707 "%02u; Time in run [s]; LostEvent Fract/MS []; MS",
708 uChan),
709 fuHistoryHistoSize, 0, fuHistoryHistoSize, 1000, 0, 1);
710 // clang-format on
711
713 AddHistoToVector(fvhBmonMsgCntEvoChan[uChan], sFolder);
715 AddHistoToVector(fvhBmonHitCntEvoChan[uChan], sFolder);
725 } // for( UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan )
726
727 return kTRUE;
728}
729
731{
732 for (UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan) {
733 fvhBmonMsgCntEvoChan[uChan]->Reset();
734 fvhBmonMsgCntPerMsEvoChan[uChan]->Reset();
735
736 fvhBmonHitCntEvoChan[uChan]->Reset();
737 fvhBmonHitCntPerMsEvoChan[uChan]->Reset();
738
739 fvhBmonErrorCntEvoChan[uChan]->Reset();
740 fvhBmonErrorCntPerMsEvoChan[uChan]->Reset();
741
742 fvhBmonEvtLostCntEvoChan[uChan]->Reset();
743 fvhBmonEvtLostCntPerMsEvoChan[uChan]->Reset();
744
745 fvhBmonErrorFractEvoChan[uChan]->Reset();
746 fvhBmonErrorFractPerMsEvoChan[uChan]->Reset();
747
748 fvhBmonEvtLostFractEvoChan[uChan]->Reset();
749 fvhBmonEvtLostFractPerMsEvoChan[uChan]->Reset();
750 } // for( UInt_t uChan = 0; uChan < fuNbChanBmon; ++uChan )
751
752 fhBmonCompMap->Reset();
753 fhBmonCompGet4->Reset();
754 fhBmonGet4Map->Reset();
755 fhBmonGet4MapEvo->Reset();
756 fhBmonChannelMapAll->Reset();
757 fhBmonChannelTotAll->Reset();
758 fhBmonHitMapEvoAll->Reset();
759 fhBmonHitTotEvoAll->Reset();
760 fhBmonChanHitMapAll->Reset();
761 fhBmonChanHitMapEvoAll->Reset();
762
763 fhBmonCompMap->Reset();
764 fhBmonCompMap->Reset();
765 fhBmonChannelMap->Reset();
766 fhBmonHitMapEvo->Reset();
767 fhBmonHitTotEvo->Reset();
768 fhBmonChanHitMap->Reset();
769 fhBmonChanHitMapEvo->Reset();
770 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
771 fvhBmonCompMapSpill[uSpill]->Reset();
772 fvhBmonChannelMapSpill[uSpill]->Reset();
773 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
774 fhBmonHitsPerSpill->Reset();
775
776 fhBmonMsgCntEvo->Reset();
777 fhBmonHitCntEvo->Reset();
778 fhBmonErrorCntEvo->Reset();
779
780 fhBmonErrorFractEvo->Reset();
781 fhBmonLostEvtFractEvo->Reset();
782
783 fhBmonMsgCntPerMsEvo->Reset();
784 fhBmonHitCntPerMsEvo->Reset();
785 fhBmonErrorCntPerMsEvo->Reset();
789
790 fhBmonChannelMapPulser->Reset();
791 fhBmonHitMapEvoPulser->Reset();
792
793 if (kTRUE == bResetTime) {
795 fdStartTime = -1.0;
796
799 } // if( kTRUE == bResetTime )
800
801 return kTRUE;
802}
803
805{
806 std::string sFolder = "canvases";
807
808 /*******************************************************************/
810 fcBmonSummary = new TCanvas("cBmonSummary", "Hit maps, Hit rate, Error fraction");
811 fcBmonSummary->Divide(2, 2);
812
813 fcBmonSummary->cd(1);
814 gPad->SetGridx();
815 gPad->SetGridy();
816 gPad->SetLogy();
817 fhBmonChannelMap->Draw();
818
819 fcBmonSummary->cd(2);
820 gPad->SetGridx();
821 gPad->SetGridy();
822 gPad->SetLogz();
823 fhBmonHitMapEvo->Draw("colz");
824
825 fcBmonSummary->cd(3);
826 gPad->SetGridx();
827 gPad->SetGridy();
828 gPad->SetLogy();
829 fhBmonHitCntEvo->Draw();
830
831 fcBmonSummary->cd(4);
832 gPad->SetGridx();
833 gPad->SetGridy();
834 gPad->SetLogz();
835 fhBmonErrorFractEvo->Draw("hist");
836
838 /*******************************************************************/
839
840 /*******************************************************************/
842 fcBmonSummaryMap = new TCanvas("cBmonSummaryMap", "Hit maps, Hit rate, Error fraction");
843 fcBmonSummaryMap->Divide(2, 2);
844
845 fcBmonSummaryMap->cd(1);
846 gPad->SetGridx();
847 gPad->SetGridy();
848 gPad->SetLogy();
849 fhBmonChanHitMap->Draw();
850
851 fcBmonSummaryMap->cd(2);
852 gPad->SetGridx();
853 gPad->SetGridy();
854 gPad->SetLogz();
855 fhBmonChanHitMapEvo->Draw("colz");
856
857 fcBmonSummaryMap->cd(3);
858 gPad->SetGridx();
859 gPad->SetGridy();
860 gPad->SetLogy();
861 fhBmonHitCntEvo->Draw();
862
863 fcBmonSummaryMap->cd(4);
864 gPad->SetGridx();
865 gPad->SetGridy();
866 gPad->SetLogz();
867 fhBmonErrorFractEvo->Draw("hist");
868
870 /*******************************************************************/
871
872 /*******************************************************************/
874 fcBmonHitMaps = new TCanvas("cBmonHitMaps", "Hit maps");
875 fcBmonHitMaps->Divide(2);
876
877 fcBmonHitMaps->cd(1);
878 gPad->SetGridx();
879 gPad->SetGridy();
880 gPad->SetLogy();
881 fhBmonChannelMap->Draw();
882
883 fcBmonHitMaps->cd(2);
884 gPad->SetGridx();
885 gPad->SetGridy();
886 gPad->SetLogz();
887 fhBmonHitMapEvo->Draw("colz");
888
890 /*******************************************************************/
891
892 /*******************************************************************/
895 new TCanvas("cBmonGenCntsPerMs", "Messages and hit cnt per MS, Error and Evt Loss Fract. per MS ");
896 fcBmonGenCntsPerMs->Divide(2, 2);
897
898 fcBmonGenCntsPerMs->cd(1);
899 gPad->SetGridx();
900 gPad->SetGridy();
901 gPad->SetLogy();
902 gPad->SetLogz();
903 fhBmonMsgCntPerMsEvo->Draw("colz");
904
905 fcBmonGenCntsPerMs->cd(2);
906 gPad->SetGridx();
907 gPad->SetGridy();
908 gPad->SetLogy();
909 gPad->SetLogz();
910 fhBmonHitCntPerMsEvo->Draw("colz");
911
912 fcBmonGenCntsPerMs->cd(3);
913 gPad->SetGridx();
914 gPad->SetGridy();
915 gPad->SetLogy();
916 gPad->SetLogz();
917 fhBmonErrorFractPerMsEvo->Draw("colz");
918
919 fcBmonGenCntsPerMs->cd(4);
920 gPad->SetGridx();
921 gPad->SetGridy();
922 gPad->SetLogy();
923 gPad->SetLogz();
924 fhBmonLostEvtFractPerMsEvo->Draw("colz");
925
927 /*******************************************************************/
928
929 /*******************************************************************/
931 fcBmonSpillCounts = new TCanvas("cBmonSpillCounts", "Counts per spill, last 5 spills including current one");
933
934 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
935 fcBmonSpillCounts->cd(1 + uSpill);
936 gPad->SetGridx();
937 gPad->SetGridy();
938 gPad->SetLogy();
939 // fvhChannelMapSpill[ uSpill ]->SetStats( kTRUE );
940 fvhBmonChannelMapSpill[uSpill]->Draw();
941 gPad->Update();
942 TPaveStats* st = (TPaveStats*) fvhBmonChannelMapSpill[uSpill]->FindObject("stats");
943 st->SetOptStat(10);
944 st->SetX1NDC(0.25);
945 st->SetX2NDC(0.95);
946 st->SetY1NDC(0.90);
947 st->SetY2NDC(0.95);
948 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
949
951 /*******************************************************************/
952
953 /*******************************************************************/
955 fcBmonSpillCountsHori = new TCanvas("cBmonSpillCountsHori", "Counts per spill, last 5 spills including current one");
957
958 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
959 fcBmonSpillCountsHori->cd(1 + uSpill);
960 gPad->SetGridx();
961 gPad->SetGridy();
962 gPad->SetLogy();
963 fvhBmonChannelMapSpill[uSpill]->Draw();
964 gPad->Update();
965 TPaveStats* st = (TPaveStats*) fvhBmonChannelMapSpill[uSpill]->FindObject("stats");
966 st->SetOptStat(110);
967 st->SetX1NDC(0.25);
968 st->SetX2NDC(0.95);
969 st->SetY1NDC(0.90);
970 st->SetY2NDC(0.95);
971 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
972
974 /*******************************************************************/
975
976 /*******************************************************************/
979 new TCanvas("cBmonSpillCompCountsHori", "Counts in Comp. per spill, last 5 spills including current one");
981
982 for (UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill++) {
983 fcBmonSpillCompCountsHori->cd(1 + uSpill);
984 gPad->SetGridx();
985 gPad->SetGridy();
986 gPad->SetLogy();
987 fvhBmonCompMapSpill[uSpill]->Draw();
988 gPad->Update();
989 TPaveStats* st = (TPaveStats*) fvhBmonCompMapSpill[uSpill]->FindObject("stats");
990 st->SetOptStat(110);
991 st->SetX1NDC(0.25);
992 st->SetX2NDC(0.95);
993 st->SetY1NDC(0.90);
994 st->SetY2NDC(0.95);
995 } // for( UInt_t uSpill = 0; uSpill < kuNbSpillPlots; uSpill ++)
996
998 /*******************************************************************/
999}
1000// -------------------------------------------------------------------------
1001
1002
1003// -------------------------------------------------------------------------
1005{
1007 uint32_t uNbBinsLog = 0;
1009 std::vector<double> dBinsLogVector = GenerateLogBinArray(6, 9, 10, uNbBinsLog, 1, true);
1010 double* dBinsLog = dBinsLogVector.data();
1011
1012 uint32_t uNbBinsLogFract = 0;
1013 std::vector<double> dBinsLogVectorFract = GenerateLogBinArray(6, 9, 10, uNbBinsLogFract, -6, true);
1014 double* dBinsLogFract = dBinsLogVectorFract.data();
1015
1017 fArrHitCounts = std::make_unique<double[]>(fuBmonMicrospillsNbBinsTs);
1018 fArrErrCounts = std::make_unique<double[]>(fuBmonMicrospillsNbBinsTs);
1019
1020 // clang-format off
1021 // ==> Only internal, not for users
1022 fhBmonMicrospillsDistHits = new TH1I("hBmonMicrospillsDistHits", "Hits per 10 us; Time in spill [us]; Hits nb []",
1024 // ==> Only internal, not for users
1025 fhBmonMicrospillsDistErrs = new TH1I("hBmonMicrospillsDistErrs", "Erros per 10 us; Time in spill [us]; Errors nb []",
1027
1028 fhBmonMicrospillsTsBinCntHits = new TH2I("hBmonMicrospillsTsBinCntHits",
1029 "Nb 10 us bins with hit count per TS; TS []; Hits nb. []; 10 us bins []",
1030 1000, -0.5, 999.5,
1031 uNbBinsLog, dBinsLog);
1032 fhBmonMicrospillsTsBinCntErrs = new TH2I("hBmonMicrospillsTsBinCntErrs",
1033 "Nb 10 us bins with error count per TS; TS []; Errors nb. []; 10 us bins []",
1034 1000, -0.5, 999.5,
1035 uNbBinsLog, dBinsLog);
1036
1037 fhBmonMicrospillsTsMeanHits = new TH1I("hBmonMicrospillsTsMeanHits",
1038 "Mean nb hits per 10 us per TS; TS []; Hits nb. []",
1039 1000, -0.5, 999.5);
1040 fhBmonMicrospillsTsMeanErrs = new TH1I("hBmonMicrospillsTsMeanErrs",
1041 "Mean nb error per 10 us per TS; TS []; Errors nb. []",
1042 1000, -0.5, 999.5);
1043
1044
1045 fhBmonMicrospillsTsMedianHits = new TH1I("hBmonMicrospillsTsMedianHits",
1046 "Median nb hits per 10 us per TS; TS []; Hits nb. []",
1047 1000, -0.5, 999.5);
1048 fhBmonMicrospillsTsMedianErrs = new TH1I("hBmonMicrospillsTsMedianErrs",
1049 "Median nb error per 10 us per TS; TS []; Errors nb. []",
1050 1000, -0.5, 999.5);
1051
1052 fhBmonMicrospillsTsBinRatioHits = new TH2I("hBmonMicrospillsTsBinRatioHits",
1053 "Nb 10us bins with hit ratio to mean per TS; TS []; Ratio; 10 us bins []",
1054 1000, -0.5, 999.5,
1055 1000, -0.5, 499.5);
1056 fhBmonMicrospillsTsBinRatioErrs = new TH2I("hBmonMicrospillsTsBinRatioErrs",
1057 "Nb 10us bins with error ratio to mean per TS; TS []; Ratio; 10 us bins []",
1058 1000, -0.5, 999.5,
1059 1000, -0.5, 499.5);
1060
1061 fhBmonMicrospillsTsBinFractHits = new TH2I("hBmonMicrospillsTsBinFractHits",
1062 "Nb 10 us bins with hit fract. per TS; TS []; Fraction; 10 us bins []",
1063 1000, -0.5, 999.5,
1064 uNbBinsLogFract, dBinsLogFract);
1065 fhBmonMicrospillsTsBinFractErrs = new TH2I("hBmonMicrospillsTsBinFractErrs",
1066 "Nb 10 us bins with error count per TS; TS []; Fraction; 10 us bins []",
1067 1000, -0.5, 999.5,
1068 uNbBinsLogFract, dBinsLogFract);
1069 // clang-format on
1070
1072 std::string sFolder = "Microspills";
1073 // AddHistoToVector(fhBmonMicrospillsDistHits, sFolder);
1074 // AddHistoToVector(fhBmonMicrospillsDistErrs, sFolder);
1075
1078
1081
1084
1087
1090
1091 return kTRUE;
1092}
1093
1109
1111{
1112 std::string sFolder = "canvases";
1113
1114 /*******************************************************************/
1116 fcBmonMicrospillsBinCnts = new TCanvas("BmonMicrospillsBinCnts", "Nb 10 us bins with hit/err counts per TS");
1117 fcBmonMicrospillsBinCnts->Divide(2);
1118
1120 gPad->SetGridx();
1121 gPad->SetGridy();
1122 gPad->SetLogy();
1123 gPad->SetLogz();
1124 fhBmonMicrospillsTsBinCntHits->Draw("colz");
1125 fhBmonMicrospillsTsMeanHits->SetLineColor(kRed);
1126 fhBmonMicrospillsTsMeanHits->Draw("HIST same");
1127 fhBmonMicrospillsTsMedianHits->SetLineColor(kBlack);
1128 fhBmonMicrospillsTsMedianHits->Draw("HIST same");
1129
1131 gPad->SetGridx();
1132 gPad->SetGridy();
1133 gPad->SetLogy();
1134 gPad->SetLogz();
1135 fhBmonMicrospillsTsBinCntErrs->Draw("colz");
1136 fhBmonMicrospillsTsMeanErrs->SetLineColor(kRed);
1137 fhBmonMicrospillsTsMeanErrs->Draw("HIST same");
1138 fhBmonMicrospillsTsMedianErrs->SetLineColor(kBlack);
1139 fhBmonMicrospillsTsMedianErrs->Draw("HIST same");
1140
1142 /*******************************************************************/
1143
1144 /*******************************************************************/
1147 new TCanvas("BmonMicrospillsFraction", "Nb 10 us bins with fraction of hit/err counts per TS/Total count per TS");
1148 fcBmonMicrospillsFraction->Divide(2);
1149
1151 gPad->SetGridx();
1152 gPad->SetGridy();
1153 gPad->SetLogy();
1154 gPad->SetLogz();
1155 fhBmonMicrospillsTsBinFractHits->Draw("colz");
1156
1158 gPad->SetGridx();
1159 gPad->SetGridy();
1160 gPad->SetLogy();
1161 gPad->SetLogz();
1162 fhBmonMicrospillsTsBinFractErrs->Draw("colz");
1163
1165 /*******************************************************************/
1166
1167 /*******************************************************************/
1170 new TCanvas("BmonMicrospillsRatios", "Nb 10 us bins with ratio of hit/err counts per mean count per TS/bin");
1171 fcBmonMicrospillsRatios->Divide(2);
1172
1174 gPad->SetGridx();
1175 gPad->SetGridy();
1176 gPad->SetLogz();
1177 fhBmonMicrospillsTsBinRatioHits->Draw("colz");
1178
1180 gPad->SetGridx();
1181 gPad->SetGridy();
1182 gPad->SetLogz();
1183 fhBmonMicrospillsTsBinRatioErrs->Draw("colz");
1184
1186 /*******************************************************************/
1187}
1188// -------------------------------------------------------------------------
1189
1190// -------------------------------------------------------------------------
1191void CbmTofUnpackMonitor::FillHitMonitoringHistos(const double_t& dMsTime, const uint32_t& uCurrCompIdx,
1192 const uint32_t& uGet4Id, const uint32_t& uRawCh,
1193 const uint32_t& uRemapCh, const uint32_t& uTot)
1194{
1195 if (-1 == fdStartTime) {
1197 fdStartTime = dMsTime;
1198 }
1199
1200 if (!fBmonMicroSpillMode) {
1202 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1203 fhGet4MessType->Fill(uGet4InSys, 0);
1205 fvhCompGet4MessType[uCurrCompIdx]->Fill(uGet4Id, 0);
1207 fvhCompRawChCount[uCurrCompIdx]->Fill(uRawCh);
1208 fvhCompRawChRate[uCurrCompIdx]->Fill(dMsTime - fdStartTime, uRawCh);
1209 fvhCompRawChTot[uCurrCompIdx]->Fill(uRawCh, uTot);
1211 fvhCompRemapChCount[uCurrCompIdx]->Fill(uRemapCh);
1212 fvhCompRemapChRate[uCurrCompIdx]->Fill(dMsTime - fdStartTime, uRemapCh);
1213 fvhCompRemapChTot[uCurrCompIdx]->Fill(uRemapCh, uTot);
1214 }
1215}
1216void CbmTofUnpackMonitor::FillEpochMonitoringHistos(const uint32_t& uCurrCompIdx, const uint32_t& uGet4Id,
1217 const bool& bSyncFlag, // mess.getGdpbEpSync
1218 const bool& bDataLoss, // mess.getGdpbEpDataLoss()
1219 const bool& bEpochLoss, // mess.getGdpbEpEpochLoss()
1220 const bool& bMissmMatch // mess.getGdpbEpMissmatch()
1221)
1222{
1223 if (!fBmonMicroSpillMode) {
1225 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1226 fhGet4MessType->Fill(uGet4InSys, 1);
1227 if (bSyncFlag) fhGet4EpochFlags->Fill(uGet4InSys, 0);
1228 if (bDataLoss) fhGet4EpochFlags->Fill(uGet4InSys, 1);
1229 if (bEpochLoss) fhGet4EpochFlags->Fill(uGet4InSys, 2);
1230 if (bMissmMatch) fhGet4EpochFlags->Fill(uGet4InSys, 3);
1232 fvhCompGet4MessType[uCurrCompIdx]->Fill(uGet4Id, 1);
1233 }
1234}
1235void CbmTofUnpackMonitor::FillScmMonitoringHistos(const uint32_t& uCurrCompIdx, const uint32_t& uGet4Id,
1236 const uint32_t& uCh, // mess.getGdpbSlcChan()
1237 const uint32_t& uEdge, // mess.getGdpbSlcEdge()
1238 const uint32_t& uType // mess.getGdpbSlcType()
1239)
1240{
1241 if (!fBmonMicroSpillMode) {
1243 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1244 fhGet4MessType->Fill(uGet4InSys, 2);
1245
1247 fvhCompGet4MessType[uCurrCompIdx]->Fill(uGet4Id, 2);
1248 double_t uChInComp = uCh + 0.5 * uEdge + uGet4Id * fuNbOfChannelsPerGet4;
1249 if (uType == critof001::GET4_32B_SLC_START_SEU && 0 == uEdge) {
1251 fhGet4ScmType->Fill(uGet4InSys, uType + 1);
1252 fvhCompGet4ChScm[uCurrCompIdx]->Fill(uChInComp, uType + 1);
1253 } // if (uType == critof001::GET4_32B_SLC_START_SEU && 0 == uEdge)
1254 else {
1255 fhGet4ScmType->Fill(uGet4InSys, uType);
1256 fvhCompGet4ChScm[uCurrCompIdx]->Fill(uChInComp, uType);
1257 } // else of if (uType == critof001::GET4_32B_SLC_START_SEU && 0 == uEdge)
1258 }
1259}
1260void CbmTofUnpackMonitor::FillSysMonitoringHistos(const uint32_t& uCurrCompIdx, const uint32_t& uGet4Id,
1261 const uint32_t& uType // mess.getGdpbSysSubType()
1262)
1263{
1264 if (!fBmonMicroSpillMode) {
1266 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1267 fhGet4SysMessType->Fill(uGet4InSys, uType);
1268 }
1269}
1270void CbmTofUnpackMonitor::FillErrMonitoringHistos(const uint32_t& uCurrCompIdx, const uint32_t& uGet4Id,
1271 const uint32_t& uCh, // mess.getGdpbSysErrChanId()
1272 const uint32_t& uType // mess.getGdpbSysErrData()
1273)
1274{
1275 if (!fBmonMicroSpillMode) {
1277 uint32_t uGet4InSys = uGet4Id + uCurrCompIdx * fuNbOfGet4PerComp;
1278 fhGet4MessType->Fill(uGet4InSys, 3);
1280 fvhCompGet4MessType[uCurrCompIdx]->Fill(uGet4Id, 3);
1281
1282 uint32_t uChInComp = uCh + uGet4Id * fuNbOfChannelsPerGet4;
1283 switch (uType) {
1285 fhGet4ErrorsType->Fill(uGet4InSys, 0);
1286 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 0);
1287 break;
1288 } // case critof001::GET4_V2X_ERR_READ_INIT:
1290 fhGet4ErrorsType->Fill(uGet4InSys, 1);
1291 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 1);
1292 break;
1293 } // case critof001::GET4_V2X_ERR_SYNC:
1295 fhGet4ErrorsType->Fill(uGet4InSys, 2);
1296 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 2);
1297 break;
1298 } // case critof001::GET4_V2X_ERR_EP_CNT_SYNC:
1300 fhGet4ErrorsType->Fill(uGet4InSys, 3);
1301 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 3);
1302 break;
1303 } // case critof001::GET4_V2X_ERR_EP:
1305 fhGet4ErrorsType->Fill(uGet4InSys, 4);
1306 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 4);
1307 break;
1308 } // case critof001::GET4_V2X_ERR_FIFO_WRITE:
1310 fhGet4ErrorsType->Fill(uGet4InSys, 5);
1311 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 5);
1312 break;
1313 } // case critof001::GET4_V2X_ERR_LOST_EVT:
1315 fhGet4ErrorsType->Fill(uGet4InSys, 6);
1316 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 6);
1317 break;
1318 } // case critof001::GET4_V2X_ERR_CHAN_STATE:
1320 fhGet4ErrorsType->Fill(uGet4InSys, 7);
1321 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 7);
1322 break;
1323 } // case critof001::GET4_V2X_ERR_TOK_RING_ST:
1325 fhGet4ErrorsType->Fill(uGet4InSys, 8);
1326 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 8);
1327 break;
1328 } // case critof001::GET4_V2X_ERR_TOKEN:
1330 fhGet4ErrorsType->Fill(uGet4InSys, 9);
1331 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 9);
1332 break;
1333 } // case critof001::GET4_V2X_ERR_READOUT_ERR:
1335 fhGet4ErrorsType->Fill(uGet4InSys, 10);
1336 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 10);
1337 break;
1338 } // case critof001::GET4_V2X_ERR_SPI:
1340 fhGet4ErrorsType->Fill(uGet4InSys, 11);
1341 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 11);
1342 break;
1343 } // case critof001::GET4_V2X_ERR_DLL_LOCK:
1345 fhGet4ErrorsType->Fill(uGet4InSys, 12);
1346 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 12);
1347 break;
1348 } // case critof001::GET4_V2X_ERR_DLL_RESET:
1350 fhGet4ErrorsType->Fill(uGet4InSys, 13);
1351 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 13);
1352 break;
1353 } // case critof001::GET4_V2X_ERR_TOT_OVERWRT:
1355 fhGet4ErrorsType->Fill(uGet4InSys, 14);
1356 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 14);
1357 break;
1358 } // case critof001::GET4_V2X_ERR_TOT_RANGE:
1360 fhGet4ErrorsType->Fill(uGet4InSys, 15);
1361 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 15);
1362 break;
1363 } // case critof001::GET4_V2X_ERR_EVT_DISCARD:
1365 fhGet4ErrorsType->Fill(uGet4InSys, 16);
1366 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 16);
1367 break;
1368 } // case critof001::GET4_V2X_ERR_ADD_RIS_EDG:
1370 fhGet4ErrorsType->Fill(uGet4InSys, 17);
1371 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 17);
1372 break;
1373 } // case critof001::GET4_V2X_ERR_UNPAIR_FALL:
1375 fhGet4ErrorsType->Fill(uGet4InSys, 18);
1376 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 18);
1377 break;
1378 } // case critof001::GET4_V2X_ERR_SEQUENCE_ER:
1380 fhGet4ErrorsType->Fill(uGet4InSys, 19);
1381 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 19);
1382 break;
1383 } // case critof001::GET4_V2X_ERR_EPOCH_OVERF:
1385 fhGet4ErrorsType->Fill(uGet4InSys, 20);
1386 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 20);
1387 break;
1388 } // case critof001::GET4_V2X_ERR_UNKNOWN:
1389 default: // Corrupt error or not yet supported error
1390 {
1391 fhGet4ErrorsType->Fill(uGet4InSys, 21);
1392 fvhCompGet4ChErrors[uCurrCompIdx]->Fill(uChInComp, 21);
1393 break;
1394 } //
1395 } // Switch( mess.getGdpbSysErrData() )
1396 }
1397}
1398
1399
1400// -------------------------------------------------------------------------
1402{
1403 if (-1 == fdStartTime) {
1405 fdStartTime = dMsTime;
1406 }
1407
1408 if (!fBmonMicroSpillMode) {
1411 if (fdSpillCheckInterval < dMsTime - fdBmonLastInterTime) {
1415 fbSpillOn = kFALSE;
1418 fdStartTimeSpill = dMsTime;
1421 } // if( fbSpillOn && fuCountsLastInter < fuOffSpillCountLimit && same for non pulser)
1423 fbSpillOn = kTRUE;
1424 }
1425
1426 // LOG(debug) << Form("%6llu %6.4f %9u %9u %2d", fulCurrentTsIdx, dMsTime - fdLastInterTime, fuBmonCountsLastInter,
1427 // fuBmonNonPulserCountsLastInter, fuCurrentSpillIdx);
1428
1431 fdBmonLastInterTime = dMsTime;
1432 } // if( fdSpillCheckInterval < dMsTime - fdLastInterTime )
1433 }
1434}
1435void CbmTofUnpackMonitor::FillHitBmonMonitoringHistos(const double_t& dMsTime, const uint32_t& uCurrCompIdx,
1436 const uint32_t& uGet4Id, const uint32_t& uTot)
1437{
1438 if (-1 == fdStartTime) {
1440 fdStartTime = dMsTime;
1441 }
1442 if (!fBmonMicroSpillMode) {
1445 UInt_t uChannelBmon = (uGet4Id / 8) + 4 * uCurrCompIdx;
1446
1447 fhBmonGet4Map->Fill(uGet4Id + 80 * uCurrCompIdx);
1448 fhBmonGet4MapEvo->Fill(dMsTime - fdStartTime, uGet4Id + 80 * uCurrCompIdx);
1449 fhBmonCompGet4->Fill(uGet4Id + 80 * uCurrCompIdx, uChannelBmon);
1450 if (fuNbChanBmon <= uChannelBmon) return;
1451
1452 fhBmonCompMapAll->Fill(uCurrCompIdx);
1453 fhBmonChannelMapAll->Fill(uChannelBmon);
1454 fhBmonChannelTotAll->Fill(uChannelBmon, uTot);
1455 fhBmonHitMapEvoAll->Fill(uChannelBmon, dMsTime - fdStartTime);
1456 fhBmonHitTotEvoAll->Fill(dMsTime - fdStartTime, uTot);
1457 fhBmonChanHitMapAll->Fill(fuBmonChanMap[uChannelBmon]);
1458 fhBmonChanHitMapEvoAll->Fill(fuBmonChanMap[uChannelBmon], dMsTime - fdStartTime);
1459
1462
1463 fhBmonErrorFractEvo->Fill(dMsTime - fdStartTime, 0.0);
1464 fhBmonLostEvtFractEvo->Fill(dMsTime - fdStartTime, 0.0);
1465 fvhBmonErrorFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 0.0);
1466 fvhBmonEvtLostFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 0.0);
1467
1468 fhBmonMsgCntEvo->Fill(dMsTime - fdStartTime);
1469 fhBmonHitCntEvo->Fill(dMsTime - fdStartTime);
1470
1471 fvhBmonHitCntEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime);
1472
1473 fvuBmonHitCntChanMs[uChannelBmon]++;
1474
1477 if ((0 == uGet4Id / 8) && (fuMinTotPulser <= uTot) && (uTot <= fuMaxTotPulser)) {
1478 fhBmonChannelMapPulser->Fill(uChannelBmon);
1479 fhBmonHitMapEvoPulser->Fill(uChannelBmon, dMsTime - fdStartTime);
1480 } // if ( (0 == uGet4Id / 8) && (fuMinTotPulser <= uTot) && (uTot <= fuMaxTotPulser) )
1481 else {
1483
1484 fhBmonCompMap->Fill(uCurrCompIdx);
1485 fhBmonChannelMap->Fill(uChannelBmon);
1486 fhBmonHitMapEvo->Fill(uChannelBmon, dMsTime - fdStartTime);
1487 fhBmonHitTotEvo->Fill(dMsTime - fdStartTime, uTot);
1488 fhBmonChanHitMap->Fill(fuBmonChanMap[uChannelBmon]);
1489 fhBmonChanHitMapEvo->Fill(fuBmonChanMap[uChannelBmon], dMsTime - fdStartTime);
1490
1491 fvhBmonCompMapSpill[fuCurrentSpillPlot]->Fill(uCurrCompIdx);
1494 } // else of if ( (0 == uGet4Id / 8) && (fuMinTotPulser <= uTot) && (uTot <= fuMaxTotPulser) )
1495 }
1496}
1497
1498void CbmTofUnpackMonitor::FillErrBmonMonitoringHistos(const double_t& dMsTime, const uint32_t& uCurrCompIdx,
1499 const uint32_t& uGet4Id, const bool& bErrEvtLost)
1500{
1501 if (-1 == fdStartTime) {
1503 fdStartTime = dMsTime;
1504 }
1505 if (fBmonMicroSpillMode) { //
1506 fhBmonMicrospillsDistErrs->Fill((dMsTime - fdStartTime) * 1e6);
1507 }
1508 else {
1512 UInt_t uChannelBmon = (uGet4Id / 8) + 4 * uCurrCompIdx;
1513
1514 fhBmonErrorFractEvo->Fill(dMsTime - fdStartTime, 0.0);
1515 fhBmonLostEvtFractEvo->Fill(dMsTime - fdStartTime, 0.0);
1516 fvhBmonErrorFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 0.0);
1517 fvhBmonEvtLostFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 0.0);
1518
1519 fhBmonMsgCntEvo->Fill(dMsTime - fdStartTime);
1520 fhBmonErrorCntEvo->Fill(dMsTime - fdStartTime);
1521 fhBmonErrorFractEvo->Fill(dMsTime - fdStartTime, 1.0);
1522
1523 fvhBmonErrorCntEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime);
1524 fvhBmonErrorFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 1.0);
1525
1526 fvuBmonErrorCntChanMs[uChannelBmon]++;
1527 if (bErrEvtLost) {
1528 fhBmonLostEvtCntEvo->Fill(dMsTime - fdStartTime);
1529 fhBmonLostEvtFractEvo->Fill(dMsTime - fdStartTime, 1.0);
1530
1531 fvhBmonEvtLostCntEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime);
1532 fvhBmonEvtLostFractEvoChan[uChannelBmon]->Fill(dMsTime - fdStartTime, 1.0);
1533
1534 fvuBmonEvtLostCntChanMs[uChannelBmon]++;
1535 } // if( gdpbv100::GET4_V2X_ERR_LOST_EVT == mess.getGdpbSysErrData() )
1536 }
1537}
1538// -------------------------------------------------------------------------
1539
1540// -------------------------------------------------------------------------
1542{
1543
1544 if (-1 == fdStartTime) {
1546 fdStartTime = dTime * 1e-9;
1547 }
1548 if (fBmonMicroSpillMode) {
1549 fhBmonMicrospillsDistHits->Fill(dTime / 1e3);
1550 }
1551}
1552
1554{
1555 if (fBmonMicroSpillMode) {
1556 uint32_t uNbHitsTs = fhBmonMicrospillsDistHits->GetEntries();
1557 uint32_t uNbErrsTs = fhBmonMicrospillsDistErrs->GetEntries();
1558 double dMeanHitsBin = static_cast<double>(uNbHitsTs) / fuBmonMicrospillsNbBinsTs;
1559 double dMeanErrsBin = static_cast<double>(uNbErrsTs) / fuBmonMicrospillsNbBinsTs;
1562
1563 for (uint32_t uBin = 0; uBin < fuBmonMicrospillsNbBinsTs; ++uBin) {
1564 double dNbHitsInBin = fhBmonMicrospillsDistHits->GetBinContent(uBin + 1);
1565 double dNbErrsInBin = fhBmonMicrospillsDistErrs->GetBinContent(uBin + 1);
1566
1567 fArrHitCounts[uBin] = dNbHitsInBin;
1568 fArrErrCounts[uBin] = dNbErrsInBin;
1569
1572
1573 fhBmonMicrospillsTsBinRatioHits->Fill(fuNbTsMicrospills, dNbHitsInBin / dMeanHitsBin);
1574 fhBmonMicrospillsTsBinRatioErrs->Fill(fuNbTsMicrospills, dNbErrsInBin / dMeanErrsBin);
1575
1576 fhBmonMicrospillsTsBinFractHits->Fill(fuNbTsMicrospills, dNbHitsInBin / uNbHitsTs);
1577 fhBmonMicrospillsTsBinFractErrs->Fill(fuNbTsMicrospills, dNbErrsInBin / uNbErrsTs);
1578 }
1580 TMath::Median(fuBmonMicrospillsNbBinsTs, fArrHitCounts.get()));
1582 TMath::Median(fuBmonMicrospillsNbBinsTs, fArrErrCounts.get()));
1583
1586 fdStartTime = -1; // Make sure Error times are still set in "Time in TS", not compatible w/ standard moni histos!
1587
1589 }
1590}
1591// -------------------------------------------------------------------------
1592
1593// ---- Init ----
1595{
1596 // Get Infos from the parset
1597 fUnpackPar = parset;
1598
1601 // FIXME: Start using again the parameter class accessors once a new CRI oriented class is brought into use
1602 fuNbOfGet4PerComp = 80;
1606
1608 TFile* oldFile = gFile;
1609 TDirectory* oldDir = gDirectory;
1610 gROOT->cd();
1611
1613 if (fBmonMicroSpillMode) {
1616 }
1617 else {
1619 DrawCanvases();
1620 if (fBmonMode) {
1623 }
1624 }
1625
1627 gFile = oldFile;
1628 gDirectory = oldDir;
1629
1631 std::vector<std::pair<TNamed*, std::string>> vHistos = GetHistoVector();
1632
1634 std::vector<std::pair<TCanvas*, std::string>> vCanvases = GetCanvasVector();
1635
1637 std::string sSystem = "tof";
1639 //
1640 sSystem = "bmon";
1641 }
1642
1643 if (fbInternalHttp) {
1644 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
1645 if (nullptr != server) {
1646 for (UInt_t uCanvas = 0; uCanvas < vCanvases.size(); ++uCanvas) {
1647 server->Register(Form("/%s/%s", sSystem.data(), vCanvases[uCanvas].second.data()), vCanvases[uCanvas].first);
1648 }
1649 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
1650 server->Register(Form("/%s/%s", sSystem.data(), vHistos[uHisto].second.data()), vHistos[uHisto].first);
1651 }
1652 /*
1653 server->RegisterCommand(Form("/Reset_%s_Hist", sSystem.data()), "bMcbm2018UnpackerTaskStsResetHistos=kTRUE");
1654 server->Restrict("/Reset_UnpSts_Hist", "allow=admin");
1655 */
1656 }
1657 }
1658
1659 return kTRUE;
1660}
1661
1662// ---- Finish ----
1664{
1666 std::vector<std::pair<TNamed*, std::string>> vHistos = GetHistoVector();
1667
1669 std::vector<std::pair<TCanvas*, std::string>> vCanvases = GetCanvasVector();
1670
1672 TFile* oldFile = gFile;
1673 TDirectory* oldDir = gDirectory;
1674 TFile* histoFile = nullptr;
1675
1676 // open separate histo file in recreate mode
1677 histoFile = new TFile(fHistoFileName, "RECREATE");
1678 histoFile->cd();
1679
1681 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
1683 TString sFolder = vHistos[uHisto].second.data();
1684 if (nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
1685 gDirectory->cd(sFolder);
1686
1688 vHistos[uHisto].first->Write();
1689
1690 histoFile->cd();
1691 }
1692
1694 for (UInt_t uCanvas = 0; uCanvas < vCanvases.size(); ++uCanvas) {
1696 TString sFolder = vCanvases[uCanvas].second.data();
1697 if (nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
1698 gDirectory->cd(sFolder);
1699
1701 vCanvases[uCanvas].first->Write();
1702
1703 histoFile->cd();
1704 }
1705
1707 gFile = oldFile;
1708 gDirectory = oldDir;
1709
1710 histoFile->Close();
1711 delete histoFile;
1712
1714 for (auto iter = fvpAllHistoPointers.begin(); iter != fvpAllHistoPointers.end();) {
1715 if (iter->first != nullptr) {
1716 delete iter->first;
1717 }
1718 iter = fvpAllHistoPointers.erase(iter);
1719 }
1720 for (auto iter = fvpAllCanvasPointers.begin(); iter != fvpAllCanvasPointers.end();) {
1721 if (iter->first != nullptr) {
1722 delete iter->first;
1723 }
1724 iter = fvpAllCanvasPointers.erase(iter);
1725 }
1726}
1727
1728
ClassImp(CbmConverterManager)
std::vector< double > GenerateLogBinArray(uint32_t uNbDecadesLog, uint32_t uNbStepsDecade, uint32_t uNbSubStepsInStep, uint32_t &uNbBinsLog, int32_t iStartExp, bool bAddZeroStart)
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
std::vector< TH1 * > fvhBmonEvtLostCntEvoChan
Bool_t ResetMsComponentSizeHistos(UInt_t component)
static const UInt_t kuNbChanBmon
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< TH1 * > fvhBmonHitCntEvoChan
std::vector< TH1 * > fvhCompRemapChCount
---> Per remapped (PADI) channel in Component
void FillSysMonitoringHistos(const uint32_t &uCurrCompIdx, const uint32_t &uGet4Id, const uint32_t &uType)
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.
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
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< 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
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
void FillHitBmonMicroSpillHistos(const double_t &dTime)
Fill BMon Microspill histograms.
std::vector< TH2 * > fvhBmonErrorFractPerMsEvoChan
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.
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
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
UInt_t fuNbOfChannelsPerGet4
Max number of Get4 per component.
void Finish()
Write all histograms and canvases to file.
UInt_t fuNbOfGet4InSyst
Number of channels per Component, recalculated.
std::vector< UInt_t > fvuBmonHitCntChanMs
double_t fdBmonMicrospillsTsLengthSec
BMon micro-spills monitoring histograms.
@ 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