CbmRoot
|
#include <CbmTofUnpackAlgo.h>
Public Member Functions | |
CbmTofUnpackAlgo () | |
Create the Cbm Trd Unpack AlgoBase object. | |
virtual | ~CbmTofUnpackAlgo () |
Destroy the Cbm Trd Unpack Task object. | |
CbmTofUnpackAlgo (const CbmTofUnpackAlgo &)=delete | |
Copy constructor - not implemented. | |
CbmTofUnpackAlgo & | operator= (const CbmTofUnpackAlgo &)=delete |
Assignment operator - not implemented. | |
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 parameter containers together with the paths to the ascii files to. | |
void | SetFlagEpochCountHack2021 (bool bFlagin=true) |
Sets the flag enabling the epoch offset hack for the July 2021 data. Default is enable. | |
void | SetFlagBmonParMode (bool bFlagin=true) |
Sets the flag switching to a request of CbmMcbm2018BmonPar. Default is enable. | |
void | SetParFileName (std::string sNewName) |
Sets the name of the parameter file to be used. | |
void | SetMonitor (std::shared_ptr< CbmTofUnpackMonitor > monitor) |
Set a predefined monitor. | |
std::vector< CbmTofDigi > & | GetOutputVec () |
Get a reference to the output vector. Used by BMON encapsulating algo to access output. | |
void | finish () |
Raise permissions for access to these protected methods to allow access in encapsulating BMON algo. | |
void | finishDerived () |
Function that allows special calls during Finish in the derived algos. | |
Bool_t | init () |
Initialisation at begin of run. Special inits of the derived algos. | |
Bool_t | initParSet (FairParGenericSet *parset) |
Handles the distribution of the hidden derived classes to their explicit functions. | |
Bool_t | initParSet (CbmMcbm2018TofPar *parset) |
Handles the distribution of the hidden derived classes to their explicit functions. | |
bool | setDerivedTsParameters (size_t) |
Set the Derived Ts Parameters. | |
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. | |
Private Member Functions | |
void | ProcessEpSupprBuffer () |
Buffers processing. | |
void | ExtractTsStartEpoch (const uint64_t &ulTsStart) |
Message processing methods. | |
void | ProcessEpoch (const critof001::Message &mess, uint32_t uMesgIdx) |
void | ProcessEndOfMsEpoch () |
void | ProcessHit (const critof001::Message &mess) |
Int_t | GetArrayIndex (Int_t gdpbId, Int_t get4Id) |
Private Attributes | |
std::string | fParFileName = "mTofCriPar.par" |
Settings from parameter file. | |
CbmMcbm2018TofPar * | fUnpackPar = nullptr |
UInt_t | fuNrOfGdpbs = 0 |
For static/inline mapping functions. | |
std::map< UInt_t, UInt_t > | fGdpbIdIndexMap = {} |
Total number of GDPBs in the system. | |
UInt_t | fuNrOfFeePerGdpb = 0 |
gDPB ID to index map | |
UInt_t | fuNrOfGet4PerFee = 0 |
Number of FEBs per GDPB. | |
UInt_t | fuNrOfChannelsPerGet4 = 0 |
Number of GET4s per FEE. | |
UInt_t | fuNrOfChannelsPerFee = 0 |
Number of channels in each GET4. | |
UInt_t | fuNrOfGet4 = 0 |
Number of channels in each FEE. | |
UInt_t | fuNrOfGet4PerGdpb = 0 |
Total number of Get4 chips in the system. | |
UInt_t | fuNrOfChannelsPerGdpb = 0 |
Number of GET4s per GDPB. | |
UInt_t | fuNrOfGbtx = 0 |
Number of channels per GDPB. | |
UInt_t | fuNrOfModules = 0 |
std::vector< Int_t > | fviRpcChUId = {} |
UInt_t | fuMapWarnToPrint = 100 |
Running indices. | |
ULong64_t | fulCurrentTsIdx = 0 |
ULong64_t | fulCurrentMsIdx = 0 |
Idx of the current TS. | |
double | fdCurrentMsTime = 0.0 |
Idx of the current MS in TS (0 to fuTotalMsNb) | |
size_t | fuCurrentMsSysId = 0 |
Time of the current MS in s. | |
UInt_t | fuCurrentEquipmentId = 0 |
SysId of the current MS in TS (0 to fuTotalMsNb) | |
UInt_t | fuCurrDpbId = 0 |
Current equipment ID, tells from which DPB the current MS is originating. | |
UInt_t | fuCurrDpbIdx = 0 |
Temp holder until Current equipment ID is properly filled in MS. | |
UInt_t | fuGet4Id |
Index of the DPB from which the MS currently unpacked is coming. | |
UInt_t | fuGet4Nr = 0 |
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message | |
ULong64_t | fulCurrentEpoch = 0 |
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle, full epoch [fuNrOfGdpbs]. | |
bool | fbEpochCountHack2021 = false |
Current epoch index. | |
bool | fbBmonParMode = false |
std::vector< bool > | fvbMaskedComponents = {} |
bool | fbLastEpochGood = false |
uint64_t | fulBadEpochNb = 0 |
uint64_t | fulBadEpochHitNb = 0 |
uint32_t | fuProcEpochUntilError = 0 |
Book-keeping members. | |
uint64_t | fulTsStartInEpoch = 0 |
uint64_t | fulEpochIndexInTs = 0 |
std::shared_ptr< CbmTofUnpackMonitor > | fMonitor = nullptr |
Potential (online) monitor for the unpacking process. | |
Definition at line 40 of file CbmTofUnpackAlgo.h.
CbmTofUnpackAlgo::CbmTofUnpackAlgo | ( | ) |
Create the Cbm Trd Unpack AlgoBase object.
Definition at line 20 of file CbmTofUnpackAlgo.cxx.
|
virtual |
Destroy the Cbm Trd Unpack Task object.
Definition at line 22 of file CbmTofUnpackAlgo.cxx.
|
delete |
Copy constructor - not implemented.
|
private |
Message processing methods.
FIXME: seems there is an offset of +4 Epoch between data and header from dt to PSD, the epoch seem to be right => placed in wrong MS!
Definition at line 337 of file CbmTofUnpackAlgo.cxx.
References fbEpochCountHack2021, fulTsStartInEpoch, critof001::kuEpochInNs, and critof001::kulEpochCycleEp.
Referenced by unpack().
|
inline |
Raise permissions for access to these protected methods to allow access in encapsulating BMON algo.
Finish function for this algorithm base clase
Definition at line 101 of file CbmTofUnpackAlgo.h.
References finishDerived(), and fMonitor.
Referenced by CbmBmonUnpackAlgo::finish().
void CbmTofUnpackAlgo::finishDerived | ( | ) |
Function that allows special calls during Finish in the derived algos.
Definition at line 48 of file CbmTofUnpackAlgo.cxx.
References fulBadEpochHitNb, and fulBadEpochNb.
Referenced by finish(), and CbmBmonUnpackAlgo::finishDerived().
|
inlineprivate |
Definition at line 171 of file CbmTofUnpackAlgo.h.
References fuNrOfGet4PerGdpb.
|
inline |
Get a reference to the output vector. Used by BMON encapsulating algo to access output.
Definition at line 95 of file CbmTofUnpackAlgo.h.
Referenced by CbmBmonUnpackAlgo::FinalizeComponent(), and CbmBmonUnpackAlgo::Unpack().
|
virtual |
Get the requested parameter containers. To be defined in the derived classes! Return the required parameter containers together with the paths to the ascii files to.
[in] | std::string | geoTag as used in CbmSetup |
[in] | std::uint32_t | runId for runwise defined parameters |
Should be enabled only when both TOF and BMON are used with same RunManagerDb (only MQ for now)
Definition at line 26 of file CbmTofUnpackAlgo.cxx.
References fbBmonParMode, and fParFileName.
Referenced by CbmBmonUnpackAlgo::GetParContainerRequest().
Bool_t CbmTofUnpackAlgo::init | ( | ) |
Initialisation at begin of run. Special inits of the derived algos.
Bool_t | initOk |
Definition at line 56 of file CbmTofUnpackAlgo.cxx.
Referenced by CbmBmonUnpackAlgo::init().
Bool_t CbmTofUnpackAlgo::initParSet | ( | CbmMcbm2018TofPar * | parset | ) |
Handles the distribution of the hidden derived classes to their explicit functions.
parset |
Definition at line 79 of file CbmTofUnpackAlgo.cxx.
References fGdpbIdIndexMap, fMonitor, fUnpackPar, fuNrOfChannelsPerFee, fuNrOfChannelsPerGdpb, fuNrOfChannelsPerGet4, fuNrOfFeePerGdpb, fuNrOfGbtx, fuNrOfGdpbs, fuNrOfGet4, fuNrOfGet4PerFee, fuNrOfGet4PerGdpb, fviRpcChUId, CbmMcbm2018TofPar::GetGdpbId(), CbmMcbm2018TofPar::GetNrOfChannelsPerGet4(), CbmMcbm2018TofPar::GetNrOfFeesPerGdpb(), CbmMcbm2018TofPar::GetNrOfGbtx(), CbmMcbm2018TofPar::GetNrOfGdpbs(), CbmMcbm2018TofPar::GetNrOfGet4PerFee(), and CbmMcbm2018TofPar::GetRpcChUidMap().
Bool_t CbmTofUnpackAlgo::initParSet | ( | FairParGenericSet * | parset | ) |
Handles the distribution of the hidden derived classes to their explicit functions.
parset |
Should be the case only if fbBmonParMode is enabled and when both TOF and BMON are used with same RunManagerDb (only MQ for now). CbmMcbm2018BmonPar is an identical derivation of CbmMcbm2018TofPar
Definition at line 59 of file CbmTofUnpackAlgo.cxx.
References initParSet().
Referenced by CbmBmonUnpackAlgo::initParSet(), CbmBmonUnpackAlgo::initParSet(), and initParSet().
|
delete |
Assignment operator - not implemented.
|
private |
|
private |
FIXME: seems there is an offset of +4 Epoch between data and header from dt to PSD, the epoch seem to be right => placed in wrong MS!
Definition at line 353 of file CbmTofUnpackAlgo.cxx.
References fbEpochCountHack2021, fbLastEpochGood, fMonitor, fuCurrDpbId, fuCurrDpbIdx, fuGet4Id, fulBadEpochNb, fulCurrentEpoch, fulCurrentMsIdx, fulEpochIndexInTs, fulTsStartInEpoch, fuProcEpochUntilError, critof001::Message::getData(), critof001::Message::getGdpbEpDataLoss(), critof001::Message::getGdpbEpEpochLoss(), critof001::Message::getGdpbEpEpochNb(), critof001::Message::getGdpbEpMissmatch(), critof001::Message::getGdpbEpSync(), critof001::kuEpochInNs, and critof001::kulEpochCycleEp.
Referenced by unpack().
|
private |
Buffers processing.
|
private |
Diamond FEE have straight connection from Get4 to eLink and from PADI to GET4
Diamond debug
FIXME: seems there is an offset of +4 Epoch between data and header from dt to PSD, the epoch are probably the one off, not the MS time!
Create output object and store it
Definition at line 434 of file CbmTofUnpackAlgo.cxx.
References fbEpochCountHack2021, fdCurrentMsTime, fMonitor, fuCurrDpbIdx, fuCurrentMsSysId, fuGet4Id, fulEpochIndexInTs, fuMapWarnToPrint, fUnpackPar, fuNrOfChannelsPerFee, fuNrOfChannelsPerGdpb, fuNrOfChannelsPerGet4, fuNrOfFeePerGdpb, fuNrOfGet4PerFee, fviRpcChUId, CbmMcbm2018TofPar::Get4ChanToPadiChan(), critof001::Message::getGdpbHit32Tot(), critof001::Message::getGdpbHitChanId(), critof001::Message::getMsgFullTimeD(), and critof001::kuEpochInNs.
Referenced by unpack().
|
inline |
Set the Derived Ts Parameters.
In this function parameters required by the explicit algo connected to the timeslice can be set.
itimeslice |
Definition at line 146 of file CbmTofUnpackAlgo.h.
|
inline |
Sets the flag switching to a request of CbmMcbm2018BmonPar. Default is enable.
[in] | Optional | boolean flag value, default is true |
Definition at line 78 of file CbmTofUnpackAlgo.h.
References fbBmonParMode.
Referenced by CbmBmonUnpackAlgo::SetFlagBmonParMode().
|
inline |
Sets the flag enabling the epoch offset hack for the July 2021 data. Default is enable.
[in] | Optional | boolean flag value, default is true |
Definition at line 71 of file CbmTofUnpackAlgo.h.
References fbEpochCountHack2021.
Referenced by CbmBmonUnpackAlgo::SetFlagEpochCountHack2021().
|
inline |
Set a predefined monitor.
monitor | predefined unpacking monitor |
Definition at line 88 of file CbmTofUnpackAlgo.h.
References fMonitor.
Referenced by CbmBmonUnpackAlgo::SetMonitor().
|
inline |
Sets the name of the parameter file to be used.
[in] | std:string,path | should not be included as set in the Config class |
Definition at line 85 of file CbmTofUnpackAlgo.h.
References fParFileName.
Referenced by CbmBmonUnpackAlgo::SetParFileName().
bool CbmTofUnpackAlgo::unpack | ( | const fles::Timeslice * | ts, |
std::uint16_t | icomp, | ||
UInt_t | imslice ) |
Unpack a given microslice. To be implemented in the derived unpacker algos.
ts | timeslice pointer |
icomp | index to the component to be unpacked |
imslice | index of the microslice to be unpacked |
Check if this sDPB ID was declared in parameter file and stop there if not
Extract the time base only on MS 0, assuming that we get all TS of a component in order
Due to buffer bug some messages are duplicated
Ignore duplicate message
Get message type
Epoch OK
Should be checked in monitor task, here we just jump it
Ignored messages TODO,FIXME: should be filled into fOptOutAVec as CbmErrorMessage
Ignored messages TODO,FIXME: should be filled into fOptOutAVec as CbmErrorMessage
Definition at line 151 of file CbmTofUnpackAlgo.cxx.
References CbmMcbm2018TofPar::CheckInnerComp(), CbmMcbm2018TofPar::ElinkIdxToGet4Idx(), CbmMcbm2018TofPar::ElinkIdxToGet4IdxA(), ExtractTsStartEpoch(), fbLastEpochGood, fdCurrentMsTime, fGdpbIdIndexMap, fMonitor, FormatMsHeaderPrintout(), fuCurrDpbId, fuCurrDpbIdx, fuCurrentEquipmentId, fuCurrentMsSysId, fuGet4Id, fuGet4Nr, fulBadEpochHitNb, fulCurrentMsIdx, fulCurrentTsIdx, fUnpackPar, fuNrOfGet4PerGdpb, fuProcEpochUntilError, fvbMaskedComponents, critof001::GET4_V2X_ERR_LOST_EVT, critof001::Message::getGet4Idx(), critof001::Message::getMessageType(), critof001::kuChipIdMergedEpoch, critof001::MSG_EPOCH, critof001::MSG_HIT, critof001::MSG_SLOWC, critof001::MSG_SYST, ProcessEpoch(), ProcessHit(), and critof001::SYS_GET4_ERROR.
Referenced by CbmBmonUnpackAlgo::Unpack().
|
private |
Definition at line 211 of file CbmTofUnpackAlgo.h.
Referenced by GetParContainerRequest(), and SetFlagBmonParMode().
|
private |
Current epoch index.
Control flags
Definition at line 210 of file CbmTofUnpackAlgo.h.
Referenced by ExtractTsStartEpoch(), ProcessEpoch(), ProcessHit(), and SetFlagEpochCountHack2021().
|
private |
Definition at line 213 of file CbmTofUnpackAlgo.h.
Referenced by ProcessEpoch(), and unpack().
|
private |
Idx of the current MS in TS (0 to fuTotalMsNb)
Definition at line 198 of file CbmTofUnpackAlgo.h.
Referenced by ProcessHit(), and unpack().
|
private |
Total number of GDPBs in the system.
Definition at line 180 of file CbmTofUnpackAlgo.h.
Referenced by initParSet(), and unpack().
|
private |
Potential (online) monitor for the unpacking process.
Definition at line 223 of file CbmTofUnpackAlgo.h.
Referenced by finish(), initParSet(), ProcessEpoch(), ProcessHit(), SetMonitor(), and unpack().
|
private |
Settings from parameter file.
Definition at line 175 of file CbmTofUnpackAlgo.h.
Referenced by GetParContainerRequest(), and SetParFileName().
|
private |
Current equipment ID, tells from which DPB the current MS is originating.
Definition at line 201 of file CbmTofUnpackAlgo.h.
Referenced by ProcessEpoch(), and unpack().
|
private |
Temp holder until Current equipment ID is properly filled in MS.
Definition at line 202 of file CbmTofUnpackAlgo.h.
Referenced by ProcessEpoch(), ProcessHit(), and unpack().
|
private |
SysId of the current MS in TS (0 to fuTotalMsNb)
Definition at line 200 of file CbmTofUnpackAlgo.h.
Referenced by unpack().
|
private |
Time of the current MS in s.
Definition at line 199 of file CbmTofUnpackAlgo.h.
Referenced by ProcessHit(), and unpack().
|
private |
Index of the DPB from which the MS currently unpacked is coming.
Definition at line 203 of file CbmTofUnpackAlgo.h.
Referenced by ProcessEpoch(), ProcessHit(), and unpack().
|
private |
running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
Definition at line 205 of file CbmTofUnpackAlgo.h.
Referenced by unpack().
|
private |
Definition at line 215 of file CbmTofUnpackAlgo.h.
Referenced by finishDerived(), and unpack().
|
private |
Definition at line 214 of file CbmTofUnpackAlgo.h.
Referenced by finishDerived(), and ProcessEpoch().
|
private |
Data format control: Current time references for each GDPB: merged epoch marker, epoch cycle, full epoch [fuNrOfGdpbs].
running number (0 to fuNrOfGet4) of the Get4 chip in the system for current message
Definition at line 207 of file CbmTofUnpackAlgo.h.
Referenced by ProcessEpoch().
|
private |
Idx of the current TS.
Definition at line 197 of file CbmTofUnpackAlgo.h.
Referenced by ProcessEpoch(), and unpack().
|
private |
Definition at line 196 of file CbmTofUnpackAlgo.h.
Referenced by unpack().
|
private |
Definition at line 220 of file CbmTofUnpackAlgo.h.
Referenced by ProcessEpoch(), and ProcessHit().
|
private |
Definition at line 219 of file CbmTofUnpackAlgo.h.
Referenced by ExtractTsStartEpoch(), and ProcessEpoch().
|
private |
|
private |
Definition at line 176 of file CbmTofUnpackAlgo.h.
Referenced by initParSet(), ProcessHit(), and unpack().
|
private |
Number of channels in each GET4.
Definition at line 184 of file CbmTofUnpackAlgo.h.
Referenced by initParSet(), and ProcessHit().
|
private |
Number of GET4s per GDPB.
Definition at line 187 of file CbmTofUnpackAlgo.h.
Referenced by initParSet(), and ProcessHit().
|
private |
Number of GET4s per FEE.
Definition at line 183 of file CbmTofUnpackAlgo.h.
Referenced by initParSet(), and ProcessHit().
|
private |
gDPB ID to index map
Definition at line 181 of file CbmTofUnpackAlgo.h.
Referenced by initParSet(), and ProcessHit().
|
private |
Number of channels per GDPB.
Detector Mapping
Definition at line 190 of file CbmTofUnpackAlgo.h.
Referenced by initParSet().
|
private |
For static/inline mapping functions.
Readout chain dimensions and mapping
Definition at line 179 of file CbmTofUnpackAlgo.h.
Referenced by initParSet().
|
private |
Number of channels in each FEE.
Definition at line 185 of file CbmTofUnpackAlgo.h.
Referenced by initParSet().
|
private |
Number of FEBs per GDPB.
Definition at line 182 of file CbmTofUnpackAlgo.h.
Referenced by initParSet(), and ProcessHit().
|
private |
Total number of Get4 chips in the system.
Definition at line 186 of file CbmTofUnpackAlgo.h.
Referenced by GetArrayIndex(), initParSet(), and unpack().
|
private |
Definition at line 191 of file CbmTofUnpackAlgo.h.
|
private |
Book-keeping members.
Definition at line 218 of file CbmTofUnpackAlgo.h.
Referenced by ProcessEpoch(), and unpack().
|
private |
Definition at line 212 of file CbmTofUnpackAlgo.h.
Referenced by unpack().
|
private |
Definition at line 192 of file CbmTofUnpackAlgo.h.
Referenced by initParSet(), and ProcessHit().