25 const uint64_t tTimeslice)
const
39 auto const msTime = msDescr.idx;
46 auto msSize = msDescr.size;
48 std::get<1>(result).fNumErrInvalidMsSize++;
52 if (numMessages < 2) {
53 std::get<1>(result).fNumErrInvalidMsSize++;
57 const uint32_t maxDigis = numMessages - 2;
58 std::get<0>(result).reserve(maxDigis);
65 std::get<1>(result).fNumErrInvalidFirstMessage++;
71 std::get<1>(result).fNumErrInvalidFirstMessage++;
77 for (uint32_t messageNr = 2; messageNr < numMessages; messageNr++) {
80 switch (message[messageNr].GetMessType()) {
83 ProcessHitMessage(message[messageNr], time, std::get<0>(result), std::get<1>(result));
91 std::get<1>(result).fNumNonHitOrTsbMessage++;
118 if (!elinkPar.fChanMask.empty() && elinkPar.fChanMask[channel] ==
true) {
122 uint32_t address = (elinkPar.fAddress)[channel];
131 messageTime -= elinkPar.fTimeOffset;
137 digiVec.emplace_back(address, charge, messageTime);
std::tuple< std::vector< Digi_t >, Monitor_t, Aux_t > Result_t
static constexpr uint32_t fkClockCycleDen
void ProcessTsmsbMessage(const stsxyter::Message &message, TimeSpec &time) const
Process an epoch message (TS_MSB)
UnpackMS(const UnpackPar &pars)
Construct with parameters.
void ProcessHitMessage(const stsxyter::Message &message, const TimeSpec &time, std::vector< CbmMuchDigi > &digiVec, UnpackMonitorData &monitor) const
Process a hit message.
static constexpr uint64_t fkEpochLength
~UnpackMS() override
Destructor.
static constexpr uint64_t fkEpochsPerCycle
Result_t operator()(const uint8_t *msContent, const fles::MicrosliceDescriptor &msDescr, const uint64_t tTimeslice) const override
Algorithm execution.
static constexpr uint32_t fkClockCycleNom
UnpackPar fParams
Parameter container.
static constexpr uint64_t fkCycleLength
XPU_D uint32_t GetTsMsbValBinning() const
For TS MSB data: Returns the TS MSB 29 bit field)
XPU_D uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
XPU_D uint16_t GetHitChannel() const
For Hit data: Returns StsXYTER channel number (7 bit field)
XPU_D uint16_t GetLinkIndexHitBinning() const
XPU_D uint16_t GetHitTimeBinning() const
uint64_t currentCycle
Current epoch cycle.
uint64_t currentEpochTime
Current epoch time relative to timeslice in clock cycles.
uint32_t currentEpoch
Current epoch number within epoch cycle.
uint64_t currentTsTime
Unix time of timeslice in units of epoch length.
uint32_t fNumErrElinkOutOfRange
Elink not contained in parameters.
Parameters required for the STS unpacking (specific to one component)
std::vector< UnpackElinkPar > fElinkParams
Parameters for each eLink.