CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018TofTestFee.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// ----- CbmMcbm2018TofTestFee -----
8// ----- Created 10.07.2018 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
13
14#include "CbmFlesHistosTools.h"
17#include "CbmHistManager.h"
18#include "CbmMcbm2018TofPar.h"
19#include "FairRootManager.h"
20#include "FairRun.h"
21#include "FairRunOnline.h"
22#include "FairRuntimeDb.h"
23#include "Rtypes.h"
24#include "TCanvas.h"
25#include "TClonesArray.h"
26#include "TF1.h"
27#include "TH1.h"
28#include "TH2.h"
29#include "THStack.h"
30#include "THttpServer.h"
31#include "TMath.h"
32#include "TPaveStats.h"
33#include "TProfile.h"
34#include "TProfile2D.h"
35#include "TROOT.h"
36#include "TString.h"
37#include "TStyle.h"
38
39#include <Logger.h>
40
41#include <TFile.h>
42
43#include <algorithm>
44#include <cstdint>
45#include <ctime>
46#include <iomanip>
47#include <iostream>
48
55
61 , fbIgnoreOverlapMs(kFALSE)
62 , fsHistoFileFullname("data/TofPulserHistos.root")
64 , fuTotalMsNb(0)
65 , fuOverlapMsNb(0)
66 , fuCoreMs(0)
67 , fdMsSizeInNs(0.0)
68 , fdTsCoreSizeInNs(0.0)
69 , fuMinNbGdpb(0)
70 , fuCurrNbGdpb(0)
71 , fUnpackPar()
72 , fuNrOfGdpbs(0)
77 , fuNrOfGet4(0)
80 , fuRawDataPrintMsgNb(100000)
82 , fbPrintAllHitsEnable(kFALSE)
85 , fuCurrentMs(0)
87 , fdMsIndex(0)
88 , fuGdpbId(0)
89 , fuGdpbNr(0)
90 , fuGet4Id(0)
91 , fuGet4Nr(0)
92 , fiEquipmentId(0)
93 , fviMsgCounter(11, 0)
94 , // length of enum MessageTypes initialized with 0
113 , dMinDt(-1. * (kuNbBinsDt * gdpbv100::kdBinSize / 2.) - gdpbv100::kdBinSize / 2.)
114 , dMaxDt(1. * (kuNbBinsDt * gdpbv100::kdBinSize / 2.) + gdpbv100::kdBinSize / 2.)
115 , fuNbFeePlot(2)
117 , fdStartTime(-1.)
118 , fdStartTimeLong(-1.)
119 , fdStartTimeMsSz(-1.)
120 , fuHistoryHistoSize(1800)
122 , fdFitZoomWidthPs(0.0)
123 , fcMsSizeAll(NULL)
124 , fvhMsSzPerLink(12, NULL)
125 , fvhMsSzTimePerLink(12, NULL)
126 , fuGdpbA(0)
127 , fuGbtxA(0)
128 , fuFeeA(0)
129 , fuGlobalIdxFeeA(0)
130 , fuGdpbB(0)
131 , fuGbtxB(0)
132 , fuFeeB(1)
133 , fuGlobalIdxFeeB(1)
136 , fhTimeRmsPulserFeeA(NULL)
141 , fhTimeRmsPulserFeeB(NULL)
149 , fhChanTotFeeA(NULL)
150 , fhChanTotFeeB(NULL)
154 , fcPulserFeeA(NULL)
155 , fcPulserFeeB(NULL)
156 , fcPulserFeeFee(NULL)
157 , fcPulseProp(NULL)
158 , fvuPadiToGet4()
159 , fvuGet4ToPadi()
163{
164}
165
167
169{
170 LOG(info) << "Initializing Get4 monitor";
171
172 FairRootManager* ioman = FairRootManager::Instance();
173 if (ioman == NULL) { LOG(fatal) << "No FairRootManager instance"; } // if( ioman == NULL )
174
175 return kTRUE;
176}
177
179{
180 LOG(info) << "Setting parameter containers for " << GetName();
181 fUnpackPar = (CbmMcbm2018TofPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer("CbmMcbm2018TofPar"));
182}
183
185{
186 LOG(info) << "Init parameter containers for " << GetName();
187 Bool_t initOK = ReInitContainers();
188
190
195 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
196 for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j) {
200 } // for( UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j )
201 } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
202
203 return initOK;
204}
205
207{
208 LOG(info) << "ReInit parameter containers for " << GetName();
209
210 fuNrOfGdpbs = fUnpackPar->GetNrOfGdpbs();
211 LOG(info) << "Nr. of Tof GDPBs: " << fuNrOfGdpbs;
213
214 fuNrOfFeePerGdpb = fUnpackPar->GetNrOfFeesPerGdpb();
215 LOG(info) << "Nr. of FEEs per Tof GDPB: " << fuNrOfFeePerGdpb;
216
217 fuNrOfGet4PerFee = fUnpackPar->GetNrOfGet4PerFee();
218 LOG(info) << "Nr. of GET4 per Tof FEE: " << fuNrOfGet4PerFee;
219
220 fuNrOfChannelsPerGet4 = fUnpackPar->GetNrOfChannelsPerGet4();
221 LOG(info) << "Nr. of channels per GET4: " << fuNrOfChannelsPerGet4;
222
224 LOG(info) << "Nr. of channels per FEE: " << fuNrOfChannelsPerFee;
225
227 LOG(info) << "Nr. of GET4s: " << fuNrOfGet4;
228
230 LOG(info) << "Nr. of GET4s per GDPB: " << fuNrOfGet4PerGdpb;
231
233 LOG(info) << "Nr. of channels per GDPB: " << fuNrOfChannelsPerGdpb;
234
235 fGdpbIdIndexMap.clear();
236 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
237 fGdpbIdIndexMap[fUnpackPar->GetGdpbId(i)] = i;
238 LOG(info) << "GDPB Id of TOF " << i << " : " << std::hex << fUnpackPar->GetGdpbId(i) << std::dec;
239 } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
240
241 fuNrOfGbtx = fUnpackPar->GetNrOfGbtx();
242 LOG(info) << "Nr. of GBTx: " << fuNrOfGbtx;
243
244 fuNrOfModules = fUnpackPar->GetNrOfModules();
245 LOG(info) << "Nr. of GBTx: " << fuNrOfModules;
246
247 fviRpcType.resize(fuNrOfGbtx);
248 fviModuleId.resize(fuNrOfGbtx);
249 fviNrOfRpc.resize(fuNrOfGbtx);
250 fviRpcSide.resize(fuNrOfGbtx);
251 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx) {
252 fviNrOfRpc[uGbtx] = fUnpackPar->GetNrOfRpc(uGbtx);
253 fviRpcType[uGbtx] = fUnpackPar->GetRpcType(uGbtx);
254 fviRpcSide[uGbtx] = fUnpackPar->GetRpcSide(uGbtx);
255 fviModuleId[uGbtx] = fUnpackPar->GetModuleId(uGbtx);
256 } // for( UInt_t uGbtx = 0; uGbtx < uNrOfGbtx; ++uGbtx)
257
258 TString sPrintoutLine = "Nr. of RPCs per GBTx: ";
259 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
260 sPrintoutLine += Form(" %2d", fviNrOfRpc[uGbtx]);
261 LOG(info) << sPrintoutLine;
262
263 sPrintoutLine = "RPC type per GBTx: ";
264 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
265 sPrintoutLine += Form(" %2d", fviRpcType[uGbtx]);
266 LOG(info) << sPrintoutLine;
267
268 sPrintoutLine = "RPC side per GBTx: ";
269 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
270 sPrintoutLine += Form(" %2d", fviRpcSide[uGbtx]);
271 LOG(info) << sPrintoutLine;
272
273 sPrintoutLine = "Module ID per GBTx: ";
274 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
275 sPrintoutLine += Form(" %2d", fviModuleId[uGbtx]);
276 LOG(info) << sPrintoutLine;
277
278 fuTotalMsNb = fUnpackPar->GetNbMsTot();
279 fuOverlapMsNb = fUnpackPar->GetNbMsOverlap();
281 fdMsSizeInNs = fUnpackPar->GetSizeMsInNs();
283 LOG(info) << "Timeslice parameters: " << fuTotalMsNb << " MS per link, of which " << fuOverlapMsNb
284 << " overlap MS, each MS is " << fdMsSizeInNs << " ns";
285
296 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
297 fvulGdpbTsMsb[uGdpb] = 0;
298 fvulGdpbTsLsb[uGdpb] = 0;
299 fvulStarTsMsb[uGdpb] = 0;
300 fvulStarTsMid[uGdpb] = 0;
301 fvulGdpbTsFullLast[uGdpb] = 0;
302 fvulStarTsFullLast[uGdpb] = 0;
303 fvuStarTokenLast[uGdpb] = 0;
304 fvuStarDaqCmdLast[uGdpb] = 0;
305 fvuStarTrigCmdLast[uGdpb] = 0;
306 } // for (Int_t iGdpb = 0; iGdpb < fuNrOfGdpbs; ++iGdpb)
307
309
311 fuGlobalIdxFeeA = fuNrOfFeePerGdpb * fuGdpbA + fUnpackPar->GetNrOfFeePerGbtx() * fuGbtxA + fuFeeA;
312 fuGlobalIdxFeeB = fuNrOfFeePerGdpb * fuGdpbB + fUnpackPar->GetNrOfFeePerGbtx() * fuGbtxB + fuFeeB;
313
316 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFee) {
319 } // for( UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFee );
320
324 /*
325 UInt_t uGet4topadi[32] = {
326 4, 3, 2, 1, // provided by Jochen
327 24, 23, 22, 21,
328 8, 7, 6, 5,
329 28, 27, 26, 25,
330 12, 11, 10, 9,
331 32, 31, 30, 29,
332 16, 15, 14, 13,
333 20, 19, 18, 17 };
334*/
336 UInt_t uGet4topadi[32] = {4, 3, 2, 1, // provided by Jochen
337 8, 7, 6, 5, 12, 11, 10, 9, 16, 15, 14, 13, 20, 19,
338 18, 17, 24, 23, 22, 21, 28, 27, 26, 25, 32, 31, 30, 29};
339
340 UInt_t uPaditoget4[32] = {4, 3, 2, 1, // provided by Jochen
341 12, 11, 10, 9, 20, 19, 18, 17, 28, 27, 26, 25, 32, 31,
342 30, 29, 8, 7, 6, 5, 16, 15, 14, 13, 24, 23, 22, 21};
343
344 for (UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan) {
345 fvuPadiToGet4[uChan] = uPaditoget4[uChan] - 1;
346 fvuGet4ToPadi[uChan] = uGet4topadi[uChan] - 1;
347 } // for( UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan )
348
349
353 UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14,
354 10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23,
355 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11};
356 UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = {24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11,
357 13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0,
358 30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36};
359
360 for (UInt_t uLinkAsic = 0; uLinkAsic < kuNbGet4PerGbtx; ++uLinkAsic) {
361 fvuElinkToGet4[uLinkAsic] = kuElinkToGet4[uLinkAsic];
362 fvuGet4ToElink[uLinkAsic] = kuGet4ToElink[uLinkAsic];
363 } // for( UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan )
364
365 return kTRUE;
366}
367
368
369void CbmMcbm2018TofTestFee::AddMsComponentToList(size_t component, UShort_t /*usDetectorId*/)
370{
372 for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
373 if (component == fvMsComponentsList[uCompIdx]) return;
374
376 fvMsComponentsList.push_back(component);
377
379 if (NULL == fvhMsSzPerLink[component]) {
380 TString sMsSzName = Form("MsSz_link_%02lu", component);
381 TString sMsSzTitle = Form("Size of MS from link %02lu; Ms Size [bytes]", component);
382 fvhMsSzPerLink[component] = new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
383
384 sMsSzName = Form("MsSzTime_link_%02lu", component);
385 sMsSzTitle = Form("Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]", component);
386 fvhMsSzTimePerLink[component] =
387 new TProfile(sMsSzName.Data(), sMsSzTitle.Data(), 100 * fuHistoryHistoSize, 0., 2 * fuHistoryHistoSize);
388 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
389 if (server) {
390 server->Register("/FlibRaw", fvhMsSzPerLink[component]);
391 server->Register("/FlibRaw", fvhMsSzTimePerLink[component]);
392 } // if( server )
393 if (NULL != fcMsSizeAll) {
394 fcMsSizeAll->cd(1 + component);
395 gPad->SetLogy();
396 fvhMsSzTimePerLink[component]->Draw("hist le0");
397 } // if( NULL != fcMsSizeAll )
398 LOG(info) << "Added MS size histo for component (link): " << component;
399 } // if( NULL == fvhMsSzPerLink[ component ] )
400}
401void CbmMcbm2018TofTestFee::SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
402{
403 fuNbCoreMsPerTs = uCoreMsNb;
404 fuNbOverMsPerTs = uOverlapMsNb;
405
406 // UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
407}
408
410{
411 LOG(info) << "create Histos for " << fuNrOfGdpbs << " gDPBs ";
412
413 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
414
415 TString name {""};
416 TString title {""};
417
418 // Full Fee time difference test
419 UInt_t uNbBinsDt = kuNbBinsDt + 1; // To account for extra bin due to shift by 1/2 bin of both ranges
420
422 Double_t dBinSzG4v2 = (6250. / 112.);
423 dMinDt = -1. * (kuNbBinsDt * dBinSzG4v2 / 2.) - dBinSzG4v2 / 2.;
424 dMaxDt = 1. * (kuNbBinsDt * dBinSzG4v2 / 2.) + dBinSzG4v2 / 2.;
425
426
427 /*******************************************************************/
432 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++) {
436 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++) {
437 if (uChanA < uChanB) {
438 fvhTimeDiffPulserFeeA[uChanA][uChanB] =
439 new TH1I(Form("hTimeDiffPulser_g%02u_gbt%1u_f%1u_ch%02u_ch%02u", fuGdpbA, fuGbtxA, fuFeeA, uChanA, uChanB),
440 Form("Time difference for pulser on gDPB %02u GBTx %02u FEE "
441 "%1u channels %02u and %02u; DeltaT [ps]; Counts",
442 fuGdpbA, fuGbtxA, fuFeeA, uChanA, uChanB),
443 uNbBinsDt, dMinDt, dMaxDt);
444
445 fvhTimeDiffPulserFeeB[uChanA][uChanB] =
446 new TH1I(Form("hTimeDiffPulser_g%02u_gbt%1u_f%1u_ch%02u_ch%02u", fuGdpbB, fuGbtxB, fuFeeB, uChanA, uChanB),
447 Form("Time difference for pulser on gDPB %02u GBTx %02u FEE "
448 "%1u channels %02u and %02u; DeltaT [ps]; Counts",
449 fuGdpbB, fuGbtxB, fuFeeB, uChanA, uChanB),
450 uNbBinsDt, dMinDt, dMaxDt);
451 } // if( uChanA < uFeeB )
452 else {
453 fvhTimeDiffPulserFeeA[uChanA][uChanB] = NULL;
454 fvhTimeDiffPulserFeeB[uChanA][uChanB] = NULL;
455 } // else of if( uChanA < uChanB )
456
457 fvhTimeDiffPulserFeeFee[uChanA][uChanB] =
458 new TH1I(Form("hTimeDiffPulser_g%02u_gbt%1u_f%1u_ch%02u_g%02u_gbt%1u_f%1u_ch%02u", fuGdpbA, fuGbtxA, fuFeeA,
459 uChanA, fuGdpbB, fuGbtxB, fuFeeB, uChanB),
460 Form("Time difference for pulser on gDPB %02u GBTx %02u FEE %1u "
461 "channel %02u and gDPB %02u GBTx %02u FEE %1u channel %02u; "
462 "DeltaT [ps]; Counts",
463 fuGdpbA, fuGbtxA, fuFeeA, uChanA, fuGdpbB, fuGbtxB, fuFeeB, uChanB),
464 uNbBinsDt, dMinDt, dMaxDt);
465 } // for( UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
466 } // for( UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
467
469 name = "hTimeMeanPulserFeeA";
470 fhTimeMeanPulserFeeA = new TH2D(name.Data(),
471 "Time difference Mean for each channel pairs "
472 "in FEE A; Chan A; Chan B ; Mean [ps]",
474 0.5, fuNrOfChannelsPerFee - 0.5);
475
476 name = "hTimeRmsPulserFeeA";
477 fhTimeRmsPulserFeeA = new TH2D(name.Data(),
478 "Time difference RMS for each channel pairs "
479 "in FEE A; Chan A; Chan B; RMS [ps]",
481 0.5, fuNrOfChannelsPerFee - 0.5);
482
483 name = "hTimeRmsZoomFitPulsFeeA";
484 fhTimeRmsZoomFitPulsFeeA = new TH2D(name.Data(),
485 "Time difference RMS after zoom for each channel pairs in FEE A; "
486 "Chan A; Chan B; RMS [ps]",
489
490 name = "hTimeResFitPulsFeeA";
491 fhTimeResFitPulsFeeA = new TH2D(name.Data(),
492 "Time difference Res from fit for each channel pairs in FEE A; "
493 "Chan A; Chan B; Sigma [ps]",
495 0.5, fuNrOfChannelsPerFee - 0.5);
496
498 name = "hTimeMeanPulserFeeB";
499 fhTimeMeanPulserFeeB = new TH2D(name.Data(),
500 "Time difference Mean for each channel pairs "
501 "in FEE B; Chan A; Chan B ; Mean [ps]",
503 0.5, fuNrOfChannelsPerFee - 0.5);
504
505 name = "hTimeRmsPulserFeeB";
506 fhTimeRmsPulserFeeB = new TH2D(name.Data(),
507 "Time difference RMS for each channel pairs "
508 "in FEE B; Chan A; Chan B; RMS [ps]",
510 0.5, fuNrOfChannelsPerFee - 0.5);
511
512 name = "hTimeRmsZoomFitPulsFeeB";
513 fhTimeRmsZoomFitPulsFeeB = new TH2D(name.Data(),
514 "Time difference RMS after zoom for each channel pairs in FEE B; "
515 "Chan A; Chan B; RMS [ps]",
518
519 name = "hTimeResFitPulsFeeB";
520 fhTimeResFitPulsFeeB = new TH2D(name.Data(),
521 "Time difference Res from fit for each channel pairs in FEE B; "
522 "Chan A; Chan B; Sigma [ps]",
524 0.5, fuNrOfChannelsPerFee - 0.5);
525
527 name = "hTimeMeanPulserFeeFee";
528 fhTimeMeanPulserFeeFee = new TH2D(name.Data(),
529 "Time difference Mean for each channel pairs in FEE A & B; Chan "
530 "FEE A; Chan FEE B ; Mean [ps]",
533
534 name = "hTimeRmsPulserFeeFee";
535 fhTimeRmsPulserFeeFee = new TH2D(name.Data(),
536 "Time difference RMS for each channel pairs in FEE A & B; Chan "
537 "FEE A; Chan FEE B; RMS [ps]",
540
541 name = "hTimeRmsZoomFitPulsFeeFee";
542 fhTimeRmsZoomFitPulsFeeFee = new TH2D(name.Data(),
543 "Time difference RMS after zoom for each channel pairs in FEE A & "
544 "B; Chan FEE A; Chan FEE B; RMS [ps]",
546 -0.5, fuNrOfChannelsPerFee - 0.5);
547
548 name = "hTimeResFitPulsFeeFee";
549 fhTimeResFitPulsFeeFee = new TH2D(name.Data(),
550 "Time difference Res from fit for each channel pairs in FEE A & "
551 "B; Chan FEE A; Chan FEE B; Sigma [ps]",
554
556 name = "hChanTotFeeA";
557 fhChanTotFeeA = new TH2D(name.Data(), "TOT distribution per channel in FEE A; Chan FEE A; TOT [bin]; Counts []",
560 name = "hChanTotFeeB";
561 fhChanTotFeeB = new TH2D(name.Data(), "TOT distribution per channel in FEE B; Chan FEE B; TOT [bin]; Counts []",
564
567 uint32_t iNbBinsLog = 0;
569 std::vector<double> dBinsLogVector = GenerateLogBinArray(9, 9, 10, iNbBinsLog);
570 double* dBinsLog = dBinsLogVector.data();
571 // double * dBinsLog = GenerateLogBinArray( 9, 9, 10, iNbBinsLog );
572
573 name = "hChanPulseIntervalFeeA";
574 fhChanPulseIntervalFeeA = new TH2D(name.Data(),
575 "Pulses time interval per channel in FEE A; Time interval [ns]; "
576 "Chan FEE A; Counts []",
577 iNbBinsLog, dBinsLog, fuNrOfChannelsPerFee, -0.5, fuNrOfChannelsPerFee - 0.5);
578 name = "hChanPulseIntervalFeeB";
579 fhChanPulseIntervalFeeB = new TH2D(name.Data(),
580 "Pulses time interval per channel in FEE B; Time interval [ns]; "
581 "Chan FEE B; Counts []",
582 iNbBinsLog, dBinsLog, fuNrOfChannelsPerFee, -0.5, fuNrOfChannelsPerFee - 0.5);
583
584 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
585 name = Form("hPulserCountEvoPerFeeGdpb%02u", uGdpb);
587 new TH2D(name.Data(), Form("Pulser count per FEE in gDPB %02u; time in run [s]; FEE []", uGdpb),
589 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
590
592 // delete dBinsLog;
593
594 if (server) {
595 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
596 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++) {
597 if (NULL != fvhTimeDiffPulserFeeA[uChanA][uChanB])
598 server->Register("/TofDtFeeA", fvhTimeDiffPulserFeeA[uChanA][uChanB]);
599 if (NULL != fvhTimeDiffPulserFeeB[uChanA][uChanB])
600 server->Register("/TofDtFeeB", fvhTimeDiffPulserFeeB[uChanA][uChanB]);
601
602 server->Register("/TofDtFeeFee", fvhTimeDiffPulserFeeFee[uChanA][uChanB]);
603 } // Loop anc channels A and B
604
605 server->Register("/TofDt", fhTimeMeanPulserFeeA);
606 server->Register("/TofDt", fhTimeRmsPulserFeeA);
607 server->Register("/TofDt", fhTimeRmsZoomFitPulsFeeA);
608 server->Register("/TofDt", fhTimeResFitPulsFeeA);
609
610 server->Register("/TofDt", fhTimeMeanPulserFeeB);
611 server->Register("/TofDt", fhTimeRmsPulserFeeB);
612 server->Register("/TofDt", fhTimeRmsZoomFitPulsFeeB);
613 server->Register("/TofDt", fhTimeResFitPulsFeeB);
614
615 server->Register("/TofDt", fhTimeMeanPulserFeeFee);
616 server->Register("/TofDt", fhTimeRmsPulserFeeFee);
617 server->Register("/TofDt", fhTimeRmsZoomFitPulsFeeFee);
618 server->Register("/TofDt", fhTimeResFitPulsFeeFee);
619
620 server->Register("/TofPulse", fhChanTotFeeA);
621 server->Register("/TofPulse", fhChanTotFeeB);
622 server->Register("/TofPulse", fhChanPulseIntervalFeeA);
623 server->Register("/TofPulse", fhChanPulseIntervalFeeB);
624
625 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
626 server->Register("/TofCnt", fvhPulserCountEvoPerFeeGdpb[uGdpb]);
627
628 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
629
630 server->RegisterCommand("/Reset_All_eTOF", "bMcbmTofTestFeeResetHistos=kTRUE");
631 server->RegisterCommand("/Save_All_eTof", "bMcbmTofTestFeeSaveHistos=kTRUE");
632 server->RegisterCommand("/Update_PulsFit", "bMcbmTofTestFeeUpdateZoomedFit=kTRUE");
633 server->RegisterCommand("/Print_Raw_Data", "bMcbmTofTestFeeRawDataPrint=kTRUE");
634 server->RegisterCommand("/Print_AllHits", "bMcbmTofTestFeePrintAllHitsEna=kTRUE");
635 server->RegisterCommand("/Print_AllEps", "bMcbmTofTestFeePrintAllEpochsEna=kTRUE");
636
637 server->Restrict("/Reset_All_eTof", "allow=admin");
638 server->Restrict("/Save_All_eTof", "allow=admin");
639 server->Restrict("/Update_PulsFit", "allow=admin");
640 server->Restrict("/Print_Raw_Data", "allow=admin");
641 server->Restrict("/Print_AllHits", "allow=admin");
642 server->Restrict("/Print_AllEps", "allow=admin");
643 } // if( server )
644
645 /*****************************/
646 Double_t w = 600;
647 Double_t h = 480;
648
650 fcPulserFeeA = new TCanvas("cPulserFeeA", "Time difference RMS for channels on FEE A", w, h);
651 fcPulserFeeA->Divide(2, 2);
652
653 fcPulserFeeA->cd(1);
654 gPad->SetGridx();
655 gPad->SetGridy();
656 fhTimeRmsPulserFeeA->Draw("colz");
657
658 fcPulserFeeA->cd(2);
659 gPad->SetGridx();
660 gPad->SetGridy();
661 fhTimeMeanPulserFeeA->Draw("colz");
662
663 fcPulserFeeA->cd(3);
664 gPad->SetGridx();
665 gPad->SetGridy();
666 fhTimeRmsZoomFitPulsFeeA->Draw("colz");
667
668 fcPulserFeeA->cd(4);
669 gPad->SetGridx();
670 gPad->SetGridy();
671 fhTimeResFitPulsFeeA->Draw("colz");
672
673 server->Register("/canvases", fcPulserFeeA);
674 /*****************************/
675
677 fcPulserFeeB = new TCanvas("cPulserFeeB", "Time difference RMS for channels on FEE A", w, h);
678 fcPulserFeeB->Divide(2, 2);
679
680 fcPulserFeeB->cd(1);
681 gPad->SetGridx();
682 gPad->SetGridy();
683 fhTimeRmsPulserFeeB->Draw("colz");
684
685 fcPulserFeeB->cd(2);
686 gPad->SetGridx();
687 gPad->SetGridy();
688 fhTimeMeanPulserFeeB->Draw("colz");
689
690 fcPulserFeeB->cd(3);
691 gPad->SetGridx();
692 gPad->SetGridy();
693 fhTimeRmsZoomFitPulsFeeB->Draw("colz");
694
695 fcPulserFeeB->cd(4);
696 gPad->SetGridx();
697 gPad->SetGridy();
698 fhTimeResFitPulsFeeB->Draw("colz");
699
700 server->Register("/canvases", fcPulserFeeB);
701 /*****************************/
702
704 fcPulserFeeFee = new TCanvas("cPulserFeeFee", "Time difference RMS for channels on FEE A VS FEE B", w, h);
705 fcPulserFeeFee->Divide(2, 2);
706
707 fcPulserFeeFee->cd(1);
708 gPad->SetGridx();
709 gPad->SetGridy();
710 fhTimeRmsPulserFeeFee->Draw("colz");
711
712 fcPulserFeeFee->cd(2);
713 gPad->SetGridx();
714 gPad->SetGridy();
715 fhTimeMeanPulserFeeFee->Draw("colz");
716
717 fcPulserFeeFee->cd(3);
718 gPad->SetGridx();
719 gPad->SetGridy();
720 fhTimeRmsZoomFitPulsFeeFee->Draw("colz");
721
722 fcPulserFeeFee->cd(4);
723 gPad->SetGridx();
724 gPad->SetGridy();
725 fhTimeResFitPulsFeeFee->Draw("colz");
726
727 server->Register("/canvases", fcPulserFeeFee);
728 /*****************************/
729
731 fcPulseProp = new TCanvas("cPulseProp", "Pulse properties for each channel on FEE A and FEE B", w, h);
732 fcPulseProp->Divide(2, 2);
733
734 fcPulseProp->cd(1);
735 gPad->SetGridx();
736 gPad->SetGridy();
737 gPad->SetLogz();
738 fhChanTotFeeA->Draw("colz");
739
740 fcPulseProp->cd(2);
741 gPad->SetGridx();
742 gPad->SetGridy();
743 gPad->SetLogz();
744 fhChanTotFeeB->Draw("colz");
745
746 fcPulseProp->cd(3);
747 gPad->SetGridx();
748 gPad->SetGridy();
749 gPad->SetLogx();
750 gPad->SetLogz();
751 fhChanPulseIntervalFeeA->Draw("colz");
752
753 fcPulseProp->cd(4);
754 gPad->SetGridx();
755 gPad->SetGridy();
756 gPad->SetLogx();
757 gPad->SetLogz();
758 fhChanPulseIntervalFeeB->Draw("colz");
759
760 server->Register("/canvases", fcPulseProp);
761 /*****************************/
762
764 // Try to recover canvas in case it was created already by another monitor
765 // If not existing, create it
766 fcMsSizeAll = dynamic_cast<TCanvas*>(gROOT->FindObject("cMsSizeAll"));
767 if (NULL == fcMsSizeAll) {
768 fcMsSizeAll = new TCanvas("cMsSizeAll", "Evolution of MS size in last 300 s", w, h);
769 fcMsSizeAll->Divide(4, 3);
770 LOG(info) << "Created MS size canvas in TOF monitor";
771 } // if( NULL == fcMsSizeAll )
772 else
773 LOG(info) << "Recovered MS size canvas in TOF monitor";
774
775 LOG(info) << "Leaving CreateHistograms";
776}
777
778Bool_t CbmMcbm2018TofTestFee::DoUnpack(const fles::Timeslice& ts, size_t component)
779{
781 LOG(info) << "Reset eTOF STAR histos ";
784 } // if( bMcbmTofTestFeeResetHistos )
786 LOG(info) << "Start saving eTOF STAR histos ";
787 SaveAllHistos("data/histos_Shift_StarTof.root");
789 } // if( bSaveStsHistos )
795 } // if (bMcbmTofTestFeeUpdateZoomedFit)
799 } // if( bMcbmTofTestFeeRawDataPrint )
803 } // if( bMcbmTofTestFeePrintAllHitsEna )
807 } // if( bMcbmTofTestFeePrintAllEpochsEna )
808
810 std::chrono::time_point<std::chrono::system_clock> timeCurrent = std::chrono::system_clock::now();
811 std::chrono::duration<double> elapsed_seconds = timeCurrent - fTimeLastHistoSaving;
812 if (0 == fTimeLastHistoSaving.time_since_epoch().count()) {
813 fTimeLastHistoSaving = timeCurrent;
814 // fulNbBuiltSubEventLastPrintout = fulNbBuiltSubEvent;
815 // fulNbStarSubEventLastPrintout = fulNbStarSubEvent;
816 } // if( 0 == fTimeLastHistoSaving.time_since_epoch().count() )
817 else if (300 < elapsed_seconds.count()) {
818 std::time_t cTimeCurrent = std::chrono::system_clock::to_time_t(timeCurrent);
819 char tempBuff[80];
820 std::strftime(tempBuff, 80, "%F %T", localtime(&cTimeCurrent));
821 /*
822 LOG(info) << "CbmTofStarEventBuilder2018::DoUnpack => " << tempBuff
823 << " Total number of Built events: " << std::setw(9) << fulNbBuiltSubEvent
824 << ", " << std::setw(9) << (fulNbBuiltSubEvent - fulNbBuiltSubEventLastPrintout)
825 << " events in last " << std::setw(4) << elapsed_seconds.count() << " s";
826 fTimeLastPrintoutNbStarEvent = timeCurrent;
827 fulNbBuiltSubEventLastPrintout = fulNbBuiltSubEvent;
828*/
829 fTimeLastHistoSaving = timeCurrent;
830 SaveAllHistos("data/histos_tof_pulser.root");
831 } // else if( 300 < elapsed_seconds.count() )
832
833 LOG(debug1) << "Timeslice contains " << ts.num_microslices(component) << "microslices.";
834
836 UInt_t uNbMsLoop = fuNbCoreMsPerTs;
837 if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
838
839 Int_t messageType = -111;
840 Double_t dTsStartTime = -1;
841
843 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
844 if (fuMsAcceptsPercent < uMsIdx) continue;
845
846 fuCurrentMs = uMsIdx;
847
848 if (0 == fulCurrentTsIndex && 0 == uMsIdx) {
849 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
850 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
851 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
852 /*
853 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
854 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
855 static_cast<unsigned int>(msDescriptor.hdr_id),
856 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
857 static_cast<unsigned int>(msDescriptor.sys_id),
858 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
859 msDescriptor.size, msDescriptor.offset );
860*/
861 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
862 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
863 } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
864
866 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
867 constexpr uint32_t kuBytesPerMessage = 8;
868
869 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
870 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
871 fiEquipmentId = msDescriptor.eq_id;
872 fdMsIndex = static_cast<double>(msDescriptor.idx);
873 fuCurrentMsSysId = static_cast<unsigned int>(msDescriptor.sys_id);
874 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
875
876 uint32_t size = msDescriptor.size;
877 // fulLastMsIdx = msDescriptor.idx;
878 if (size > 0) LOG(debug) << "Microslice: " << msDescriptor.idx << " has size: " << size;
879 /*
880 if( numCompMsInTs - fuOverlapMsNb <= m )
881 {
882// LOG(info) << "Ignore overlap Microslice: " << msDescriptor.idx;
883 continue;
884 } // if( numCompMsInTs - fuOverlapMsNb <= m )
885*/
886 if (0 == uMsIdx && 0 == uMsCompIdx) dTsStartTime = (1e-9) * fdMsIndex;
887
888 if (fdStartTimeMsSz < 0) fdStartTimeMsSz = (1e-9) * fdMsIndex;
889 fvhMsSzPerLink[uMsComp]->Fill(size);
890 if (2 * fuHistoryHistoSize < (1e-9) * fdMsIndex - fdStartTimeMsSz) {
891 // Reset the evolution Histogram and the start time when we reach the end of the range
892 fvhMsSzTimePerLink[uMsComp]->Reset();
893 fdStartTimeMsSz = (1e-9) * fdMsIndex;
894 } // if( 2 * fuHistoryHistoSize < (1e-9) * fdMsIndex - fdStartTimeMsSz )
895 fvhMsSzTimePerLink[uMsComp]->Fill((1e-9) * fdMsIndex - fdStartTimeMsSz, size);
896
897 // If not integer number of message in input buffer, print warning/error
898 if (0 != (size % kuBytesPerMessage))
899 LOG(error) << "The input microslice buffer does NOT "
900 << "contain only complete nDPB messages!";
901
902 // Compute the number of complete messages in the input microslice buffer
903 uint32_t uNbMessages = (size - (size % kuBytesPerMessage)) / kuBytesPerMessage;
904
905 // Get the gDPB ID from the MS header
907
909 auto it = fGdpbIdIndexMap.find(fuGdpbId);
910 if (it == fGdpbIdIndexMap.end()) {
911 LOG(info) << "---------------------------------------------------------------";
912 /*
913 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
914 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
915 static_cast<unsigned int>(msDescriptor.hdr_id),
916 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
917 static_cast<unsigned int>(msDescriptor.sys_id),
918 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
919 msDescriptor.size, msDescriptor.offset );
920*/
921 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
922 LOG(warning) << "Could not find the gDPB index for AFCK id 0x" << std::hex << fuGdpbId << std::dec
923 << " in timeslice " << fulCurrentTsIndex << " in microslice " << fdMsIndex << " component "
924 << uMsCompIdx << "\n"
925 << "If valid this index has to be added in the TOF "
926 "parameter file in the RocIdArray field";
927 continue;
928 } // if( it == fGdpbIdIndexMap.end() )
929 else
931
932 // Prepare variables for the loop on contents
933 const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent);
934 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
935 // Fill message
936 uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
937
939 if (0 == uIdx) {
940 ProcessEpochCycle(ulData);
941 continue;
942 } // if( 0 == uIdx )
943
944 gdpbv100::Message mess(ulData);
945
946 if (fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging(fair::Severity::debug2)) {
947 mess.printDataCout();
949 } // if( fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging( fair::Severity::debug2 ) )
950
951 // Increment counter for different message types
952 // and fill the corresponding histogram
953 messageType = mess.getMessageType();
954 fviMsgCounter[messageType]++;
955
959 if (0x90 == fuCurrentMsSysId) fuGet4Id = mess.getGdpbGenChipId();
961
963 LOG(warning) << "Message with Get4 ID too high: " << fuGet4Id << " VS " << fuNrOfGet4PerGdpb
964 << " set in parameters.";
965
966 switch (messageType) {
967 case gdpbv100::MSG_HIT: {
968 if (mess.getGdpbHitIs24b()) { PrintGenInfo(mess); } // if( getGdpbHitIs24b() )
969 else {
970 fvmEpSupprBuffer[fuGet4Nr].push_back(mess);
971 } // else of if( getGdpbHitIs24b() )
972 break;
973 } // case gdpbv100::MSG_HIT:
974 case gdpbv100::MSG_EPOCH: {
976 for (uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index++) {
977 fuGet4Id = uGet4Index;
979 gdpbv100::Message tmpMess(mess);
980 tmpMess.setGdpbGenChipId(uGet4Index);
981
982 FillEpochInfo(tmpMess);
983 } // for( uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGetIndex ++ )
984
985 if (kTRUE == fbPrintAllEpochsEnable) {
986 LOG(info) << "Epoch: " << Form("0x%08x ", fuGdpbId) << ", Merg"
987 << ", Link " << std::setw(1) << mess.getGdpbEpLinkId() << ", epoch " << std::setw(8)
988 << mess.getGdpbEpEpochNb() << ", Sync " << std::setw(1) << mess.getGdpbEpSync()
989 << ", Data loss " << std::setw(1) << mess.getGdpbEpDataLoss() << ", Epoch loss "
990 << std::setw(1) << mess.getGdpbEpEpochLoss() << ", Epoch miss " << std::setw(1)
991 << mess.getGdpbEpMissmatch();
992 } // if( kTRUE == fbPrintAllEpochsEnable )
993 } // if this epoch message is a merged one valid for all chips
994 else {
995 FillEpochInfo(mess);
996
997 if (kTRUE == fbPrintAllEpochsEnable) {
998 LOG(info) << "Epoch: " << Form("0x%08x ", fuGdpbId) << ", " << std::setw(4) << fuGet4Nr << ", Link "
999 << std::setw(1) << mess.getGdpbEpLinkId() << ", epoch " << std::setw(8)
1000 << mess.getGdpbEpEpochNb() << ", Sync " << std::setw(1) << mess.getGdpbEpSync()
1001 << ", Data loss " << std::setw(1) << mess.getGdpbEpDataLoss() << ", Epoch loss "
1002 << std::setw(1) << mess.getGdpbEpEpochLoss() << ", Epoch miss " << std::setw(1)
1003 << mess.getGdpbEpMissmatch();
1004 } // if( kTRUE == fbPrintAllEpochsEnable )
1005 } // if single chip epoch message
1006 break;
1007 } // case gdpbv100::MSG_EPOCH:
1008 case gdpbv100::MSG_SLOWC: {
1009 PrintSlcInfo(mess);
1010 break;
1011 } // case gdpbv100::MSG_SLOWC:
1012 case gdpbv100::MSG_SYST: {
1014
1015 // UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
1016
1017 // Int_t dGdpbChId = fuGet4Id * fuNrOfChannelsPerGet4 + mess.getGdpbSysErrChanId();
1018 // Int_t dFullChId = fuGet4Nr * fuNrOfChannelsPerGet4 + mess.getGdpbSysErrChanId();
1019 } // if( gdpbv100::SYSMSG_GET4_EVENT == mess.getGdpbSysSubType() )
1021 FillPattInfo(mess);
1022 } // if( gdpbv100::SYS_PATTERN == mess.getGdpbSysSubType() )
1023 PrintSysInfo(mess);
1024 break;
1025 } // case gdpbv100::MSG_SYST:
1030 // fhGet4MessType->Fill(fuGet4Nr, 5);
1031 FillStarTrigInfo(mess);
1032 break;
1033 default:
1034 LOG(error) << "Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType)
1035 << " not included in Get4 unpacker.";
1036 } // switch( mess.getMessageType() )
1037 } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
1038 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
1039
1043 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++) {
1045 Bool_t bChanOkFeeA = kFALSE;
1046 Bool_t bChanOkFeeB = kFALSE;
1047 if (1 == fvuFeeChanNbHitsLastMs[fuGlobalIdxFeeA][uChanA]) bChanOkFeeA = kTRUE;
1048 if (1 == fvuFeeChanNbHitsLastMs[fuGlobalIdxFeeB][uChanA]) bChanOkFeeB = kTRUE;
1049
1051 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++) {
1052 if (bChanOkFeeA) {
1054 if (uChanA < uChanB && 1 == fvuFeeChanNbHitsLastMs[fuGlobalIdxFeeA][uChanB]) {
1055 Double_t dTimeDiff = 1e3
1058 if (TMath::Abs(dTimeDiff) < kdMaxDtPulserPs) fvhTimeDiffPulserFeeA[uChanA][uChanB]->Fill(dTimeDiff);
1059 } // if( uChanA < uChanB && 1 == fvuFeeChanNbHitsLastMs[ fuGlobalIdxFeeA ][ uChanB ] )
1060
1062 if (1 == fvuFeeChanNbHitsLastMs[fuGlobalIdxFeeB][uChanB]) {
1063 Double_t dTimeDiff = 1e3
1066 if (TMath::Abs(dTimeDiff) < kdMaxDtPulserPs) fvhTimeDiffPulserFeeFee[uChanA][uChanB]->Fill(dTimeDiff);
1067 } // if( 1 == fvuFeeChanNbHitsLastMs[ fuGlobalIdxFeeB ][ uChanB ] )
1068 } // if( bChanOkFeeA )
1069
1070 if (bChanOkFeeB) {
1072 if (uChanA < uChanB && 1 == fvuFeeChanNbHitsLastMs[fuGlobalIdxFeeB][uChanB]) {
1073 Double_t dTimeDiff = 1e3
1076 if (TMath::Abs(dTimeDiff) < kdMaxDtPulserPs) fvhTimeDiffPulserFeeB[uChanA][uChanB]->Fill(dTimeDiff);
1077 } // if( uChanA < uChanB && 1 == fvuFeeChanNbHitsLastMs[ fuGlobalIdxFeeB ][ uChanB ] )
1078 } // if( bChanOkFeeB )
1079 } // for( UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
1080 } // for( UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1081
1083 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeA)
1084 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1085 fvuFeeChanNbHitsLastMs[uFeeA][uChanA] = 0;
1086 } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
1087
1088 // Update RMS plots only every 10s in data
1089 if (10.0 < dTsStartTime - fdLastRmsUpdateTime) {
1090 // Reset summary histograms for safety
1091 fhTimeMeanPulserFeeA->Reset();
1092 fhTimeRmsPulserFeeA->Reset();
1093
1094 fhTimeMeanPulserFeeB->Reset();
1095 fhTimeRmsPulserFeeB->Reset();
1096
1097 fhTimeMeanPulserFeeFee->Reset();
1098 fhTimeRmsPulserFeeFee->Reset();
1099
1100 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1101 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++) {
1102 if (NULL != fvhTimeDiffPulserFeeA[uChanA][uChanB]) {
1103 fhTimeMeanPulserFeeA->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeA[uChanA][uChanB]->GetMean());
1104 fhTimeRmsPulserFeeA->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeA[uChanA][uChanB]->GetRMS());
1105 } // if( NULL != fvhTimeDiffPulserFeeA[ uChanA ][ uChanB ] )
1106
1107 if (NULL != fvhTimeDiffPulserFeeB[uChanA][uChanB]) {
1108 fhTimeMeanPulserFeeB->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeB[uChanA][uChanB]->GetMean());
1109 fhTimeRmsPulserFeeB->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeB[uChanA][uChanB]->GetRMS());
1110 } // if( NULL != fvhTimeDiffPulserFeeB[ uChanA ][ uChanB ] )
1111
1112 if (NULL != fvhTimeDiffPulserFeeFee[uChanA][uChanB]) {
1113 fhTimeMeanPulserFeeFee->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeFee[uChanA][uChanB]->GetMean());
1114 fhTimeRmsPulserFeeFee->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeFee[uChanA][uChanB]->GetRMS());
1115 } // if( NULL != fvhTimeDiffPulserFeeFee[ uChanA ][ uChanB ] )
1116 } // Loop on both channels
1118 } // if( 10.0 < dTsStartTime - fdLastRmsUpdateTime )
1119
1121
1122 return kTRUE;
1123}
1124
1126{
1127 uint64_t ulEpochCycleVal = ulCycleData & gdpbv100::kulEpochCycleFieldSz;
1128
1129 if (fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging(fair::Severity::debug2)) {
1130 LOG(info) << "CbmMcbm2018TofTestFee::ProcessEpochCyle => "
1131 // << Form( " TS %5llu MS %3lu In data 0x%016llX Cycle 0x%016llX",
1132 // fulCurrentTsIndex, fuCurrentMs, ulCycleData, ulEpochCycleVal );
1133 << " TS " << FormatDecPrintout(fulCurrentTsIndex, 5) << " MS " << FormatDecPrintout(fuCurrentMs, 3)
1134 << " In data 0x" << FormatHexPrintout(ulCycleData, 16, '0', true) << " Cycle 0x"
1135 << FormatHexPrintout(ulEpochCycleVal, 16, '0', true);
1137 } // if( fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging( fair::Severity::debug2 ) )
1138
1139 for (uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index++) {
1140 fuGet4Id = uGet4Index;
1142 /*
1143 if( !( ulEpochCycleVal == fvulCurrentEpochCycle[fuGet4Nr] ||
1144 ulEpochCycleVal == fvulCurrentEpochCycle[fuGet4Nr] + 1 ) )
1145 LOG(error) << "CbmMcbm2018TofTestFee::ProcessEpochCyle => "
1146 << " Missmatch in epoch cycles detected, probably fake cycles due to epoch index corruption! "
1147 << Form( " Current cycle 0x%09X New cycle 0x%09X", fvulCurrentEpochCycle[fuGet4Nr], ulEpochCycleVal );
1148*/
1149 fvulCurrentEpochCycle[fuGet4Nr] = ulEpochCycleVal;
1150 } // for( uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index ++ )
1151 return;
1152}
1153
1155{
1156 UInt_t uChannel = mess.getGdpbHitChanId();
1157 UInt_t uTot = mess.getGdpbHit32Tot();
1158 UInt_t uFts = mess.getGdpbHitFineTs();
1159
1160 ULong64_t ulCurEpochGdpbGet4 = fvulCurrentEpoch[fuGet4Nr];
1161
1162 // In Ep. Suppr. Mode, receive following epoch instead of previous
1163 if (0 < ulCurEpochGdpbGet4) ulCurEpochGdpbGet4--;
1164 else
1165 ulCurEpochGdpbGet4 = gdpbv100::kuEpochCounterSz; // Catch epoch cycle!
1166
1167 // UInt_t uChannelNr = fuGet4Id * fuNrOfChannelsPerGet4 + uChannel;
1168 UInt_t uChannelNrInFee = (fuGet4Id % fuNrOfGet4PerFee) * fuNrOfChannelsPerGet4 + uChannel;
1169 UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
1170 UInt_t uFeeNrInSys = fuGdpbNr * fuNrOfFeePerGdpb + uFeeNr;
1171 // UInt_t uRemappedChannelNr = uFeeNr * fuNrOfChannelsPerFee + fvuGet4ToPadi[ uChannelNrInFee ];
1172 UInt_t uRemappedChannelNrInFee = fvuGet4ToPadi[uChannelNrInFee];
1174 if (0x90 == fuCurrentMsSysId) {
1175 // uRemappedChannelNr = uChannelNr;
1176 uRemappedChannelNrInFee = uChannelNrInFee;
1177 } // if( 0x90 == fuCurrentMsSysId )
1178 // UInt_t uGbtxNr = (uFeeNr / kuNbFeePerGbtx);
1179 // UInt_t uFeeInGbtx = (uFeeNr % kuNbFeePerGbtx);
1180 // UInt_t uGbtxNrInSys = fuGdpbNr * kuNbGbtxPerGdpb + uGbtxNr;
1181
1182 ULong_t ulHitTime = mess.getMsgFullTime(ulCurEpochGdpbGet4);
1183 Double_t dHitTime = mess.getMsgFullTimeD(ulCurEpochGdpbGet4);
1184
1185 // In 32b mode the coarse counter is already computed back to 112 FTS bins
1186 // => need to hide its contribution from the Finetime
1187 // => FTS = Fullt TS modulo 112
1188 uFts = mess.getGdpbHitFullTs() % 112;
1189
1190 // In Run rate evolution
1191 if (fdStartTime < 0) fdStartTime = dHitTime;
1192
1193 // Reset the evolution Histogram and the start time when we reach the end of the range
1194 if (fuHistoryHistoSize < 1e-9 * (dHitTime - fdStartTime)) {
1196 fdStartTime = dHitTime;
1197 } // if( fuHistoryHistoSize < 1e-9 * (dHitTime - fdStartTime) )
1198
1199 // In Run rate evolution
1200 if (fdStartTimeLong < 0) fdStartTimeLong = dHitTime;
1201
1204 if (fuGlobalIdxFeeA == uFeeNrInSys) {
1205 fhChanTotFeeA->Fill(uRemappedChannelNrInFee, uTot);
1206 fhChanPulseIntervalFeeA->Fill(dHitTime - fvdFeeChanMsLastPulserHit[uFeeNrInSys][uRemappedChannelNrInFee],
1207 uRemappedChannelNrInFee);
1208 } // if( fuGlobalIdxFeeA == uFeeNrInSys )
1209 else if (fuGlobalIdxFeeB == uFeeNrInSys) {
1210 fhChanTotFeeB->Fill(uRemappedChannelNrInFee, uTot);
1211 fhChanPulseIntervalFeeB->Fill(dHitTime - fvdFeeChanMsLastPulserHit[uFeeNrInSys][uRemappedChannelNrInFee],
1212 uRemappedChannelNrInFee);
1213 } // if( fuGlobalIdxFeeB == uFeeNrInSys )
1214 fvdFeeChanMsLastPulserHit[uFeeNrInSys][uRemappedChannelNrInFee] = dHitTime;
1215 fvuFeeChanNbHitsLastMs[uFeeNrInSys][uRemappedChannelNrInFee]++;
1216
1217 if (0 <= fdStartTime) fvhPulserCountEvoPerFeeGdpb[fuGdpbNr]->Fill(1e-9 * (dHitTime - fdStartTime), uFeeNr);
1218
1219 if (kTRUE == fbPrintAllHitsEnable) {
1220 LOG(info) << "Hit: " << Form("0x%08x ", fuGdpbId) << ", " << std::setw(2) << fuGet4Nr << ", " << std::setw(3)
1221 << uChannel << ", " << std::setw(3) << uTot << ", epoch " << std::setw(3) << ulCurEpochGdpbGet4
1222 << ", FullTime Clk " << Form("%12lu ", ulHitTime) << ", FullTime s " << Form("%12.9f ", dHitTime / 1e9)
1223 << ", FineTime " << uFts;
1224 } // if( kTRUE == fbPrintAllHitsEnable )
1225}
1226
1228{
1229 ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
1230 /*
1231 if( fvulCurrentEpoch[fuGet4Nr] < ulEpochNr )
1232 fvulCurrentEpochCycle[fuGet4Nr]++;
1233*/
1234 fvulCurrentEpoch[fuGet4Nr] = ulEpochNr;
1236
1237 fulCurrentEpochTime = mess.getMsgFullTime(ulEpochNr);
1238
1241 if (0 < ulEpochNr) mess.setGdpbEpEpochNb(ulEpochNr - 1);
1242 else
1244
1245 Int_t iBufferSize = fvmEpSupprBuffer[fuGet4Nr].size();
1246 if (0 < iBufferSize) {
1247 LOG(debug) << "Now processing stored messages for for get4 " << fuGet4Nr << " with epoch number "
1248 << (fvulCurrentEpoch[fuGet4Nr] - 1);
1249
1252 std::stable_sort(fvmEpSupprBuffer[fuGet4Nr].begin(), fvmEpSupprBuffer[fuGet4Nr].begin());
1253
1254 for (Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++) {
1256 } // for( Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++ )
1257
1258 fvmEpSupprBuffer[fuGet4Nr].clear();
1259 } // if( 0 < fvmEpSupprBuffer[fuGet4Nr] )
1260}
1261
1263{
1264 /*
1265 if (fGdpbIdIndexMap.end() != fGdpbIdIndexMap.find(fuGdpbId))
1266 {
1267 UInt_t uChip = mess.getGdpbGenChipId();
1268 UInt_t uChan = mess.getGdpbSlcChan();
1269 UInt_t uEdge = mess.getGdpbSlcEdge();
1270 UInt_t uData = mess.getGdpbSlcData();
1271 UInt_t uType = mess.getGdpbSlcType();
1272 Double_t dGdpbChId = fuGet4Id * fuNrOfChannelsPerGet4 + mess.getGdpbSlcChan() + 0.5 * mess.getGdpbSlcEdge();
1273 Double_t dFullChId = fuGet4Nr * fuNrOfChannelsPerGet4 + mess.getGdpbSlcChan() + 0.5 * mess.getGdpbSlcEdge();
1274 Double_t dMessTime = static_cast< Double_t>( fulCurrentEpochTime ) * 1.e-9;
1275
1277
1278 }
1279*/
1280}
1281
1283{
1284 Int_t mType = mess.getMessageType();
1285 Int_t channel = mess.getGdpbHitChanId();
1286 uint64_t uData = mess.getData();
1287
1288 LOG(debug) << "Get4 MSG type " << mType << " from gdpbId " << fuGdpbId << ", getId " << fuGet4Id << ", (hit channel) "
1289 << channel << " data " << std::hex << uData;
1290}
1291
1293{
1294 if (fGdpbIdIndexMap.end() != fGdpbIdIndexMap.find(fuGdpbId))
1295 LOG(debug) << "GET4 System message, epoch " << static_cast<Int_t>(fvulCurrentEpoch[fuGet4Nr]) << ", time "
1296 << std::setprecision(9) << std::fixed << Double_t(fulCurrentEpochTime) * 1.e-9 << " s "
1297 << " for board ID " << std::hex << std::setw(4) << fuGdpbId << std::dec;
1298
1299 switch (mess.getGdpbSysSubType()) {
1301 uint32_t uData = mess.getGdpbSysErrData();
1305 LOG(debug) << " +++++++ > gDPB: " << std::hex << std::setw(4) << fuGdpbId << std::dec
1306 << ", Chip = " << std::setw(2) << mess.getGdpbGenChipId() << ", Chan = " << std::setw(1)
1307 << mess.getGdpbSysErrChanId() << ", Edge = " << std::setw(1) << mess.getGdpbSysErrEdge()
1308 << ", Empt = " << std::setw(1) << mess.getGdpbSysErrUnused() << ", Data = " << std::hex
1309 << std::setw(2) << uData << std::dec << " -- GET4 V1 Error Event";
1310 else
1311 LOG(debug) << " +++++++ >gDPB: " << std::hex << std::setw(4) << fuGdpbId << std::dec
1312 << ", Chip = " << std::setw(2) << mess.getGdpbGenChipId() << ", Chan = " << std::setw(1)
1313 << mess.getGdpbSysErrChanId() << ", Edge = " << std::setw(1) << mess.getGdpbSysErrEdge()
1314 << ", Empt = " << std::setw(1) << mess.getGdpbSysErrUnused() << ", Data = " << std::hex
1315 << std::setw(2) << uData << std::dec << " -- GET4 V1 Error Event ";
1316 break;
1317 } // case gdpbv100::SYSMSG_GET4_EVENT
1319 LOG(debug) << "Unknown GET4 message, data: " << std::hex << std::setw(8) << mess.getGdpbSysUnkwData() << std::dec
1320 << " Full message: " << std::hex << std::setw(16) << mess.getData() << std::dec;
1321 break;
1322 } // case gdpbv100::SYS_GDPB_UNKWN:
1324 if (mess.getGdpbSysFwErrResync())
1325 LOG(info) << Form("GET4 Resynchronization: Get4:0x%04x ", mess.getGdpbGenChipId()) << std::hex << std::setw(4)
1326 << fuGdpbId << std::dec;
1327 else
1328 LOG(info) << "GET4 synchronization pulse missing in gDPB " << std::hex << std::setw(4) << fuGdpbId << std::dec;
1329 break;
1330 } // case gdpbv100::SYS_GET4_SYNC_MISS:
1331 case gdpbv100::SYS_PATTERN: {
1332 LOG(debug) << "ASIC pattern for missmatch, disable or resync";
1333 break;
1334 } // case gdpbv100::SYS_PATTERN:
1335 default: {
1336 LOG(debug) << "Crazy system message, subtype " << mess.getGdpbSysSubType();
1337 break;
1338 } // default
1339
1340 } // switch( getGdpbSysSubType() )
1341}
1342
1344{
1345 /*
1346 uint16_t usType = mess.getGdpbSysPattType();
1347 uint16_t usIndex = mess.getGdpbSysPattIndex();
1348 uint32_t uPattern = mess.getGdpbSysPattPattern();
1349
1350 switch( usType )
1351 {
1352 case gdpbv100::PATT_MISSMATCH:
1353 {
1354 LOG(debug) << Form( "Missmatch pattern message => Type %d, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern );
1355 for( UInt_t uBit = 0; uBit < 32; ++uBit )
1356 if( ( uPattern >> uBit ) & 0x1 )
1357 {
1358 UInt_t uBadAsic = ConvertElinkToGet4( 32 * usIndex + uBit );
1360 if( 0x90 == fuCurrentMsSysId )
1361 uBadAsic = 32 * usIndex + uBit;
1362 } // if( ( uPattern >> uBit ) & 0x1 )
1363
1364 break;
1365 } // case gdpbv100::PATT_MISSMATCH:
1366 case gdpbv100::PATT_ENABLE:
1367 {
1368 for( UInt_t uBit = 0; uBit < 32; ++uBit )
1369 if( ( uPattern >> uBit ) & 0x1 )
1370 {
1371 UInt_t uBadAsic = ConvertElinkToGet4( 32 * usIndex + uBit );
1373 if( 0x90 == fuCurrentMsSysId )
1374 uBadAsic = 32 * usIndex + uBit;
1375 } // if( ( uPattern >> uBit ) & 0x1 )
1376
1377 break;
1378 } // case gdpbv100::PATT_ENABLE:
1379 case gdpbv100::PATT_RESYNC:
1380 {
1381 LOG(debug) << Form( "RESYNC pattern message => Type %d, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern );
1382
1383 for( UInt_t uBit = 0; uBit < 32; ++uBit )
1384 if( ( uPattern >> uBit ) & 0x1 )
1385 {
1386 UInt_t uBadAsic = ConvertElinkToGet4( 32 * usIndex + uBit );
1388 if( 0x90 == fuCurrentMsSysId )
1389 uBadAsic = 32 * usIndex + uBit;
1390 } // if( ( uPattern >> uBit ) & 0x1 )
1391
1392 break;
1393 } // case gdpbv100::PATT_RESYNC:
1394 default:
1395 {
1396 LOG(debug) << "Crazy pattern message, subtype " << usType;
1397 break;
1398 } // default
1399 } // switch( usType )
1400*/
1401 return;
1402}
1403
1405{
1406 Int_t iMsgIndex = mess.getStarTrigMsgIndex();
1407
1408 switch (iMsgIndex) {
1409 case 0: fvulGdpbTsMsb[fuGdpbNr] = mess.getGdpbTsMsbStarA(); break;
1410 case 1:
1413 break;
1414 case 2: fvulStarTsMid[fuGdpbNr] = mess.getStarTsMidStarC(); break;
1415 case 3: {
1416
1417 ULong64_t ulNewGdpbTsFull = (fvulGdpbTsMsb[fuGdpbNr] << 24) + (fvulGdpbTsLsb[fuGdpbNr]);
1418 ULong64_t ulNewStarTsFull =
1420 UInt_t uNewToken = mess.getStarTokenStarD();
1421 UInt_t uNewDaqCmd = mess.getStarDaqCmdStarD();
1422 UInt_t uNewTrigCmd = mess.getStarTrigCmdStarD();
1423
1424 if ((uNewToken == fvuStarTokenLast[fuGdpbNr]) && (ulNewGdpbTsFull == fvulGdpbTsFullLast[fuGdpbNr])
1425 && (ulNewStarTsFull == fvulStarTsFullLast[fuGdpbNr]) && (uNewDaqCmd == fvuStarDaqCmdLast[fuGdpbNr])
1426 && (uNewTrigCmd == fvuStarTrigCmdLast[fuGdpbNr])) {
1427 UInt_t uTrigWord = ((fvuStarTrigCmdLast[fuGdpbNr] & 0x00F) << 16)
1428 + ((fvuStarDaqCmdLast[fuGdpbNr] & 0x00F) << 12) + ((fvuStarTokenLast[fuGdpbNr] & 0xFFF));
1429 LOG(warning) << "Possible error: identical STAR tokens found twice in "
1430 "a row => ignore 2nd! "
1431 << " TS " << fulCurrentTsIndex << " gDBB #" << fuGdpbNr << " "
1432 << Form("token = %5u ", fvuStarTokenLast[fuGdpbNr])
1433 << Form("gDPB ts = %12llu ", fvulGdpbTsFullLast[fuGdpbNr])
1434 << Form("STAR ts = %12llu ", fvulStarTsFullLast[fuGdpbNr])
1435 << Form("DAQ cmd = %2u ", fvuStarDaqCmdLast[fuGdpbNr])
1436 << Form("TRG cmd = %2u ", fvuStarTrigCmdLast[fuGdpbNr]) << Form("TRG Wrd = %5x ", uTrigWord);
1437 return;
1438 } // if exactly same message repeated
1439 /*
1440 if( (uNewToken != fuStarTokenLast[fuGdpbNr] + 1) &&
1441 0 < fvulGdpbTsFullLast[fuGdpbNr] && 0 < fvulStarTsFullLast[fuGdpbNr] &&
1442 ( 4095 != fvuStarTokenLast[fuGdpbNr] || 1 != uNewToken) )
1443 LOG(warning) << "Possible error: STAR token did not increase by exactly 1! "
1444 << " gDBB #" << fuGdpbNr << " "
1445 << Form("old = %5u vs new = %5u ", fvuStarTokenLast[fuGdpbNr], uNewToken)
1446 << Form("old = %12llu vs new = %12llu ", fvulGdpbTsFullLast[fuGdpbNr], ulNewGdpbTsFull)
1447 << Form("old = %12llu vs new = %12llu ", fvulStarTsFullLast[fuGdpbNr], ulNewStarTsFull)
1448 << Form("old = %2u vs new = %2u ", fvuStarDaqCmdLast[fuGdpbNr], uNewDaqCmd)
1449 << Form("old = %2u vs new = %2u ", fvuStarTrigCmdLast[fuGdpbNr], uNewTrigCmd);
1450*/
1451 // STAR TS counter reset detection
1452 if (ulNewStarTsFull < fvulStarTsFullLast[fuGdpbNr])
1453 LOG(debug) << "Probable reset of the STAR TS: old = " << Form("%16llu", fvulStarTsFullLast[fuGdpbNr])
1454 << " new = " << Form("%16llu", ulNewStarTsFull) << " Diff = -"
1455 << Form("%8llu", fvulStarTsFullLast[fuGdpbNr] - ulNewStarTsFull);
1456
1457 /*
1458 LOG(info) << "Updating trigger token for " << fuGdpbNr
1459 << " " << fuStarTokenLast[fuGdpbNr] << " " << uNewToken;
1460*/
1461 // ULong64_t ulGdpbTsDiff = ulNewGdpbTsFull - fvulGdpbTsFullLast[fuGdpbNr];
1462 fvulGdpbTsFullLast[fuGdpbNr] = ulNewGdpbTsFull;
1463 fvulStarTsFullLast[fuGdpbNr] = ulNewStarTsFull;
1464 fvuStarTokenLast[fuGdpbNr] = uNewToken;
1465 fvuStarDaqCmdLast[fuGdpbNr] = uNewDaqCmd;
1466 fvuStarTrigCmdLast[fuGdpbNr] = uNewTrigCmd;
1467 /*
1469 if( fuCurrentMs < fuCoreMs )
1470 {
1472 if( 0 <= fdStartTime )
1473 {
1475 if( fuHistoryHistoSize < 1e-9 * (fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime) )
1476 {
1477 ResetEvolutionHistograms();
1478 fdStartTime = fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs;
1479 } // if( fuHistoryHistoSize < 1e-9 * (fulGdpbTsFullLast * gdpbv100::kdClockCycleSizeNs - fdStartTime) )
1480
1481 fvhTriggerRate[fuGdpbNr]->Fill( 1e-9 * ( fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime ) );
1482 fvhStarTokenEvo[fuGdpbNr]->Fill( 1e-9 * ( fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime ),
1483 fvuStarTokenLast[fuGdpbNr] );
1484 fvhStarTrigGdpbTsEvo[fuGdpbNr]->Fill( 1e-9 * ( fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime ),
1485 fvulGdpbTsFullLast[fuGdpbNr] );
1486 fvhStarTrigStarTsEvo[fuGdpbNr]->Fill( 1e-9 * ( fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs - fdStartTime ),
1487 fvulStarTsFullLast[fuGdpbNr] );
1488 } // if( 0 < fdStartTime )
1489 else fdStartTime = fvulGdpbTsFullLast[fuGdpbNr] * gdpbv100::kdClockCycleSizeNs;
1490 fvhCmdDaqVsTrig[fuGdpbNr]->Fill( fvuStarDaqCmdLast[fuGdpbNr], fvuStarTrigCmdLast[fuGdpbNr] );
1491 } // if( fuCurrentMs < fuCoreMs )
1492*/
1493 break;
1494 } // case 3
1495 default: LOG(error) << "Unknown Star Trigger messageindex: " << iMsgIndex;
1496 } // switch( iMsgIndex )
1497}
1498
1500
1502{
1503 // Printout some stats on what was unpacked
1504 TString message_type;
1505 for (unsigned int i = 0; i < fviMsgCounter.size(); ++i) {
1506 switch (i) {
1507 case 0: message_type = "NOP"; break;
1508 case 1: message_type = "HIT"; break;
1509 case 2: message_type = "EPOCH"; break;
1510 case 3: message_type = "SYNC"; break;
1511 case 4: message_type = "AUX"; break;
1512 case 5: message_type = "EPOCH2"; break;
1513 case 6: message_type = "GET4"; break;
1514 case 7: message_type = "SYS"; break;
1515 case 8: message_type = "GET4_SLC"; break;
1516 case 9: message_type = "GET4_32B"; break;
1517 case 10: message_type = "GET4_SYS"; break;
1518 default: message_type = "UNKNOWN"; break;
1519 } // switch(i)
1520 LOG(info) << message_type << " messages: " << fviMsgCounter[i];
1521 } // for (unsigned int i=0; i< fviMsgCounter.size(); ++i)
1522
1523 /*
1524 LOG(info) << "-------------------------------------";
1525 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i)
1526 {
1527 for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j)
1528 {
1529 LOG(info) << "Last epoch for gDPB: " << std::hex << std::setw(4) << i
1530 << std::dec << " , GET4 " << std::setw(4) << j << " => "
1531 << fvulCurrentEpoch[GetArrayIndex(i, j)];
1532 } // for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j)
1533 } // for (UInt_t i = 0; i < fuNrOfGdpbs; ++i)
1534 LOG(info) << "-------------------------------------";
1535*/
1536
1539 fhTimeMeanPulserFeeA->Reset();
1540 fhTimeRmsPulserFeeA->Reset();
1541
1542 fhTimeMeanPulserFeeB->Reset();
1543 fhTimeRmsPulserFeeB->Reset();
1544
1545 fhTimeMeanPulserFeeFee->Reset();
1546 fhTimeRmsPulserFeeFee->Reset();
1547
1548 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1549 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++) {
1550 if (NULL != fvhTimeDiffPulserFeeA[uChanA][uChanB]) {
1551 fhTimeMeanPulserFeeA->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeA[uChanA][uChanB]->GetMean());
1552 fhTimeRmsPulserFeeA->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeA[uChanA][uChanB]->GetRMS());
1553 } // if( NULL != fvhTimeDiffPulserFeeA[ uChanA ][ uChanB ] )
1554
1555 if (NULL != fvhTimeDiffPulserFeeB[uChanA][uChanB]) {
1556 fhTimeMeanPulserFeeB->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeB[uChanA][uChanB]->GetMean());
1557 fhTimeRmsPulserFeeB->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeB[uChanA][uChanB]->GetRMS());
1558 } // if( NULL != fvhTimeDiffPulserFeeB[ uChanA ][ uChanB ] )
1559
1560 if (NULL != fvhTimeDiffPulserFeeFee[uChanA][uChanB]) {
1561 fhTimeMeanPulserFeeFee->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeFee[uChanA][uChanB]->GetMean());
1562 fhTimeRmsPulserFeeFee->Fill(uChanA, uChanB, fvhTimeDiffPulserFeeFee[uChanA][uChanB]->GetRMS());
1563 } // if( NULL != fvhTimeDiffPulserFeeFee[ uChanA ][ uChanB ] )
1564 } // Loop on both channels
1565
1570
1572 // SaveAllHistos();
1573}
1574
1576{
1578 TFile* oldFile = gFile;
1579 TDirectory* oldDir = gDirectory;
1580
1581 TFile* histoFile = NULL;
1582 if ("" != sFileName) {
1583 // open separate histo file in recreate mode
1584 histoFile = new TFile(sFileName, "RECREATE");
1585 histoFile->cd();
1586 } // if( "" != sFileName )
1587
1588 gDirectory->mkdir("TofDt");
1589 gDirectory->cd("TofDt");
1590 fhTimeMeanPulserFeeA->Write();
1591 fhTimeRmsPulserFeeA->Write();
1592 fhTimeRmsZoomFitPulsFeeA->Write();
1593 fhTimeResFitPulsFeeA->Write();
1594
1595 fhTimeMeanPulserFeeB->Write();
1596 fhTimeRmsPulserFeeB->Write();
1597 fhTimeRmsZoomFitPulsFeeB->Write();
1598 fhTimeResFitPulsFeeB->Write();
1599
1600 fhTimeMeanPulserFeeFee->Write();
1601 fhTimeRmsPulserFeeFee->Write();
1603 fhTimeResFitPulsFeeFee->Write();
1604
1605 gDirectory->cd("..");
1606
1607
1609 gDirectory->mkdir("TofDtFeeA");
1610 gDirectory->cd("TofDtFeeA");
1611 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1612 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
1613 if (NULL != fvhTimeDiffPulserFeeA[uChanA][uChanB]) fvhTimeDiffPulserFeeA[uChanA][uChanB]->Write();
1614 gDirectory->cd("..");
1615
1616 gDirectory->mkdir("TofDtFeeB");
1617 gDirectory->cd("TofDtFeeB");
1618 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1619 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
1620 if (NULL != fvhTimeDiffPulserFeeB[uChanA][uChanB]) fvhTimeDiffPulserFeeB[uChanA][uChanB]->Write();
1621 gDirectory->cd("..");
1622
1623 gDirectory->mkdir("TofDtFeeFee");
1624 gDirectory->cd("TofDtFeeFee");
1625 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1626 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
1627 if (NULL != fvhTimeDiffPulserFeeFee[uChanA][uChanB]) fvhTimeDiffPulserFeeFee[uChanA][uChanB]->Write();
1628 gDirectory->cd("..");
1629
1630 gDirectory->mkdir("TofPulse");
1631 gDirectory->cd("TofPulse");
1632 fhChanTotFeeA->Write();
1633 fhChanTotFeeB->Write();
1634 fhChanPulseIntervalFeeA->Write();
1635 fhChanPulseIntervalFeeB->Write();
1636 gDirectory->cd("..");
1637
1638 gDirectory->mkdir("TofCnt");
1639 gDirectory->cd("TofCnt");
1640 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb)
1641 fvhPulserCountEvoPerFeeGdpb[uGdpb]->Write();
1642 gDirectory->cd("..");
1643
1644 gDirectory->mkdir("Flib_Raw");
1645 gDirectory->cd("Flib_Raw");
1646 for (UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++) {
1647 if (NULL == fvhMsSzPerLink[uLinks]) continue;
1648
1649 fvhMsSzPerLink[uLinks]->Write();
1650 fvhMsSzTimePerLink[uLinks]->Write();
1651 } // for( UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++ )
1652
1653 TH1* pMissedTsH1 = dynamic_cast<TH1*>(gROOT->FindObjectAny("Missed_TS"));
1654 if (NULL != pMissedTsH1) pMissedTsH1->Write();
1655
1656 TProfile* pMissedTsEvoP = dynamic_cast<TProfile*>(gROOT->FindObjectAny("Missed_TS_Evo"));
1657 if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
1658
1659 gDirectory->cd("..");
1660
1661 fcPulserFeeA->Write();
1662 fcPulserFeeB->Write();
1663 fcPulserFeeFee->Write();
1664 fcPulseProp->Write();
1665
1666
1667 if ("" != sFileName) {
1668 // Restore original directory position
1669 histoFile->Close();
1670 } // if( "" != sFileName )
1671
1673 gFile = oldFile;
1674 gDirectory = oldDir;
1675}
1676
1678{
1679 LOG(info) << "Reseting all TOF histograms.";
1680
1682 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1683 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
1684 if (NULL != fvhTimeDiffPulserFeeA[uChanA][uChanB]) fvhTimeDiffPulserFeeA[uChanA][uChanB]->Reset();
1685
1686 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1687 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
1688 if (NULL != fvhTimeDiffPulserFeeB[uChanA][uChanB]) fvhTimeDiffPulserFeeB[uChanA][uChanB]->Reset();
1689
1690 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1691 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
1692 if (NULL != fvhTimeDiffPulserFeeFee[uChanA][uChanB]) fvhTimeDiffPulserFeeFee[uChanA][uChanB]->Reset();
1693
1694 fhTimeMeanPulserFeeA->Reset();
1695 fhTimeRmsPulserFeeA->Reset();
1696 fhTimeRmsZoomFitPulsFeeA->Reset();
1697 fhTimeResFitPulsFeeA->Reset();
1698
1699 fhTimeMeanPulserFeeB->Reset();
1700 fhTimeRmsPulserFeeB->Reset();
1701 fhTimeRmsZoomFitPulsFeeB->Reset();
1702 fhTimeResFitPulsFeeB->Reset();
1703
1704 fhTimeMeanPulserFeeFee->Reset();
1705 fhTimeRmsPulserFeeFee->Reset();
1707 fhTimeResFitPulsFeeFee->Reset();
1708
1709 fhChanTotFeeA->Reset();
1710 fhChanTotFeeB->Reset();
1711 fhChanPulseIntervalFeeA->Reset();
1712 fhChanPulseIntervalFeeB->Reset();
1713
1714 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb)
1716
1717 for (UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++) {
1718 if (NULL == fvhMsSzPerLink[uLinks]) continue;
1719
1720 fvhMsSzPerLink[uLinks]->Reset();
1721 fvhMsSzTimePerLink[uLinks]->Reset();
1722 } // for( UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++ )
1723
1724 fdStartTime = -1;
1725 fdStartTimeMsSz = -1;
1726}
1728
1729void CbmMcbm2018TofTestFee::UpdateZoomedFit(std::vector<std::vector<TH1*>> phTimeDiff, TH2* phTimeRmsZoom,
1730 TH2* phTimeResFit)
1731{
1732 // Only do something if the user defined the width he wants for the zoom
1733 if (0.0 < fdFitZoomWidthPs) {
1734 // Reset summary histograms for safety
1735 phTimeRmsZoom->Reset();
1736 phTimeResFit->Reset();
1737
1738 Double_t dRes = 0;
1739 TF1* fitFuncPairs[fuNrOfChannelsPerFee][fuNrOfChannelsPerFee];
1740
1741 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerFee; uChanA++)
1742 for (UInt_t uChanB = 0; uChanB < fuNrOfChannelsPerFee; uChanB++)
1743 if (NULL != phTimeDiff[uChanA][uChanB]) {
1744 // Check that we have at least 1 entry
1745 if (0 == phTimeDiff[uChanA][uChanB]->GetEntries()) {
1746 phTimeRmsZoom->Fill(uChanA, uChanB, 0.0);
1747 phTimeResFit->Fill(uChanA, uChanB, 0.0);
1748 LOG(debug) << "CbmMcbm2018TofTestFee::UpdateZoomedFit => Empty input "
1749 << "for Chan pair " << uChanA << " and " << uChanB << " !!! ";
1750 continue;
1751 } // if( 0 == phTimeDiff[ uChanA ][ uChanB ]->GetEntries() )
1752
1753 // Read the peak position (bin with max counts) + total nb of entries
1754 Int_t iBinWithMax = phTimeDiff[uChanA][uChanB]->GetMaximumBin();
1755 Double_t dNbCounts = phTimeDiff[uChanA][uChanB]->Integral();
1756
1757 // Zoom the X axis to +/- ZoomWidth around the peak position
1758 Double_t dPeakPos = phTimeDiff[uChanA][uChanB]->GetXaxis()->GetBinCenter(iBinWithMax);
1759 phTimeDiff[uChanA][uChanB]->GetXaxis()->SetRangeUser(dPeakPos - fdFitZoomWidthPs,
1760 dPeakPos + fdFitZoomWidthPs);
1761
1762 // Read integral and check how much we lost due to the zoom (% loss allowed)
1763 Double_t dZoomCounts = phTimeDiff[uChanA][uChanB]->Integral();
1764 if ((dZoomCounts / dNbCounts) < 0.99) {
1765 phTimeRmsZoom->Fill(uChanA, uChanB, 0.0);
1766 phTimeResFit->Fill(uChanA, uChanB, 0.0);
1767 LOG(warning) << "CbmMcbm2018TofTestFee::UpdateZoomedFit => Zoom too strong, "
1768 << "more than 1% loss for Chan pair " << uChanA << " and " << uChanB << " !!! ";
1769 continue;
1770 } // if( ( dZoomCounts / dNbCounts ) < 0.99 )
1771
1772 // Fill new RMS after zoom into summary histo
1773 phTimeRmsZoom->Fill(uChanA, uChanB, phTimeDiff[uChanA][uChanB]->GetRMS());
1774
1775
1776 // Fit using zoomed boundaries + starting gaussian width, store into summary histo
1777 dRes = 0;
1778 fitFuncPairs[uChanA][uChanB] = new TF1(Form("fPair_%02d_%02d", uChanA, uChanB), "gaus",
1779 dPeakPos - fdFitZoomWidthPs, dPeakPos + fdFitZoomWidthPs);
1780 // Fix the Mean fit value around the Histogram Mean
1781 fitFuncPairs[uChanA][uChanB]->SetParameter(0, dZoomCounts);
1782 fitFuncPairs[uChanA][uChanB]->SetParameter(1, dPeakPos);
1783 fitFuncPairs[uChanA][uChanB]->SetParameter(2, 200.0); // Hardcode start with ~4*BinWidth, do better later
1784 // Using integral instead of bin center seems to lead to unrealistic values => no "I"
1785 phTimeDiff[uChanA][uChanB]->Fit(Form("fPair_%02d_%02d", uChanA, uChanB), "QRM0");
1786 // Get Sigma
1787 dRes = fitFuncPairs[uChanA][uChanB]->GetParameter(2);
1788 // Cleanup memory
1789 delete fitFuncPairs[uChanA][uChanB];
1790 // Fill summary
1791 phTimeResFit->Fill(uChanA, uChanB, dRes / TMath::Sqrt2());
1792
1793
1794 LOG(debug) << "CbmMcbm2018TofTestFee::UpdateZoomedFit => "
1795 << "For chan pair " << uChanA << " and " << uChanB
1796 << " we have zoomed RMS = " << phTimeDiff[uChanA][uChanB]->GetRMS() << " and a resolution of "
1797 << dRes / TMath::Sqrt2();
1798
1799 // Restore original axis state?
1800 phTimeDiff[uChanA][uChanB]->GetXaxis()->UnZoom();
1801 } // loop on chanA and chanB + check if corresponding fvhTimeDiffPulser exists
1802 } // if( 0.0 < fdFitZoomWidthPs )
1803 else {
1804 LOG(error) << "CbmMcbm2018TofTestFee::UpdateZoomedFit => Zoom width not defined, "
1805 << "please use SetFitZoomWidthPs, e.g. in macro, before trying this "
1806 "update !!!";
1807 } // else of if( 0.0 < fdFitZoomWidthPs )
1808}
1809
ClassImp(CbmConverterManager)
std::vector< double > GenerateLogBinArray(uint32_t uNbDecadesLog, uint32_t uNbStepsDecade, uint32_t uNbSubStepsInStep, uint32_t &uNbBinsLog, int32_t iStartExp, bool bAddZeroStart)
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 bMcbmTofTestFeeUpdateZoomedFit
Bool_t bMcbmTofTestFeePrintAllHitsEna
Bool_t bMcbmTofTestFeePrintAllEpochsEna
Bool_t bMcbmTofTestFeeResetHistos
Bool_t bMcbmTofTestFeeSaveHistos
Bool_t bMcbmTofTestFeeRawDataPrint
static double dTsStartTime
static constexpr size_t size()
Definition KfSimdPseudo.h:2
int Int_t
bool Bool_t
std::vector< std::vector< gdpbv100::Message > > fvmEpSupprBuffer
Buffer for suppressed epoch processing.
TH2 * fhTimeMeanPulserFeeA
[ Ch A ][ Ch B ]
std::vector< std::vector< Double_t > > fvdFeeChanMsLastPulserHit
[ fuFeeNr ][ ChanNr ]
std::vector< TH2 * > fvhPulserCountEvoPerFeeGdpb
CbmMcbm2018TofPar * fUnpackPar
std::vector< ULong64_t > fvulGdpbTsMsb
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
void FillEpochInfo(gdpbv100::Message)
void PrintSlcInfo(gdpbv100::Message)
std::vector< UInt_t > fvuPadiToGet4
std::vector< Int_t > fviModuleId
std::vector< size_t > fvMsComponentsList
FLES containers.
std::vector< UInt_t > fvuStarTrigCmdLast
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
ULong64_t fulCurrentEpochTime
Epoch + Epoch Cycle.
TCanvas * fcPulserFeeA
Canvases.
std::vector< TH1 * > fvhMsSzPerLink
TString fsHistoFileFullname
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
std::chrono::time_point< std::chrono::system_clock > fTimeLastHistoSaving
size_t fuMsAcceptsPercent
OLD, to be cleaned out !!!!!
std::vector< std::vector< TH1 * > > fvhTimeDiffPulserFeeFee
std::vector< UInt_t > fvuStarTokenLast
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
void SaveAllHistos(TString sFileName="")
void ProcessEpochCycle(uint64_t ulCycleData)
void PrintGenInfo(gdpbv100::Message)
std::vector< Int_t > fviRpcSide
std::vector< ULong64_t > fvulStarTsMsb
std::vector< std::vector< TH1 * > > fvhTimeDiffPulserFeeA
TH2 * fhTimeMeanPulserFeeB
[ Ch A ][ Ch B ]
std::vector< std::vector< UInt_t > > fvuFeeChanNbHitsLastMs
Buffer for pulser channels.
const UInt_t kuNbBinsDt
[ fuFeeNr ][ ChanNr ]
std::vector< int > fviMsgCounter
void FillHitInfo(gdpbv100::Message)
std::vector< TProfile * > fvhMsSzTimePerLink
std::vector< UInt_t > fvuGet4ToElink
std::vector< Int_t > fviNrOfRpc
std::vector< ULong64_t > fvulStarTsMid
std::vector< UInt_t > fvuElinkToGet4
5 FEE with 8 GET4 each
void FillPattInfo(gdpbv100::Message)
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::vector< std::vector< TH1 * > > fvhTimeDiffPulserFeeB
void UpdateZoomedFit(std::vector< std::vector< TH1 * > > phTimeDiff, TH2 *phTimeRmsZoom, TH2 *phTimeResFit)
std::vector< UInt_t > fvuStarDaqCmdLast
std::vector< ULong64_t > fvulCurrentEpoch
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
std::vector< ULong64_t > fvulStarTsFullLast
std::vector< ULong64_t > fvulGdpbTsLsb
void PrintSysInfo(gdpbv100::Message)
std::vector< ULong64_t > fvulCurrentEpochCycle
std::vector< ULong64_t > fvulGdpbTsFullLast
TH2 * fhTimeMeanPulserFeeFee
[ Ch FEE A ][ Ch FEE B ]
std::vector< UInt_t > fvuGet4ToPadi
std::vector< Int_t > fviRpcType
void FillStarTrigInfo(gdpbv100::Message)
static const UInt_t kuNbGet4PerGbtx
std::vector< Bool_t > fvbFirstEpochSeen
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
const uint32_t kuTotCounterSize
@ 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 uint32_t kuEpochCounterSz
const uint64_t kulEpochCycleFieldSz
@ SYS_GET4_SYNC_MISS