CbmRoot
|
#include <UnpackMS.h>
Classes | |
struct | MsContext |
Public Types | |
using | Digi_t |
using | Monitor_t |
using | Aux_t |
using | Result_t |
Public Member Functions | |
UnpackMS (const UnpackPar &pars) | |
Construct from parameters. | |
~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. | |
UnpackMS< 0x01 >::Result_t | operator() (const uint8_t *msContent, const fles::MicrosliceDescriptor &msDescr, const uint64_t tTimeslice) const |
Private Member Functions | |
void | digestOutput (std::unique_ptr< CbmTrdDigi > digi, CbmTrdRawMessageSpadic raw) |
Handle the output created by the explicit algorithms. E.g. write to output vectors. | |
Spadic::MsInfoType | digestBufInfoFlags (const std::uint32_t frame) const |
Digest the aditional flags stored in the 4 "cccc" bits of the EPO messages. | |
void | digestMsFlags (const std::uint16_t flags, UnpackMonitorData &monitor) const |
Digest the flags of the currently unpacked µSlice. | |
void | digestInfoMsg (const std::uint32_t frame) const |
Digest a info message run all default information forwarding from the msg. | |
std::int16_t | extractSample (size_t *adcbuffer, size_t *nadcbits) const |
Extract one adc sample from a given adcbuffer. | |
std::float_t | extractAvgSample (size_t *adcbuffer, size_t *nadcbits) const |
Extract the baseline average sample from a given adcbuffer. Depending on the Spadic settings sample-0 is a plain sample or the averaged baseline calculation. The latter is not a 9 bit signed integer, but a 9 bit floating point number 7 digits before the point and 2 afterwards. | |
Spadic::MsInfoType | getInfoType (const std::uint32_t frame) const |
Identify the InfoType of a 64bit InfoMessage word inside a Microslice. | |
std::uint8_t | getTsMsb (const std::uint32_t frame, UnpackMonitorData &monitor) const |
Get the ts_msb information from the TS_MSB(kEPO) frame. We take the first of the 3 The 3 redundant TS_MSB sets are already compared at the FPGA level. | |
CbmTrdRawMessageSpadic | makeRaw (const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, std::uint16_t elinkId, std::uint8_t istream, MsContext &ctx) const |
Create a CbmTrdRawMessageSpadic from the hit message input. | |
CbmTrdDigi | makeDigi (CbmTrdRawMessageSpadic raw, MsContext &ctx) const |
Create an actual digi from the raw message. | |
CbmTrdDigi | makeDigi (Spadic::FexWord< sys_ver > fw, size_t fMsStartTimeRel) const |
Create an actual digi from the fex message. | |
uint64_t | GetBinTimeShift (const std::vector< std::int16_t > *) const |
Get the Bin Time Shift value. | |
std::float_t | GetMaxAdcValue (const std::vector< std::int16_t > *samples) const |
Get the MaxAdc value. | |
float_t | GetBaseline (const std::vector< std::int16_t > *samples) const |
Get the Baseline value The digi charge is an unsigned. Hence, we need to get the baseline to 0. | |
Spadic::MsMessageType | getMessageType (const std::uint32_t frame) const |
Identify the message type of a given 32bit frame inside a Microslice. | |
CbmTrdDigi | makeDigi (Spadic::FexWord< 0x10 > fw, size_t fMsStartTimeRel) const |
Static Private Member Functions | |
static CbmTrdDigi::eTriggerType | GetDigiTriggerType (Spadic::eTriggerType tt) |
Get the Digi Trigger Type from the raw message triggertype. | |
Private Attributes | |
UnpackPar | fParams = {} |
Parameter container. | |
Static Private Attributes | |
static constexpr std::uint8_t | fBytesPerWord = 8 |
Bytes per spadic frame stored in the microslices. | |
static constexpr std::uint8_t | fStreamsPerWord = 2 |
Number of streams per word. | |
static constexpr size_t | fNrOfPresamples = 1 |
Number of samples not considered for max adc. | |
static constexpr float_t | fAsicClockCycle = 62.5 |
Clock length of Spadic in ns. | |
static constexpr std::uint16_t | fTsMsbLength = 16000 |
length of one ts_msb in [ns] | |
static constexpr size_t | fTsMsbLengthCC = fTsMsbLength / fAsicClockCycle |
length of one ts_msb in [cc] | |
static constexpr size_t | fPeakingBinMin = fNrOfPresamples |
First sample to look for the max adc. | |
static constexpr size_t | fPeakingBinMax = static_cast<size_t>(120.0 / fAsicClockCycle + fNrOfPresamples + 5) |
Last sample to look for the max adc Default value is set based on the Shaping time + 5 samples safety margin. | |
Definition at line 110 of file trd/UnpackMS.h.
|
inherited |
Definition at line 23 of file UnpackMSBase.h.
|
inherited |
Definition at line 21 of file UnpackMSBase.h.
|
inherited |
Definition at line 22 of file UnpackMSBase.h.
|
inherited |
Definition at line 25 of file UnpackMSBase.h.
|
inline |
Construct from parameters.
Definition at line 114 of file trd/UnpackMS.h.
|
overridedefault |
Destructor.
|
private |
Digest the aditional flags stored in the 4 "cccc" bits of the EPO messages.
frame |
Definition at line 20 of file trd/UnpackMS.cxx.
References Spadic::kChannelBuf, Spadic::kChannelBufM, and Spadic::kOrdFifoBuf.
|
private |
Digest a info message run all default information forwarding from the msg.
frame |
Save info message if needed.
Definition at line 34 of file trd/UnpackMS.cxx.
|
private |
Digest the flags of the currently unpacked µSlice.
flags | flags stored in the µSlice descriptor |
storage | of monitoring data |
Definition at line 46 of file trd/UnpackMS.cxx.
References cbm::algo::trd::UnpackMonitorData::fNumCrcValidFlags, cbm::algo::trd::UnpackMonitorData::fNumDataErrorFlags, cbm::algo::trd::UnpackMonitorData::fNumOverflowFlimFlags, and cbm::algo::trd::UnpackMonitorData::fNumOverflowUserFlags.
|
private |
Handle the output created by the explicit algorithms. E.g. write to output vectors.
digi | |
raw |
|
private |
Extract the baseline average sample from a given adcbuffer. Depending on the Spadic settings sample-0 is a plain sample or the averaged baseline calculation. The latter is not a 9 bit signed integer, but a 9 bit floating point number 7 digits before the point and 2 afterwards.
[in] | adcbuffer | |
[in,out] | nadcbits |
Definition at line 67 of file trd/UnpackMS.cxx.
|
private |
Extract one adc sample from a given adcbuffer.
[in] | adcbuffer | |
[in,out] | nadcbits |
Definition at line 97 of file trd/UnpackMS.cxx.
|
private |
Get the Baseline value The digi charge is an unsigned. Hence, we need to get the baseline to 0.
samples |
Definition at line 397 of file trd/UnpackMS.cxx.
|
inlineprivate |
Get the Bin Time Shift value.
samples |
Definition at line 244 of file trd/UnpackMS.h.
|
staticprivate |
Get the Digi Trigger Type from the raw message triggertype.
tt |
Definition at line 348 of file trd/UnpackMS.cxx.
References Spadic::kGlobal, Spadic::kNeigh, CbmTrdDigi::kNeighbor, CbmTrdDigi::kNTrg, Spadic::kSandN, CbmTrdDigi::kSelf, and Spadic::kSelf.
|
private |
Identify the InfoType of a 64bit InfoMessage word inside a Microslice.
Definition at line 121 of file trd/UnpackMS.cxx.
References Spadic::kBOM, Spadic::kBUF, Spadic::kMIS, Spadic::kMSB, Spadic::kUNU, and L_.
|
private |
Get the MaxAdc value.
samples |
Definition at line 367 of file trd/UnpackMS.cxx.
|
private |
Identify the message type of a given 32bit frame inside a Microslice.
Definition at line 164 of file trd/UnpackMS.cxx.
References Spadic::kEOM, Spadic::kEPO, Spadic::kINF, Spadic::kNUL, Spadic::kRDA, Spadic::kSOM, and Spadic::kUNK.
|
private |
Get the ts_msb information from the TS_MSB(kEPO) frame. We take the first of the 3 The 3 redundant TS_MSB sets are already compared at the FPGA level.
frame | |
storage | of monitoring data |
Definition at line 201 of file trd/UnpackMS.cxx.
References cbm::algo::trd::UnpackMonitorData::fNumNonMajorTsMsb.
|
private |
Create an actual digi from the raw message.
raw |
Definition at line 271 of file trd/UnpackMS.cxx.
References cbm::algo::trd::UnpackElinkPar::fAddress, cbm::algo::trd::UnpackElinkPar::fChanAddress, cbm::algo::trd::UnpackCrobPar::fElinkParams, cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fLastFulltime, cbm::algo::trd::UnpackElinkPar::fTimeOffset, CbmTrdRawMessageSpadic::GetChannelId(), CbmTrdRawMessageSpadic::GetCrobId(), CbmTrdRawMessageSpadic::GetElinkId(), CbmTrdRawMessageSpadic::GetFullTime(), CbmTrdRawMessageSpadic::GetHitType(), CbmTrdRawMessageSpadic::GetMultiHit(), CbmTrdRawMessageSpadic::GetSamples(), CbmTrdRawMessageSpadic::GetTime(), CbmTrdDigi::kMulti, and CbmTrdDigi::SetTriggerType().
|
private |
|
private |
Create an actual digi from the fex message.
fw |
Definition at line 230 of file trd/UnpackMS.cxx.
|
private |
Create a CbmTrdRawMessageSpadic from the hit message input.
word | |
criId | id of the cri that send the µSlice |
criobId | id of the crob that send the µSlice (currently not used set to 0 062021 PR) |
istream |
Definition at line 324 of file trd/UnpackMS.cxx.
References cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fMsStartTimeRelCC, and cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fNrTsMsbVec.
|
virtual |
Implements cbm::algo::UnpackMSBase< CbmTrdDigi, UnpackMonitorData, UnpackAuxData >.
Definition at line 456 of file trd/UnpackMS.cxx.
References cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fMsStartTimeRelCC, cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fNrTsMsbVec, CbmTrdRawMessageSpadic::GetElinkId(), CbmTrdRawMessageSpadic::IncNrSamples(), Spadic::kEOM, Spadic::kEPO, Spadic::kINF, Spadic::kNUL, Spadic::kRDA, Spadic::kSOM, Spadic::kUNK, and CbmTrdRawMessageSpadic::SetSample().
|
overridevirtual |
Algorithm execution.
msContent | Microslice payload |
msDescr | Microslice descriptor |
tTimeslice | Unix start time of timeslice [ns] |
Implements cbm::algo::UnpackMSBase< CbmTrdDigi, UnpackMonitorData, UnpackAuxData >.
Definition at line 419 of file trd/UnpackMS.cxx.
References Spadic::BytesPerWord().
|
inline |
Set the parameter container.
params | Pointer to parameter container |
Definition at line 133 of file trd/UnpackMS.h.
References cbm::algo::trd::UnpackMS< sys_ver >::fParams.
|
staticconstexprprivate |
Clock length of Spadic in ns.
Definition at line 276 of file trd/UnpackMS.h.
|
staticconstexprprivate |
Bytes per spadic frame stored in the microslices.
Definition at line 265 of file trd/UnpackMS.h.
|
staticconstexprprivate |
Number of samples not considered for max adc.
Definition at line 273 of file trd/UnpackMS.h.
|
private |
Parameter container.
Definition at line 148 of file trd/UnpackMS.h.
Referenced by cbm::algo::trd::UnpackMS< sys_ver >::SetParams().
|
staticconstexprprivate |
Last sample to look for the max adc Default value is set based on the Shaping time + 5 samples safety margin.
Definition at line 293 of file trd/UnpackMS.h.
|
staticconstexprprivate |
First sample to look for the max adc.
Definition at line 285 of file trd/UnpackMS.h.
|
staticconstexprprivate |
Number of streams per word.
For the msg format used from 2021 ongoing we have 2 parallel streams per word. * All data from eLinks 0..20 go to one stream and 21..41 to the other
Definition at line 270 of file trd/UnpackMS.h.
|
staticconstexprprivate |
length of one ts_msb in [ns]
Definition at line 279 of file trd/UnpackMS.h.
|
staticconstexprprivate |
length of one ts_msb in [cc]
Definition at line 282 of file trd/UnpackMS.h.