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
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, std::uint32_t runId);
67
68
69 protected:
78 Spadic::MsInfoType digestBufInfoFlags(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId,
79 std::uint16_t elinkId);
80
88 void digestInfoMsg(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, std::uint16_t elinkId);
89
96 void digestMsFlags(const std::uint16_t flags, std::uint16_t criId, std::uint8_t crobId);
97
107 std::int16_t extractSample(size_t* adcbuffer, size_t* nadcbits);
108
118 std::float_t extractAvgSample(size_t* adcbuffer, size_t* nadcbits);
119
121 void finishDerived();
122
124 Spadic::MsInfoType getInfoType(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId,
125 std::uint16_t elinkId);
126
128 Spadic::MsMessageType getMessageType(const std::uint32_t frame);
129
136 std::uint8_t getTsMsb(const std::uint32_t frame);
137
149 virtual CbmTrdRawMessageSpadic makeRaw(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId,
150 std::uint16_t elinkId, std::uint8_t istream);
151
158
166 void makeDigi(Spadic::FexWord<0x10> fw, std::uint32_t criid);
167
169 bool setDerivedTsParameters(size_t /*itimeslice*/) { return true; }
170
182 bool unpack(const fles::Timeslice* ts, std::uint16_t icomp, UInt_t imslice);
183
184 bool unpackRaw(const fles::MicrosliceDescriptor msdesc, const size_t* mscontent);
185
186 template<std::uint8_t sys_ver>
187 bool unpackFex(const fles::MicrosliceDescriptor msdesc, const size_t* mscontent);
188
189 // Parameter storage members
190
192 std::vector<std::uint8_t> fNrTsMsbVec = {};
193
196
198 size_t fNrElinkMis = 0;
199
201 size_t fNrCorruptEom = 0;
202
204 size_t fMsStartTimeRel = 0;
205
208
209 // Constants
211 static const std::uint8_t fBytesPerWord = 8;
214 static const std::uint8_t fStreamsPerWord = 2;
215
216
217 private:
218 ClassDef(CbmTrdUnpackAlgoR, 2)
219};
220
221#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...
size_t fNrCorruptEom
Number of corrupted EOM frames.
CbmTrdUnpackAlgoR(const CbmTrdUnpackAlgoR &)=delete
Copy constructor - not implemented.
static const std::uint8_t fStreamsPerWord
Number of streams per word For the msg format used from 2021 ongoing we have 2 parallel streams per w...
virtual CbmTrdRawMessageSpadic makeRaw(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, std::uint16_t elinkId, std::uint8_t istream)
Create a CbmTrdRawMessageSpadic from the hit message input.
void makeDigi(CbmTrdRawMessageSpadic raw)
Create an actual digi from the raw message.
CbmTrdUnpackAlgoR()
Create the Cbm Trd Unpack AlgoBase object.
Spadic::MsMessageType getMessageType(const std::uint32_t frame)
Identify the message type of a given 32bit frame inside a Microslice.
std::int16_t extractSample(size_t *adcbuffer, size_t *nadcbits)
Extract all adc samples from a given adcbuffer container.
std::uint8_t getTsMsb(const std::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...
void finishDerived()
Additional explicit finish function of this algo implementation.
bool unpackRaw(const fles::MicrosliceDescriptor msdesc, const size_t *mscontent)
bool setDerivedTsParameters(size_t)
Up to now we do not need this function for this algorithm.
Spadic::MsInfoType digestBufInfoFlags(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, std::uint16_t elinkId)
Digest the aditional flags stored in the 4 "cccc" bits of the EPO messages.
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...
virtual std::vector< std::pair< std::string, std::shared_ptr< FairParGenericSet > > > * GetParContainerRequest(std::string geoTag, std::uint32_t runId)
Get the requested parameter containers. Return the required parameter containers together with the pa...
bool unpackFex(const fles::MicrosliceDescriptor msdesc, const size_t *mscontent)
std::vector< std::uint8_t > fNrTsMsbVec
Counter for the ts_msb used to reconstruct the time.
size_t fNrNonMajorTsMsb
Counter for the ts_msb used to reconstruct the time.
void digestInfoMsg(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, std::uint16_t elinkId)
Digest a info message run all default information forwarding from the msg.
void digestMsFlags(const std::uint16_t flags, std::uint16_t criId, std::uint8_t crobId)
Digest the flags of the currently unpacked µSlice.
virtual ~CbmTrdUnpackAlgoR()
Destroy the Cbm Trd Unpack Task object.
static const std::uint8_t fBytesPerWord
Bytes per spadic frame stored in the microslices.
Spadic::MsInfoType getInfoType(const std::uint32_t frame, std::uint16_t criId, std::uint8_t crobId, std::uint16_t elinkId)
Identify the InfoType of a 64bit InfoMessage word inside a Microslice.
CbmTrdUnpackAlgoR & operator=(const CbmTrdUnpackAlgoR &)=delete
Assignment operator - not implemented.
size_t fMsStartTimeRelCC
Start time of the current µSlice relative to the Timeslice start time in Spadic CC.
bool unpack(const fles::Timeslice *ts, std::uint16_t icomp, UInt_t imslice)
Unpack a given microslice.
size_t fNrElinkMis
Number of SOM to RDA/EOM mismatches.
size_t fMsStartTimeRel
Start time of the current µSlice relative to the Timeslice start time in ns.