7#include "MicrosliceDescriptor.hpp"
16#define NFASPROB NFASPMOD / NROBMOD
18#define NFASPPAD NFASPCH / 2
20#define FASP_EPOCH_LENGTH 128
81 FaspMessage(uint8_t c, uint8_t typ, uint8_t t, uint16_t d, uint8_t asic);
86 template<std::u
int8_t mess_ver>
89 std::string
print()
const;
94 template<std::u
int8_t mess_ver>
100 template<std::u
int8_t mess_ver>
152 template<u
int8_t ver>
170 return (numErrors > 0 ?
true :
false);
174 std::stringstream ss;
195 template<std::u
int8_t sys_ver>
212 const uint64_t tTimeslice)
const override;
230 bool pushDigis(std::vector<FaspMessage> messages,
const uint64_t time, MsContext& ctx)
const;
247 public UnpackMSBase<CbmTrdDigi, UnpackMonitorData, UnpackAuxData> {
263 Result_t operator()(
const uint8_t* msContent,
const fles::MicrosliceDescriptor& msDescr,
264 const uint64_t tTimeslice)
const override;
285 static constexpr float fAsicClockFreq = 0.08;
std::tuple< std::vector< Digi_t >, Monitor_t, Aux_t > Result_t
~UnpackMS() override=default
Destructor.
bool pushDigis(std::vector< FaspMessage > messages, const uint64_t time, MsContext &ctx) const
UnpackMS(const UnpackPar &pars)
Construct from parameters.
void SetParams(std::unique_ptr< UnpackPar > params)
Set the parameter container.
Unpack algorithm for TRD2D.
~UnpackMS() override=default
Destructor.
void SetParams(std::unique_ptr< UnpackPar > params)
Set the parameter container.
std::vector< CbmTrdDigi > FinalizeComponent(MsContext &ctx) const
Finalize component (e.g. copy from temp buffers)
UnpackMS(const UnpackPar &pars)
Construct from parameters.
bool pushDigis(std::vector< FaspMessage > messages, const uint64_t time, MsContext &ctx) const
UnpackPar fParams
Parameter container.
Result_t operator()(const uint8_t *msContent, const fles::MicrosliceDescriptor &msDescr, const uint64_t tTimeslice) const override
Algorithm execution.
@ kMess24
unpacker version for 2-board FASPRO+GETS HW
Data structure for unpacking the FASP word.
uint8_t tlab
time of the digi inside the epoch
void readDW(uint32_t w)
Read DATA WORD and store the content locally.
uint32_t epoch
epoch id (not used for the moment)
uint8_t ch
ch id in the FASP
std::string print() const
void readEW(uint32_t w)
Read EPOCH WORD and store the content locally.
uint8_t fasp
FASP id in the module.
eMessageType type
message type 0 = data, 1 = epoch (not used for the moment)
static eMessageType getType(uint32_t w)
Implementation of message type descriptor according to message version.
FaspMessage(const FaspMessage &)=default
TRD2D Unpacking parameters for one Asic.
std::vector< UnpackChannelPar > fChanParams
Parameters for different channels.
TRD2D Unpacking parameters for one Asic channel.
int32_t fPadAddress
Pad address for channel.
uint16_t fSignalThres
Signal threshold to remove ringing channels.
uint8_t fDaqOffset
Time calibration parameter.
bool fMask
Flag for channel masking.
UnpackMonitorData fMonitor
Container for monitoring data.
std::array< std::vector< CbmTrdDigi >, NFASPMOD *NFASPCH > fDigiBuffer
FaspMessage fMess
encapsulation of the FASP message.
UnpackMonitorData fMonitor
Container for monitoring data.
uint32_t fNumSelfTriggeredData
word fulfills data & 0x2000
uint32_t fNumIncompleteDigis
incomplete digis left in pads after finalization
uint32_t fNumErrEndBitSet
Corrupted data with end bit set.
Parameters required for the TRD2D unpacking (specific to one component)
void dump() const
Write to the debug stream the content of the current param object.
uint8_t fEqId
Equipment (optical fiber) ID of component.
uint16_t fModId
Module ID of component.
int32_t fSystemTimeOffset
Time calibration parameter.
std::map< uint8_t, UnpackAsicPar > fAsicParams
Parameters for each ASIC.
uint8_t mapFaspId2Mod(uint8_t fasp_id) const
Calculate the module wise FASP id from the FASP id provided at the level of equipment Id (optical fib...
uint16_t fEqAdd
Equipment (optical fiber) address [HEX].