CbmRoot
Loading...
Searching...
No Matches
CbmTrdUnpackAlgoR.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Goethe-University Frankfurt, Frankfurt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pascal Raisig [committer] */
4
18
19#ifndef CbmTrdUnpackAlgoR_H
20#define CbmTrdUnpackAlgoR_H
21
25
26#include <Timeslice.hpp> // timeslice
27
28#include <FairTask.h> // for InitStatus
29
30#include <Rtypes.h> // for types
31#include <RtypesCore.h>
32
33#include <cmath>
34#include <cstdint>
35#include <vector>
36
37
39
40 private:
41 /* data */
42
43 public:
45 CbmTrdUnpackAlgoR(/* args */);
46
48 virtual ~CbmTrdUnpackAlgoR();
49
52
55
65 virtual std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>*
66 GetParContainerRequest(std::string geoTag, uint32_t runId);
67
68
69 protected:
78 Spadic::MsInfoType digestBufInfoFlags(const uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId);
79
87 void digestInfoMsg(const uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId);
88
95 void digestMsFlags(const uint16_t flags, uint16_t criId, uint8_t crobId);
96
98
106 int16_t extractSample(size_t* adcbuffer, size_t* nadcbits);
107
117 std::float_t extractAvgSample(size_t* adcbuffer, size_t* nadcbits);
118
120 void finishDerived();
121
123 Spadic::MsInfoType getInfoType(const uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId);
124
126 Spadic::MsMessageType getMessageType(const uint32_t frame);
127
134 uint8_t getTsMsb(const uint32_t frame);
135
147 virtual CbmTrdRawMessageSpadic makeRaw(const uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId,
148 uint8_t istream);
149
156
163
164 void makeDigi(Spadic::FexWord<0x10> fw, uint32_t criid);
165
167 bool setDerivedTsParameters(size_t /*itimeslice*/) { return true; }
168
180 bool unpack(const fles::Timeslice* ts, uint16_t icomp, UInt_t imslice);
181
182 bool unpackRaw(const fles::MicrosliceDescriptor msdesc, const size_t* mscontent);
183
184 template<uint8_t sys_ver>
185 bool unpackFex(const fles::MicrosliceDescriptor msdesc, const size_t* mscontent);
186
187 // Parameter storage members
188
190 std::vector<uint8_t> fNrTsMsbVec = {};
191
194
196 size_t fNrElinkMis = 0;
197
199 size_t fNrCorruptEom = 0;
200
202 size_t fMsStartTimeRel = 0;
203
206
207 // Constants
209 static const uint8_t fBytesPerWord = 8;
212 static const uint8_t fStreamsPerWord = 2;
213
214
215 private:
216 ClassDef(CbmTrdUnpackAlgoR, 2)
217};
218
219#endif // CbmTrdUnpackAlgoR_H
Baseclass for the TrdR unpacker algorithms.
Base class for storing raw information which comes from the Spadic v2.2 trough flib or from a tsa fil...
CbmTrdUnpackAlgoBaseR(std::string name)
Create the Cbm Trd Unpack AlgoBase object.
std::vector< uint8_t > fNrTsMsbVec
Counter for the ts_msb used to reconstruct the time.
static const uint8_t fBytesPerWord
Bytes per spadic frame stored in the microslices.
size_t fNrCorruptEom
Number of corrupted EOM frames.
CbmTrdUnpackAlgoR(const CbmTrdUnpackAlgoR &)=delete
Copy constructor - not implemented.
static const uint8_t fStreamsPerWord
Number of streams per word For the msg format used from 2021 ongoing we have 2 parallel streams per w...
void makeDigi(CbmTrdRawMessageSpadic raw)
Create an actual digi from the raw message.
virtual std::vector< std::pair< std::string, std::shared_ptr< FairParGenericSet > > > * GetParContainerRequest(std::string geoTag, uint32_t runId)
Get the requested parameter containers. Return the required parameter containers together with the pa...
CbmTrdUnpackAlgoR()
Create the Cbm Trd Unpack AlgoBase object.
int16_t extractSample(size_t *adcbuffer, size_t *nadcbits)
Extract all adc samples from a given adcbuffer container.
Spadic::MsMessageType getMessageType(const uint32_t frame)
Identify the message type of a given 32bit frame inside a Microslice.
void finishDerived()
Additional explicit finish function of this algo implementation.
bool unpackRaw(const fles::MicrosliceDescriptor msdesc, const size_t *mscontent)
Spadic::MsInfoType digestBufInfoFlags(const uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId)
Digest the aditional flags stored in the 4 "cccc" bits of the EPO messages.
bool setDerivedTsParameters(size_t)
Up to now we do not need this function for this algorithm.
std::float_t extractAvgSample(size_t *adcbuffer, size_t *nadcbits)
Extract the baseline average sample from a given adcbuffer. Depending on the Spadic settings sample-0...
bool unpackFex(const fles::MicrosliceDescriptor msdesc, const size_t *mscontent)
size_t fNrNonMajorTsMsb
Counter for the ts_msb used to reconstruct the time.
uint8_t getTsMsb(const uint32_t frame)
Get the ts_msb information from the TS_MSB(kEPO) frame. We take the first of the 3 The 3 redundant TS...
virtual ~CbmTrdUnpackAlgoR()
Destroy the Cbm Trd Unpack Task object.
bool unpack(const fles::Timeslice *ts, uint16_t icomp, UInt_t imslice)
Unpack a given microslice.
Spadic::MsInfoType getInfoType(const uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId)
Identify the InfoType of a 64bit InfoMessage word inside a Microslice.
CbmTrdUnpackAlgoR & operator=(const CbmTrdUnpackAlgoR &)=delete
Assignment operator - not implemented.
virtual CbmTrdRawMessageSpadic makeRaw(const uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId, uint8_t istream)
Create a CbmTrdRawMessageSpadic from the hit message input.
size_t fMsStartTimeRelCC
Start time of the current micro-Slice relative to the Timeslice start time in Spadic CC.
void digestMsFlags(const uint16_t flags, uint16_t criId, uint8_t crobId)
Digest the flags of the currently unpacked micro-Slice.
size_t fNrElinkMis
Number of SOM to RDA/EOM mismatches.
void digestInfoMsg(const uint32_t frame, uint16_t criId, uint8_t crobId, uint16_t elinkId)
Digest a info message run all default information forwarding from the msg.
size_t fMsStartTimeRel
Start time of the current micro-Slice relative to the Timeslice start time in ns.