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