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*/, std::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, std::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*/
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 if (0x90 == fuCurrentMsSysId && 0xabf3 == fuCurrDpbId) {
330 LOG(fatal) << "Last T0, stop there";
331 }
332*/
333 return true;
334}
335
336// -------------------------------------------------------------------------
337void CbmTofUnpackAlgo::ExtractTsStartEpoch(const uint64_t& ulTsStart)
338{
339 fulTsStartInEpoch = static_cast<uint64_t>(ulTsStart / critof001::kuEpochInNs) % critof001::kulEpochCycleEp;
340
344 if (fulTsStartInEpoch < 4) {
346 }
347 else {
349 }
350 } // if (fbEpochCountHack2021)
351}
352
353void CbmTofUnpackAlgo::ProcessEpoch(const critof001::Message& mess, uint32_t uMesgIdx)
354{
355 ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
356
357 if (0 == uMesgIdx) {
358 uint64_t ulMsStartInEpoch =
360
364 if (ulMsStartInEpoch < 4) {
365 ulMsStartInEpoch = critof001::kulEpochCycleEp + ulMsStartInEpoch - 4;
366 }
367 else {
368 ulMsStartInEpoch -= 4;
369 }
370 } // if (fbEpochCountHack2021)
371
372 if (ulEpochNr != ulMsStartInEpoch) {
373 // size_t required to silence a warning on macos (there a uint64_t is a llu)
374 LOG(error)
375 << fName << "::ProcessEpoch => Error first global epoch, "
376 << Form("from MS index 0x%06llx, current 0x%06llx, diff %lld, raw 0x%016llx, NoErr %d, current 0x%06lx %f",
377 static_cast<unsigned long long int>(ulMsStartInEpoch), ulEpochNr, ulEpochNr - ulMsStartInEpoch,
378 static_cast<unsigned long long int>(mess.getData()), fuProcEpochUntilError,
379 static_cast<size_t>(fulCurrentMsIdx / critof001::kuEpochInNs),
381 LOG(fatal) << fName << "::ProcessEpoch => Stopping there, system is not synchronized and send corrupt data";
382
383 fbLastEpochGood = false;
384 ulEpochNr = ulMsStartInEpoch;
387 } // if( ulEpochNr != ulMsStartInEpoch )
388 else {
389 fbLastEpochGood = true;
391 } // else of if( ulEpochNr != ulMsStartInEpoch )
392 } // if( 0 < uMesgIdx )
393 else if (((fulCurrentEpoch + 1) % critof001::kulEpochCycleEp) != ulEpochNr) {
394 // Cast required to silence a warning on macos (there a uint64_t is a llu)
395 LOG(error) << fName << "::ProcessEpoch => Error global epoch, DPB 0x" << std::setw(4) << std::hex << fuCurrDpbId
396 << std::dec
397 << Form(" last 0x%06llx, current 0x%06llx, diff %lld, raw 0x%016lx, NoErr %d", fulCurrentEpoch,
398 ulEpochNr, ulEpochNr - fulCurrentEpoch, static_cast<size_t>(mess.getData()),
400 LOG(error) << fName << "::ProcessEpoch => Ignoring data until next valid epoch";
401
403 fbLastEpochGood = false;
406 } // if( ( (fulCurrentEpoch + 1) % critof001::kuEpochCounterSz ) != ulEpochNr )
407 else {
408 fbLastEpochGood = true;
410 }
411
412 fulCurrentEpoch = ulEpochNr;
413 if (fulTsStartInEpoch <= ulEpochNr) {
415 }
416 else {
418 }
420 // Cast required to silence a warning on macos (there a uint64_t is a llu)
421 LOG(debug) << fName << "::ProcessEpoch => "
422 << Form("Raw Epoch: 0x%06llx, Epoch offset 0x%06llx, Epoch in Ts: 0x%07lx, time %f ns (%f * %lu)",
423 ulEpochNr, static_cast<long long unsigned int>(fulTsStartInEpoch),
425 critof001::kuEpochInNs, static_cast<size_t>(fulEpochIndexInTs));
426 }
427
428 if (fMonitor) {
429 fMonitor->FillEpochMonitoringHistos(fuCurrDpbIdx, fuGet4Id, mess.getGdpbEpSync(), mess.getGdpbEpDataLoss(),
431 }
432}
433
435{
436 UInt_t uChannel = mess.getGdpbHitChanId();
437 UInt_t uTot = mess.getGdpbHit32Tot();
438
439 UInt_t uChannelNr = fuGet4Id * fuNrOfChannelsPerGet4 + uChannel;
440 UInt_t uChannelNrInFee = (fuGet4Id % fuNrOfGet4PerFee) * fuNrOfChannelsPerGet4 + uChannel;
441 UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
442 UInt_t uFeeNrInSys = fuCurrDpbIdx * fuNrOfFeePerGdpb + uFeeNr;
443 UInt_t uRemappedChannelNr = uFeeNr * fuNrOfChannelsPerFee + fUnpackPar->Get4ChanToPadiChan(uChannelNrInFee);
444
445 UInt_t uRemappedChannelNrInSys = fuCurrDpbIdx * fuNrOfChannelsPerGdpb + uFeeNr * fuNrOfChannelsPerFee
446 + fUnpackPar->Get4ChanToPadiChan(uChannelNrInFee);
448 if (0x90 == fuCurrentMsSysId) {
449 uRemappedChannelNr = uChannelNr;
450 uRemappedChannelNrInSys = fuCurrDpbIdx * fuNrOfChannelsPerGdpb + uChannelNr;
451 } // if(0x90 == fuCurrentMsSysId)
452
453 Double_t dHitTime = mess.getMsgFullTimeD(fulEpochIndexInTs);
454 Double_t dHitTot = uTot; // in bins
455
456 if (fMonitor) {
457 fMonitor->FillHitMonitoringHistos(fdCurrentMsTime, fuCurrDpbIdx, fuGet4Id, uChannelNr, uRemappedChannelNr, uTot);
458 if (0x90 == fuCurrentMsSysId && 0 == uChannel) {
459 fMonitor->FillHitBmonMonitoringHistos(fdCurrentMsTime, fuCurrDpbIdx, fuGet4Id, uTot);
460 }
461 }
462
464 if (0x90 == fuCurrentMsSysId) {
465 LOG(debug) << fName << "::unpack => "
466 << "T0 data item at " << std::setw(4) << uRemappedChannelNrInSys << ", from FLIM " << fuCurrDpbIdx
467 << ", Get4 " << std::setw(2) << fuGet4Id << ", Ch " << uChannel << ", ChNr " << std::setw(2)
468 << uChannelNr << ", ChNrIF " << std::setw(2) << uChannelNrInFee << ", FiS " << std::setw(2)
469 << uFeeNrInSys
470 << (fviRpcChUId.size() < uRemappedChannelNrInSys || 0 == fviRpcChUId[uRemappedChannelNrInSys]
471 ? " ----------"
472 : Form(" 0x%08x", fviRpcChUId[uRemappedChannelNrInSys]))
473 << " TOT " << std::setw(3) << uTot << " time " << dHitTime;
474 // return;
475 } // if(0x90 == fuCurrentMsSysId)
476
477 if (fviRpcChUId.size() < uRemappedChannelNrInSys) {
478 LOG(fatal) << fName << "::unpack => "
479 << "Invalid mapping index " << uRemappedChannelNrInSys << " VS " << fviRpcChUId.size() << ", from FLIM "
480 << fuCurrDpbIdx << ", Get4 " << fuGet4Id << ", Ch " << uChannel << ", ChNr " << uChannelNr << ", ChNrIF "
481 << uChannelNrInFee << ", FiS " << uFeeNrInSys;
482 return;
483 } // if( fviRpcChUId.size() < uRemappedChannelNrInSys )
484
485 UInt_t uChanUId = fviRpcChUId[uRemappedChannelNrInSys];
486
487 if (0 == uChanUId) {
488 if (0 < fuMapWarnToPrint--)
489 LOG(debug) << fName << "::unpack => "
490 << "Unused data item at " << uRemappedChannelNrInSys << ", from FLIM " << fuCurrDpbIdx << ", Get4 "
491 << fuGet4Id << ", Ch " << uChannel << ", ChNr " << uChannelNr << ", ChNrIF " << uChannelNrInFee
492 << ", FiS " << uFeeNrInSys;
493 return; // Hit not mapped to digi
494 }
495
496 dHitTime -= fSystemTimeOffset;
497
501 dHitTime -= 4.0 * critof001::kuEpochInNs;
502 }
503
504 LOG(debug) << Form("Insert 0x%08x digi with time ", uChanUId) << dHitTime << Form(", Tot %4.0f", dHitTot)
505 << " at epoch " << fulEpochIndexInTs;
506
507 if (fMonitor && 0x90 == fuCurrentMsSysId && 0 == uChannel) { //
508 fMonitor->FillHitBmonMicroSpillHistos(dHitTime);
509 }
510
512 std::unique_ptr<CbmTofDigi> digi(new CbmTofDigi(uChanUId, dHitTime, dHitTot));
513 if (digi) fOutputVec.emplace_back(*std::move(digi));
514}
515
ClassImp(CbmConverterManager)
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Baseclass for the TrdR unpacker algorithms.
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)
Int_t Get4ChanToPadiChan(UInt_t uChannelInFee)
bool CheckInnerComp(uint32_t uCompId)
Int_t ElinkIdxToGet4Idx(UInt_t uElink)
Int_t ElinkIdxToGet4IdxA(UInt_t uElink)
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.
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.
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.
virtual std::vector< std::pair< std::string, std::shared_ptr< FairParGenericSet > > > * GetParContainerRequest(std::string geoTag, std::uint32_t runId)
Get the requested parameter containers. To be defined in the derived classes! Return the required par...
bool unpack(const fles::Timeslice *ts, std::uint16_t icomp, UInt_t imslice)
Unpack a given microslice. To be implemented in the derived unpacker algos.
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