17#ifndef CbmMuchUnpackAlgo_H
18#define CbmMuchUnpackAlgo_H
25#include "CbmRecoUnpackAlgo.tmpl"
26#include "Timeslice.hpp"
31#include <RtypesCore.h>
39class CbmMuchUnpackAlgo :
public CbmRecoUnpackAlgo<CbmMuchDigi, CbmMuchDigi, CbmErrorMessage> {
82 virtual std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>*
92 void MaskNoisyChannel(
const uint32_t uFeb,
const uint32_t uChan,
const bool bMasked =
true);
114 uint32_t
getFebIndex(uint32_t dpbidx, uint32_t crobidx, uint16_t elinkidx);
174 void loopMsMessages(
const uint8_t* msContent,
const uint32_t uSize,
const size_t uMsIdx);
181 const std::vector<std::vector<std::vector<int32_t>>>& ,
182 const std::vector<std::vector<std::vector<int32_t>>>& );
225 bool unpack(
const fles::Timeslice* ts, std::uint16_t icomp, UInt_t imslice);
295 std::vector<std::vector<std::vector<int32_t>>>
fviFebType = {};
330 std::shared_ptr<CbmMuchUnpackMonitor>
fMonitor =
nullptr;
std::vector< int32_t > fviFebSide
Module side for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
std::vector< int32_t > fviFebAddress
STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
uint32_t CreateMuchAddress(uint32_t dpbidx, int32_t febId, uint32_t usChan)
void printAddressMaps(CbmMuchUnpackPar *parset, const std::vector< std::vector< std::vector< int32_t > > > &, const std::vector< std::vector< std::vector< int32_t > > > &)
experts please add description
Bool_t initParSet(FairParGenericSet *parset)
Handles the distribution of the hidden derived classes to their explicit functions.
uint32_t fNrAsicsPerFeb
Number of ASICs per FEB.
bool fbDupliWithoutAdc
If rejecting duplicate digis, enables rejection even if ADC differs.
std::vector< uint64_t > fvulCurrentTsMsb
Current TS MSB for each DPB.
uint64_t fuSkippMessNoValidAddress
For static/inline mapping functions.
uint32_t fNrElinksPerCrob
Number of eLinks per CROB.
std::vector< double > fvdFebAdcOffs
ADC offset in e-, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
bool setDerivedTsParameters(size_t)
Set the Derived Ts Parameters.
std::vector< std::vector< uint64_t > > fvvulLastTsMsbChan
TS MSB in TS of last hit message for each channel, [ AsicIdx ][ Chan ].
virtual ~CbmMuchUnpackAlgo()
Destroy the Cbm Much Unpack Algo object.
void processErrorInfo(const stsxyter::Message &mess)
experts please add description
uint32_t fNrFebsPerCrob
Number of FEBs per CROB.
std::vector< std::vector< uint16_t > > fvvusLastTsChan
TS of last hit message for each channel, [ AsicIdx ][ Chan ].
std::map< uint32_t, uint32_t > fdAdcCut_perFeb
Minimum adc cut per Feb to store a hit.
CbmMuchUnpackAlgo()
Create the Cbm Much Unpack Algo object.
std::vector< bool > fvbMaskedComponents
Masked components to print out missing component only once.
virtual void finish()
Finish function for this algorithm base clase.
std::vector< uint32_t > fvuCurrentTsMsbCycle
Current TS MSB cycle for DPB.
bool fbRejectDuplicateDigis
Enables the rejection of duplicate digis.
void SetMinAdcCut(uint32_t value)
Set the minimum adc cut value.
std::map< uint32_t, uint32_t > fDpbIdIndexMap
Map of DPB Identifier to DPB index.
void initInternalStatus(CbmMuchUnpackPar *parset)
experts please add description here
void processTsMsbInfo(const stsxyter::Message &mess, uint32_t uMessIdx, uint32_t uMsIdx)
experts please add description
void processStatusInfo(const stsxyter::Message &mess, uint32_t uIdx)
experts please add description
uint64_t fuSkippMessNoValidElink
CbmMuchUnpackPar * fUnpackPar
static const uint32_t kuMaxTsMsbDiffDuplicates
Duplicate hits suppression.
std::vector< std::vector< bool > > fvvbMaskedChannels
Vector of channel masks, [ NbFeb ][ NbCHanInFeb ], used only if fbUseChannelMask is true.
uint32_t fNrCrobPerDpb
Number of CROBs per DPB.
uint64_t fMaskedNoisyHitsFromCbmMuchAddress
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...
std::vector< std::vector< uint16_t > > fvvusLastAdcChan
ADC of last hit message for each channel, [ AsicIdx ][ Chan ].
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.
std::shared_ptr< CbmMuchUnpackMonitor > fMonitor
Potential (online) monitor for the unpacking process.
void SetMonitor(std::shared_ptr< CbmMuchUnpackMonitor > monitor)
Set a predefined monitor.
void refreshTsMsbFields(const uint32_t imslice, const size_t mstime)
experts please add description here
void SetInactiveChannel(uint32_t channel)
uint32_t fNrChsPerAsic
Number of Channels per Asic.
uint64_t getFullTimeStamp(const uint16_t usRawTs)
Get the Full Time Stamp from raw time stamp.
CbmMuchUnpackAlgo(const CbmMuchUnpackAlgo &)=delete
Copy constructor - not implemented.
uint32_t fuNbFebs
Number of FEBs with StsXyter ASICs.
void processEpochInfo(const stsxyter::Message &)
experts please add description marked as not used currently
std::vector< uint64_t > fulTsMsbIndexInTs
Current TS MSB cycle for DPB relative to TS start.
std::vector< std::pair< uint32_t, uint32_t > > fElinkIdxToAsicIdxVec
Vector used for the translation between eLink index and Asic index first is feb type A second is feb ...
std::vector< int > fElinkIdxToFebIdxVec
Vector used for the translation between eLink index and FEB index.
void SetParFileName(std::string sNewName)
Sets the name of the parameter file to be used.
uint32_t fdAdcCut
Minimum adc cut to store a hit.
Bool_t init()
Intialisation at begin of run. Special inits of the derived algos.
uint32_t fuCurrDpbIdx
Current dpb id.
std::vector< double > fvdFebAdcGain
ADC gain in e-/b, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
std::vector< uint32_t > fvbFebAdcCut
ADC cuts for FEBs.
void loopMsMessages(const uint8_t *msContent, const uint32_t uSize, const size_t uMsIdx)
Initialize and transfer the informations to the parameters storage vectors.
void printActiveCrobs(CbmMuchUnpackPar *parset, const std::vector< std::vector< bool > > &vbCrobActiveFlag)
experts please add description
void SetDuplicatesRejection(bool bIn=true, bool bDiffAdc=true)
Enable/Disable the duplicate digis rejection, without or with same ADC checks.
bool fbUseChannelMask
flag if channel mask is to be used or not. Set automatically via MaskNoisyChannels
uint32_t fNrAsicsPerCrob
Number of ASICs per CROB.
uint64_t fuSkippMessNoValidFebPosition
std::vector< double > fvdTimeOffsetNsAsics
Time offsets per Asic???
std::vector< bool > fvbFebPulser
Pulser flag for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
std::string fParFileName
Settings from parameter file.
void SetAsicTimeOffsetVec(std::vector< double > value)
Set the time offset per Asic.
std::vector< std::vector< std::vector< int32_t > > > fviFebType
FEB type, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = A, 1 = B, -1 if inactive.
CbmMuchUnpackAlgo & operator=(const CbmMuchUnpackAlgo &)=delete
Assignment operator - not implemented.
uint32_t getFebIndex(uint32_t dpbidx, uint32_t crobidx, uint16_t elinkidx)
Get the Asic Index.
void MaskNoisyChannel(const uint32_t uFeb, const uint32_t uChan, const bool bMasked=true)
Mask a Noisy Channel.
void processHitInfo(const stsxyter::Message &mess)
Process the information of the hit message and create a MuchDigi from it.
void initDpbIdIndexMap(CbmMuchUnpackPar *parset)
Initialize the DpbIdIndexMap with the information from the parset.
void SetMinAdcCut(uint32_t febid, uint32_t value)
uint64_t fMsStartTime
Current µSlice time.
std::set< uint32_t > fInactiveChannels
uint64_t fulTsStartInTsMsb
Start time of the TS expressed in TS_MSB instead of ns.
uint32_t fNrChsPerFeb
Number of Channels per FEB.