CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MonitorTofPulser.cxx
Go to the documentation of this file.
1/* Copyright (C) 2018-2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmMcbm2018MonitorTofPulser -----
8// ----- Created 10.07.2018 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
13
16#include "CbmHistManager.h"
17#include "CbmMcbm2018TofPar.h"
18
19#include "FairRootManager.h"
20#include "FairRun.h"
21#include "FairRunOnline.h"
22#include "FairRuntimeDb.h"
23#include <Logger.h>
24
25#include "Rtypes.h"
26#include "TCanvas.h"
27#include "TClonesArray.h"
28#include "TF1.h"
29#include "TH1.h"
30#include "TH2.h"
31#include "THStack.h"
32#include "THttpServer.h"
33#include "TMath.h"
34#include "TPaveStats.h"
35#include "TProfile.h"
36#include "TProfile2D.h"
37#include "TROOT.h"
38#include "TString.h"
39#include "TStyle.h"
40#include <TFile.h>
41
42#include <algorithm>
43#include <ctime>
44#include <iomanip>
45#include <iostream>
46
47#include <stdint.h>
48
56
59 , fvMsComponentsList()
60 , fuNbCoreMsPerTs(0)
61 , fuNbOverMsPerTs(0)
62 , fbIgnoreOverlapMs(kFALSE)
63 , fsHistoFileFullname("data/TofPulserHistos.root")
64 , fuMsAcceptsPercent(100)
65 , fuTotalMsNb(0)
66 , fuOverlapMsNb(0)
67 , fuCoreMs(0)
68 , fdMsSizeInNs(0.0)
69 , fdTsCoreSizeInNs(0.0)
70 , fuMinNbGdpb(0)
71 , fuCurrNbGdpb(0)
72 , fUnpackPar()
73 , fuNrOfGdpbs(0)
74 , fuNrOfFeePerGdpb(0)
75 , fuNrOfGet4PerFee(0)
76 , fuNrOfChannelsPerGet4(0)
77 , fuNrOfChannelsPerFee(0)
78 , fuNrOfGet4(0)
79 , fuNrOfGet4PerGdpb(0)
80 , fuNrOfChannelsPerGdpb(0)
81 , fuRawDataPrintMsgNb(100000)
82 , fuRawDataPrintMsgIdx(fuRawDataPrintMsgNb)
83 , fbPrintAllHitsEnable(kFALSE)
84 , fbPrintAllEpochsEnable(kFALSE)
85 , fbOldFwData(kFALSE)
86 , fuDiamondDpbIdx(10000)
87 , // Crazy default value => should never make troubles given the price
88 fulCurrentTsIndex(0)
89 , fuCurrentMs(0)
90 , fuCurrentMsSysId(0)
91 , fdMsIndex(0)
92 , fuGdpbId(0)
93 , fuGdpbNr(0)
94 , fuGet4Id(0)
95 , fuGet4Nr(0)
96 , fiEquipmentId(0)
97 , fviMsgCounter(11, 0)
98 , // length of enum MessageTypes initialized with 0
99 fvulGdpbTsMsb()
100 , fvulGdpbTsLsb()
101 , fvulStarTsMsb()
102 , fvulStarTsMid()
103 , fvulGdpbTsFullLast()
104 , fvulStarTsFullLast()
105 , fvuStarTokenLast()
106 , fvuStarDaqCmdLast()
107 , fvuStarTrigCmdLast()
108 , fvulCurrentEpoch()
109 , fvbFirstEpochSeen()
110 , fvulCurrentEpochCycle()
111 , fvulCurrentEpochFull()
112 , fulCurrentEpochTime(0)
113 , fGdpbIdIndexMap()
114 , fvmEpSupprBuffer()
115 , fvuFeeNbHitsLastMs()
116 , fdTsLastPulserHit()
117 , fvuCoincNbHitsLastMs()
118 , fvdCoincTsLastHit()
119 , dMinDt(-1. * (kuNbBinsDt * gdpbv100::kdBinSize / 2.) - gdpbv100::kdBinSize / 2.)
120 , dMaxDt(1. * (kuNbBinsDt * gdpbv100::kdBinSize / 2.) + gdpbv100::kdBinSize / 2.)
121 , fuNbFeePlot(2)
122 , fuNbFeePlotsPerGdpb(0)
123 , fdStartTime(-1.)
124 , fdStartTimeLong(-1.)
125 , fdStartTimeMsSz(-1.)
126 , fuHistoryHistoSize(1800)
127 , fuHistoryHistoSizeLong(600)
128 , fdLastRmsUpdateTime(0.0)
129 , fdFitZoomWidthPs(0.0)
130 , fcMsSizeAll(NULL)
131 , fvhMsSzPerLink(12, NULL)
132 , fvhMsSzTimePerLink(12, NULL)
133 , fvhTimeDiffPulser()
134 , fhTimeMeanPulser(NULL)
135 , fhTimeRmsPulser(NULL)
136 , fhTimeRmsZoomFitPuls(NULL)
137 , fhTimeResFitPuls(NULL)
138 , fvhPulserCountEvoPerFeeGdpb()
139 , fvhPulserTimeDiffEvoGbtxGbtx()
140 , fvvhPulserTimeDiffEvoGdpbGdpb()
141 , fvvhPulserTimeDiffEvoFeeFee()
142 , fvuPadiToGet4()
143 , fvuGet4ToPadi()
144 , fvuElinkToGet4()
145 , fvuGet4ToElink()
146 , fTimeLastHistoSaving()
147{
148}
149
151
153{
154 LOG(info) << "Initializing Get4 monitor";
155
156 FairRootManager* ioman = FairRootManager::Instance();
157 if (ioman == NULL) { LOG(fatal) << "No FairRootManager instance"; } // if( ioman == NULL )
158
159 return kTRUE;
160}
161
163{
164 LOG(info) << "Setting parameter containers for " << GetName();
165 fUnpackPar = (CbmMcbm2018TofPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer("CbmMcbm2018TofPar"));
166}
167
169{
170 LOG(info) << "Init parameter containers for " << GetName();
171 Bool_t initOK = ReInitContainers();
172
174
179 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
180 for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j) {
184 } // for( UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j )
185 } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
186
187 return initOK;
188}
189
191{
192 LOG(info) << "ReInit parameter containers for " << GetName();
193
195 LOG(info) << "Nr. of Tof GDPBs: " << fuNrOfGdpbs;
197
199 LOG(info) << "Nr. of FEEs per Tof GDPB: " << fuNrOfFeePerGdpb;
200
202 LOG(info) << "Nr. of GET4 per Tof FEE: " << fuNrOfGet4PerFee;
203
205 LOG(info) << "Nr. of channels per GET4: " << fuNrOfChannelsPerGet4;
206
208 LOG(info) << "Nr. of channels per FEE: " << fuNrOfChannelsPerFee;
209
211 LOG(info) << "Nr. of GET4s: " << fuNrOfGet4;
212
214 LOG(info) << "Nr. of GET4s per GDPB: " << fuNrOfGet4PerGdpb;
215
217 LOG(info) << "Nr. of channels per GDPB: " << fuNrOfChannelsPerGdpb;
218
219 fGdpbIdIndexMap.clear();
220 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
222 LOG(info) << "GDPB Id of TOF " << i << " : " << std::hex << fUnpackPar->GetGdpbId(i) << std::dec;
223 } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
224
226 LOG(info) << "Nr. of GBTx: " << fuNrOfGbtx;
227
229 LOG(info) << "Nr. of GBTx: " << fuNrOfModules;
230
231 fviRpcType.resize(fuNrOfGbtx);
232 fviModuleId.resize(fuNrOfGbtx);
233 fviNrOfRpc.resize(fuNrOfGbtx);
234 fviRpcSide.resize(fuNrOfGbtx);
235 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx) {
236 fviNrOfRpc[uGbtx] = fUnpackPar->GetNrOfRpc(uGbtx);
237 fviRpcType[uGbtx] = fUnpackPar->GetRpcType(uGbtx);
238 fviRpcSide[uGbtx] = fUnpackPar->GetRpcSide(uGbtx);
239 fviModuleId[uGbtx] = fUnpackPar->GetModuleId(uGbtx);
240 } // for( UInt_t uGbtx = 0; uGbtx < uNrOfGbtx; ++uGbtx)
241
242 LOG(info) << "Nr. of RPCs per GBTx: ";
243 std::stringstream ss;
244 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
245 ss << Form(" %2d", fviNrOfRpc[uGbtx]);
246 LOG(info) << ss.str();
247
248 LOG(info) << "RPC type per GBTx: ";
249 ss.clear();
250 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
251 ss << Form(" %2d", fviRpcType[uGbtx]);
252 LOG(info) << ss.str();
253
254 LOG(info) << "RPC side per GBTx: ";
255 ss.clear();
256 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
257 ss << Form(" %2d", fviRpcSide[uGbtx]);
258 LOG(info) << ss.str();
259
260 LOG(info) << "Module ID per GBTx: ";
261 ss.clear();
262 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
263 ss << Form(" %2d", fviModuleId[uGbtx]);
264 LOG(info) << ss.str();
265
271 LOG(info) << "Timeslice parameters: " << fuTotalMsNb << " MS per link, of which " << fuOverlapMsNb
272 << " overlap MS, each MS is " << fdMsSizeInNs << " ns";
273
284 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
285 fvulGdpbTsMsb[uGdpb] = 0;
286 fvulGdpbTsLsb[uGdpb] = 0;
287 fvulStarTsMsb[uGdpb] = 0;
288 fvulStarTsMid[uGdpb] = 0;
289 fvulGdpbTsFullLast[uGdpb] = 0;
290 fvulStarTsFullLast[uGdpb] = 0;
291 fvuStarTokenLast[uGdpb] = 0;
292 fvuStarDaqCmdLast[uGdpb] = 0;
293 fvuStarTrigCmdLast[uGdpb] = 0;
294 } // for (Int_t iGdpb = 0; iGdpb < fuNrOfGdpbs; ++iGdpb)
295
297
301
305 /*
306 UInt_t uGet4topadi[32] = {
307 4, 3, 2, 1, // provided by Jochen
308 24, 23, 22, 21,
309 8, 7, 6, 5,
310 28, 27, 26, 25,
311 12, 11, 10, 9,
312 32, 31, 30, 29,
313 16, 15, 14, 13,
314 20, 19, 18, 17 };
315*/
317 UInt_t uGet4topadi[32] = {4, 3, 2, 1, // provided by Jochen
318 8, 7, 6, 5, 12, 11, 10, 9, 16, 15, 14, 13, 20, 19,
319 18, 17, 24, 23, 22, 21, 28, 27, 26, 25, 32, 31, 30, 29};
320
321 UInt_t uPaditoget4[32] = {4, 3, 2, 1, // provided by Jochen
322 12, 11, 10, 9, 20, 19, 18, 17, 28, 27, 26, 25, 32, 31,
323 30, 29, 8, 7, 6, 5, 16, 15, 14, 13, 24, 23, 22, 21};
324
325 for (UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan) {
326 fvuPadiToGet4[uChan] = uPaditoget4[uChan] - 1;
327 fvuGet4ToPadi[uChan] = uGet4topadi[uChan] - 1;
328 } // for( UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan )
329
330
334 UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14,
335 10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23,
336 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11};
337 UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = {24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11,
338 13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0,
339 30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36};
340
341 for (UInt_t uLinkAsic = 0; uLinkAsic < kuNbGet4PerGbtx; ++uLinkAsic) {
342 fvuElinkToGet4[uLinkAsic] = kuElinkToGet4[uLinkAsic];
343 fvuGet4ToElink[uLinkAsic] = kuGet4ToElink[uLinkAsic];
344 } // for( UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan )
345
346 return kTRUE;
347}
348
349
350void CbmMcbm2018MonitorTofPulser::AddMsComponentToList(size_t component, UShort_t /*usDetectorId*/)
351{
353 for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
354 if (component == fvMsComponentsList[uCompIdx]) return;
355
357 fvMsComponentsList.push_back(component);
358
360 if (NULL == fvhMsSzPerLink[component]) {
361 TString sMsSzName = Form("MsSz_link_%02lu", component);
362 TString sMsSzTitle = Form("Size of MS from link %02lu; Ms Size [bytes]", component);
363 fvhMsSzPerLink[component] = new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
364
365 sMsSzName = Form("MsSzTime_link_%02lu", component);
366 sMsSzTitle = Form("Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]", component);
367 fvhMsSzTimePerLink[component] =
368 new TProfile(sMsSzName.Data(), sMsSzTitle.Data(), 100 * fuHistoryHistoSize, 0., 2 * fuHistoryHistoSize);
369 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
370 if (server) {
371 server->Register("/FlibRaw", fvhMsSzPerLink[component]);
372 server->Register("/FlibRaw", fvhMsSzTimePerLink[component]);
373 } // if( server )
374 if (NULL != fcMsSizeAll) {
375 fcMsSizeAll->cd(1 + component);
376 gPad->SetLogy();
377 fvhMsSzTimePerLink[component]->Draw("hist le0");
378 } // if( NULL != fcMsSizeAll )
379 LOG(info) << "Added MS size histo for component (link): " << component;
380 } // if( NULL == fvhMsSzPerLink[ component ] )
381}
382void CbmMcbm2018MonitorTofPulser::SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
383{
384 fuNbCoreMsPerTs = uCoreMsNb;
385 fuNbOverMsPerTs = uOverlapMsNb;
386
387 // UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
388}
389
391{
392 LOG(info) << "create Histos for " << fuNrOfGdpbs << " gDPBs ";
393
394 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
395
396 TString name {""};
397 TString title {""};
398
399 // Full Fee time difference test
400 UInt_t uNbBinsDt = kuNbBinsDt + 1; // To account for extra bin due to shift by 1/2 bin of both ranges
401
403 Double_t dBinSzG4v2 = (6250. / 112.);
404 dMinDt = -1. * (kuNbBinsDt * dBinSzG4v2 / 2.) - dBinSzG4v2 / 2.;
405 dMaxDt = 1. * (kuNbBinsDt * dBinSzG4v2 / 2.) + dBinSzG4v2 / 2.;
406
407
408 /*******************************************************************/
410 /* clang-format off */
411
414 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++) {
416 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++) {
417 if (uFeeA < uFeeB) {
418 UInt_t uGdpbA = uFeeA / (fuNrOfFeePerGdpb);
419 UInt_t uFeeIdA = uFeeA - (fuNrOfFeePerGdpb * uGdpbA);
420 UInt_t uGdpbB = uFeeB / (fuNrOfFeePerGdpb);
421 UInt_t uFeeIdB = uFeeB - (fuNrOfFeePerGdpb * uGdpbB);
422 fvhTimeDiffPulser[uFeeA][uFeeB] =
423 new TH1I(Form("hTimeDiffPulser_g%02u_f%1u_g%02u_f%1u",
424 uGdpbA, uFeeIdA, uGdpbB, uFeeIdB),
425 Form("Time difference for pulser on gDPB %02u FEE %1u and "
426 "gDPB %02u FEE %1u; DeltaT [ps]; Counts",
427 uGdpbA, uFeeIdA, uGdpbB, uFeeIdB),
428 uNbBinsDt, dMinDt, dMaxDt);
429 } // if( uFeeA < uFeeB )
430 else
431 fvhTimeDiffPulser[uFeeA][uFeeB] = NULL;
432 } // for( UInt_t uFeeB = uFeeA; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs - 1; uFeeB++)
433 } // for( UInt_t uFeeA = 0; uFeeA < kuNbChanTest - 1; uFeeA++)
434
435 name = "hTimeMeanPulser";
436 fhTimeMeanPulser = new TH2D(
437 name.Data(),
438 "Time difference Mean for each FEE pairs; FEE A; FEE B ; Mean [ps]",
441
442 name = "hTimeRmsPulser";
443 fhTimeRmsPulser = new TH2D(
444 name.Data(),
445 "Time difference RMS for each FEE pairs; FEE A; FEE B ; RMS [ps]",
448
449 name = "hTimeRmsZoomFitPuls";
450 fhTimeRmsZoomFitPuls = new TH2D(
451 name.Data(),
452 "Time difference RMS after zoom for each FEE "
453 "pairs; FEE A; FEE B ; RMS [ps]",
456
457 name = "hTimeResFitPuls";
458 fhTimeResFitPuls = new TH2D(
459 name.Data(),
460 "Time difference Res from fit for each FEE pairs; FEE A; FEE B ; Sigma [ps]",
463
466 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
467
468 name = Form("hPulserCountEvoPerFeeGdpb%02u", uGdpb);
469 fvhPulserCountEvoPerFeeGdpb.push_back(new TH2D(
470 name.Data(),
471 Form("Pulser count per FEE in gDPB %02u; time in run [s]; dt [ps]",
472 uGdpb),
475
476 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx) {
477 name = Form("hPulserTimeDiffEvoGdpb%02uGbtx00Gbtx%02u", uGdpb, uGbtx + 1);
478 fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx] =
479 new TProfile(name.Data(),
480 Form("Time difference of the 1st FEE in the 1st GBTx of "
481 "gDPB %02u vs GBTx %02u; time in run [s]; dt [ps]",
482 uGdpb,
483 uGbtx + 1),
485 } // for( UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb; ++uGbtx )
486
487 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb].resize(fuNrOfGdpbs, NULL);
488 for (UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB) {
489 name = Form("hPulserTimeDiffEvoGdpb%02uGdpb%02u", uGdpb, uGdpbB);
490 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB] =
491 new TProfile(name.Data(),
492 Form("Time difference of the 1st FEE in the 1st GBTx of "
493 "gDPB %02u vs %02u; time in run [s]; dt [ps]",
494 uGdpb,
495 uGdpbB),
497 } // for( UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB )
498 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
499
501 for (UInt_t uFeeRef = 0; uFeeRef < kuNbRefFeeEvo; ++uFeeRef) {
502 UInt_t uGdpbRef = kuRefFeeEvoIdx[uFeeRef] / (fuNrOfFeePerGdpb);
503 UInt_t uFeeIdRef = kuRefFeeEvoIdx[uFeeRef] - (fuNrOfFeePerGdpb * uGdpbRef);
504
506 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++) {
507 UInt_t uGdpb = uFee / (fuNrOfFeePerGdpb);
508 UInt_t uFeeId = uFee - (fuNrOfFeePerGdpb * uGdpb);
509
510 fvvhPulserTimeDiffEvoFeeFee[uFeeRef][uFee] =
511 new TProfile(Form("hTimeDiffEvoFeeFee_g%02u_f%02u_g%02u_f%02u",
512 uGdpbRef, uFeeIdRef, uGdpb, uFeeId),
513 Form("Time difference for pulser on gDPB %02u FEE %1u and "
514 "gDPB %02u FEE %02u; time in run [s]; DeltaT [ps]",
515 uGdpbRef, uFeeIdRef, uGdpb, uFeeId),
517 } // for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++)
518 } // for( UInt_t uFeeRef = 0; uFeeRef < kuNbRefFeeEvo; ++uFeeRef )
519
523 for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++)
524 {
525 UInt_t uGdpb = uFee / ( fuNrOfFeePerGdpb );
526 UInt_t uFeeId = uFee - ( fuNrOfFeePerGdpb * uGdpb );
527 fhFeeFtDistribPerCh[ uFee ] = new TH2D(
528 Form( "hFeeFtDistribPerCh_g%02u_f%02u", uGdpb, uFeeId ),
529 Form( "FT distribution per channel for gDPB %02u FEE %02u", uGdpb, uFeeId ),
532 fhFeeFtNormDnl[ uFee ] = new TH2D(
533 Form( "hFeeFtNormDnl_g%02u_f%02u", uGdpb, uFeeId ),
534 Form( "Normalized DNL per channel for gDPB %02u FEE %02u", uGdpb, uFeeId ),
537 fhFeeFtNormInl[ uFee ] = new TH2D(
538 Form( "hFeeFtNormInl_g%02u_f%02u", uGdpb, uFeeId ),
539 Form( "Normalized INL per channel for gDPB %02u FEE %02u", uGdpb, uFeeId ),
542 } // for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++)
543
545 /* clang-format on */
546
547 if (server) {
548 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
549 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
550 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) server->Register("/TofDt", fvhTimeDiffPulser[uFeeA][uFeeB]);
551
552 server->Register("/TofRaw", fhTimeMeanPulser);
553 server->Register("/TofRaw", fhTimeRmsPulser);
554 server->Register("/TofRaw", fhTimeRmsZoomFitPuls);
555 server->Register("/TofRaw", fhTimeResFitPuls);
556
557 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
558 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx)
559 if (NULL != fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx])
560 server->Register("/TofDtEvo", fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx]);
561
562 for (UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB)
563 if (NULL != fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB])
564 server->Register("/TofDtEvo", fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB]);
565 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
566
567 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++) {
568 server->Register("/DnlInl", fhFeeFtDistribPerCh[uFee]);
569 server->Register("/DnlInl", fhFeeFtNormDnl[uFee]);
570 server->Register("/DnlInl", fhFeeFtNormInl[uFee]);
571 } // for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++)
572
573 server->RegisterCommand("/Reset_All_eTOF", "bMcbmMoniTofPulserResetHistos=kTRUE");
574 server->RegisterCommand("/Save_All_eTof", "bMcbmMoniTofPulserSaveHistos=kTRUE");
575 server->RegisterCommand("/Update_PulsFit", "bMcbmMoniTofPulserUpdateZoomedFit=kTRUE");
576 server->RegisterCommand("/Print_Raw_Data", "bMcbmMoniTofPulserRawDataPrint=kTRUE");
577 server->RegisterCommand("/Print_AllHits", "bMcbmMoniTofPulserPrintAllHitsEna=kTRUE");
578 server->RegisterCommand("/Print_AllEps", "bMcbmMoniTofPulserPrintAllEpochsEna=kTRUE");
579
580 server->Restrict("/Reset_All_eTof", "allow=admin");
581 server->Restrict("/Save_All_eTof", "allow=admin");
582 server->Restrict("/Update_PulsFit", "allow=admin");
583 server->Restrict("/Update_DnlInl", "allow=admin");
584 server->Restrict("/Print_Raw_Data", "allow=admin");
585 server->Restrict("/Print_AllHits", "allow=admin");
586 server->Restrict("/Print_AllEps", "allow=admin");
587 } // if( server )
588
589 /*****************************/
590 Double_t w = 10;
591 Double_t h = 10;
592
594 TCanvas* cPulser = new TCanvas("cPulser", "Time difference RMS for pulser channels when FEE pulser mode is ON", w, h);
595 cPulser->Divide(2, 2);
596
597 cPulser->cd(1);
598 gPad->SetGridx();
599 gPad->SetGridy();
600 fhTimeRmsPulser->Draw("colz");
601
602 cPulser->cd(2);
603 gPad->SetGridx();
604 gPad->SetGridy();
605 fhTimeMeanPulser->Draw("colz");
606
607 cPulser->cd(3);
608 gPad->SetGridx();
609 gPad->SetGridy();
610 fhTimeRmsZoomFitPuls->Draw("colz");
611
612 cPulser->cd(4);
613 gPad->SetGridx();
614 gPad->SetGridy();
615 fhTimeResFitPuls->Draw("colz");
616 /*****************************/
617
619 TCanvas* cPulserEvo =
620 new TCanvas("cPulserEvo", "Time difference evolution between 1st FEE of 1st GBTx of gDPB pairs", w, h);
621 cPulserEvo->Divide(1, fuNrOfGdpbs - 1);
622 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs - 1; uGdpb++) {
623 cPulserEvo->cd(1 + uGdpb);
624 gPad->SetGridx();
625 gPad->SetGridy();
626 if (NULL != fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpb + 1])
627 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpb + 1]->Draw();
628
629 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs - 1; uGdpb ++)
630 /*****************************/
632 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; uGdpb++) {
633 TCanvas* cPulserEvoGbtx =
634 new TCanvas(Form("cPulserEvoGbtx%02u", uGdpb),
635 Form("Time difference evolution between 1st FEE of GBTx pairs in gDPB %02u", uGdpb), w, h);
636 cPulserEvoGbtx->Divide(1, kuNbGbtxPerGdpb - 1);
637
638 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx) {
639 cPulserEvoGbtx->cd(1 + uGbtx);
640 gPad->SetGridx();
641 gPad->SetGridy();
642
643 if (NULL != fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx])
644 fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx]->Draw();
645 } // for( UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx )
646 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; uGdpb ++)
647 /*****************************/
648
650 // Try to recover canvas in case it was created already by another monitor
651 // If not existing, create it
652 fcMsSizeAll = dynamic_cast<TCanvas*>(gROOT->FindObject("cMsSizeAll"));
653 if (NULL == fcMsSizeAll) {
654 fcMsSizeAll = new TCanvas("cMsSizeAll", "Evolution of MS size in last 300 s", w, h);
655 fcMsSizeAll->Divide(4, 3);
656 LOG(info) << "Created MS size canvas in TOF monitor";
657 } // if( NULL == fcMsSizeAll )
658 else
659 LOG(info) << "Recovered MS size canvas in TOF monitor";
660
661 LOG(info) << "Leaving CreateHistograms";
662}
663
664Bool_t CbmMcbm2018MonitorTofPulser::DoUnpack(const fles::Timeslice& ts, size_t component)
665{
667 LOG(info) << "Reset eTOF STAR histos ";
670 } // if( bMcbmMoniTofPulserResetHistos )
672 LOG(info) << "Start saving eTOF STAR histos ";
673 SaveAllHistos("data/histos_Shift_StarTof.root");
675 } // if( bSaveStsHistos )
679 } // if (bMcbmMoniTofPulserUpdateZoomedFit)
683 } // if (bMcbmMoniTofPulserUpdateZoomedFit)
687 } // if( bMcbmMoniTofPulserRawDataPrint )
691 } // if( bMcbmMoniTofPulserPrintAllHitsEna )
695 } // if( bMcbmMoniTofPulserPrintAllEpochsEna )
696
698 std::chrono::time_point<std::chrono::system_clock> timeCurrent = std::chrono::system_clock::now();
699 std::chrono::duration<double> elapsed_seconds = timeCurrent - fTimeLastHistoSaving;
700 if (0 == fTimeLastHistoSaving.time_since_epoch().count()) {
701 fTimeLastHistoSaving = timeCurrent;
702 // fulNbBuiltSubEventLastPrintout = fulNbBuiltSubEvent;
703 // fulNbStarSubEventLastPrintout = fulNbStarSubEvent;
704 } // if( 0 == fTimeLastHistoSaving.time_since_epoch().count() )
705 else if (300 < elapsed_seconds.count()) {
706 std::time_t cTimeCurrent = std::chrono::system_clock::to_time_t(timeCurrent);
707 char tempBuff[80];
708 std::strftime(tempBuff, 80, "%F %T", localtime(&cTimeCurrent));
709 /*
710 LOG(info) << "CbmTofStarEventBuilder2018::DoUnpack => " << tempBuff
711 << " Total number of Built events: " << std::setw(9) << fulNbBuiltSubEvent
712 << ", " << std::setw(9) << (fulNbBuiltSubEvent - fulNbBuiltSubEventLastPrintout)
713 << " events in last " << std::setw(4) << elapsed_seconds.count() << " s";
714 fTimeLastPrintoutNbStarEvent = timeCurrent;
715 fulNbBuiltSubEventLastPrintout = fulNbBuiltSubEvent;
716*/
717 fTimeLastHistoSaving = timeCurrent;
718 SaveAllHistos("data/histos_tof_pulser.root");
719 } // else if( 300 < elapsed_seconds.count() )
720
721 LOG(debug1) << "Timeslice contains " << ts.num_microslices(component) << "microslices.";
722
724 UInt_t uNbMsLoop = fuNbCoreMsPerTs;
725 if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
726
727 Int_t messageType = -111;
728 Double_t dTsStartTime = -1;
729
731 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
732 if (fuMsAcceptsPercent < uMsIdx) continue;
733
734 fuCurrentMs = uMsIdx;
735
736 if (0 == fulCurrentTsIndex && 0 == uMsIdx) {
737 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
738 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
739 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
740 /*
741 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
742 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
743 static_cast<unsigned int>(msDescriptor.hdr_id),
744 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
745 static_cast<unsigned int>(msDescriptor.sys_id),
746 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
747 msDescriptor.size, msDescriptor.offset );
748*/
749 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
750 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
751 } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
752
754 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
755 constexpr uint32_t kuBytesPerMessage = 8;
756
757 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
758 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
759 fiEquipmentId = msDescriptor.eq_id;
760 fdMsIndex = static_cast<double>(msDescriptor.idx);
761 fuCurrentMsSysId = static_cast<unsigned int>(msDescriptor.sys_id);
762 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
763
764 uint32_t size = msDescriptor.size;
765 // fulLastMsIdx = msDescriptor.idx;
766 if (size > 0) LOG(debug) << "Microslice: " << msDescriptor.idx << " has size: " << size;
767 /*
768 if( numCompMsInTs - fuOverlapMsNb <= m )
769 {
770// LOG(info) << "Ignore overlap Microslice: " << msDescriptor.idx;
771 continue;
772 } // if( numCompMsInTs - fuOverlapMsNb <= m )
773*/
774 if (0 == uMsIdx && 0 == uMsCompIdx) dTsStartTime = (1e-9) * fdMsIndex;
775
776 if (fdStartTimeMsSz < 0) fdStartTimeMsSz = (1e-9) * fdMsIndex;
777 fvhMsSzPerLink[uMsComp]->Fill(size);
778 if (2 * fuHistoryHistoSize < (1e-9) * fdMsIndex - fdStartTimeMsSz) {
779 // Reset the evolution Histogram and the start time when we reach the end of the range
780 fvhMsSzTimePerLink[uMsComp]->Reset();
781 fdStartTimeMsSz = (1e-9) * fdMsIndex;
782 } // if( 2 * fuHistoryHistoSize < (1e-9) * fdMsIndex - fdStartTimeMsSz )
783 fvhMsSzTimePerLink[uMsComp]->Fill((1e-9) * fdMsIndex - fdStartTimeMsSz, size);
784
785 // If not integer number of message in input buffer, print warning/error
786 if (0 != (size % kuBytesPerMessage))
787 LOG(error) << "The input microslice buffer does NOT "
788 << "contain only complete nDPB messages!";
789
790 // Compute the number of complete messages in the input microslice buffer
791 uint32_t uNbMessages = (size - (size % kuBytesPerMessage)) / kuBytesPerMessage;
792
793 // Get the gDPB ID from the MS header
795
797 auto it = fGdpbIdIndexMap.find(fuGdpbId);
798 if (it == fGdpbIdIndexMap.end()) {
799 LOG(info) << "---------------------------------------------------------------";
800 /*
801 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
802 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
803 static_cast<unsigned int>(msDescriptor.hdr_id),
804 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
805 static_cast<unsigned int>(msDescriptor.sys_id),
806 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
807 msDescriptor.size, msDescriptor.offset );
808*/
809 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
810 LOG(warning) << "Could not find the gDPB index for AFCK id 0x" << std::hex << fuGdpbId << std::dec
811 << " in timeslice " << fulCurrentTsIndex << " in microslice " << fdMsIndex << " component "
812 << uMsCompIdx << "\n"
813 << "If valid this index has to be added in the TOF "
814 "parameter file in the RocIdArray field";
815 continue;
816 } // if( it == fGdpbIdIndexMap.end() )
817 else
819
820 // Prepare variables for the loop on contents
821 const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent);
822 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
823 // Fill message
824 uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
825
827 if (0 == uIdx && kFALSE == fbOldFwData) {
828 ProcessEpochCycle(ulData);
829 continue;
830 } // if( 0 == uIdx && kFALSE == fbOldFwData )
831
832 gdpbv100::Message mess(ulData);
833
834 if (fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging(fair::Severity::debug2)) {
835 mess.printDataCout();
837 } // if( fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging( fair::Severity::debug2 ) )
838
839 // Increment counter for different message types
840 // and fill the corresponding histogram
841 messageType = mess.getMessageType();
842 fviMsgCounter[messageType]++;
843
849
851 LOG(warning) << "Message with Get4 ID too high: " << fuGet4Id << " VS " << fuNrOfGet4PerGdpb
852 << " set in parameters.";
853
854 switch (messageType) {
855 case gdpbv100::MSG_HIT: {
856 if (mess.getGdpbHitIs24b()) { PrintGenInfo(mess); } // if( getGdpbHitIs24b() )
857 else {
858 fvmEpSupprBuffer[fuGet4Nr].push_back(mess);
859 } // else of if( getGdpbHitIs24b() )
860 break;
861 } // case gdpbv100::MSG_HIT:
862 case gdpbv100::MSG_EPOCH: {
864 for (uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index++) {
865 fuGet4Id = uGet4Index;
867 gdpbv100::Message tmpMess(mess);
868 tmpMess.setGdpbGenChipId(uGet4Index);
869
870 FillEpochInfo(tmpMess);
871 } // for( uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGetIndex ++ )
872
873 if (kTRUE == fbPrintAllEpochsEnable) {
874 LOG(info) << "Epoch: " << Form("0x%08x ", fuGdpbId) << ", Merg"
875 << ", Link " << std::setw(1) << mess.getGdpbEpLinkId() << ", epoch " << std::setw(8)
876 << mess.getGdpbEpEpochNb() << ", Sync " << std::setw(1) << mess.getGdpbEpSync()
877 << ", Data loss " << std::setw(1) << mess.getGdpbEpDataLoss() << ", Epoch loss "
878 << std::setw(1) << mess.getGdpbEpEpochLoss() << ", Epoch miss " << std::setw(1)
879 << mess.getGdpbEpMissmatch();
880 } // if( kTRUE == fbPrintAllEpochsEnable )
881 } // if this epoch message is a merged one valid for all chips
882 else {
883 FillEpochInfo(mess);
884
885 if (kTRUE == fbPrintAllEpochsEnable) {
886 LOG(info) << "Epoch: " << Form("0x%08x ", fuGdpbId) << ", " << std::setw(4) << fuGet4Nr << ", Link "
887 << std::setw(1) << mess.getGdpbEpLinkId() << ", epoch " << std::setw(8)
888 << mess.getGdpbEpEpochNb() << ", Sync " << std::setw(1) << mess.getGdpbEpSync()
889 << ", Data loss " << std::setw(1) << mess.getGdpbEpDataLoss() << ", Epoch loss "
890 << std::setw(1) << mess.getGdpbEpEpochLoss() << ", Epoch miss " << std::setw(1)
891 << mess.getGdpbEpMissmatch();
892 } // if( kTRUE == fbPrintAllEpochsEnable )
893 } // if single chip epoch message
894 break;
895 } // case gdpbv100::MSG_EPOCH:
896 case gdpbv100::MSG_SLOWC: {
897 PrintSlcInfo(mess);
898 break;
899 } // case gdpbv100::MSG_SLOWC:
900 case gdpbv100::MSG_SYST: {
902
903 // UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
904 /*
905 if (0 <= fdStartTime)
906 {
907 fvhFeeErrorRate_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(
908 1e-9 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTime));
909 fvhFeeErrorRatio_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(
910 1e-9 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTime), 1, 1 );
911
912 UInt_t uGbtxNr = (uFeeNr / kuNbFeePerGbtx);
913 UInt_t uGbtxNrInSys = fuGdpbNr * kuNbGbtxPerGdpb + uGbtxNr;
914 fvhModErrorRate[ fviModuleId[ uGbtxNrInSys ] ]->Fill(
915 1e-9 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTime));
916 fvhModErrorRatio[ fviModuleId[ uGbtxNrInSys ] ]->Fill(
917 1e-9 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTime), 1, 1);
918 } // if (0 <= fdStartTime)
919 if (0 <= fdStartTimeLong)
920 {
921 fvhFeeErrorRateLong_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(
922 1e-9 / 60.0 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTimeLong), 1 / 60.0);
923 fvhFeeErrorRatioLong_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(
924 1e-9 / 60.0 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTimeLong), 1, 1 / 60.0);
925 } // if (0 <= fdStartTime)
926*/
927 // Int_t dGdpbChId = fuGet4Id * fuNrOfChannelsPerGet4 + mess.getGdpbSysErrChanId();
928 // Int_t dFullChId = fuGet4Nr * fuNrOfChannelsPerGet4 + mess.getGdpbSysErrChanId();
929 } // if( gdpbv100::SYSMSG_GET4_EVENT == mess.getGdpbSysSubType() )
931 FillPattInfo(mess);
932 } // if( gdpbv100::SYS_PATTERN == mess.getGdpbSysSubType() )
933 PrintSysInfo(mess);
934 break;
935 } // case gdpbv100::MSG_SYST:
940 // fhGet4MessType->Fill(fuGet4Nr, 5);
941 FillStarTrigInfo(mess);
942 break;
943 default:
944 LOG(error) << "Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType)
945 << " not included in Get4 unpacker.";
946 } // switch( mess.getMessageType() )
947 } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
948 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
949
952 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeA) {
953 if (1 != fvuFeeNbHitsLastMs[uFeeA]) {
955 fvuFeeNbHitsLastMs[uFeeA] = 0;
956 continue;
957 } // if( 1 != fvuFeeNbHitsLastMs[ uFeeA ] )
958
959 UInt_t uGdpbNr = uFeeA / fuNrOfFeePerGdpb;
960 UInt_t uGbtxNr = (uFeeA % fuNrOfFeePerGdpb) / kuNbFeePerGbtx;
961
962 UInt_t uFeeRefIndexA = kuNbRefFeeEvo;
963 for (UInt_t uFeeRef = 0; uFeeRef < kuNbRefFeeEvo; ++uFeeRef)
964 if (kuRefFeeEvoIdx[uFeeRef] == uFeeA) uFeeRefIndexA = uFeeRef;
965
967 for (UInt_t uFeeB = uFeeA + 1; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeB) {
968 if (1 != fvuFeeNbHitsLastMs[uFeeB]) continue;
969
970 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) {
971 UInt_t uFeeRefIndexB = kuNbRefFeeEvo;
972 for (UInt_t uFeeRef = 0; uFeeRef < kuNbRefFeeEvo; ++uFeeRef)
973 if (kuRefFeeEvoIdx[uFeeRef] == uFeeB) uFeeRefIndexB = uFeeRef;
974
975 Double_t dTimeDiff = 1e3 * (fdTsLastPulserHit[uFeeB] - fdTsLastPulserHit[uFeeA]);
976 if (TMath::Abs(dTimeDiff) < kdMaxDtPulserPs) {
977 fvhTimeDiffPulser[uFeeA][uFeeB]->Fill(dTimeDiff);
978
979 if (uFeeRefIndexA < kuNbRefFeeEvo)
980 fvvhPulserTimeDiffEvoFeeFee[uFeeRefIndexA][uFeeB]->Fill(1e-9 * (fdTsLastPulserHit[uFeeA] - fdStartTime),
981 dTimeDiff);
982
983 if (uFeeRefIndexB < kuNbRefFeeEvo)
984 fvvhPulserTimeDiffEvoFeeFee[uFeeRefIndexB][uFeeA]->Fill(1e-9 * (fdTsLastPulserHit[uFeeB] - fdStartTime),
985 -1.0 * dTimeDiff);
986
988 if (0 == uFeeA % kuNbFeePerGbtx && 0 == uFeeB % kuNbFeePerGbtx) {
989 UInt_t uGdpbNrB = uFeeB / fuNrOfFeePerGdpb;
990 UInt_t uGbtxNrB = (uFeeB % fuNrOfFeePerGdpb) / kuNbFeePerGbtx;
991
993 if (uGdpbNr == uGdpbNrB) {
994 if (0 == uGbtxNr) {
995 UInt_t uPlotIdx = uGdpbNr * (kuNbGbtxPerGdpb - 1) + uGbtxNrB - 1;
996 fvhPulserTimeDiffEvoGbtxGbtx[uPlotIdx]->Fill(1e-9 * (fdTsLastPulserHit[uFeeA] - fdStartTime),
997 dTimeDiff);
998 } // if( 0 == uGbtxNr )
999 } // if( uGdpbNr == uFeeB / fuNrOfFeePerGdpb )
1000 else // if( NULL != fvvhPulserTimeDiffEvoGdpbGdpb[ uFeeB / fuNrOfFeePerGdpb ][ uGdpbNr ] )
1001 {
1003 if (0 == uGbtxNr && 0 == uGbtxNrB)
1004 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpbNr][uFeeB / fuNrOfFeePerGdpb]->Fill(
1005 1e-9 * (fdTsLastPulserHit[uFeeA] - fdStartTime), dTimeDiff);
1006 } // else of if( uGdpbNr == uFeeB / fuNrOfFeePerGdpb )
1007 } // if( 0 == uFeeA % kuNbFeePerGbtx && 0 == uFeeB % kuNbFeePerGbtx )
1008 } // if( TMath::Abs( dTimeDiff ) < kdMaxDtPulserPs )
1009 // else if( 10 == uFeeA && 20 == uFeeB )
1010 // LOG(info) << "new in 10 " << dTimeDiff;
1011 } // if( NULL != fvhTimeDiffPulser[uFeeA][uFeeB] )
1012 } // for( UInt_t uFeeB = uFeeA + 1; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeB)
1013
1015 fvuFeeNbHitsLastMs[uFeeA] = 0;
1016 } // for( UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeA)
1017 } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
1018
1019 // Update RMS plots only every 10s in data
1020 if (10.0 < dTsStartTime - fdLastRmsUpdateTime) {
1021 // Reset summary histograms for safety
1022 fhTimeMeanPulser->Reset();
1023 fhTimeRmsPulser->Reset();
1024
1025 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
1026 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
1027 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) {
1028 fhTimeMeanPulser->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetMean());
1029 fhTimeRmsPulser->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetRMS());
1030 } // for( UInt_t uChan = 0; uChan < kuNbChanTest - 1; uChan++)
1032 } // if( 10.0 < dTsStartTime - fdLastRmsUpdateTime )
1033
1035
1036 return kTRUE;
1037}
1038
1040{
1041 uint64_t ulEpochCycleVal = ulCycleData & gdpbv100::kulEpochCycleFieldSz;
1042
1043 if (fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging(fair::Severity::debug2)) {
1044 LOG(info) << "CbmMcbm2018MonitorTofPulser::ProcessEpochCyle => "
1045 // << Form( " TS %5llu MS %3lu In data 0x%016llX Cycle 0x%016llX",
1046 // fulCurrentTsIndex, fuCurrentMs, ulCycleData, ulEpochCycleVal );
1047 << " TS " << FormatDecPrintout(fulCurrentTsIndex, 5) << " MS " << FormatDecPrintout(fuCurrentMs, 3)
1048 << " In data 0x" << FormatHexPrintout(ulCycleData, 16, '0', true) << " Cycle 0x"
1049 << FormatHexPrintout(ulEpochCycleVal, 16, '0', true);
1051 } // if( fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging( fair::Severity::debug2 ) )
1052
1053 for (uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index++) {
1054 fuGet4Id = uGet4Index;
1056 /*
1057 if( !( ulEpochCycleVal == fvulCurrentEpochCycle[fuGet4Nr] ||
1058 ulEpochCycleVal == fvulCurrentEpochCycle[fuGet4Nr] + 1 ) )
1059 LOG(error) << "CbmMcbm2018MonitorTofPulser::ProcessEpochCyle => "
1060 << " Missmatch in epoch cycles detected, probably fake cycles due to epoch index corruption! "
1061 << Form( " Current cycle 0x%09X New cycle 0x%09X", fvulCurrentEpochCycle[fuGet4Nr], ulEpochCycleVal );
1062*/
1063 fvulCurrentEpochCycle[fuGet4Nr] = ulEpochCycleVal;
1064 } // for( uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index ++ )
1065 return;
1066}
1067
1069{
1070 UInt_t uChannel = mess.getGdpbHitChanId();
1071 UInt_t uTot = mess.getGdpbHit32Tot();
1072 UInt_t uFts = mess.getGdpbHitFineTs();
1073
1074 ULong64_t ulCurEpochGdpbGet4 = fvulCurrentEpoch[fuGet4Nr];
1075
1076 // In Ep. Suppr. Mode, receive following epoch instead of previous
1077 if (0 < ulCurEpochGdpbGet4) ulCurEpochGdpbGet4--;
1078 else
1079 ulCurEpochGdpbGet4 = gdpbv100::kuEpochCounterSz; // Catch epoch cycle!
1080
1081 // UInt_t uChannelNr = fuGet4Id * fuNrOfChannelsPerGet4 + uChannel;
1082 UInt_t uChannelNrInFee = (fuGet4Id % fuNrOfGet4PerFee) * fuNrOfChannelsPerGet4 + uChannel;
1083 UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
1084 UInt_t uFeeNrInSys = fuGdpbNr * fuNrOfFeePerGdpb + uFeeNr;
1085 // UInt_t uRemappedChannelNr = uFeeNr * fuNrOfChannelsPerFee + fvuGet4ToPadi[ uChannelNrInFee ];
1087 // if( fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId )
1088 // uRemappedChannelNr = uChannelNr;
1089 // UInt_t uGbtxNr = (uFeeNr / kuNbFeePerGbtx);
1090 // UInt_t uFeeInGbtx = (uFeeNr % kuNbFeePerGbtx);
1091 // UInt_t uGbtxNrInSys = fuGdpbNr * kuNbGbtxPerGdpb + uGbtxNr;
1092
1093 ULong_t ulHitTime = mess.getMsgFullTime(ulCurEpochGdpbGet4);
1094 Double_t dHitTime = mess.getMsgFullTimeD(ulCurEpochGdpbGet4);
1095
1096 // In 32b mode the coarse counter is already computed back to 112 FTS bins
1097 // => need to hide its contribution from the Finetime
1098 // => FTS = Fullt TS modulo 112
1099 uFts = mess.getGdpbHitFullTs() % 112;
1100
1102 fhFeeFtDistribPerCh[uFeeNrInSys]->Fill(uFts, uChannelNrInFee);
1103
1104 // In Run rate evolution
1105 if (fdStartTime < 0) fdStartTime = dHitTime;
1106
1107 // Reset the evolution Histogram and the start time when we reach the end of the range
1108 if (fuHistoryHistoSize < 1e-9 * (dHitTime - fdStartTime)) {
1110 fdStartTime = dHitTime;
1111 } // if( fuHistoryHistoSize < 1e-9 * (dHitTime - fdStartTime) )
1112
1113 // In Run rate evolution
1114 if (fdStartTimeLong < 0) fdStartTimeLong = dHitTime;
1115
1116 // Reset the evolution Histogram and the start time when we reach the end of the range
1117 if (fuHistoryHistoSizeLong < 1e-9 * (dHitTime - fdStartTimeLong) / 60.0) {
1119 fdStartTimeLong = dHitTime;
1120 } // if( fuHistoryHistoSize < 1e-9 * (dHitTime - fdStartTime) / 60.0 )
1121
1125 if (92 < uTot && uTot < 95) {
1126 if (gdpbv100::kuFeePulserChannel == uChannelNrInFee && fuGdpbNr != fuDiamondDpbIdx && 0x90 != fuCurrentMsSysId) {
1127 fdTsLastPulserHit[uFeeNrInSys] = dHitTime;
1128 fvuFeeNbHitsLastMs[uFeeNrInSys]++;
1129 fvhPulserCountEvoPerFeeGdpb[fuGdpbNr]->Fill(dHitTime * 1e-9, uFeeNr);
1130 } // if( gdpbv100::kuFeePulserChannel == uChannelNrInFee && fuGdpbNr != fuDiamondDpbIdx && 0x90 != fuCurrentMsSysId )
1132 else if ((fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId) && 0 == uChannelNrInFee) {
1133 fdTsLastPulserHit[uFeeNrInSys] = dHitTime;
1134 fvuFeeNbHitsLastMs[uFeeNrInSys]++;
1135 fvhPulserCountEvoPerFeeGdpb[fuGdpbNr]->Fill(dHitTime * 1e-9, uFeeNr);
1136 } // if( ( fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId ) && 0 == uChannelNrInFee )
1137 } // if( 92 < uTot && uTot < 95 )
1138
1139 /*
1140 if (0 <= fdStartTime)
1141 {
1142 fvhChannelRate_gDPB[ fuGdpbNr ]->Fill( 1e-9 * (dHitTime - fdStartTime), uChannelNr );
1143 fvhRemapChRate_gDPB[ fuGdpbNr ]->Fill( 1e-9 * (dHitTime - fdStartTime), uRemappedChannelNr );
1144 fvhFeeRate_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill( 1e-9 * (dHitTime - fdStartTime));
1145 fvhFeeErrorRatio_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill( 1e-9 * (dHitTime - fdStartTime), 0, 1);
1146
1147 fvhModRate[ fviModuleId[ uGbtxNrInSys ] ]->Fill( 1e-9 * (dHitTime - fdStartTime));
1148 fvhModErrorRatio[ fviModuleId[ uGbtxNrInSys ] ]->Fill( 1e-9 * (dHitTime - fdStartTime), 0, 1);
1149 } // if (0 <= fdStartTime)
1150
1151 if (0 <= fdStartTimeLong)
1152 {
1153 fvhFeeRateLong_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(
1154 1e-9 / 60.0 * (dHitTime - fdStartTimeLong), 1 / 60.0 );
1155 fvhFeeErrorRatioLong_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(
1156 1e-9 / 60.0 * (dHitTime - fdStartTimeLong), 0, 1 / 60.0 );
1157 } // if (0 <= fdStartTimeLong)
1158*/
1159 if (kTRUE == fbPrintAllHitsEnable) {
1160 LOG(info) << "Hit: " << Form("0x%08x ", fuGdpbId) << ", " << std::setw(2) << fuGet4Nr << ", " << std::setw(3)
1161 << uChannel << ", " << std::setw(3) << uTot << ", epoch " << std::setw(3) << ulCurEpochGdpbGet4
1162 << ", FullTime Clk " << Form("%12lu ", ulHitTime) << ", FullTime s " << Form("%12.9f ", dHitTime / 1e9)
1163 << ", FineTime " << uFts;
1164 } // if( kTRUE == fbPrintAllHitsEnable )
1165}
1166
1168{
1169 ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
1170 /*
1171 if( fvulCurrentEpoch[fuGet4Nr] < ulEpochNr )
1172 fvulCurrentEpochCycle[fuGet4Nr]++;
1173*/
1174 fvulCurrentEpoch[fuGet4Nr] = ulEpochNr;
1176
1177 fulCurrentEpochTime = mess.getMsgFullTime(ulEpochNr);
1178
1181 if (0 < ulEpochNr) mess.setGdpbEpEpochNb(ulEpochNr - 1);
1182 else
1184
1185 Int_t iBufferSize = fvmEpSupprBuffer[fuGet4Nr].size();
1186 if (0 < iBufferSize) {
1187 LOG(debug) << "Now processing stored messages for for get4 " << fuGet4Nr << " with epoch number "
1188 << (fvulCurrentEpoch[fuGet4Nr] - 1);
1189
1192 std::stable_sort(fvmEpSupprBuffer[fuGet4Nr].begin(), fvmEpSupprBuffer[fuGet4Nr].begin());
1193
1194 for (Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++) {
1196 } // for( Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++ )
1197
1198 fvmEpSupprBuffer[fuGet4Nr].clear();
1199 } // if( 0 < fvmEpSupprBuffer[fuGet4Nr] )
1200}
1201
1203{
1204 /*
1205 if (fGdpbIdIndexMap.end() != fGdpbIdIndexMap.find(fuGdpbId))
1206 {
1207 UInt_t uChip = mess.getGdpbGenChipId();
1208 UInt_t uChan = mess.getGdpbSlcChan();
1209 UInt_t uEdge = mess.getGdpbSlcEdge();
1210 UInt_t uData = mess.getGdpbSlcData();
1211 UInt_t uType = mess.getGdpbSlcType();
1212 Double_t dGdpbChId = fuGet4Id * fuNrOfChannelsPerGet4 + mess.getGdpbSlcChan() + 0.5 * mess.getGdpbSlcEdge();
1213 Double_t dFullChId = fuGet4Nr * fuNrOfChannelsPerGet4 + mess.getGdpbSlcChan() + 0.5 * mess.getGdpbSlcEdge();
1214 Double_t dMessTime = static_cast< Double_t>( fulCurrentEpochTime ) * 1.e-9;
1215
1216
1217 }
1218*/
1219}
1220
1222{
1223 Int_t mType = mess.getMessageType();
1224 Int_t channel = mess.getGdpbHitChanId();
1225 uint64_t uData = mess.getData();
1226
1227 LOG(debug) << "Get4 MSG type " << mType << " from gdpbId " << fuGdpbId << ", getId " << fuGet4Id << ", (hit channel) "
1228 << channel << " data " << std::hex << uData;
1229}
1230
1232{
1233 if (fGdpbIdIndexMap.end() != fGdpbIdIndexMap.find(fuGdpbId))
1234 LOG(debug) << "GET4 System message, epoch " << static_cast<Int_t>(fvulCurrentEpoch[fuGet4Nr]) << ", time "
1235 << std::setprecision(9) << std::fixed << Double_t(fulCurrentEpochTime) * 1.e-9 << " s "
1236 << " for board ID " << std::hex << std::setw(4) << fuGdpbId << std::dec;
1237
1238 switch (mess.getGdpbSysSubType()) {
1240 uint32_t uData = mess.getGdpbSysErrData();
1244 LOG(debug) << " +++++++ > gDPB: " << std::hex << std::setw(4) << fuGdpbId << std::dec
1245 << ", Chip = " << std::setw(2) << mess.getGdpbGenChipId() << ", Chan = " << std::setw(1)
1246 << mess.getGdpbSysErrChanId() << ", Edge = " << std::setw(1) << mess.getGdpbSysErrEdge()
1247 << ", Empt = " << std::setw(1) << mess.getGdpbSysErrUnused() << ", Data = " << std::hex
1248 << std::setw(2) << uData << std::dec << " -- GET4 V1 Error Event";
1249 else
1250 LOG(debug) << " +++++++ >gDPB: " << std::hex << std::setw(4) << fuGdpbId << std::dec
1251 << ", Chip = " << std::setw(2) << mess.getGdpbGenChipId() << ", Chan = " << std::setw(1)
1252 << mess.getGdpbSysErrChanId() << ", Edge = " << std::setw(1) << mess.getGdpbSysErrEdge()
1253 << ", Empt = " << std::setw(1) << mess.getGdpbSysErrUnused() << ", Data = " << std::hex
1254 << std::setw(2) << uData << std::dec << " -- GET4 V1 Error Event ";
1255 break;
1256 } // case gdpbv100::SYSMSG_GET4_EVENT
1258 LOG(debug) << "Unknown GET4 message, data: " << std::hex << std::setw(8) << mess.getGdpbSysUnkwData() << std::dec
1259 << " Full message: " << std::hex << std::setw(16) << mess.getData() << std::dec;
1260 break;
1261 } // case gdpbv100::SYS_GDPB_UNKWN:
1263 if (mess.getGdpbSysFwErrResync())
1264 LOG(info) << Form("GET4 Resynchronization: Get4:0x%04x ", mess.getGdpbGenChipId()) << std::hex << std::setw(4)
1265 << fuGdpbId << std::dec;
1266 else
1267 LOG(info) << "GET4 synchronization pulse missing in gDPB " << std::hex << std::setw(4) << fuGdpbId << std::dec;
1268 break;
1269 } // case gdpbv100::SYS_GET4_SYNC_MISS:
1270 case gdpbv100::SYS_PATTERN: {
1271 LOG(debug) << "ASIC pattern for missmatch, disable or resync";
1272 break;
1273 } // case gdpbv100::SYS_PATTERN:
1274 default: {
1275 LOG(debug) << "Crazy system message, subtype " << mess.getGdpbSysSubType();
1276 break;
1277 } // default
1278
1279 } // switch( getGdpbSysSubType() )
1280}
1281
1283{
1284 /*
1285 uint16_t usType = mess.getGdpbSysPattType();
1286 uint16_t usIndex = mess.getGdpbSysPattIndex();
1287 uint32_t uPattern = mess.getGdpbSysPattPattern();
1288
1289 switch( usType )
1290 {
1291 case gdpbv100::PATT_MISSMATCH:
1292 {
1293 LOG(debug) << Form( "Missmatch pattern message => Type %d, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern );
1294 for( UInt_t uBit = 0; uBit < 32; ++uBit )
1295 if( ( uPattern >> uBit ) & 0x1 )
1296 {
1297 UInt_t uBadAsic = ConvertElinkToGet4( 32 * usIndex + uBit );
1299 if( fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId )
1300 uBadAsic = 32 * usIndex + uBit;
1301 } // if( ( uPattern >> uBit ) & 0x1 )
1302
1303 break;
1304 } // case gdpbv100::PATT_MISSMATCH:
1305 case gdpbv100::PATT_ENABLE:
1306 {
1307 for( UInt_t uBit = 0; uBit < 32; ++uBit )
1308 if( ( uPattern >> uBit ) & 0x1 )
1309 {
1310 UInt_t uBadAsic = ConvertElinkToGet4( 32 * usIndex + uBit );
1312 if( fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId )
1313 uBadAsic = 32 * usIndex + uBit;
1314 } // if( ( uPattern >> uBit ) & 0x1 )
1315
1316 break;
1317 } // case gdpbv100::PATT_ENABLE:
1318 case gdpbv100::PATT_RESYNC:
1319 {
1320 LOG(debug) << Form( "RESYNC pattern message => Type %d, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern );
1321
1322 for( UInt_t uBit = 0; uBit < 32; ++uBit )
1323 if( ( uPattern >> uBit ) & 0x1 )
1324 {
1325 UInt_t uBadAsic = ConvertElinkToGet4( 32 * usIndex + uBit );
1327 if( fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId )
1328 uBadAsic = 32 * usIndex + uBit;
1329 } // if( ( uPattern >> uBit ) & 0x1 )
1330
1331 break;
1332 } // case gdpbv100::PATT_RESYNC:
1333 default:
1334 {
1335 LOG(debug) << "Crazy pattern message, subtype " << usType;
1336 break;
1337 } // default
1338 } // switch( usType )
1339*/
1340 return;
1341}
1342
1344{
1345 Int_t iMsgIndex = mess.getStarTrigMsgIndex();
1346
1347 switch (iMsgIndex) {
1348 case 0: fvulGdpbTsMsb[fuGdpbNr] = mess.getGdpbTsMsbStarA(); break;
1349 case 1:
1352 break;
1353 case 2: fvulStarTsMid[fuGdpbNr] = mess.getStarTsMidStarC(); break;
1354 case 3: {
1355
1356 ULong64_t ulNewGdpbTsFull = (fvulGdpbTsMsb[fuGdpbNr] << 24) + (fvulGdpbTsLsb[fuGdpbNr]);
1357 ULong64_t ulNewStarTsFull =
1359 UInt_t uNewToken = mess.getStarTokenStarD();
1360 UInt_t uNewDaqCmd = mess.getStarDaqCmdStarD();
1361 UInt_t uNewTrigCmd = mess.getStarTrigCmdStarD();
1362
1363 if ((uNewToken == fvuStarTokenLast[fuGdpbNr]) && (ulNewGdpbTsFull == fvulGdpbTsFullLast[fuGdpbNr])
1364 && (ulNewStarTsFull == fvulStarTsFullLast[fuGdpbNr]) && (uNewDaqCmd == fvuStarDaqCmdLast[fuGdpbNr])
1365 && (uNewTrigCmd == fvuStarTrigCmdLast[fuGdpbNr])) {
1366 UInt_t uTrigWord = ((fvuStarTrigCmdLast[fuGdpbNr] & 0x00F) << 16)
1367 + ((fvuStarDaqCmdLast[fuGdpbNr] & 0x00F) << 12) + ((fvuStarTokenLast[fuGdpbNr] & 0xFFF));
1368 LOG(warning) << "Possible error: identical STAR tokens found twice in "
1369 "a row => ignore 2nd! "
1370 << " TS " << fulCurrentTsIndex << " gDBB #" << fuGdpbNr << " "
1371 << Form("token = %5u ", fvuStarTokenLast[fuGdpbNr])
1372 << Form("gDPB ts = %12llu ", fvulGdpbTsFullLast[fuGdpbNr])
1373 << Form("STAR ts = %12llu ", fvulStarTsFullLast[fuGdpbNr])
1374 << Form("DAQ cmd = %2u ", fvuStarDaqCmdLast[fuGdpbNr])
1375 << Form("TRG cmd = %2u ", fvuStarTrigCmdLast[fuGdpbNr]) << Form("TRG Wrd = %5x ", uTrigWord);
1376 return;
1377 } // if exactly same message repeated
1378 /*
1379 if( (uNewToken != fuStarTokenLast[fuGdpbNr] + 1) &&
1380 0 < fvulGdpbTsFullLast[fuGdpbNr] && 0 < fvulStarTsFullLast[fuGdpbNr] &&
1381 ( 4095 != fvuStarTokenLast[fuGdpbNr] || 1 != uNewToken) )
1382 LOG(warning) << "Possible error: STAR token did not increase by exactly 1! "
1383 << " gDBB #" << fuGdpbNr << " "
1384 << Form("old = %5u vs new = %5u ", fvuStarTokenLast[fuGdpbNr], uNewToken)
1385 << Form("old = %12llu vs new = %12llu ", fvulGdpbTsFullLast[fuGdpbNr], ulNewGdpbTsFull)
1386 << Form("old = %12llu vs new = %12llu ", fvulStarTsFullLast[fuGdpbNr], ulNewStarTsFull)
1387 << Form("old = %2u vs new = %2u ", fvuStarDaqCmdLast[fuGdpbNr], uNewDaqCmd)
1388 << Form("old = %2u vs new = %2u ", fvuStarTrigCmdLast[fuGdpbNr], uNewTrigCmd);
1389*/
1390 // STAR TS counter reset detection
1391 if (ulNewStarTsFull < fvulStarTsFullLast[fuGdpbNr])
1392 LOG(debug) << "Probable reset of the STAR TS: old = " << Form("%16llu", fvulStarTsFullLast[fuGdpbNr])
1393 << " new = " << Form("%16llu", ulNewStarTsFull) << " Diff = -"
1394 << Form("%8llu", fvulStarTsFullLast[fuGdpbNr] - ulNewStarTsFull);
1395
1396 /*
1397 LOG(info) << "Updating trigger token for " << fuGdpbNr
1398 << " " << fuStarTokenLast[fuGdpbNr] << " " << uNewToken;
1399*/
1400 // ULong64_t ulGdpbTsDiff = ulNewGdpbTsFull - fvulGdpbTsFullLast[fuGdpbNr];
1401 fvulGdpbTsFullLast[fuGdpbNr] = ulNewGdpbTsFull;
1402 fvulStarTsFullLast[fuGdpbNr] = ulNewStarTsFull;
1403 fvuStarTokenLast[fuGdpbNr] = uNewToken;
1404 fvuStarDaqCmdLast[fuGdpbNr] = uNewDaqCmd;
1405 fvuStarTrigCmdLast[fuGdpbNr] = uNewTrigCmd;
1406 /*
1408 if( fuCurrentMs < fuCoreMs )
1409 {
1411 if( 0 <= fdStartTime )
1412 {
1414 if( fuHistoryHistoSize < 1e-9 * (fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime) )
1415 {
1416 ResetEvolutionHistograms();
1417 fdStartTime = fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs;
1418 } // if( fuHistoryHistoSize < 1e-9 * (fulGdpbTsFullLast * gdpbv100::kdClockCycleSizeNs - fdStartTime) )
1419
1420 fvhTriggerRate[fuGdpbNr]->Fill( 1e-9 * ( fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime ) );
1421 fvhStarTokenEvo[fuGdpbNr]->Fill( 1e-9 * ( fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime ),
1422 fvuStarTokenLast[fuGdpbNr] );
1423 fvhStarTrigGdpbTsEvo[fuGdpbNr]->Fill( 1e-9 * ( fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime ),
1424 fvulGdpbTsFullLast[fuGdpbNr] );
1425 fvhStarTrigStarTsEvo[fuGdpbNr]->Fill( 1e-9 * ( fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime ),
1426 fvulStarTsFullLast[fuGdpbNr] );
1427 } // if( 0 < fdStartTime )
1428 else fdStartTime = fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs;
1429 fvhCmdDaqVsTrig[fuGdpbNr]->Fill( fvuStarDaqCmdLast[fuGdpbNr], fvuStarTrigCmdLast[fuGdpbNr] );
1430 } // if( fuCurrentMs < fuCoreMs )
1431*/
1432 break;
1433 } // case 3
1434 default: LOG(error) << "Unknown Star Trigger messageindex: " << iMsgIndex;
1435 } // switch( iMsgIndex )
1436}
1437
1439
1441{
1442 // Printout some stats on what was unpacked
1443 TString message_type;
1444 for (unsigned int i = 0; i < fviMsgCounter.size(); ++i) {
1445 switch (i) {
1446 case 0: message_type = "NOP"; break;
1447 case 1: message_type = "HIT"; break;
1448 case 2: message_type = "EPOCH"; break;
1449 case 3: message_type = "SYNC"; break;
1450 case 4: message_type = "AUX"; break;
1451 case 5: message_type = "EPOCH2"; break;
1452 case 6: message_type = "GET4"; break;
1453 case 7: message_type = "SYS"; break;
1454 case 8: message_type = "GET4_SLC"; break;
1455 case 9: message_type = "GET4_32B"; break;
1456 case 10: message_type = "GET4_SYS"; break;
1457 default: message_type = "UNKNOWN"; break;
1458 } // switch(i)
1459 LOG(info) << message_type << " messages: " << fviMsgCounter[i];
1460 } // for (unsigned int i=0; i< fviMsgCounter.size(); ++i)
1461
1462 LOG(info) << "-------------------------------------";
1463 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
1464 for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j) {
1465 LOG(info) << "Last epoch for gDPB: " << std::hex << std::setw(4) << i << std::dec << " , GET4 " << std::setw(4)
1466 << j << " => " << fvulCurrentEpoch[GetArrayIndex(i, j)];
1467 } // for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j)
1468 } // for (UInt_t i = 0; i < fuNrOfGdpbs; ++i)
1469 LOG(info) << "-------------------------------------";
1470
1471
1474 fhTimeMeanPulser->Reset();
1475 fhTimeRmsPulser->Reset();
1476
1477 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
1478 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
1479 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) {
1480 fhTimeMeanPulser->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetMean());
1481 fhTimeRmsPulser->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetRMS());
1482 } // for( UInt_t uChan = 0; uChan < kuNbChanTest - 1; uChan++)
1483
1486
1489
1491 // SaveAllHistos();
1492}
1493
1495
1497{
1499 TFile* oldFile = gFile;
1500 TDirectory* oldDir = gDirectory;
1501
1502 TFile* histoFile = NULL;
1503 if ("" != sFileName) {
1504 // open separate histo file in recreate mode
1505 histoFile = new TFile(sFileName, "RECREATE");
1506 histoFile->cd();
1507 } // if( "" != sFileName )
1508
1509 gDirectory->mkdir("Tof_Raw_gDPB");
1510 gDirectory->cd("Tof_Raw_gDPB");
1511 fhTimeMeanPulser->Write();
1512 fhTimeRmsPulser->Write();
1513 fhTimeRmsZoomFitPuls->Write();
1514 fhTimeResFitPuls->Write();
1515
1516 gDirectory->cd("..");
1517
1518
1520 gDirectory->mkdir("TofDt");
1521 gDirectory->cd("TofDt");
1522 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
1523 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
1524 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) fvhTimeDiffPulser[uFeeA][uFeeB]->Write();
1525 gDirectory->cd("..");
1526
1528 gDirectory->mkdir("TofDtEvo");
1529 gDirectory->cd("TofDtEvo");
1530 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1531 fvhPulserCountEvoPerFeeGdpb[uGdpb]->Write();
1532 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx)
1533 fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx]->Write();
1534
1535 for (UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB)
1536 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB]->Write();
1537 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1538
1539 for (UInt_t uFeeRef = 0; uFeeRef < kuNbRefFeeEvo; ++uFeeRef) {
1540 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++) {
1541 fvvhPulserTimeDiffEvoFeeFee[uFeeRef][uFee]->Write();
1542 } // for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++)
1543 } // for( UInt_t uFeeRef = 0; uFeeRef < kuNbRefFeeEvo; ++uFeeRef )
1544
1545 gDirectory->cd("..");
1546
1547 gDirectory->mkdir("TofDnlInl");
1548 gDirectory->cd("TofDnlInl");
1549 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++) {
1550 fhFeeFtDistribPerCh[uFee]->Write();
1551 fhFeeFtNormDnl[uFee]->Write();
1552 fhFeeFtNormInl[uFee]->Write();
1553 } // for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++)
1554
1555 gDirectory->cd("..");
1556
1557 gDirectory->mkdir("Flib_Raw");
1558 gDirectory->cd("Flib_Raw");
1559 for (UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++) {
1560 if (NULL == fvhMsSzPerLink[uLinks]) continue;
1561
1562 fvhMsSzPerLink[uLinks]->Write();
1563 fvhMsSzTimePerLink[uLinks]->Write();
1564 } // for( UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++ )
1565
1566 TH1* pMissedTsH1 = dynamic_cast<TH1*>(gROOT->FindObjectAny("Missed_TS"));
1567 if (NULL != pMissedTsH1) pMissedTsH1->Write();
1568
1569 TProfile* pMissedTsEvoP = dynamic_cast<TProfile*>(gROOT->FindObjectAny("Missed_TS_Evo"));
1570 if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
1571
1572 gDirectory->cd("..");
1573
1574
1575 if ("" != sFileName) {
1576 // Restore original directory position
1577 histoFile->Close();
1578 } // if( "" != sFileName )
1579
1581 gFile = oldFile;
1582 gDirectory = oldDir;
1583}
1584
1586{
1587 LOG(info) << "Reseting all TOF histograms.";
1588
1589
1591 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
1592 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
1593 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) fvhTimeDiffPulser[uFeeA][uFeeB]->Reset();
1594
1595 fhTimeMeanPulser->Reset();
1596 fhTimeRmsPulser->Reset();
1597 fhTimeRmsZoomFitPuls->Reset();
1598 fhTimeResFitPuls->Reset();
1599
1600 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1601 fvhPulserCountEvoPerFeeGdpb[uGdpb]->Reset();
1602 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx)
1603 fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx]->Reset();
1604
1605 for (UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB)
1606 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB]->Reset();
1607 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1608
1609 for (UInt_t uFeeRef = 0; uFeeRef < kuNbRefFeeEvo; ++uFeeRef) {
1610 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++) {
1611 fvvhPulserTimeDiffEvoFeeFee[uFeeRef][uFee]->Reset();
1612 } // for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++)
1613 } // for( UInt_t uFeeRef = 0; uFeeRef < kuNbRefFeeEvo; ++uFeeRef )
1614
1615 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++) {
1616 fhFeeFtDistribPerCh[uFee]->Reset();
1617 fhFeeFtNormDnl[uFee]->Reset();
1618 fhFeeFtNormInl[uFee]->Reset();
1619 } // for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFee++)
1620
1621 for (UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++) {
1622 if (NULL == fvhMsSzPerLink[uLinks]) continue;
1623
1624 fvhMsSzPerLink[uLinks]->Reset();
1625 fvhMsSzTimePerLink[uLinks]->Reset();
1626 } // for( UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++ )
1627
1628 fdStartTime = -1;
1629 fdStartTimeLong = -1;
1630 fdStartTimeMsSz = -1;
1631}
1634
1636{
1637 // Only do something is the user defined the width he want for the zoom
1638 if (0.0 < fdFitZoomWidthPs) {
1639 // Reset summary histograms for safety
1640 fhTimeRmsZoomFitPuls->Reset();
1641 fhTimeResFitPuls->Reset();
1642
1643 Double_t dRes = 0;
1645
1646 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
1647 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
1648 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) {
1649 // Check that we have at least 1 entry
1650 if (0 == fvhTimeDiffPulser[uFeeA][uFeeB]->GetEntries()) {
1651 fhTimeRmsZoomFitPuls->Fill(uFeeA, uFeeB, 0.0);
1652 fhTimeResFitPuls->Fill(uFeeA, uFeeB, 0.0);
1653 LOG(info) << "CbmMcbm2018MonitorTofPulser::UpdateZoomedFit => Empty input "
1654 << "for FEE pair " << uFeeA << " and " << uFeeB << " !!! ";
1655 continue;
1656 } // if( 0 == fvhTimeDiffPulser[uFeeA][uFeeB]->GetEntries() )
1657
1658 // Read the peak position (bin with max counts) + total nb of entries
1659 Int_t iBinWithMax = fvhTimeDiffPulser[uFeeA][uFeeB]->GetMaximumBin();
1660 Double_t dNbCounts = fvhTimeDiffPulser[uFeeA][uFeeB]->Integral();
1661
1662 // Zoom the X axis to +/- ZoomWidth around the peak position
1663 Double_t dPeakPos = fvhTimeDiffPulser[uFeeA][uFeeB]->GetXaxis()->GetBinCenter(iBinWithMax);
1664 fvhTimeDiffPulser[uFeeA][uFeeB]->GetXaxis()->SetRangeUser(dPeakPos - fdFitZoomWidthPs,
1665 dPeakPos + fdFitZoomWidthPs);
1666
1667 // Read integral and check how much we lost due to the zoom (% loss allowed)
1668 Double_t dZoomCounts = fvhTimeDiffPulser[uFeeA][uFeeB]->Integral();
1669 if ((dZoomCounts / dNbCounts) < 0.99) {
1670 fhTimeRmsZoomFitPuls->Fill(uFeeA, uFeeB, 0.0);
1671 fhTimeResFitPuls->Fill(uFeeA, uFeeB, 0.0);
1672 LOG(warning) << "CbmMcbm2018MonitorTofPulser::UpdateZoomedFit => "
1673 "Zoom too strong, "
1674 << "more than 1% loss for FEE pair " << uFeeA << " and " << uFeeB << " !!! ";
1675 continue;
1676 } // if( ( dZoomCounts / dNbCounts ) < 0.99 )
1677
1678 // Fill new RMS after zoom into summary histo
1679 fhTimeRmsZoomFitPuls->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetRMS());
1680
1681
1682 // Fit using zoomed boundaries + starting gaussian width, store into summary histo
1683 dRes = 0;
1684 fitFuncPairs[uFeeA][uFeeB] = new TF1(Form("fPair_%02d_%02d", uFeeA, uFeeB), "gaus",
1685 dPeakPos - fdFitZoomWidthPs, dPeakPos + fdFitZoomWidthPs);
1686 // Fix the Mean fit value around the Histogram Mean
1687 fitFuncPairs[uFeeA][uFeeB]->SetParameter(0, dZoomCounts);
1688 fitFuncPairs[uFeeA][uFeeB]->SetParameter(1, dPeakPos);
1689 fitFuncPairs[uFeeA][uFeeB]->SetParameter(2, 200.0); // Hardcode start with ~4*BinWidth, do better later
1690 // Using integral instead of bin center seems to lead to unrealistic values => no "I"
1691 fvhTimeDiffPulser[uFeeA][uFeeB]->Fit(Form("fPair_%02d_%02d", uFeeA, uFeeB), "QRM0");
1692 // Get Sigma
1693 dRes = fitFuncPairs[uFeeA][uFeeB]->GetParameter(2);
1694 // Cleanup memory
1695 delete fitFuncPairs[uFeeA][uFeeB];
1696 // Fill summary
1697 fhTimeResFitPuls->Fill(uFeeA, uFeeB, dRes / TMath::Sqrt2());
1698
1699
1700 LOG(info) << "CbmMcbm2018MonitorTofPulser::UpdateZoomedFit => "
1701 << "For FEE pair " << uFeeA << " and " << uFeeB
1702 << " we have zoomed RMS = " << fvhTimeDiffPulser[uFeeA][uFeeB]->GetRMS() << " and a resolution of "
1703 << dRes / TMath::Sqrt2();
1704
1705 // Restore original axis state?
1706 fvhTimeDiffPulser[uFeeA][uFeeB]->GetXaxis()->UnZoom();
1707 } // loop on uFeeA and uFeeB + check if corresponding fvhTimeDiffPulser exists
1708 } // if( 0.0 < fdFitZoomWidthPs )
1709 else {
1710 LOG(error) << "CbmMcbm2018MonitorTofPulser::UpdateZoomedFit => Zoom width "
1711 "not defined, "
1712 << "please use SetFitZoomWidthPs, e.g. in macro, before trying "
1713 "this update !!!";
1714 } // else of if( 0.0 < fdFitZoomWidthPs )
1715}
1717{
1718 TDirectory* oldDir = gDirectory;
1719
1720 gROOT->cd();
1721 TF1* constantVal = new TF1("constant", "1", 0, gdpbv100::kdFtBinsNb);
1722 for (UInt_t uFeeNrInSys = 0; uFeeNrInSys < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeNrInSys++) {
1723 fhFeeFtNormDnl[uFeeNrInSys]->Reset();
1724 fhFeeFtNormInl[uFeeNrInSys]->Reset();
1725
1726 for (UInt_t uChannel = 0; uChannel < fuNrOfChannelsPerFee; uChannel++) {
1727 // Rising edge
1728 TH1* pFtSelChSlice =
1729 fhFeeFtDistribPerCh[uFeeNrInSys]->ProjectionX("temp_pFtSelChSlice", 1 + uChannel, 1 + uChannel);
1730 if (0 < pFtSelChSlice->GetEntries()) {
1731 Double_t dNormFactRise = pFtSelChSlice->GetEntries() / gdpbv100::kdFtBinsNb;
1732 pFtSelChSlice->Scale(1.0 / dNormFactRise);
1733 pFtSelChSlice->Add(constantVal, -1.);
1734 } // if( 0 < pFtSelChSliceRise->GetEntries() )
1735
1736 // INLs + storage
1737 Double_t dDnl = 0.0;
1738 Double_t dInl = 0.0;
1739 for (UInt_t uFtBin = 0; uFtBin < gdpbv100::kdFtBinsNb; uFtBin++) {
1740 dDnl = pFtSelChSlice->GetBinContent(1 + uFtBin);
1741 dInl += dDnl;
1742 fhFeeFtNormDnl[uFeeNrInSys]->Fill(uFtBin, uChannel, dDnl);
1743 fhFeeFtNormInl[uFeeNrInSys]->Fill(uFtBin, uChannel, dInl);
1744 } // for( UInt_t uFtBin = 0; uFtBin < gdpbv100::kuFineCounterSize; uFtBin++)
1745
1746 delete pFtSelChSlice;
1747 } // for( UInt_t uChannel = 0; uChannel < fuNrOfChannelsPerFee; uChannel++ )
1748 } // for( UInt_t uFeeNrInSys = 0; uFeeNrInSys < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeNrInSys++ )
1749 delete constantVal;
1750
1751 oldDir->cd();
1752}
1753
ClassImp(CbmConverterManager)
std::string FormatDecPrintout(uint64_t ulVal, char cFill, uint uWidth)
std::string FormatHexPrintout(uint64_t ulVal, char cFill, uint uWidth, bool bUppercase)
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Histogram manager.
Bool_t bMcbmMoniTofPulserSaveHistos
Bool_t bMcbmMoniTofPulserPrintAllHitsEna
Bool_t bMcbmMoniTofPulserUpdateZoomedFit
Bool_t bMcbmMoniTofPulserResetHistos
Bool_t bMcbmMoniTofPulserUpdateDnlInl
Bool_t bMcbmMoniTofPulserPrintAllEpochsEna
Bool_t bMcbmMoniTofPulserRawDataPrint
static double dTsStartTime
static constexpr size_t size()
Definition KfSimdPseudo.h:2
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
std::chrono::time_point< std::chrono::system_clock > fTimeLastHistoSaving
size_t fuMsAcceptsPercent
OLD, to be cleaned out !!!!!
std::vector< TProfile * > fvhPulserTimeDiffEvoGbtxGbtx
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
std::vector< ULong64_t > fvulCurrentEpochCycle
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
std::vector< std::vector< TProfile * > > fvvhPulserTimeDiffEvoGdpbGdpb
std::vector< std::vector< TH1 * > > fvhTimeDiffPulser
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
std::vector< ULong64_t > fvulGdpbTsFullLast
std::vector< TProfile * > fvhMsSzTimePerLink
const UInt_t kuNbBinsDt
[ fuNrOfGdpbs ][ fuNrOfChannelsPerGdpb ]
std::vector< UInt_t > fvuElinkToGet4
5 FEE with 8 GET4 each
UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
std::vector< UInt_t > fvuFeeNbHitsLastMs
Buffer for pulser channels.
void ProcessEpochCycle(uint64_t ulCycleData)
ULong64_t fulCurrentEpochTime
Epoch + Epoch Cycle.
std::vector< std::vector< TProfile * > > fvvhPulserTimeDiffEvoFeeFee
std::vector< ULong64_t > fvulStarTsFullLast
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
const UInt_t kuRefFeeEvoIdx[kuNbRefFeeEvo]
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::vector< std::vector< gdpbv100::Message > > fvmEpSupprBuffer
Buffer for suppressed epoch processing.
std::vector< ULong64_t > fvulCurrentEpoch
TString fsHistoFileFullname
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
std::vector< size_t > fvMsComponentsList
FLES containers.
std::vector< Double_t > fdTsLastPulserHit
[ fuFeeNr ]
Int_t GetModuleId(Int_t i)
Int_t GetRpcSide(Int_t i)
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
Int_t GetNrOfRpc(Int_t i)
Int_t GetGdpbId(Int_t i)
Int_t GetRpcType(Int_t i)
Data class with information on a STS local track.
uint16_t getGdpbHitIs24b() const
uint16_t getStarTrigMsgIndex() const
uint32_t getGdpbEpEpochNb() const
uint16_t getGdpbHit32Tot() const
uint64_t getStarTsMidStarC() const
uint16_t getGdpbSysSubType() const
uint64_t getGdpbTsLsbStarB() const
bool getGdpbEpMissmatch() const
double getMsgFullTimeD(uint64_t epoch) const
Returns expanded and adjusted time of message in double (in ns)
void setGdpbGenChipId(uint32_t v)
uint16_t getGdpbHitFineTs() const
void setGdpbEpEpochNb(uint32_t v)
bool getGdpbEpSync() const
uint32_t getGdpbSysFwErrResync() const
uint64_t getStarTsMsbStarB() const
uint32_t getGdpbHitFullTs() const
uint32_t getStarTrigCmdStarD() const
bool isStarTrigger() const
Returns true is message type is MSG_STAR_TRI_A, _B, _C, _D (STAR Trigger message)
bool getGdpbEpEpochLoss() const
uint32_t getStarDaqCmdStarD() const
uint64_t getGdpbTsMsbStarA() const
uint16_t getGdpbGenChipId() const
uint16_t getGdpbSysErrUnused() const
void printDataCout(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to cout.
bool getGdpbEpDataLoss() const
uint32_t getStarTokenStarD() const
bool getGdpbEpLinkId() const
uint64_t getStarTsLsbStarD() const
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
uint32_t getGdpbSysUnkwData() const
uint64_t getData() const
uint16_t getGdpbSysErrData() const
bool getGdpbSysErrEdge() const
uint16_t getGdpbSysErrChanId() const
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
uint16_t getGdpbHitChanId() const
const uint64_t kulEpochCycleBins
@ GET4_V2X_ERR_TOT_RANGE
@ GET4_V2X_ERR_ADD_RIS_EDG
@ GET4_V2X_ERR_TOT_OVERWRT
@ GET4_V2X_ERR_EVT_DISCARD
@ GET4_V2X_ERR_UNPAIR_FALL
@ GET4_V2X_ERR_SEQUENCE_ER
const uint32_t kuChipIdMergedEpoch
const double kdFtBinsNb
const uint32_t kuFeePulserChannel
const uint32_t kuEpochCounterSz
const uint64_t kulEpochCycleFieldSz
@ SYS_GET4_SYNC_MISS