|
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 uint32_t frame) const |
| Digest the aditional flags stored in the 4 "cccc" bits of the EPO messages. | |
| void | digestMsFlags (const uint16_t flags, UnpackMonitorData &monitor) const |
| Digest the flags of the currently unpacked micro-Slice. | |
| void | digestInfoMsg (const uint32_t frame) const |
| Digest a info message run all default information forwarding from the msg. | |
| 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 uint32_t frame) const |
| Identify the InfoType of a 64bit InfoMessage word inside a Microslice. | |
| uint8_t | getTsMsb (const 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 uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId, uint8_t istream, MsContext &ctx) const |
| Create a CbmTrdRawMessageSpadic from the hit message input. | |
| CbmTrdDigi | makeDigi (CbmTrdRawMessageSpadic raw, MsContext &ctx, UnpackMonitorData &monitor) const |
| Create an actual digi from the raw message. | |
| CbmTrdDigi | makeDigi (Spadic::FexWord< sys_ver > fw, size_t fMsStartTimeRel, UnpackMonitorData &monitor) const |
| Create an actual digi from the fex message. | |
| uint64_t | GetBinTimeShift (const std::vector< int16_t > *) const |
| Get the Bin Time Shift value. | |
| std::float_t | GetMaxAdcValue (const std::vector< int16_t > *samples) const |
| Get the MaxAdc value. | |
| float_t | GetBaseline (const std::vector< 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 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, UnpackMonitorData &monitor) 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 uint8_t | fBytesPerWord = 8 |
| Bytes per spadic frame stored in the microslices. | |
| static constexpr 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 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 129 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 |
|
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.
Referenced by getInfoType().
|
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.
References getInfoType().
Referenced by operator()().
|
private |
Digest the flags of the currently unpacked micro-Slice.
| flags | flags stored in the micro-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.
Referenced by operator()(), and operator()().
|
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.
Referenced by operator()().
|
private |
Extract one adc sample from a given adcbuffer.
| [in] | adcbuffer | |
| [in,out] | nadcbits |
Definition at line 97 of file trd/UnpackMS.cxx.
Referenced by operator()().
|
private |
Get the Baseline value The digi charge is an unsigned. Hence, we need to get the baseline to 0.
| samples |
Definition at line 418 of file trd/UnpackMS.cxx.
References fNrOfPresamples, and fParams.
Referenced by GetMaxAdcValue().
|
inlineprivate |
Get the Bin Time Shift value.
| samples |
Definition at line 265 of file trd/UnpackMS.h.
Referenced by makeDigi().
|
staticprivate |
Get the Digi Trigger Type from the raw message triggertype.
| tt |
Definition at line 369 of file trd/UnpackMS.cxx.
References Spadic::kGlobal, Spadic::kNeigh, CbmTrdDigi::kNeighbor, CbmTrdDigi::kNTrg, Spadic::kSandN, CbmTrdDigi::kSelf, and Spadic::kSelf.
Referenced by makeDigi(), and makeDigi().
|
private |
Identify the InfoType of a 64bit InfoMessage word inside a Microslice.
Definition at line 121 of file trd/UnpackMS.cxx.
References digestBufInfoFlags(), Spadic::kBOM, Spadic::kBUF, Spadic::kMIS, Spadic::kMSB, Spadic::kUNU, and L_.
Referenced by digestInfoMsg().
|
private |
Get the MaxAdc value.
| samples |
Definition at line 388 of file trd/UnpackMS.cxx.
References fPeakingBinMax, fPeakingBinMin, and GetBaseline().
Referenced by makeDigi().
|
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.
Referenced by operator()().
|
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.
Referenced by operator()().
|
private |
Create an actual digi from the raw message.
| raw | |
| storage | of monitoring data |
Definition at line 279 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::UnpackMonitorData::fNumErrTimestampUnderflow, fParams, cbm::algo::trd::UnpackElinkPar::fTimeOffset, GetBinTimeShift(), CbmTrdRawMessageSpadic::GetChannelId(), CbmTrdRawMessageSpadic::GetCrobId(), GetDigiTriggerType(), CbmTrdRawMessageSpadic::GetElinkId(), CbmTrdRawMessageSpadic::GetFullTime(), CbmTrdRawMessageSpadic::GetHitType(), GetMaxAdcValue(), CbmTrdRawMessageSpadic::GetMultiHit(), CbmTrdRawMessageSpadic::GetSamples(), CbmTrdRawMessageSpadic::GetTime(), CbmTrdDigi::kMulti, and CbmTrdDigi::SetTriggerType().
Referenced by operator()(), and operator()().
|
private |
Definition at line 238 of file trd/UnpackMS.cxx.
References cbm::algo::trd::UnpackElinkPar::fAddress, fAsicClockCycle, cbm::algo::trd::UnpackElinkPar::fChanAddress, cbm::algo::trd::UnpackCrobPar::fElinkParams, cbm::algo::trd::UnpackMonitorData::fNumErrTimestampUnderflow, fParams, cbm::algo::trd::UnpackElinkPar::fTimeOffset, GetDigiTriggerType(), CbmTrdDigi::kMulti, and CbmTrdDigi::SetTriggerType().
|
private |
Create an actual digi from the fex message.
| fw | |
| storage | of monitoring data |
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 micro-Slice |
| criobId | id of the crob that send the micro-Slice (currently not used set to 0 062021 PR) |
| istream |
Definition at line 346 of file trd/UnpackMS.cxx.
References cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fMsStartTimeRelCC, cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fNrTsMsbVec, and fTsMsbLengthCC.
Referenced by operator()().
|
virtual |
Implements cbm::algo::UnpackMSBase< CbmTrdDigi, UnpackMonitorData, UnpackAuxData >.
Definition at line 477 of file trd/UnpackMS.cxx.
References digestInfoMsg(), digestMsFlags(), extractAvgSample(), extractSample(), fAsicClockCycle, fBytesPerWord, cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fMsStartTimeRelCC, cbm::algo::trd::UnpackMS< sys_ver >::MsContext::fNrTsMsbVec, fParams, fStreamsPerWord, CbmTrdRawMessageSpadic::GetElinkId(), getMessageType(), getTsMsb(), CbmTrdRawMessageSpadic::IncNrSamples(), Spadic::kEOM, Spadic::kEPO, Spadic::kINF, Spadic::kNUL, Spadic::kRDA, Spadic::kSOM, Spadic::kUNK, makeDigi(), makeRaw(), 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 440 of file trd/UnpackMS.cxx.
References Spadic::BytesPerWord(), digestMsFlags(), and makeDigi().
|
inline |
Set the parameter container.
| params | Pointer to parameter container |
Definition at line 152 of file trd/UnpackMS.h.
References fParams.
|
staticconstexprprivate |
Clock length of Spadic in ns.
Definition at line 297 of file trd/UnpackMS.h.
Referenced by makeDigi(), and operator()().
|
staticconstexprprivate |
Bytes per spadic frame stored in the microslices.
Definition at line 286 of file trd/UnpackMS.h.
Referenced by operator()().
|
staticconstexprprivate |
Number of samples not considered for max adc.
Definition at line 294 of file trd/UnpackMS.h.
Referenced by GetBaseline().
|
private |
Parameter container.
Definition at line 167 of file trd/UnpackMS.h.
Referenced by GetBaseline(), makeDigi(), makeDigi(), operator()(), SetParams(), and UnpackMS().
|
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 314 of file trd/UnpackMS.h.
Referenced by GetMaxAdcValue().
|
staticconstexprprivate |
First sample to look for the max adc.
Definition at line 306 of file trd/UnpackMS.h.
Referenced by GetMaxAdcValue().
|
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 291 of file trd/UnpackMS.h.
Referenced by operator()().
|
staticconstexprprivate |
length of one ts_msb in [ns]
Definition at line 300 of file trd/UnpackMS.h.
|
staticconstexprprivate |
length of one ts_msb in [cc]
Definition at line 303 of file trd/UnpackMS.h.
Referenced by makeRaw().