7#include "MicrosliceDescriptor.hpp"
16#define NFASPROB NFASPMOD / NROBMOD
18#define NFASPPAD NFASPCH / 2
20#define FASP_EPOCH_LENGTH 128
84 FaspMessage(uint8_t c, uint8_t typ, uint8_t t, uint16_t d, uint8_t asic);
89 template<std::u
int8_t mess_ver>
92 std::string
print()
const;
97 template<std::u
int8_t mess_ver>
103 template<std::u
int8_t mess_ver>
184 template<u
int8_t ver>
202 return (numErrors > 0 ?
true :
false);
206 std::stringstream ss;
227 template<std::u
int8_t sys_ver>
243 Result_t operator()(
const uint8_t* msContent,
const fles::MicrosliceDescriptor& msDescr,
244 const uint64_t tTimeslice)
const override;
262 bool pushDigis(std::vector<FaspMessage> messages,
const uint64_t time, MsContext& ctx)
const;
279 public UnpackMSBase<CbmTrdDigi, UnpackMonitorData, UnpackAuxData> {
296 const uint64_t tTimeslice)
const override;
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.
Result_t operator()(const uint8_t *msContent, const fles::MicrosliceDescriptor &msDescr, const uint64_t tTimeslice) const override
Algorithm execution.
void SetParams(std::unique_ptr< UnpackPar > params)
Set the parameter container.
Unpack algorithm for TRD2D.
~UnpackMS() override=default
Destructor.
Result_t operator()(const uint8_t *msContent, const fles::MicrosliceDescriptor &msDescr, const uint64_t tTimeslice) const override
Algorithm execution.
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.
static constexpr uint fAsicClockPeriod
Clock period of FASP 12.5ns. Use 25ns follow by division by 2.
@ kMess24
unpacker version for 2-board FASPRO+GETS HW
TRD2D Calibration parameters for one Asic channel.
float fGainFee
gain correction wrt to reference
bool fMask
Flag for channel masking.
int8_t fDaqOffset
Time calibration parameter.
NoiseChannelPar noise
noise channel parametrisation
float fBaseline
baseline correction
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 noise parameters for one Asic channel.
uint16_t fSignalThres
Signal threshold for independent - static noise.
uint16_t tWindow
time [clk] delay wrt to causing primary signal
uint16_t lThreshold
time [clk] window to search for noisy signal
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.
bool fMask
Flag for channel masking.
int8_t fDaqOffset
Time calibration parameter.
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.
int toff[NFASPMOD *NFASPPAD]
int32_t fSystemTimeOffset
Time calibration parameter.
float fRefSignal
reference signal for calibration
std::map< uint8_t, UnpackAsicPar > fAsicParams
Parameters for each ASIC.
std::array< CalibChannelPar, NFASPMOD *NFASPCH > fCalibParams
Parameters for each ASIC channel for each module.
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].