CbmRoot
Loading...
Searching...
No Matches
CbmTofUnpackAlgo.cxx
Go to the documentation of this file.
1/* Copyright (C) 2021 Goethe-University Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau, Pascal Raisig [committer] */
4
5#include "CbmTofUnpackAlgo.h"
6
9
10#include <FairParGenericSet.h>
11#include <FairTask.h>
12#include <Logger.h>
13
14#include <Rtypes.h>
15#include <RtypesCore.h>
16
17#include <cstddef>
18
19
20CbmTofUnpackAlgo::CbmTofUnpackAlgo() : CbmRecoUnpackAlgo("CbmTofUnpackAlgo") {}
21
23
24// ---- GetParContainerRequest ----
25std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>*
26 CbmTofUnpackAlgo::GetParContainerRequest(std::string /*geoTag*/, uint32_t /*runId*/)
27{
28 // Basepath for default Tof parameter sets (those connected to a geoTag)
29 std::string basepath = Form("%s", fParFilesBasePath.data());
30 std::string temppath = "";
31
32 // // Get parameter container
33 temppath = basepath + fParFileName;
34 LOG(info) << fName << "::GetParContainerRequest - Trying to open file " << temppath;
35 if (fbBmonParMode) {
37 LOG(info) << fName << "::GetParContainerRequest - Requesting CbmMcbm2018BmonPar instead of CbmMcbm2018TofPar";
38 fParContVec.emplace_back(std::make_pair(temppath, std::make_shared<CbmMcbm2018BmonPar>()));
39 }
40 else {
41 fParContVec.emplace_back(std::make_pair(temppath, std::make_shared<CbmMcbm2018TofPar>()));
42 }
43
44 return &fParContVec;
45}
46
47// ---- finishDerived ----
49{
50 LOG(info) << fName << std::endl // Block clang format
51 << " " << fulBadEpochNb << " bad epochs" << std::endl // Block clang format
52 << " " << fulBadEpochHitNb << " hit messages lost due to bad epochs";
53}
54
55// ---- init
56Bool_t CbmTofUnpackAlgo::init() { return kTRUE; }
57
58// ---- initParSet(FairParGenericSet* parset) ----
59Bool_t CbmTofUnpackAlgo::initParSet(FairParGenericSet* parset)
60{
61 LOG(info) << fName << "::initParSet - for container " << parset->ClassName();
62 if (parset->IsA() == CbmMcbm2018BmonPar::Class()) {
65 return initParSet(dynamic_cast<CbmMcbm2018TofPar*>(parset));
66 }
67 else if (parset->IsA() == CbmMcbm2018TofPar::Class()) {
68 return initParSet(static_cast<CbmMcbm2018TofPar*>(parset));
69 }
70
71 // If we do not know the derived ParSet class we return false
72 LOG(error)
73 << fName << "::initParSet - for container " << parset->ClassName()
74 << " failed, since CbmTofUnpackAlgo::initParSet() does not know the derived ParSet and what to do with it!";
75 return kFALSE;
76}
77
78// ---- initParSet(CbmTrdParSetAsic* parset) ----
80{
81 fUnpackPar = parset;
82
83 LOG(debug) << "InitParameters from " << parset;
84
85 fuNrOfGdpbs = parset->GetNrOfGdpbs();
86 LOG(debug) << "Nr. of Tof GDPBs: " << fuNrOfGdpbs;
87
89 LOG(debug) << "Nr. of FEES per Tof GDPB: " << fuNrOfFeePerGdpb;
90
92 LOG(debug) << "Nr. of GET4 per Tof FEE: " << fuNrOfGet4PerFee;
93
95 LOG(debug) << "Nr. of channels per GET4: " << fuNrOfChannelsPerGet4;
96
98 LOG(debug) << "Nr. of channels per FEE: " << fuNrOfChannelsPerFee;
99
101 LOG(debug) << "Nr. of GET4s: " << fuNrOfGet4;
102
104 LOG(debug) << "Nr. of GET4s per GDPB: " << fuNrOfGet4PerGdpb;
105
107 LOG(debug) << "Nr. of channels per GDPB: " << fuNrOfChannelsPerGdpb;
108
109 fGdpbIdIndexMap.clear();
110 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
111 fGdpbIdIndexMap[parset->GetGdpbId(i)] = i;
112 LOG(debug) << "GDPB Id of TOF " << i << " : " << std::hex << parset->GetGdpbId(i) << std::dec;
113 } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
114
115 fuNrOfGbtx = parset->GetNrOfGbtx();
116 LOG(debug) << "Nr. of GBTx: " << fuNrOfGbtx;
117
118 UInt_t uNrOfChannels = fuNrOfGet4 * fuNrOfChannelsPerGet4;
119 LOG(debug) << "Nr. of possible Tof channels: " << uNrOfChannels;
120
121 // CbmTofDetectorId* fTofId = new CbmTofDetectorId_v14a();
122 fviRpcChUId = parset->GetRpcChUidMap();
123
124 TString sPrintout = "";
125 for (UInt_t uCh = 0; uCh < uNrOfChannels; ++uCh) {
126 if (0 == uCh % 8) sPrintout += "\n";
127 if (0 == uCh % fuNrOfChannelsPerGdpb) {
128 uint32_t uGdpbIdx = uCh / fuNrOfChannelsPerGdpb;
129 sPrintout += Form("\n Gdpb %u (0x%x), index %u \n", uGdpbIdx, parset->GetGdpbId(uGdpbIdx), uCh);
130 }
131 if (0 == fviRpcChUId[uCh]) {
132 sPrintout += " ----------";
133 }
134 else {
135 sPrintout += Form(" 0x%08x", fviRpcChUId[uCh]);
136 }
137 } // for( UInt_t i = 0; i < uNrOfChannels; ++i)
138 LOG(debug) << sPrintout;
139
140 LOG(info) << fName << "::initParSetTofMcbm2018 - Successfully initialized TOF settings";
141
142 if (fMonitor) {
143 fMonitor->Init(parset);
144 LOG(info) << fName << "::initParSetTofMcbm2018 - Successfully initialized TOF monitor";
145 }
146
147
148 return kTRUE;
149}
150
151bool CbmTofUnpackAlgo::unpack(const fles::Timeslice* ts, uint16_t icomp, UInt_t imslice)
152{
153 auto msDescriptor = ts->descriptor(icomp, imslice);
154 fuCurrentEquipmentId = msDescriptor.eq_id;
155 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts->content(icomp, imslice));
156
157 fulCurrentTsIdx = ts->index();
158 uint32_t uSize = msDescriptor.size;
159 fulCurrentMsIdx = msDescriptor.idx;
160 fdCurrentMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
161 // Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
162 LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec
163 << " has size: " << uSize;
164
165 if (0 == fvbMaskedComponents.size()) fvbMaskedComponents.resize(ts->num_components(), false);
166
167 fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
168 // fuCurrDpbIdx = fDpbIdIndexMap[ fuCurrDpbId ];
169
171 auto it = fGdpbIdIndexMap.find(fuCurrDpbId);
172 if (it == fGdpbIdIndexMap.end()) {
173 if (false == fvbMaskedComponents[icomp]) {
174 LOG(debug) << "---------------------------------------------------------------";
175 LOG(debug) << FormatMsHeaderPrintout(msDescriptor);
176 LOG(warning) << fName << "::unpack => "
177 << "Could not find the gDPB index for FLIM id 0x" << std::hex << fuCurrDpbId << std::dec
178 << " in timeslice " << fulCurrentTsIdx << " in microslice " << imslice << " component " << icomp
179 << std::endl
180 << "If valid this index has to be added in the TOF parameter file in the DbpIdArray field";
181 fvbMaskedComponents[icomp] = true;
182 } // if( false == fvbMaskedComponents[ uMsComp ] )
183 else
184 return true;
185
186 return false;
187 } // if( it == fGdpbIdIndexMap.end() )
188 else
190
191 fuCurrentMsSysId = static_cast<unsigned int>(msDescriptor.sys_id);
192
193 if (fMonitor) {
194 if (0x90 == fuCurrentMsSysId) {
195 fMonitor->CheckBmonSpillLimits(fdCurrentMsTime);
196 }
197 }
198
199 // If not integer number of message in input buffer, print warning/error
200 if (0 != (uSize % sizeof(critof001::Message)))
201 LOG(error) << fName << "::unpack => "
202 << "The input microslice buffer does NOT contain only complete gDPB messages!";
203
204 // Compute the number of complete messages in the input microslice buffer
205 uint32_t uNbMessages = (uSize - (uSize % sizeof(critof001::Message))) / sizeof(critof001::Message);
206
207 // Prepare variables for the loop on contents
208 Int_t messageType = -111;
209 fbLastEpochGood = false;
211
212 if (0 == imslice) {
214 ExtractTsStartEpoch(fTsStartTime);
215 }
216
217 const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent); // for epoch cycle
218 const critof001::Message* pMess = reinterpret_cast<const critof001::Message*>(pInBuff);
219
220 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
222 if (0 < uIdx && pMess[uIdx] == pMess[uIdx - 1]) {
224 continue;
225 }
226
228 messageType = pMess[uIdx].getMessageType();
229
230 if (uNbMessages - 1 == uIdx) {
231 if (pMess[uIdx].isEndOfMs()) {
232 continue;
233 }
234 else {
235 LOG(warning) << fName << "::unpack => "
236 << "In timeslice " << fulCurrentTsIdx << " in microslice " << imslice << " component " << icomp
237 << " last message is not an EndOfMs: type " << messageType
238 << Form(" dump: 0x%16llX", static_cast<unsigned long long int>(pMess[uIdx].getData()));
239 } // else of if( pMess[uIdx].isEndOfMs() )
240 } // if( uNbMessages - 1 == uIdx )
241 /*
242 if( 0 == imslice )
243 LOG(debug) << fName << "::unpack => "
244 << "Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType) << std::dec;
245*/
246 if (fUnpackPar->CheckInnerComp(fuCurrDpbId)) {
247 fuGet4Id = fUnpackPar->ElinkIdxToGet4IdxA(pMess[uIdx].getGet4Idx());
248 }
249 else {
250 fuGet4Id = fUnpackPar->ElinkIdxToGet4Idx(pMess[uIdx].getGet4Idx());
251 }
252
253 if (0x90 == fuCurrentMsSysId) fuGet4Id = pMess[uIdx].getGet4Idx();
255
257 LOG(warning) << fName << "::unpack => "
258 << "Message with Get4 ID too high: " << fuGet4Id << " VS " << fuNrOfGet4PerGdpb << " for FLIM "
259 << fuCurrDpbIdx << " set in parameters.";
260
261
262 if (0 == uIdx && critof001::MSG_EPOCH != messageType) {
263 LOG(warning) << fName << "::unpack => "
264 << "In timeslice " << fulCurrentTsIdx << " in microslice " << imslice << " component " << icomp
265 << " first message is not an epoch: type " << messageType
266 << Form(" dump: 0x%16llX", static_cast<unsigned long long int>(pMess[uIdx].getData()));
267 LOG(warning) << fName << "::unpack => "
268 << "Ignoring this microslice.";
269 return false;
270 }
271
272 switch (messageType) {
273 case critof001::MSG_HIT: {
274 if (fbLastEpochGood) {
276 ProcessHit(pMess[uIdx]);
277 }
278 else {
280 }
281 break;
282 } // case critof001::MSG_HIT:
285 ProcessEpoch(pMess[uIdx], uIdx);
286 } // if this epoch message is a merged one valid for all chips
287 else {
289 LOG(debug2) << fName << "::unpack => "
290 << "This unpacker does not support unmerged epoch messages!!!.";
291 continue;
292 } // if single chip epoch message
293 break;
294 } // case critof001::MSG_EPOCH:
298 if (fMonitor) {
299 fMonitor->FillScmMonitoringHistos(fuCurrDpbIdx, fuGet4Id, pMess[uIdx].getGdpbSlcChan(),
300 pMess[uIdx].getGdpbSlcEdge(), pMess[uIdx].getGdpbSlcType());
301 }
302 break;
303 } // case critof001::MSG_SLOWC:
304 case critof001::MSG_SYST: {
307 if (fMonitor) {
308 fMonitor->FillSysMonitoringHistos(fuCurrDpbIdx, fuGet4Id, pMess[uIdx].getGdpbSysSubType());
309 if (critof001::SYS_GET4_ERROR == pMess[uIdx].getGdpbSysSubType()) {
310 fMonitor->FillErrMonitoringHistos(fuCurrDpbIdx, fuGet4Id, pMess[uIdx].getGdpbSysErrChanId(),
311 pMess[uIdx].getGdpbSysErrData());
312
313 if (0x90 == fuCurrentMsSysId) {
314 fMonitor->FillErrBmonMonitoringHistos(fdCurrentMsTime, fuCurrDpbIdx, fuGet4Id,
316 == pMess[uIdx].getGdpbSysErrData());
317 } // if (0x90 == fuCurrentMsSysId)
318 } // if (critof001::SYS_GET4_ERROR == pMess[uIdx].getGdpbSysSubType())
319 } // if (fMonitor )
320 break;
321 } // case critof001::MSG_ERROR
322 default:
323 LOG(error) << fName << "::unpack => "
324 << "Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType) << std::dec
325 << " not included in Get4 unpacker.";
326 } // switch( mess.getMessageType() )
327 } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
328
329 /*
330 if (0x90 == fuCurrentMsSysId && 0xabf3 == fuCurrDpbId) {
331 LOG(fatal) << "Last T0, stop there";
332 }
333 */
334
335 if (fMonitor) { //
336 fMonitor->FinalizeMsHistos();
337 }
338
339 return true;
340}
341
342// -------------------------------------------------------------------------
343void CbmTofUnpackAlgo::ExtractTsStartEpoch(const uint64_t& ulTsStart)
344{
345 fulTsStartInEpoch = static_cast<uint64_t>(ulTsStart / critof001::kuEpochInNs) % critof001::kulEpochCycleEp;
346
350 if (fulTsStartInEpoch < 4) {
352 }
353 else {
355 }
356 } // if (fbEpochCountHack2021)
357}
358
359void CbmTofUnpackAlgo::ProcessEpoch(const critof001::Message& mess, uint32_t uMesgIdx)
360{
361 ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
362
363 if (0 == uMesgIdx) {
364 uint64_t ulMsStartInEpoch =
366
370 if (ulMsStartInEpoch < 4) {
371 ulMsStartInEpoch = critof001::kulEpochCycleEp + ulMsStartInEpoch - 4;
372 }
373 else {
374 ulMsStartInEpoch -= 4;
375 }
376 } // if (fbEpochCountHack2021)
377
378 if (ulEpochNr != ulMsStartInEpoch) {
379 // size_t required to silence a warning on macos (there a uint64_t is a llu)
380 LOG(error)
381 << fName << "::ProcessEpoch => Error first global epoch, "
382 << Form("from MS index 0x%06llx, current 0x%06llx, diff %lld, raw 0x%016llx, NoErr %d, current 0x%06lx %f",
383 static_cast<unsigned long long int>(ulMsStartInEpoch), ulEpochNr, ulEpochNr - ulMsStartInEpoch,
384 static_cast<unsigned long long int>(mess.getData()), fuProcEpochUntilError,
385 static_cast<size_t>(fulCurrentMsIdx / critof001::kuEpochInNs),
387 LOG(fatal) << fName << "::ProcessEpoch => Stopping there, system is not synchronized and send corrupt data";
388
389 fbLastEpochGood = false;
390 ulEpochNr = ulMsStartInEpoch;
393 } // if( ulEpochNr != ulMsStartInEpoch )
394 else {
395 fbLastEpochGood = true;
397 } // else of if( ulEpochNr != ulMsStartInEpoch )
398 } // if( 0 < uMesgIdx )
399 else if (((fulCurrentEpoch + 1) % critof001::kulEpochCycleEp) != ulEpochNr) {
400 // Cast required to silence a warning on macos (there a uint64_t is a llu)
401 LOG(error) << fName << "::ProcessEpoch => Error global epoch, DPB 0x" << std::setw(4) << std::hex << fuCurrDpbId
402 << std::dec
403 << Form(" last 0x%06llx, current 0x%06llx, diff %lld, raw 0x%016lx, NoErr %d", fulCurrentEpoch,
404 ulEpochNr, ulEpochNr - fulCurrentEpoch, static_cast<size_t>(mess.getData()),
406 LOG(error) << fName << "::ProcessEpoch => Ignoring data until next valid epoch";
407
409 fbLastEpochGood = false;
412 } // if( ( (fulCurrentEpoch + 1) % critof001::kuEpochCounterSz ) != ulEpochNr )
413 else {
414 fbLastEpochGood = true;
416 }
417
418 fulCurrentEpoch = ulEpochNr;
419 if (fulTsStartInEpoch <= ulEpochNr) {
421 }
422 else {
424 }
426 // Cast required to silence a warning on macos (there a uint64_t is a llu)
427 LOG(debug) << fName << "::ProcessEpoch => "
428 << Form("Raw Epoch: 0x%06llx, Epoch offset 0x%06llx, Epoch in Ts: 0x%07lx, time %f ns (%f * %lu)",
429 ulEpochNr, static_cast<long long unsigned int>(fulTsStartInEpoch),
431 critof001::kuEpochInNs, static_cast<size_t>(fulEpochIndexInTs));
432 }
433
434 if (fMonitor) {
435 fMonitor->FillEpochMonitoringHistos(fuCurrDpbIdx, fuGet4Id, mess.getGdpbEpSync(), mess.getGdpbEpDataLoss(),
437 }
438}
439
441{
442 UInt_t uChannel = mess.getGdpbHitChanId();
443 UInt_t uTot = mess.getGdpbHit32Tot();
444
445 UInt_t uChannelNr = fuGet4Id * fuNrOfChannelsPerGet4 + uChannel;
446 UInt_t uChannelNrInFee = (fuGet4Id % fuNrOfGet4PerFee) * fuNrOfChannelsPerGet4 + uChannel;
447 UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
448 UInt_t uFeeNrInSys = fuCurrDpbIdx * fuNrOfFeePerGdpb + uFeeNr;
449 UInt_t uRemappedChannelNr = uFeeNr * fuNrOfChannelsPerFee + fUnpackPar->Get4ChanToPadiChan(uChannelNrInFee);
450
451 UInt_t uRemappedChannelNrInSys = fuCurrDpbIdx * fuNrOfChannelsPerGdpb + uFeeNr * fuNrOfChannelsPerFee
452 + fUnpackPar->Get4ChanToPadiChan(uChannelNrInFee);
454 if (0x90 == fuCurrentMsSysId) {
455 uRemappedChannelNr = uChannelNr;
456 uRemappedChannelNrInSys = fuCurrDpbIdx * fuNrOfChannelsPerGdpb + uChannelNr;
457 } // if(0x90 == fuCurrentMsSysId)
458
459 Double_t dHitTime = mess.getMsgFullTimeD(fulEpochIndexInTs);
460 Double_t dHitTot = uTot; // in bins
461
462 if (fMonitor) {
463 // In 32b mode the coarse counter is already computed back to 112 FTS bins
464 // => need to hide its contribution from the Finetime
465 // => FTS = Fullt TS modulo 112
466 UInt_t uFts = mess.getGdpbHitFullTs() % 112;
467 fMonitor->FillHitMonitoringHistos(fdCurrentMsTime, fuCurrDpbIdx, fuGet4Id, uChannelNr, uRemappedChannelNr, uTot,
468 dHitTime, uFts, 0x90 == fuCurrentMsSysId);
469 if (0x90 == fuCurrentMsSysId && 0 == uChannel) {
470 fMonitor->FillHitBmonMonitoringHistos(fdCurrentMsTime, fuCurrDpbIdx, fuGet4Id, uTot);
471 }
472 }
473
475 if (0x90 == fuCurrentMsSysId) {
476 LOG(debug) << fName << "::unpack => "
477 << "T0 data item at " << std::setw(4) << uRemappedChannelNrInSys << ", from FLIM " << fuCurrDpbIdx
478 << ", Get4 " << std::setw(2) << fuGet4Id << ", Ch " << uChannel << ", ChNr " << std::setw(2)
479 << uChannelNr << ", ChNrIF " << std::setw(2) << uChannelNrInFee << ", FiS " << std::setw(2)
480 << uFeeNrInSys
481 << (fviRpcChUId.size() < uRemappedChannelNrInSys || 0 == fviRpcChUId[uRemappedChannelNrInSys]
482 ? " ----------"
483 : Form(" 0x%08x", fviRpcChUId[uRemappedChannelNrInSys]))
484 << " TOT " << std::setw(3) << uTot << " time " << dHitTime;
485 // return;
486 } // if(0x90 == fuCurrentMsSysId)
487
488 if (fviRpcChUId.size() < uRemappedChannelNrInSys) {
489 LOG(fatal) << fName << "::unpack => "
490 << "Invalid mapping index " << uRemappedChannelNrInSys << " VS " << fviRpcChUId.size() << ", from FLIM "
491 << fuCurrDpbIdx << ", Get4 " << fuGet4Id << ", Ch " << uChannel << ", ChNr " << uChannelNr << ", ChNrIF "
492 << uChannelNrInFee << ", FiS " << uFeeNrInSys;
493 return;
494 } // if( fviRpcChUId.size() < uRemappedChannelNrInSys )
495
496 UInt_t uChanUId = fviRpcChUId[uRemappedChannelNrInSys];
497
498 if (0 == uChanUId) {
499 if (0 < fuMapWarnToPrint--)
500 LOG(debug) << fName << "::unpack => "
501 << "Unused data item at " << uRemappedChannelNrInSys << ", from FLIM " << fuCurrDpbIdx << ", Get4 "
502 << fuGet4Id << ", Ch " << uChannel << ", ChNr " << uChannelNr << ", ChNrIF " << uChannelNrInFee
503 << ", FiS " << uFeeNrInSys;
504 return; // Hit not mapped to digi
505 }
506
507 dHitTime -= fSystemTimeOffset;
508
512 dHitTime -= 4.0 * critof001::kuEpochInNs;
513 }
514
515 LOG(debug) << Form("Insert 0x%08x digi with time ", uChanUId) << dHitTime << Form(", Tot %4.0f", dHitTot)
516 << " at epoch " << fulEpochIndexInTs;
517
518 if (fMonitor && 0x90 == fuCurrentMsSysId && 0 == uChannel) { //
519 fMonitor->FillHitBmonMicroSpillHistos(fdCurrentMsTime, dHitTime);
520 }
521
523 std::unique_ptr<CbmTofDigi> digi(new CbmTofDigi(uChanUId, dHitTime, dHitTot));
524 if (digi) fOutputVec.emplace_back(*std::move(digi));
525}
526
ClassImp(CbmConverterManager)
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Baseclass for the TrdR unpacker algorithms.
int Int_t
bool Bool_t
std::vector< Int_t > GetRpcChUidMap()
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
Int_t GetGdpbId(Int_t i)
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47
CbmMcbm2018TofPar * fUnpackPar
size_t fuCurrentMsSysId
Time of the current MS in s.
ULong64_t fulCurrentEpoch
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle,...
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
UInt_t fuNrOfGdpbs
For static/inline mapping functions.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
void ExtractTsStartEpoch(const uint64_t &ulTsStart)
Message processing methods.
bool fbEpochCountHack2021
Current epoch index.
UInt_t fuNrOfChannelsPerFee
Number of channels in each GET4.
Bool_t initParSet(FairParGenericSet *parset)
Handles the distribution of the hidden derived classes to their explicit functions.
UInt_t fuGet4Nr
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
void ProcessEpoch(const critof001::Message &mess, uint32_t uMesgIdx)
UInt_t fuNrOfChannelsPerGet4
Number of GET4s per FEE.
bool unpack(const fles::Timeslice *ts, uint16_t icomp, UInt_t imslice)
Unpack a given microslice. To be implemented in the derived unpacker algos.
virtual ~CbmTofUnpackAlgo()
Destroy the Cbm Trd Unpack Task object.
ULong64_t fulCurrentMsIdx
Idx of the current TS.
CbmTofUnpackAlgo()
Create the Cbm Trd Unpack AlgoBase object.
UInt_t fuNrOfGet4PerFee
Number of FEBs per GDPB.
UInt_t fuMapWarnToPrint
Running indices.
virtual std::vector< std::pair< std::string, std::shared_ptr< FairParGenericSet > > > * GetParContainerRequest(std::string geoTag, uint32_t runId)
Get the requested parameter containers. To be defined in the derived classes! Return the required par...
void finishDerived()
Function that allows special calls during Finish in the derived algos.
void ProcessHit(const critof001::Message &mess)
std::vector< bool > fvbMaskedComponents
std::string fParFileName
Settings from parameter file.
UInt_t fuCurrentEquipmentId
SysId of the current MS in TS (0 to fuTotalMsNb)
UInt_t fuNrOfGet4
Number of channels in each FEE.
double fdCurrentMsTime
Idx of the current MS in TS (0 to fuTotalMsNb)
uint32_t fuProcEpochUntilError
Book-keeping members.
std::vector< Int_t > fviRpcChUId
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Total number of GDPBs in the system.
UInt_t fuNrOfGet4PerGdpb
Total number of Get4 chips in the system.
UInt_t fuNrOfFeePerGdpb
gDPB ID to index map
UInt_t fuGet4Id
Index of the DPB from which the MS currently unpacked is coming.
std::shared_ptr< CbmTofUnpackMonitor > fMonitor
Potential (online) monitor for the unpacking process.
UInt_t fuNrOfChannelsPerGdpb
Number of GET4s per GDPB.
Bool_t init()
Initialisation at begin of run. Special inits of the derived algos.
UInt_t fuNrOfGbtx
Number of channels per GDPB.
uint32_t getGdpbHitFullTs() const
uint16_t getGdpbHit32Tot() const
uint64_t getData() const
uint16_t getGet4Idx() const
bool getGdpbEpEpochLoss() const
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 2 bit.
uint16_t getGdpbHitChanId() const
bool getGdpbEpSync() const
bool getGdpbEpDataLoss() const
uint32_t getGdpbEpEpochNb() const
double getMsgFullTimeD(uint64_t epoch) const
Returns expanded and adjusted time of message in double (in ns)
bool getGdpbEpMissmatch() const
const uint64_t kulEpochCycleEp
const uint32_t kuChipIdMergedEpoch
const double kuEpochInNs