CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018UnpackerAlgoTof.cxx
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer], Norbert Herrmann */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmMcbm2018UnpackerAlgoTof -----
8// ----- Created 10.02.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
13
16#include "CbmMcbm2018TofPar.h"
17#include "CbmTofAddress.h"
18#include "CbmTofDetectorId_v14a.h" // in cbmdata/tof
19#include "TCanvas.h"
20#include "TH1.h"
21#include "TH2.h"
22#include "TList.h"
23#include "TProfile.h"
24#include "TROOT.h"
25#include "TString.h"
26
27#include <Logger.h>
28
29#include <cstdint>
30#include <fstream>
31#include <iomanip>
32#include <iostream>
33#include <vector>
34
35
37/*
38static uint32_t pat_mess[8]={8*0};
39std::vector< std::vector <uint32_t> > Pat_Request;
40std::vector<Bool_t> bGdpbOK;
41static Bool_t bEnableOut=kFALSE;
42static Int_t fiMsGood=0;
43static Int_t fiMsBad=0;
44*/
45// -------------------------------------------------------------------------
48 ,
50 fbMonitorMode(kFALSE)
51 , fbDebugMonitorMode(kFALSE)
53 , fUnpackPar(nullptr)
54 , fuNrOfGdpbs(0)
60 , fuNrOfGet4(0)
63 , fuNrOfGbtx(0)
64 , fuNrOfModules(0)
65 , fviNrOfRpc()
66 , fviRpcType()
67 , fviRpcSide()
68 , fviModuleId()
69 , fviRpcChUId()
70 , fdTimeOffsetNs(0.0)
71 , fuDiamondDpbIdx(99)
75 , fdTsStartTime(-1.0)
76 , fdTsStopTimeCore(-1.0)
77 , fdMsTime(-1.0)
78 , fuMsIndex(0)
80 , fuCurrDpbId(0)
81 , fuCurrDpbIdx(0)
82 , fuGet4Id(0)
83 , fuGet4Nr(0)
87 , fdStartTime(0.0)
88 , fdStartTimeMsSz(0.0)
89 , ftStartTimeUnix(std::chrono::steady_clock::now())
100 , fdRefTime(0.)
101 , fdLastDigiTime(0.)
103 , fdEvTime0(0.)
104 , fhRawTDigEvBmon(nullptr)
105 , fhRawTDigRef0(nullptr)
106 , fhRawTDigRef(nullptr)
107 , fhRawTRefDig0(nullptr)
108 , fhRawTRefDig1(nullptr)
109 , fhRawDigiLastDigi(nullptr)
110 , fhRawTotCh()
111 , fhChCount()
113 , fvbChanThere()
114 , fhChanCoinc()
115 , fhDetChanCoinc(nullptr)
116{
117}
119{
121 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
122 fvvmEpSupprBuffer[uGdpb].clear();
123 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
124 if (nullptr != fParCList) delete fParCList;
125 if (nullptr != fUnpackPar) delete fUnpackPar;
126}
127
128// -------------------------------------------------------------------------
130{
131 LOG(info) << "Initializing mCBM TOF 2019 unpacker algo";
132
133 return kTRUE;
134}
137{
138 /*
140 LOG(info)<<"<I> MS statistics - Good: " << fiMsGood <<", Bad: " << fiMsBad;
141*/
143}
144
145// -------------------------------------------------------------------------
147{
148 LOG(info) << "Init parameter containers for CbmMcbm2018UnpackerAlgoTof";
149
150 Bool_t initOK = ReInitContainers();
151
152 return initOK;
153}
155{
156 LOG(info) << "**********************************************";
157 LOG(info) << "ReInit parameter containers for CbmMcbm2018UnpackerAlgoTof";
158
159 fUnpackPar = (CbmMcbm2018TofPar*) fParCList->FindObject("CbmMcbm2018TofPar");
160 if (nullptr == fUnpackPar) {
161 LOG(error) << " CbmMcbm2018TofPar not found ";
162 return kFALSE;
163 }
164 Bool_t initOK = InitParameters();
165
166 return initOK;
167}
169{
170 if (nullptr == fParCList) fParCList = new TList();
171 fUnpackPar = new CbmMcbm2018TofPar("CbmMcbm2018TofPar");
172 fParCList->Add(fUnpackPar);
173
174 return fParCList;
175}
177{
178 LOG(info) << "InitParameters from " << fUnpackPar;
179 fdMsSizeInNs = fUnpackPar->GetSizeMsInNs();
180
181 fuNrOfGdpbs = fUnpackPar->GetNrOfGdpbs();
182 LOG(info) << "Nr. of Tof GDPBs: " << fuNrOfGdpbs;
183
184 fuNrOfFeePerGdpb = fUnpackPar->GetNrOfFeesPerGdpb();
185 LOG(info) << "Nr. of FEES per Tof GDPB: " << fuNrOfFeePerGdpb;
186
187 fuNrOfGet4PerFee = fUnpackPar->GetNrOfGet4PerFee();
188 LOG(info) << "Nr. of GET4 per Tof FEE: " << fuNrOfGet4PerFee;
189
190 fuNrOfChannelsPerGet4 = fUnpackPar->GetNrOfChannelsPerGet4();
191 LOG(info) << "Nr. of channels per GET4: " << fuNrOfChannelsPerGet4;
192
194 LOG(info) << "Nr. of channels per FEE: " << fuNrOfChannelsPerFee;
195
197 LOG(info) << "Nr. of GET4s: " << fuNrOfGet4;
198
200 LOG(info) << "Nr. of GET4s per GDPB: " << fuNrOfGet4PerGdpb;
201
203 LOG(info) << "Nr. of channels per GDPB: " << fuNrOfChannelsPerGdpb;
204
205 fGdpbIdIndexMap.clear();
206 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
207 fGdpbIdIndexMap[fUnpackPar->GetGdpbId(i)] = i;
208 LOG(info) << "GDPB Id of TOF " << i << " : " << std::hex << fUnpackPar->GetGdpbId(i) << std::dec;
209 } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
210
211 fuNrOfGbtx = fUnpackPar->GetNrOfGbtx();
212 LOG(info) << "Nr. of GBTx: " << fuNrOfGbtx;
213
214 fviRpcType.resize(fuNrOfGbtx);
215 fviModuleId.resize(fuNrOfGbtx);
216 fviNrOfRpc.resize(fuNrOfGbtx);
217 fviRpcSide.resize(fuNrOfGbtx);
218 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx) {
219 fviNrOfRpc[uGbtx] = fUnpackPar->GetNrOfRpc(uGbtx);
220 fviRpcType[uGbtx] = fUnpackPar->GetRpcType(uGbtx);
221 fviRpcSide[uGbtx] = fUnpackPar->GetRpcSide(uGbtx);
222 fviModuleId[uGbtx] = fUnpackPar->GetModuleId(uGbtx);
223 } // for( UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
224
225 UInt_t uNrOfChannels = fuNrOfGet4 * fuNrOfChannelsPerGet4;
226 LOG(info) << "Nr. of possible Tof channels: " << uNrOfChannels;
227
228 // CbmTofDetectorId* fTofId = new CbmTofDetectorId_v14a();
229 fviRpcChUId.resize(uNrOfChannels);
230 UInt_t iCh = 0;
231 for (UInt_t iGbtx = 0; iGbtx < fuNrOfGbtx; ++iGbtx) {
232 Int_t iModuleIdMap = fviModuleId[iGbtx];
233 switch (fviRpcType[iGbtx]) {
234
235 case 0: // CBM modules
236 if (fviRpcSide[iGbtx] < 2) { // mTof modules
237 LOG(info) << " Map mTof box " << fviModuleId[iGbtx] << " at GBTX - iCh = " << iCh;
238 const Int_t RpcMap[5] = {4, 2, 0, 3, 1};
239 for (Int_t iRpc = 0; iRpc < fviNrOfRpc[iGbtx]; iRpc++) {
240 Int_t iStrMax = 32;
241 Int_t iChNext = 1;
242
243 for (Int_t iStr = 0; iStr < iStrMax; iStr++) {
244 Int_t iStrMap = iStr;
245 Int_t iRpcMap = RpcMap[iRpc];
246
247 if (fviRpcSide[iGbtx] == 0) iStrMap = 31 - iStr;
248 if (fviModuleId[iGbtx] > -1)
249 fviRpcChUId[iCh] = CbmTofAddress::GetUniqueAddress(fviModuleId[iGbtx], iRpcMap, iStrMap,
250 fviRpcSide[iGbtx], fviRpcType[iGbtx]);
251 else
252 fviRpcChUId[iCh] = 0;
253 // LOG(debug)<<Form("Map Ch %d to Address 0x%08x",iCh,fviRpcChUId[iCh]);
254 iCh += iChNext;
255 }
256 }
257 }
258 break;
259
260 case 1: // STAR eTOF modules
261 if (fviRpcSide[iGbtx] < 2) { // mTof modules
262 LOG(info) << "Start eTOF module side " << fviRpcSide[iGbtx] << " at " << iCh;
263 const Int_t RpcMap[3] = {0, 1, 2};
264 for (Int_t iRpc = 0; iRpc < fviNrOfRpc[iGbtx]; iRpc++) {
265 Int_t iStrMax = 32;
266 Int_t iChNext = 1;
267
268 for (Int_t iStr = 0; iStr < iStrMax; iStr++) {
269 Int_t iStrMap = iStr;
270 Int_t iRpcMap = RpcMap[iRpc];
271
272 if (fviRpcSide[iGbtx] == 0) iStrMap = 31 - iStr;
273 if (fviModuleId[iGbtx] > -1)
274 fviRpcChUId[iCh] = CbmTofAddress::GetUniqueAddress(fviModuleId[iGbtx], iRpcMap, iStrMap,
275 fviRpcSide[iGbtx], fviRpcType[iGbtx]);
276 else
277 fviRpcChUId[iCh] = 0;
278 // LOG(debug)<<Form("Map Ch %d to Address 0x%08x",iCh,fviRpcChUId[iCh]);
279 iCh += iChNext;
280 }
281 }
282 }
283 iCh += 64;
284 break;
285
287 case 5: {
288 LOG(info) << " Map diamond at GBTX - iCh = " << iCh;
289 for (UInt_t uFee = 0; uFee < fUnpackPar->GetNrOfFeePerGbtx(); ++uFee) {
290 for (UInt_t uCh = 0; uCh < fUnpackPar->GetNrOfChannelsPerFee(); ++uCh) {
291 /*
292 if( uFee < 4 && 0 == uCh ) {
293 fviRpcChUId[ iCh ] = CbmTofAddress::GetUniqueAddress(
294 fviModuleId[iGbtx],
295 0, uFee + 4 * fviRpcSide[iGbtx],
296 0, fviRpcType[iGbtx] );
297 LOG(info) << Form( "Map Bmon Ch %d to Address 0x%08x", iCh, fviRpcChUId[iCh] );
298 }
299 else fviRpcChUId[ iCh ] = 0;
300*/
301
303 if (0 == uFee && 1 == fviNrOfRpc[iGbtx]) {
304 switch (uCh % 8) {
305 case 0:
306 case 2:
307 case 4: {
312 UInt_t uChannelBmon = uCh / 8 + 4 * fviRpcSide[iGbtx];
313 fviRpcChUId[iCh] =
314 CbmTofAddress::GetUniqueAddress(fviModuleId[iGbtx], 0, uChannelBmon, 0, fviRpcType[iGbtx]);
315 LOG(info) << Form("Bmon channel: %u from GBTx %2u Fee %2u "
316 "Channel %2u, indx %d address %08x",
317 uChannelBmon, iGbtx, uFee, uCh, iCh, fviRpcChUId[iCh]);
318 break;
319 } // Valid Bmon channel
320 default: {
321 fviRpcChUId[iCh] = 0;
322 } // Invalid Bmon channel
323 } // switch( uCh % 4 )
324 } // if( 0 == uFee )
325
326 iCh++;
327 } // for( UInt_t uCh = 0; uCh < fUnpackPar->GetNrOfChannelsPerFee(); ++uCh )
328 } // for( UInt_t uFee = 0; uFee < fUnpackPar->GetNrOfFeePerGbtx(); ++uFee )
329 } // if( 5 == fviRpcType[iGbtx] )
330 break;
331
332 case 78: // cern-20-gap + ceramic module
333 {
334 LOG(info) << " Map CERN 20 gap at GBTX - iCh = " << iCh;
335 // clang-format off
336 const Int_t StrMap[32] = {0, 1, 2, 3, 4, 31, 5, 6, 7, 30, 8,
337 9, 10, 29, 11, 12, 13, 14, 28, 15, 16, 17,
338 18, 27, 26, 25, 24, 23, 22, 21, 20, 19};
339 // clang-format on
340 Int_t iModuleId = 0;
341 Int_t iModuleType = 7;
342 Int_t iRpcMap = 0;
343 for (Int_t iFeet = 0; iFeet < 2; iFeet++) {
344 for (Int_t iStr = 0; iStr < 32; iStr++) {
345 Int_t iStrMap = 31 - 12 - StrMap[iStr];
346 Int_t iSideMap = iFeet;
347 if (iStrMap < 20)
348 fviRpcChUId[iCh] = CbmTofAddress::GetUniqueAddress(iModuleId, iRpcMap, iStrMap, iSideMap, iModuleType);
349 else
350 fviRpcChUId[iCh] = 0;
351 iCh++;
352 }
353 }
354
355 LOG(info) << " Map end CERN 20 gap at GBTX - iCh = " << iCh;
356 }
357 [[fallthrough]]; // fall through is intended
358 case 8: // ceramics
359 {
360 Int_t iModuleId = 0;
361 Int_t iModuleType = 8;
362 for (Int_t iRpc = 0; iRpc < 8; iRpc++) {
363 fviRpcChUId[iCh] = CbmTofAddress::GetUniqueAddress(iModuleId, 7 - iRpc, 0, 0, iModuleType);
364 iCh++;
365 }
366 iCh += (24 + 2 * 32);
367 }
368
369 LOG(info) << " Map end ceramics box at GBTX - iCh = " << iCh;
370 break;
371
372 case 4: // intended fallthrough
373 [[fallthrough]];
374 case 9: // Star2 boxes
375 {
376 LOG(info) << " Map Star2 box " << fviModuleId[iGbtx] << " at GBTX - iCh = " << iCh;
377 const Int_t iRpc[5] = {1, -1, 1, 0, 0};
378 const Int_t iSide[5] = {1, -1, 0, 1, 0};
379 for (Int_t iFeet = 0; iFeet < 5; iFeet++) {
380 for (Int_t iStr = 0; iStr < 32; iStr++) {
381 Int_t iStrMap = iStr;
382 Int_t iRpcMap = iRpc[iFeet];
383 Int_t iSideMap = iSide[iFeet];
384 if (iSideMap == 0) iStrMap = 31 - iStr;
385 switch (fviRpcSide[iGbtx]) {
386 case 0:; break;
387 case 1:;
388 iRpcMap = 1 - iRpcMap; // swap counters
389 break;
390 case 2:
391 switch (iFeet) {
392 case 1:
393 iRpcMap = iRpc[4];
394 iSideMap = iSide[4];
395 iStrMap = 31 - iStrMap;
396 break;
397 case 4:
398 iRpcMap = iRpc[1];
399 iSideMap = iSide[1];
400 break;
401 default:;
402 }
403 break;
404 }
405 if (iSideMap > -1)
406 fviRpcChUId[iCh] =
407 CbmTofAddress::GetUniqueAddress(fviModuleId[iGbtx], iRpcMap, iStrMap, iSideMap, fviRpcType[iGbtx]);
408 else
409 fviRpcChUId[iCh] = 0;
410 iCh++;
411 }
412 }
413 } break;
414
415 case 6: // Buc box
416 {
417 LOG(info) << " Map Buc box at GBTX - iCh = " << iCh;
418 const Int_t iRpc[5] = {0, -1, 0, 1, 1};
419 const Int_t iSide[5] = {1, -1, 0, 1, 0};
420 for (Int_t iFeet = 0; iFeet < 5; iFeet++) {
421 for (Int_t iStr = 0; iStr < 32; iStr++) {
422 Int_t iStrMap = iStr;
423 Int_t iRpcMap = iRpc[iFeet];
424 Int_t iSideMap = iSide[iFeet];
425 switch (fviRpcSide[iGbtx]) {
426 case 0:; break;
427 case 1: // HD cosmic 2019, Buc2018, v18n
428 iStrMap = 31 - iStr;
429 iRpcMap = 1 - iRpcMap;
430 break;
431 case 2: // v18m_cosmicHD
432 // iStrMap=31-iStr;
433 iSideMap = 1 - iSideMap;
434 break;
435 case 3:
436 iStrMap = 31 - iStr;
437 iRpcMap = 1 - iRpcMap;
438 iSideMap = 1 - iSideMap;
439 break;
440 case 4: // HD cosmic 2019, Buc2018, v18o
441 iRpcMap = 1 - iRpcMap;
442 break;
443 case 5: // HD cosmic 2020, Buc2018, v20a
444 iStrMap = 31 - iStr;
445 break;
446 case 6: //BUC special
447 {
448 switch (fviModuleId[iGbtx]) {
449 case 0: iRpcMap = 0; break;
450 case 1: iRpcMap = 1; break;
451 }
452 if (iFeet % 2 == 1) iModuleIdMap = 1;
453 else
454 iModuleIdMap = 0;
455
456 switch (iFeet) {
457 case 0:
458 case 3: iSideMap = 0; break;
459 case 1:
460 case 2: iSideMap = 1; break;
461 }
462 } break;
463
464 case 7: {
465 // clang-format off
466 const Int_t iChMap[160]={
467 127, 126, 125, 124, 12, 13, 14, 15, 7, 6, 5, 4, 28, 29, 30, 31, 123, 122, 121, 120, 8, 9, 10, 11, 107, 106, 105, 104, 108, 109, 110, 111,
468 39, 38, 37, 36, 52, 53, 54, 55, 63, 62, 61, 60, 128, 129, 130, 131, 43, 42, 41, 40, 148, 149, 150, 151, 59, 58, 57, 56, 132, 133, 134, 135,
469 139, 138, 137, 136, 140, 141, 142, 143, 99, 98, 97, 96, 64, 65, 66, 67, 103, 102, 101, 100, 84, 85, 86, 87, 155, 154, 153, 152, 68, 69, 70, 71,
470 159, 158, 157, 156, 144, 145, 146, 147, 47, 46, 45, 44, 76, 77, 78, 79, 51, 50, 49, 48, 20, 21, 22, 23, 35, 34, 33, 32, 116, 117, 118, 119,
471 75, 74, 73, 72, 92, 93, 94, 95, 19, 18, 17, 16, 80, 81, 82, 83, 115, 114, 113, 112, 24, 25, 26, 27, 91, 90, 89, 88, 0, 1, 2, 3
472 };
473 // clang-format on
474 Int_t iInd = iFeet * 32 + iStr;
475 Int_t i = 0;
476 for (; i < 160; i++)
477 if (iInd == iChMap[i]) break;
478 iStrMap = i % 32;
479 Int_t iFeetInd = (i - iStrMap) / 32;
480 switch (iFeet) {
481 case 0:
482 iRpcMap = 0;
483 iSideMap = 1;
484 break;
485 case 1:
486 iRpcMap = 1;
487 iSideMap = 1;
488 break;
489 case 2:
490 iRpcMap = 0;
491 iSideMap = 0;
492 break;
493 case 3:
494 iRpcMap = 1;
495 iSideMap = 0;
496 break;
497 case 4: iSideMap = -1; break;
498 }
499 iModuleIdMap = fviModuleId[iGbtx];
500 LOG(info) << "Buc of GBTX " << iGbtx << " Ch " << iCh
501 << Form(", Feet %1d, Str %2d, Ind %3d, i %3d, FeetInd %1d, Rpc %1d, Side %1d, Str %2d ",
502 iFeet, iStr, iInd, i, iFeetInd, iRpcMap, iSideMap, iStrMap);
503 } break;
504 default:;
505 }
506 if (iSideMap > -1)
507 fviRpcChUId[iCh] =
508 CbmTofAddress::GetUniqueAddress(iModuleIdMap, iRpcMap, iStrMap, iSideMap, fviRpcType[iGbtx]);
509 else
510 fviRpcChUId[iCh] = 0;
511
512 iCh++;
513 }
514 }
515 } break;
516
517 case -1:
518 LOG(info) << " Found unused GBTX link at iCh = " << iCh;
519 iCh += 160;
520 break;
521
522 default: LOG(error) << "Invalid Tof Type specifier ";
523 }
524 }
525 TString sPrintout = "";
526 for (UInt_t uCh = 0; uCh < uNrOfChannels; ++uCh) {
527 if (0 == uCh % 8) sPrintout += "\n";
528 if (0 == uCh % fuNrOfChannelsPerGdpb) sPrintout += Form("\n Gdpb %u\n", uCh / fuNrOfChannelsPerGdpb);
529 sPrintout += Form(" 0x%08x", fviRpcChUId[uCh]);
530 } // for( UInt_t i = 0; i < uNrOfChannels; ++i)
531 LOG(info) << sPrintout;
532
533 // Request masks
534 /*
535 LOG(info) << " Load " << fUnpackPar->GetNrReqPattern() << " GET4 Request masks for " << fuNrOfGdpbs << " Gdpbs ";
536 if(fUnpackPar->GetNrReqPattern()>0){
537 bGdpbOK.resize(fuNrOfGdpbs);
538 Pat_Request.resize(fuNrOfGdpbs);
539 Int_t iInd=0;
540 for(Int_t iGdpb=0; iGdpb<fuNrOfGdpbs; iGdpb++) {
541 bGdpbOK[iGdpb]=kTRUE;
542 Pat_Request[iGdpb].resize(fUnpackPar->GetNrReqPattern());
543 for (Int_t iPat=0; iPat<fUnpackPar->GetNrReqPattern(); iPat++) {
544 UInt_t PatGet4=fUnpackPar->GetReqPattern(iInd++);
545 for( UInt_t uBit = 0; uBit < 32; ++uBit ) {
546 if( ( PatGet4 >> uBit ) & 0x1 ) {
547 UInt_t iGet4=iPat*32+uBit;
548 UInt_t uElink=fUnpackPar->Get4IdxToElinkIdx(iGet4);
549 UInt_t ubit=uElink%32;
550 UInt_t iEPat=(uElink-ubit)/32;
551 Pat_Request[iGdpb][iEPat] |= (0x1 << ubit);
552 }
553 }
554 }
555 }
556 }
557 */
559 fvulCurrentEpoch.resize(fuNrOfGdpbs, 0);
562
573 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
574 fvulGdpbTsMsb[uGdpb] = 0;
575 fvulGdpbTsLsb[uGdpb] = 0;
576 fvulStarTsMsb[uGdpb] = 0;
577 fvulStarTsMid[uGdpb] = 0;
578 fvulGdpbTsFullLast[uGdpb] = 0;
579 fvulStarTsFullLast[uGdpb] = 0;
580 fvuStarTokenLast[uGdpb] = 0;
581 fvuStarDaqCmdLast[uGdpb] = 0;
582 fvuStarTrigCmdLast[uGdpb] = 0;
583 } // for (Int_t iGdpb = 0; iGdpb < fuNrOfGdpbs; ++iGdpb)
584
587
588 return kTRUE;
589}
590// -------------------------------------------------------------------------
591
592void CbmMcbm2018UnpackerAlgoTof::AddMsComponentToList(size_t component, UShort_t usDetectorId)
593{
595 for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
596 if (component == fvMsComponentsList[uCompIdx]) return;
597
599 fvMsComponentsList.push_back(component);
600
601 LOG(info) << "CbmMcbm2018UnpackerAlgoTof::AddMsComponentToList => Component " << component << " with detector ID 0x"
602 << std::hex << usDetectorId << std::dec << " added to list";
603}
604// -------------------------------------------------------------------------
605
607{
608 fulCurrentTsIdx = ts.index();
609 fdTsStartTime = static_cast<Double_t>(ts.descriptor(0, 0).idx);
610 LOG(debug) << "ProcessTs " << fulCurrentTsIdx;
611
613 if (0 == fulCurrentTsIdx) { return kTRUE; } // if( 0 == fulCurrentTsIdx )
614
616 if (-1.0 == fdTsCoreSizeInNs) {
617 fuNbCoreMsPerTs = ts.num_core_microslices();
618 fuNbOverMsPerTs = ts.num_microslices(0) - ts.num_core_microslices();
621 LOG(info) << "Timeslice parameters: each TS has " << fuNbCoreMsPerTs << " Core MS and " << fuNbOverMsPerTs
622 << " Overlap MS, for a core duration of " << fdTsCoreSizeInNs << " ns and a full duration of "
623 << fdTsFullSizeInNs << " ns";
624
628 LOG(info) << "In each TS " << fuNbMsLoop << " MS will be looped over";
629 } // if( -1.0 == fdTsCoreSizeInNs )
630
633 // LOG(info) << Form( "TS %5d Start %12f Stop %12f", fulCurrentTsIdx, fdTsStartTime, fdTsStopTimeCore );
634
636 for (fuMsIndex = 0; fuMsIndex < fuNbMsLoop; fuMsIndex++) {
638 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
639 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
640
641 if (kFALSE == ProcessMs(ts, uMsComp, fuMsIndex)) {
642 LOG(error) << "Failed to process ts " << fulCurrentTsIdx << " MS " << fuMsIndex << " for component " << uMsComp;
643 return kFALSE;
644 } // if( kFALSE == ProcessMs( ts, uMsCompIdx, fuMsIndex ) )
645 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
646 } // for( fuMsIndex = 0; fuMsIndex < uNbMsLoop; fuMsIndex ++ )
647
649 if (fbMonitorMode) {
650 if (kFALSE == FillHistograms()) {
651 LOG(error) << "Failed to fill histos in ts " << fulCurrentTsIdx;
652 return kFALSE;
653 } // if( kFALSE == FillHistograms() )
654
656 fhVectorCapacity->Fill(fulCurrentTsIdx, fDigiVect.capacity());
657 } // if( fbMonitorMode )
658
659 if (fuTsMaxVectorSize < fDigiVect.size()) {
661 fDigiVect.shrink_to_fit();
663 } // if( fuTsMaxVectorSize < fDigiVect.size() )
664 /*
665 if(!bEnableOut) {
666 LOG(debug) << "Ts "<< fulCurrentTsIdx << " removed ";
667 fiMsBad++;
668 fDigiVect.clear();
669 }else {
670 LOG(debug) << "Ts "<< fulCurrentTsIdx << " accepted ";
671 fiMsGood++;
672 }
673*/
675 sort(fDigiVect.begin(), fDigiVect.end(),
676 [](const CbmTofDigi& a, const CbmTofDigi& b) -> bool { return a.GetTime() < b.GetTime(); });
677
678 return kTRUE;
679}
680
681Bool_t CbmMcbm2018UnpackerAlgoTof::ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx)
682{
683 auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx);
684 fuCurrentEquipmentId = msDescriptor.eq_id;
685 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsCompIdx, uMsIdx));
686
687 uint32_t uSize = msDescriptor.size;
688 fulCurrentMsIdx = msDescriptor.idx;
689 // Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
690 LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec
691 << " has size: " << uSize;
692
693 if (0 == fvbMaskedComponents.size()) fvbMaskedComponents.resize(ts.num_components(), kFALSE);
694
695 fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
696 // fuCurrDpbIdx = fDpbIdIndexMap[ fuCurrDpbId ];
697
699 auto it = fGdpbIdIndexMap.find(fuCurrDpbId);
700 if (it == fGdpbIdIndexMap.end()) {
701 if (kFALSE == fvbMaskedComponents[uMsCompIdx]) {
702 LOG(info) << "---------------------------------------------------------------";
703 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
704 LOG(warning) << "Could not find the gDPB index for AFCK id 0x" << std::hex << fuCurrDpbId << std::dec
705 << " in timeslice " << fulCurrentTsIdx << " in microslice " << uMsIdx << " component " << uMsCompIdx
706 << "\n"
707 << "If valid this index has to be added in the TOF "
708 "parameter file in the DbpIdArray field";
709 fvbMaskedComponents[uMsCompIdx] = kTRUE;
710 } // if( kFALSE == fvbMaskedComponents[ uMsComp ] )
711 else
712 return kTRUE;
713
716
717 return kFALSE;
718 } // if( it == fGdpbIdIndexMap.end() )
719 else
721
722 fuCurrentMsSysId = static_cast<unsigned int>(msDescriptor.sys_id);
723
724 // If not integer number of message in input buffer, print warning/error
725 if (0 != (uSize % sizeof(gdpbv100::Message)))
726 LOG(error) << "The input microslice buffer does NOT "
727 << "contain only complete gDPB messages!";
728
729 // Compute the number of complete messages in the input microslice buffer
730 uint32_t uNbMessages = (uSize - (uSize % sizeof(gdpbv100::Message))) / sizeof(gdpbv100::Message);
731
732 // Prepare variables for the loop on contents
733 Int_t messageType = -111;
734 fbEpochFoundInThisMs = kFALSE;
735 const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent); // for epoch cycle
736 const gdpbv100::Message* pMess = reinterpret_cast<const gdpbv100::Message*>(pInBuff);
737 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
739 if (0 == uIdx) {
740 ProcessEpochCycle(pInBuff[uIdx]);
741 continue;
742 } // if( 0 == uIdx )
743
745 messageType = pMess[uIdx].getMessageType();
746
747 fuGet4Id = fUnpackPar->ElinkIdxToGet4Idx(pMess[uIdx].getGdpbGenChipId());
748 if (fuDiamondDpbIdx == fuCurrDpbIdx || 0x90 == fuCurrentMsSysId) fuGet4Id = pMess[uIdx].getGdpbGenChipId();
750
751 if (fuNrOfGet4PerGdpb <= fuGet4Id && !pMess[uIdx].isStarTrigger() && (gdpbv100::kuChipIdMergedEpoch != fuGet4Id))
752 LOG(warning) << "Message with Get4 ID too high: " << fuGet4Id << " VS " << fuNrOfGet4PerGdpb << " for GdpbIdx "
753 << fuCurrDpbIdx << " set in parameters.";
754
755 /*
756 if( 1 == uIdx && gdpbv100::MSG_EPOCH != messageType )
757 LOG(warning) << " in timeslice " << fulCurrentTsIdx
758 << " in microslice " << fuMsIndex
759 << " component " << uMsCompIdx
760 << " first message is not an epoch: type " << messageType;
761
762 if( uNbMessages - 1 == uIdx && gdpbv100::MSG_EPOCH != messageType )
763 LOG(warning) << " in timeslice " << fulCurrentTsIdx
764 << " in microslice " << fuMsIndex
765 << " component " << uMsCompIdx
766 << " last message is not an epoch: type " << messageType;
767*/
774 if (1 == uIdx && gdpbv100::MSG_EPOCH != messageType) {
775 LOG(debug) << " CbmMcbm2018UnpackerAlgoTof ==> In timeslice " << fulCurrentTsIdx << " in microslice " << fuMsIndex
776 << " component " << uMsCompIdx << " first message is not an epoch: type " << messageType
777 << " -> It will be ignored! ";
778 continue;
779 } // if( 1 == uIdx && gdpbv100::MSG_EPOCH != messageType )
780
781 switch (messageType) {
782 case gdpbv100::MSG_HIT: {
783 if (pMess[uIdx].getGdpbHitIs24b()) {
784 LOG(error) << "This event builder does not support 24b hit message!!!"
785 << " Message " << uIdx << "/" << uNbMessages << " 0x"
786 << FormatHexPrintout(pMess[uIdx].getData(), '0', 16);
787 continue;
788 } // if( getGdpbHitIs24b() )
789 else {
790 fvvmEpSupprBuffer[fuCurrDpbIdx].push_back(pMess[uIdx]);
791 } // else of if( getGdpbHitIs24b() )
792 break;
793 } // case gdpbv100::MSG_HIT:
794 case gdpbv100::MSG_EPOCH: {
796 fbEpochFoundInThisMs = kTRUE;
797 ProcessEpoch(pMess[uIdx], uIdx);
798 } // if this epoch message is a merged one valid for all chips
799 else {
801 LOG(debug2) << "This event builder does not support unmerged epoch "
802 "messages!!!.";
803 continue;
804 } // if single chip epoch message
805 break;
806 } // case gdpbv100::MSG_EPOCH:
807 case gdpbv100::MSG_SLOWC: {
808 fvvmEpSupprBuffer[fuCurrDpbIdx].push_back(pMess[uIdx]);
809 break;
810 } // case gdpbv100::MSG_SLOWC:
811 case gdpbv100::MSG_SYST: {
812 fvvmEpSupprBuffer[fuCurrDpbIdx].push_back(pMess[uIdx]);
813 break;
814 } // case gdpbv100::MSG_SYST:
819 ProcessStarTrigger(pMess[uIdx]);
820
823 /*
824 if( gdpbv100::MSG_STAR_TRI_A == messageType )
825 {
826 } // if( gdpbv100::MSG_STAR_TRI_A == messageType )
827*/
828 break;
829 } // case gdpbv100::MSG_STAR_TRI_A-D
830 default:
831 LOG(error) << "Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType)
832 << " not included in Get4 unpacker.";
833 } // switch( mess.getMessageType() )
834 } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
835
841 if (kTRUE == fbEpochFoundInThisMs) {
844 }
845 else {
847 }
848
849 return kTRUE;
850}
851
852// -------------------------------------------------------------------------
853void CbmMcbm2018UnpackerAlgoTof::ProcessEpochCycle(const uint64_t& ulCycleData)
854{
855 ULong64_t ulEpochCycleVal = ulCycleData & gdpbv100::kulEpochCycleFieldSz;
856
857 if (!(ulEpochCycleVal == fvulCurrentEpochCycle[fuCurrDpbIdx]
858 || ulEpochCycleVal == fvulCurrentEpochCycle[fuCurrDpbIdx] + 1)
859 && 0 < fulCurrentMsIdx) {
860 LOG(warning) << "CbmMcbm2018UnpackerAlgoTof::ProcessEpochCycle => "
861 << " Missmatch in epoch cycles detected for Gdpb " << fuCurrDpbIdx
862 << ", probably fake cycles due to epoch index corruption! "
863 << Form(" Current cycle 0x%09llX New cycle 0x%09llX", fvulCurrentEpochCycle[fuCurrDpbIdx],
864 ulEpochCycleVal);
865 } // if epoch cycle did not stay constant or increase by exactly 1, except if first MS of the TS
866 if (ulEpochCycleVal != fvulCurrentEpochCycle[fuCurrDpbIdx]) {
867 LOG(info) << "CbmMcbm2018UnpackerAlgoTof::ProcessEpochCycle => "
868 << " New epoch cycle for Gdpb " << fuCurrDpbIdx
869 << Form(": Current cycle 0x%09llX New cycle 0x%09llX", fvulCurrentEpochCycle[fuCurrDpbIdx],
870 ulEpochCycleVal);
871 } // if( ulEpochCycleVal != fvulCurrentEpochCycle[fuCurrDpbIdx] )
872 fvulCurrentEpochCycle[fuCurrDpbIdx] = ulEpochCycleVal;
873
874 return;
875}
876void CbmMcbm2018UnpackerAlgoTof::ProcessEpoch(const gdpbv100::Message& mess, uint32_t /*uMesgIdx*/)
877{
878 ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
879 /*
880 if( ( 6 == fulCurrentTsIdx && 2 == fuCurrDpbIdx ) ||
881 ( 57 == fulCurrentTsIdx && 0 == fuCurrDpbIdx ) )
882 LOG(info) << Form( "Gdpb %d TS %3llu MS %3u Msg %4u Ep %08llx",
883 fuCurrDpbIdx, fulCurrentTsIdx, fuMsIndex, uMesgIdx, ulEpochNr );
884
885 if( !( ulEpochNr == fvulCurrentEpoch[ fuCurrDpbIdx ] + 1 ||
886// ulEpochNr == fvulCurrentEpoch[ fuCurrDpbIdx ] || // For the fake "closing epoch"
887 ( 0 == ulEpochNr && gdpbv100::kuEpochCounterSz == fvulCurrentEpoch[ fuCurrDpbIdx ] )
888 )
889 )
890 {
891 Int_t iDiff = ulEpochNr;
892 iDiff -= fvulCurrentEpoch[ fuCurrDpbIdx ];
893 LOG(info) << "CbmMcbm2018UnpackerAlgoTof::ProcessEpoch => "
894 << " Non consecutive epochs for Gdpb " << fuCurrDpbIdx
895 << " in TS " << fulCurrentTsIdx
896 << " MS " << fuMsIndex
897 << " Msg " << uMesgIdx
898 << Form( " : old Ep %08llx new Ep %08llx Diff %d ", fvulCurrentEpoch[ fuCurrDpbIdx ], ulEpochNr, iDiff )
899 << std::endl;
900 } // if epoch neither +1 nor equal nor overflow
901*/
902 /*
905 if( 0 < fvulCurrentEpoch[ fuCurrDpbIdx ] && ulEpochNr < fvulCurrentEpoch[ fuCurrDpbIdx ] &&
906 1 < uMesgIdx )
907 {
908 LOG(info) << "CbmMcbm2018UnpackerAlgoTof::ProcessEpoch => "
909 << " New epoch cycle for Gdpb " << fuCurrDpbIdx
910 << Form( ": Current cycle 0x%09llX New cycle 0x%09llX", fvulCurrentEpochCycle[fuCurrDpbIdx], fvulCurrentEpochCycle[fuCurrDpbIdx] + 1 )
911 << Form( "(old Ep %08llx new Ep %08llx)", fvulCurrentEpoch[ fuCurrDpbIdx ], ulEpochNr )
912 << std::endl;
913 fvulCurrentEpochCycle[ fuCurrDpbIdx ]++;
914 } // if( 0 < fvulCurrentEpoch[ fuCurrDpbIdx ] && ulEpochNr < fvulCurrentEpoch[ fuCurrDpbIdx ] && 1 < uMesgIdx)
915*/
916 fvulCurrentEpoch[fuCurrDpbIdx] = ulEpochNr;
919
920 /*
923 if( 0 < ulEpochNr )
924 mess.setGdpbEpEpochNb( ulEpochNr - 1 );
925 else mess.setGdpbEpEpochNb( gdpbv100::kuEpochCounterSz );
926*/
929}
931{
933 ULong64_t ulEpochNr = (fvulCurrentEpoch[fuCurrDpbIdx] + 1) % gdpbv100::kuEpochCounterSz;
934
936 LOG(info) << "CbmMcbm2018UnpackerAlgoTof::ProcessEndOfMsEpoch => "
937 << " New epoch cycle for Gdpb " << fuCurrDpbIdx
938 << Form(": Current cycle 0x%09llX New cycle 0x%09llX", fvulCurrentEpochCycle[fuCurrDpbIdx],
940 << Form("(old Ep %08llx new Ep %08llx)", fvulCurrentEpoch[fuCurrDpbIdx], ulEpochNr);
942 } // if( 0 < fvulCurrentEpoch[ fuCurrDpbIdx ] && ulEpochNr < fvulCurrentEpoch[ fuCurrDpbIdx ] )
943 /*
944 fvulCurrentEpoch[ fuCurrDpbIdx ] = ulEpochNr;
945 fvulCurrentEpochFull[ fuCurrDpbIdx ] = ulEpochNr + ( gdpbv100::kuEpochCounterSz + 1 ) * fvulCurrentEpochCycle[ fuCurrDpbIdx ];
946*/
949
952}
954{
955 Int_t iMsgIndex = mess.getStarTrigMsgIndex();
956
957 switch (iMsgIndex) {
958 case 0: fvulGdpbTsMsb[fuCurrDpbIdx] = mess.getGdpbTsMsbStarA(); break;
959 case 1:
962 break;
963 case 2: fvulStarTsMid[fuCurrDpbIdx] = mess.getStarTsMidStarC(); break;
964 case 3: {
965 ULong64_t ulNewGdpbTsFull = (fvulGdpbTsMsb[fuCurrDpbIdx] << 24) + (fvulGdpbTsLsb[fuCurrDpbIdx]);
966 ULong64_t ulNewStarTsFull =
968 UInt_t uNewToken = mess.getStarTokenStarD();
969 UInt_t uNewDaqCmd = mess.getStarDaqCmdStarD();
970 UInt_t uNewTrigCmd = mess.getStarTrigCmdStarD();
971
972 if ((uNewToken == fvuStarTokenLast[fuCurrDpbIdx]) && (ulNewGdpbTsFull == fvulGdpbTsFullLast[fuCurrDpbIdx])
973 && (ulNewStarTsFull == fvulStarTsFullLast[fuCurrDpbIdx]) && (uNewDaqCmd == fvuStarDaqCmdLast[fuCurrDpbIdx])
974 && (uNewTrigCmd == fvuStarTrigCmdLast[fuCurrDpbIdx])) {
975 UInt_t uTrigWord = ((fvuStarTrigCmdLast[fuCurrDpbIdx] & 0x00F) << 16)
976 + ((fvuStarDaqCmdLast[fuCurrDpbIdx] & 0x00F) << 12)
977 + ((fvuStarTokenLast[fuCurrDpbIdx] & 0xFFF));
978 LOG(warning) << "Possible error: identical STAR tokens found twice in "
979 "a row => ignore 2nd! "
980 << " TS " << fulCurrentTsIdx << " gDBB #" << fuCurrDpbIdx << " "
981 << Form("token = %5u ", fvuStarTokenLast[fuCurrDpbIdx])
982 << Form("gDPB ts = %12llu ", fvulGdpbTsFullLast[fuCurrDpbIdx])
983 << Form("STAR ts = %12llu ", fvulStarTsFullLast[fuCurrDpbIdx])
984 << Form("DAQ cmd = %2u ", fvuStarDaqCmdLast[fuCurrDpbIdx])
985 << Form("TRG cmd = %2u ", fvuStarTrigCmdLast[fuCurrDpbIdx]) << Form("TRG Wrd = %5x ", uTrigWord);
986 return;
987 } // if exactly same message repeated
988
989 // GDPB TS counter reset detection
990 if (ulNewGdpbTsFull < fvulGdpbTsFullLast[fuCurrDpbIdx])
991 LOG(debug) << "Probable reset of the GDPB TS: old = " << Form("%16llu", fvulGdpbTsFullLast[fuCurrDpbIdx])
992 << " new = " << Form("%16llu", ulNewGdpbTsFull) << " Diff = -"
993 << Form("%8llu", fvulGdpbTsFullLast[fuCurrDpbIdx] - ulNewGdpbTsFull) << " GDPB #"
994 << Form("%2u", fuCurrDpbIdx);
995
996 // STAR TS counter reset detection
997 if (ulNewStarTsFull < fvulStarTsFullLast[fuCurrDpbIdx])
998 LOG(debug) << "Probable reset of the STAR TS: old = " << Form("%16llu", fvulStarTsFullLast[fuCurrDpbIdx])
999 << " new = " << Form("%16llu", ulNewStarTsFull) << " Diff = -"
1000 << Form("%8llu", fvulStarTsFullLast[fuCurrDpbIdx] - ulNewStarTsFull) << " GDPB #"
1001 << Form("%2u", fuCurrDpbIdx);
1002
1005 fvulGdpbTsFullLast[fuCurrDpbIdx] = ulNewGdpbTsFull;
1006 fvulStarTsFullLast[fuCurrDpbIdx] = ulNewStarTsFull;
1007 fvuStarTokenLast[fuCurrDpbIdx] = uNewToken;
1008 fvuStarDaqCmdLast[fuCurrDpbIdx] = uNewDaqCmd;
1009 fvuStarTrigCmdLast[fuCurrDpbIdx] = uNewTrigCmd;
1010 } // if( fuCurrentMs < fuNbCoreMsPerTs )
1011
1013 /*
1014 Double_t dTot = 1.;
1015 Double_t dTime = fulGdpbTsFullLast * 6.25;
1016 if( 0. == fdFirstDigiTimeDif && 0. != fdLastDigiTime )
1017 {
1018 fdFirstDigiTimeDif = dTime - fdLastDigiTime;
1019 LOG(info) << "Reference fake digi time shift initialized to " << fdFirstDigiTimeDif;
1020 } // if( 0. == fdFirstDigiTimeDif && 0. != fdLastDigiTime )
1021
1022 // dTime -= fdFirstDigiTimeDif;
1023
1024 LOG(debug) << "Insert fake digi with time " << dTime << ", Tot " << dTot;
1025 fhRawTRefDig0->Fill( dTime - fdLastDigiTime);
1026 fhRawTRefDig1->Fill( dTime - fdLastDigiTime);
1027
1028 fDigi = new CbmTofDigiExp(0x00005006, dTime, dTot); // fake start counter signal
1029 fBuffer->InsertData<CbmTofDigi>(fDigi);
1030*/
1031 break;
1032 } // case 3
1033 default: LOG(error) << "Unknown Star Trigger messageindex: " << iMsgIndex;
1034 } // switch( iMsgIndex )
1035}
1036// -------------------------------------------------------------------------
1038{
1039 Int_t iBufferSize = fvvmEpSupprBuffer[fuCurrDpbIdx].size();
1040
1041 if (0 == iBufferSize) return;
1042
1043 LOG(debug) << "Now processing stored messages for for gDPB " << fuCurrDpbIdx << " with epoch number "
1045
1048 // std::stable_sort( fvvmEpSupprBuffer[ fuCurrDpbIdx ].begin(), fvvmEpSupprBuffer[ fuCurrDpbIdx ].end() );
1049
1051 ULong64_t ulCurEpochGdpbGet4 = fvulCurrentEpochFull[fuCurrDpbIdx];
1052
1054 if (0 == ulCurEpochGdpbGet4) return;
1055
1057 ulCurEpochGdpbGet4--;
1058
1059 Int_t messageType = -111;
1060 for (Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++) {
1061 messageType = fvvmEpSupprBuffer[fuCurrDpbIdx][iMsgIdx].getMessageType();
1062
1063 fuGet4Id = fUnpackPar->ElinkIdxToGet4Idx(fvvmEpSupprBuffer[fuCurrDpbIdx][iMsgIdx].getGdpbGenChipId());
1065 fuGet4Id = fvvmEpSupprBuffer[fuCurrDpbIdx][iMsgIdx].getGdpbGenChipId();
1067
1069 gdpbv100::FullMessage fullMess(fvvmEpSupprBuffer[fuCurrDpbIdx][iMsgIdx], ulCurEpochGdpbGet4);
1070
1072 switch (messageType) {
1073 case gdpbv100::MSG_HIT: {
1074 ProcessHit(fullMess);
1075 break;
1076 } // case gdpbv100::MSG_HIT:
1077 case gdpbv100::MSG_SLOWC: {
1078 ProcessSlCtrl(fullMess);
1079 break;
1080 } // case gdpbv100::MSG_SLOWC:
1081 case gdpbv100::MSG_SYST: {
1082 ProcessSysMess(fullMess);
1083 break;
1084 } // case gdpbv100::MSG_SYST:
1091 break;
1092 default:
1093 LOG(error) << "Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType)
1094 << " not included in Get4 unpacker.";
1095 } // switch( mess.getMessageType() )
1096 } // for( Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++ )
1097
1099}
1100
1102// -------------------------------------------------------------------------
1104{
1105
1106 if (messlast == mess) return;
1107 messlast = mess;
1108
1109 UInt_t uChannel = mess.getGdpbHitChanId();
1110 UInt_t uTot = mess.getGdpbHit32Tot();
1111
1112 // In 32b mode the coarse counter is already computed back to 112 FTS bins
1113 // => need to hide its contribution from the Finetime
1114 // => FTS = Fullt TS modulo 112
1115 // UInt_t uFts = mess.getGdpbHitFullTs() % 112;
1116
1117 UInt_t uChannelNr = fuGet4Id * fuNrOfChannelsPerGet4 + uChannel;
1118 UInt_t uChannelNrInFee = (fuGet4Id % fuNrOfGet4PerFee) * fuNrOfChannelsPerGet4 + uChannel;
1119 UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
1120 UInt_t uFeeNrInSys = fuCurrDpbIdx * fuNrOfFeePerGdpb + uFeeNr;
1121 UInt_t uRemappedChannelNr = uFeeNr * fuNrOfChannelsPerFee + fUnpackPar->Get4ChanToPadiChan(uChannelNrInFee);
1122 // UInt_t uGbtxNr = (uFeeNr / fUnpackPar->GetNrOfFeePerGbtx());
1123 // UInt_t uFeeInGbtx = (uFeeNr % fUnpackPar->GetNrOfFeePerGbtx());
1124 // UInt_t uGbtxNrInSys = fuCurrDpbIdx * fUnpackPar->GetNrOfGbtxPerGdpb() + uGbtxNr;
1125
1126 // UInt_t uChanInSyst = fuCurrDpbIdx * fuNrOfChannelsPerGdpb + uChannelNr;
1127 UInt_t uRemappedChannelNrInSys = fuCurrDpbIdx * fuNrOfChannelsPerGdpb + uFeeNr * fuNrOfChannelsPerFee
1128 + fUnpackPar->Get4ChanToPadiChan(uChannelNrInFee);
1130 if (fuDiamondDpbIdx == fuCurrDpbIdx || 0x90 == fuCurrentMsSysId) {
1131 uRemappedChannelNr = uChannelNr;
1132 uRemappedChannelNrInSys = fuCurrDpbIdx * fUnpackPar->GetNrOfChannelsPerGdpb() + uChannelNr;
1133 } // if( fuDiamondDpbIdx == fuCurrDpbIdx || 0x90 == fuCurrentMsSysId )
1134
1135 // ULong_t ulHitTime = mess.getMsgFullTime( mess.getExtendedEpoch() );
1136 Double_t dHitTime = mess.GetFullTimeNs();
1137 Double_t dHitTot = uTot; // in bins
1138
1139 // Histograms filling
1140 if (kTRUE == fbMonitorMode) {
1141 fhRawTotCh[fuCurrDpbIdx]->Fill(uRemappedChannelNr, dHitTot);
1142 fhChCount[fuCurrDpbIdx]->Fill(uChannelNr);
1143 fhChCountRemap[fuCurrDpbIdx]->Fill(uRemappedChannelNr);
1144 } // if( kTRUE == fbMonitorMode )
1145
1146 /*
1147 if( fUnpackPar->GetNumberOfChannels() < uChanInSyst )
1148 {
1149 LOG(fatal) << "Invalid mapping index " << uChanInSyst
1150 << " VS " << fUnpackPar->GetNumberOfChannels()
1151 <<", from " << fuCurrDpbIdx
1152 <<", " << fuGet4Id
1153 <<", " << uChannel;
1154 return;
1155 } // if( fUnpackPar->GetNumberOfChannels() < uChanUId )
1156*/
1157 if (fviRpcChUId.size() < uRemappedChannelNrInSys) {
1158 LOG(fatal) << "Invalid mapping index " << uRemappedChannelNrInSys << " VS " << fviRpcChUId.size()
1159 << ", from GdpbNr " << fuCurrDpbIdx << ", Get4 " << fuGet4Id << ", Ch " << uChannel << ", ChNr "
1160 << uChannelNr << ", ChNrIF " << uChannelNrInFee << ", FiS " << uFeeNrInSys;
1161 return;
1162 } // if( fviRpcChUId.size() < uRemappedChannelNrInSys )
1163
1164 UInt_t uChanUId = fviRpcChUId[uRemappedChannelNrInSys];
1165 /*
1166 if( 5 == fviRpcType[uGbtxNrInSys] )
1167 LOG(info) << "Bmon mapping index " << uRemappedChannelNrInSys
1168 << " UID " << std::hex << std::setw(8) << uChanUId << std::dec
1169 << ", from GdpbNr " << fuCurrDpbIdx
1170 << ", Get4 " << fuGet4Id
1171 << ", Ch " << uChannel
1172 << ", ChNr " << uChannelNr
1173 << ", ChNrIF " << uChannelNrInFee
1174 << ", FiS " << uFeeNrInSys
1175 << ", GBTx " << uGbtxNrInSys;
1176*/
1177
1178 if (0 == uChanUId) {
1179 if (0 < NMappingWarnings--)
1180 LOG(warning) << "Unused data item at " << uRemappedChannelNrInSys << ", from GdpbNr " << fuCurrDpbIdx << ", Get4 "
1181 << fuGet4Id << ", Ch " << uChannel << ", ChNr " << uChannelNr << ", ChNrIF " << uChannelNrInFee
1182 << ", FiS " << uFeeNrInSys;
1183 return; // Hit not mapped to digi
1184 }
1185
1187 if (0x90 != fuCurrentMsSysId) dHitTime -= fdTimeOffsetNs;
1188
1189 LOG(debug) << Form("Insert 0x%08x digi with time ", uChanUId) << dHitTime
1190 << Form(", Tot %4.0f", dHitTot)
1191 // << " into buffer with " << fBuffer->GetSize() << " data from "
1192 // << Form("%11.1f to %11.1f ", fBuffer->GetTimeFirst(), fBuffer->GetTimeLast())
1193
1194 << " at epoch " << mess.getExtendedEpoch();
1195
1196 // CbmTofDigi digi( uChanUId, dHitTime, dHitTot );
1197 // fDigiVect.emplace_back( digi );
1198 fDigiVect.emplace_back(uChanUId, dHitTime, dHitTot);
1199}
1200// -------------------------------------------------------------------------
1202// -------------------------------------------------------------------------
1204{
1205 switch (mess.getGdpbSysSubType()) {
1207 ProcessError(mess);
1208 break;
1209 } // case gdpbv100::SYSMSG_GET4_EVENT
1211 LOG(debug) << "Unknown GET4 message, data: " << std::hex << std::setw(8) << mess.getGdpbSysUnkwData() << std::dec
1212 << " Full message: " << std::hex << std::setw(16) << mess.getData() << std::dec;
1213 break;
1214 } // case gdpbv100::SYS_GDPB_UNKWN:
1216 if (mess.getGdpbSysFwErrResync())
1217 LOG(info) << Form("GET4 Resynchronization: Get4:0x%04x ", mess.getGdpbGenChipId()) << fuCurrDpbIdx;
1218 else
1219 LOG(info) << "GET4 synchronization pulse missing in gDPB " << fuCurrDpbIdx;
1220 break;
1221 } // case gdpbv100::SYS_GET4_SYNC_MISS:
1222 case gdpbv100::SYS_PATTERN: {
1223 ProcessPattern(mess);
1224 break;
1225 } // case gdpbv100::SYS_PATTERN:
1226 default: {
1227 LOG(info) << "Crazy system message, subtype " << mess.getGdpbSysSubType();
1228 break;
1229 } // default
1230 } // switch( mess.getGdpbSysSubType() )
1231}
1273
1275{
1276 uint16_t usType = mess.getGdpbSysPattType();
1277 uint16_t usIndex = mess.getGdpbSysPattIndex();
1278 uint32_t uPattern = mess.getGdpbSysPattPattern();
1279
1280 switch (usType) {
1282 LOG(debug) << Form("Missmatch pattern message => Type %u, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern);
1283 /*
1284 if(usIndex==7) {
1285 TString Tok;
1286 if (bEnableOut) Tok="Ena";
1287 else Tok="Dis";
1288 LOG(debug) << Form( "Mismatch pat in TS %llu, MS %llu, Gdpb %u, T %u, Pattern 0x%08X %08X %08X %08X %08X %08X %08X %08X ",
1289 fulCurrentTsIdx, fulCurrentMsIdx, fuCurrDpbIdx, usType,
1290 pat_mess[0], pat_mess[1], pat_mess[2], pat_mess[3], pat_mess[4], pat_mess[5], pat_mess[6], pat_mess[7] )
1291 << Tok;
1292 }
1293 */
1294 break;
1295 } // case gdpbv100::PATT_MISSMATCH:
1296
1297 case gdpbv100::PATT_ENABLE: {
1298 LOG(debug2) << Form("Enable pattern message => Type %d, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern);
1299 /*
1300 for( UInt_t uBit = 0; uBit < 32; ++uBit )
1301 if( ( uPattern >> uBit ) & 0x1 )
1302 {
1303 fhPatternEnable->Fill( 32 * usIndex + uBit, fuCurrDpbIdx );
1304 fvhGdpbPatternEnableEvo[ fuCurrDpbIdx ]->Fill( fulCurrentTsIndex, 32 * usIndex + uBit );
1305 } // if( ( uPattern >> uBit ) & 0x1 )
1306 */
1307 break;
1308 } // case gdpbv100::PATT_ENABLE:
1309
1310 case gdpbv100::PATT_RESYNC: {
1311 LOG(debug) << Form("RESYNC pattern message => Type %d, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern);
1312
1313 break;
1314 } // case gdpbv100::PATT_RESYNC:
1315
1316 default: {
1317 LOG(debug) << "Crazy pattern message, subtype " << usType;
1318 break;
1319 } // default
1320 } // switch( usType )
1321 /*
1322 if(usIndex==7) {
1323 bEnableOut=kTRUE;
1324// for(Int_t iGdpb=0; iGdpb<fUnpackPar->GetNrOfGdpbs(); iGdpb++) {
1325// bEnableOut &= bGdpbOK[iGdpb];
1326// }
1327 }
1328*/
1329 return;
1330}
1331// -------------------------------------------------------------------------
1332
1334{
1335 std::string sFolder = "Tof_Raw_gDPB";
1336
1337 LOG(info) << "create Histos for " << fuNrOfGdpbs << " gDPBs ";
1338
1340 new TH1F(Form("Raw_TDig-EvBmon"), Form("Raw digi time difference to 1st digi ; time [ns]; cts"), 500, 0, 100.);
1341
1343 new TH1F(Form("Raw_TDig-Ref0"), Form("Raw digi time difference to Ref ; time [ns]; cts"), 6000, -10000, 50000);
1344
1345 fhRawTDigRef =
1346 new TH1F(Form("Raw_TDig-Ref"), Form("Raw digi time difference to Ref ; time [ns]; cts"), 6000, -1000, 5000);
1347
1348 fhRawTRefDig0 = new TH1F(Form("Raw_TRef-Dig0"), Form("Raw Ref time difference to last digi ; time [ns]; cts"), 9999,
1349 -50000, 50000);
1350
1352 new TH1F(Form("Raw_TRef-Dig1"), Form("Raw Ref time difference to last digi ; time [ns]; cts"), 9999, -5000, 5000);
1353
1354 fhRawDigiLastDigi = new TH1F(Form("Raw_Digi-LastDigi"),
1355 Form("Raw Digi time difference to last digi ; time [ns]; cts"), 9999, -5000, 5000);
1356
1364
1365 fhRawTotCh.resize(fuNrOfGdpbs);
1366 fhChCount.resize(fuNrOfGdpbs);
1368 fhChanCoinc.resize(fuNrOfGdpbs);
1369 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; uGdpb++) {
1370 fhRawTotCh[uGdpb] = new TH2F(Form("Raw_Tot_gDPB_%02u", uGdpb), Form("Raw TOT gDPB %02u; channel; TOT [bin]", uGdpb),
1371 fuNrOfGet4PerGdpb * 4, 0., fuNrOfGet4PerGdpb * 4, 256, 0., 256.);
1372
1373 fhChCount[uGdpb] =
1374 new TH1I(Form("ChCount_gDPB_%02u", uGdpb), Form("Channel counts gDPB %02u; channel; Hits", uGdpb),
1376
1377 fhChCountRemap[uGdpb] = new TH1I(Form("ChCountRemap_gDPB_%02u", uGdpb),
1378 Form("Remapped channel counts gDPB %02u; Remapped channel; Hits", uGdpb),
1380
1381 fhChanCoinc[uGdpb] =
1382 new TH2F(Form("fhChanCoinc_%02u", uGdpb), Form("Channels Coincidence %02u; Left; Right", uGdpb),
1384
1386 AddHistoToVector(fhRawTotCh[uGdpb], sFolder);
1387 AddHistoToVector(fhChCount[uGdpb], sFolder);
1388 AddHistoToVector(fhChCountRemap[uGdpb], sFolder);
1389 AddHistoToVector(fhChanCoinc[uGdpb], sFolder);
1390 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; uGdpb ++)
1391
1392 fhVectorSize = new TH1I("fhVectorSize", "Size of the vector VS TS index; TS index; Size [bytes]", 10000, 0., 10000.);
1394 new TH1I("fhVectorCapacity", "Size of the vector VS TS index; TS index; Size [bytes]", 10000, 0., 10000.);
1397
1398 /*
1400 Double_t w = 10;
1401 Double_t h = 10;
1402
1404 fcEventBuildStats = new TCanvas( "cEvtBuildStats", "Event building statistics", w, h);
1405 if( kTRUE == fbDebugMonitorMode )
1406 fcEventBuildStats->Divide( 2, 3 );
1407 else fcEventBuildStats->Divide( 2, 2 );
1408
1409 fcEventBuildStats->cd( 1 );
1410 gPad->SetGridx();
1411 gPad->SetGridy();
1412 gPad->SetLogy();
1413 fhEventNbPerTs->Draw();
1414
1415 fcEventBuildStats->cd( 2 );
1416 gPad->SetGridx();
1417 gPad->SetGridy();
1418 gPad->SetLogy();
1419 fhEventSizeDistribution->Draw();
1420
1421 fcEventBuildStats->cd( 3 );
1422 gPad->SetGridx();
1423 gPad->SetGridy();
1424 gPad->SetLogy();
1425 fhEventSizeEvolution->Draw();
1426
1427 fcEventBuildStats->cd( 4 );
1428 gPad->SetGridx();
1429 gPad->SetGridy();
1430 gPad->SetLogy();
1431 fhEventNbEvolution->Draw();
1432
1433 if( kTRUE == fbDebugMonitorMode )
1434 {
1435 fcEventBuildStats->cd( 5 );
1436 gPad->SetGridx();
1437 gPad->SetGridy();
1438 gPad->SetLogy();
1439 fhEventNbDistributionInTs->Draw();
1440
1441 fcEventBuildStats->cd( 6 );
1442 gPad->SetGridx();
1443 gPad->SetGridy();
1444 gPad->SetLogy();
1445 fhEventSizeDistributionInTs->Draw();
1446 } // if( kTRUE == fbDebugMonitorMode )
1447
1448 AddCanvasToVector( fcEventBuildStats, "canvases" );
1449*/
1450 return kTRUE;
1451}
1453{
1454 /*
1455 UInt_t uNbEvents = fvEventsBuffer.size();
1456 fhEventNbPerTs->Fill( uNbEvents );
1457
1458 for( UInt_t uEvent = 0; uEvent < uNbEvents; ++uEvent )
1459 {
1460 UInt_t uEventSize = fvEventsBuffer[ uEvent ].GetEventSize();
1461 Double_t dEventTimeSec = fvEventsBuffer[ uEvent ].GetEventTimeSec();
1462 Double_t dEventTimeMin = dEventTimeSec / 60.0;
1463
1464 fhEventSizeDistribution->Fill( uEventSize );
1465 fhEventSizeEvolution->Fill( dEventTimeMin, uEventSize );
1466 fhEventNbEvolution->Fill( dEventTimeMin );
1467
1468 if( kTRUE == fbDebugMonitorMode )
1469 {
1470 Double_t dEventTimeInTs = ( fvEventsBuffer[ uEvent ].GetTrigger().GetFullGdpbTs() * gdpbv100::kdClockCycleSizeNs
1471 - fdTsStartTime ) / 1000.0;
1472
1473 fhEventNbDistributionInTs->Fill( dEventTimeInTs );
1474 fhEventSizeDistributionInTs->Fill( dEventTimeInTs, uEventSize );
1475 } // if( kTRUE == fbDebugMonitorMode )
1476 } // for( UInt_t uEvent = 0; uEvent < uNbEvents; ++uEvent )
1477*/
1478 return kTRUE;
1479}
1481{
1482 /*
1483 for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1484 {
1485 fvhHitsTimeToTriggerRaw[ uGdpb ]->Reset();
1486 fvhHitsTimeToTriggerSel[ uGdpb ]->Reset();
1487
1488 if( kTRUE == fbDebugMonitorMode )
1489 {
1490 fvhHitsTimeToTriggerSelVsDaq[ uGdpb ]->Reset();
1491 fvhHitsTimeToTriggerSelVsTrig[ uGdpb ]->Reset();
1492 fvhTriggerDt[ uGdpb ]->Reset();
1493 fvhTriggerDistributionInTs[ uGdpb ]->Reset();
1494 fvhTriggerDistributionInMs[ uGdpb ]->Reset();
1495 fvhMessDistributionInMs[ uGdpb ]->Reset();
1496 } // if( kTRUE == fbDebugMonitorMode )
1497 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1498
1500 fhEventNbPerTs->Reset();
1501 fhEventSizeDistribution->Reset();
1502 fhEventSizeEvolution->Reset();
1503 fhEventNbEvolution->Reset();
1504
1505 if( kTRUE == fbDebugMonitorMode )
1506 {
1507 fhEventNbDistributionInTs->Reset();
1508 fhEventSizeDistributionInTs->Reset();
1509 fhRawTriggersStats->Reset();
1510 fhMissingTriggersEvolution->Reset();
1511 } // if( kTRUE == fbDebugMonitorMode )
1512*/
1513 return kTRUE;
1514}
1515// -------------------------------------------------------------------------
std::string FormatHexPrintout(uint64_t ulVal, char cFill, uint uWidth, bool bUppercase)
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
static gdpbv100::FullMessage messlast
static Int_t NMappingWarnings
int Int_t
bool Bool_t
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
Double_t fdTimeOffsetNs
User settings: Data correction parameters.
void ProcessEpoch(const gdpbv100::Message &mess, uint32_t uMesgIdx)
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
std::vector< ULong64_t > fvulStarTsFullLast
size_t fuCurrentMsSysId
Idx of the current MS in TS (0 to fuTotalMsNb)
Bool_t ProcessTs(const fles::Timeslice &ts)
std::vector< ULong64_t > fvulStarTsMsb
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
void ProcessError(const gdpbv100::FullMessage &mess)
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
std::chrono::steady_clock::time_point ftStartTimeUnix
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
void ProcessSlCtrl(const gdpbv100::FullMessage &mess)
UInt_t fuNrOfGet4
Number of channels in each FEE.
std::vector< ULong64_t > fvulCurrentEpochCycle
Current epoch index, per DPB.
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
void ProcessStarTrigger(const gdpbv100::Message &mess)
void ProcessPattern(const gdpbv100::FullMessage &mess)
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
UInt_t fuGet4Id
Index of the DPB from which the MS currently unpacked is coming.
Double_t fdMsTime
End Time in ns of current TS Core from the index of the first MS first component.
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
void ProcessEpochCycle(const uint64_t &ulCycleData)
std::vector< ULong64_t > fvulGdpbTsLsb
void ProcessSysMess(const gdpbv100::FullMessage &mess)
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
CbmMcbm2018TofPar * fUnpackPar
Settings from parameter file.
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
std::vector< ULong64_t > fvulGdpbTsMsb
STAR TRIGGER detection.
Bool_t fbEpochFoundInThisMs
[DPB], FIXME: dimension to be removed as not needed with real MS
std::vector< ULong64_t > fvulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
Double_t fdStartTime
Epoch + Epoch Cycle.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
std::vector< ULong64_t > fvulStarTsMid
void ProcessHit(const gdpbv100::FullMessage &mess)
Double_t fdTsStartTime
SysId of the current MS in TS (0 to fuTotalMsNb)
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
std::vector< std::vector< gdpbv100::Message > > fvvmEpSupprBuffer
Buffers.
ULong64_t fulCurrentMsIdx
Idx of the current TS.
std::vector< ULong64_t > fvulGdpbTsFullLast
void AddHistoToVector(TNamed *pointer, std::string sFolder="")
std::vector< size_t > fvMsComponentsList
std::vector< CbmTofDigi > fDigiVect
static uint32_t GetUniqueAddress(uint32_t Sm, uint32_t Rpc, uint32_t Channel, uint32_t Side=0, uint32_t SmType=0, uint32_t RpcType=0)
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47
double GetFullTimeNs() const
uint64_t getExtendedEpoch() const
uint16_t getStarTrigMsgIndex() const
uint32_t getGdpbEpEpochNb() const
uint16_t getGdpbHit32Tot() const
uint16_t getGdpbSysPattType() const
uint64_t getStarTsMidStarC() const
uint16_t getGdpbSysSubType() const
uint64_t getGdpbTsLsbStarB() const
uint16_t getGdpbSysPattIndex() const
uint32_t getGdpbSysFwErrResync() const
uint64_t getStarTsMsbStarB() const
uint32_t getStarTrigCmdStarD() const
uint32_t getGdpbSysPattPattern() const
uint32_t getStarDaqCmdStarD() const
uint64_t getGdpbTsMsbStarA() const
uint16_t getGdpbGenChipId() const
uint32_t getStarTokenStarD() 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
uint16_t getGdpbHitChanId() const
@ GET4_V2X_ERR_LOST_EVT
@ GET4_V2X_ERR_TOT_RANGE
@ GET4_V2X_ERR_FIFO_WRITE
@ GET4_V2X_ERR_DLL_LOCK
@ GET4_V2X_ERR_EPOCH_OVERF
@ GET4_V2X_ERR_EP_CNT_SYNC
@ GET4_V2X_ERR_UNKNOWN
@ GET4_V2X_ERR_READ_INIT
@ GET4_V2X_ERR_DLL_RESET
@ GET4_V2X_ERR_ADD_RIS_EDG
@ GET4_V2X_ERR_TOK_RING_ST
@ GET4_V2X_ERR_TOKEN
@ GET4_V2X_ERR_TOT_OVERWRT
@ GET4_V2X_ERR_READOUT_ERR
@ GET4_V2X_ERR_EVT_DISCARD
@ GET4_V2X_ERR_UNPAIR_FALL
@ GET4_V2X_ERR_CHAN_STATE
@ GET4_V2X_ERR_SYNC
@ GET4_V2X_ERR_SEQUENCE_ER
const uint32_t kuChipIdMergedEpoch
const uint32_t kuEpochCounterSz
const uint64_t kulEpochCycleFieldSz
@ SYS_GET4_SYNC_MISS
Hash for CbmL1LinkKey.