Project
Loading...
Searching...
No Matches
RawDataDecoder.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#ifndef ALICEO2_CTP_RAWDATADECODER_H_
17#define ALICEO2_CTP_RAWDATADECODER_H_
18
19#include <vector>
20#include <map>
21#include <deque>
26
27namespace o2
28{
29namespace ctp
30{
32{
33 public:
34 RawDataDecoder() = default;
35 ~RawDataDecoder() = default;
36 static void makeGBTWordInverse(std::vector<gbtword80_t>& diglets, gbtword80_t& GBTWord, gbtword80_t& remnant, uint32_t& size_gbt, uint32_t Npld);
37 int addCTPDigit(uint32_t linkCRU, uint32_t triggerOrbit, gbtword80_t& diglet, gbtword80_t& pldmask, std::map<o2::InteractionRecord, CTPDigit>& digits);
38 int decodeRaw(o2::framework::InputRecord& inputs, std::vector<o2::framework::InputSpec>& filter, o2::pmr::vector<CTPDigit>& digits, std::vector<LumiInfo>& lumiPointsHBF1);
39 int decodeRawFatal(o2::framework::InputRecord& inputs, std::vector<o2::framework::InputSpec>& filter);
40 int decodeRaw(o2::framework::InputRecord& inputs, std::vector<o2::framework::InputSpec>& filter, std::vector<CTPDigit>& digits, std::vector<LumiInfo>& lumiPointsHBF1);
41 void setDecodeInps(bool decodeinps) { mDecodeInps = decodeinps; }
42 void setDoLumi(bool lumi) { mDoLumi = lumi; }
43 void setDoDigits(bool digi) { mDoDigits = digi; }
44 void setVerbose(bool v) { mVerbose = v; }
45 void setMAXErrors(int m) { mErrorMax = m; }
46 int setLumiInp(int lumiinp, std::string inp);
47 void setCTPConfig(CTPConfiguration cfg) { mCTPConfig = std::move(cfg); };
48 void setCheckConsistency(bool check) { mCheckConsistency = check; }
49 uint32_t getIRRejected() const { return mIRRejected; }
50 uint32_t getTCRRejected() const { return mTCRRejected; }
51 std::vector<uint32_t>& getTFOrbits() { return mTFOrbits; }
52 int getErrorIR() { return mErrorIR; }
53 int getErrorTCR() { return mErrorTCR; }
54 CTPConfiguration& getCTPConfig() { return mCTPConfig; }
55 int init();
56 static int shiftNew(const o2::InteractionRecord& irin, uint32_t TFOrbit, std::bitset<48>& inpmask, int64_t shift, int level, std::map<o2::InteractionRecord, CTPDigit>& digmap);
57 static int shiftInputs(std::map<o2::InteractionRecord, CTPDigit>& digitsMap, o2::pmr::vector<CTPDigit>& digits, uint32_t TFOrbit, uint64_t trgclassmask = 0xffffffffffffffff);
58 int checkReadoutConsistentncy(o2::pmr::vector<CTPDigit>& digits, uint64_t trgclassmask = 0xffffffffffffffff);
59
60 private:
61 static constexpr uint32_t TF_TRIGGERTYPE_MASK = 0x800;
62 static constexpr uint32_t HB_TRIGGERTYPE_MASK = 0x2;
63 // true: full inps decoding includine latency shifts here; false: latency shifts in CTF decoder
64 bool mDecodeInps = false;
65 bool mCheckConsistency = false;
66 // for digits
67 bool mDoDigits = true;
68 std::vector<CTPDigit> mOutputDigits;
69 // for lumi
70 bool mDoLumi = true;
71 //
72 static constexpr std::bitset<o2::ctp::CTP_NINPUTS> LMMASKInputs = 0xfff;
73 static constexpr std::bitset<o2::ctp::CTP_NINPUTS> L0MASKInputs = 0xfff000;
74 static constexpr std::bitset<o2::ctp::CTP_NINPUTS> L1MASKInputs = (0xffffffull << 24);
75 gbtword80_t mTVXMask = 0x4; // TVX is 3rd input
76 gbtword80_t mVBAMask = 0x20; // VBA is 6 th input
77 bool mVerbose = false;
78 uint32_t mIRRejected = 0;
79 uint32_t mTCRRejected = 0;
80 bool mPadding = true;
81 uint32_t mTFOrbit = 0;
82 std::vector<uint32_t> mTFOrbits;
83 // error verbosness
84 int mErrorIR = 0;
85 int mErrorTCR = 0;
86 int mErrorMax = 3;
87 bool mStickyError = false;
88 CTPConfiguration mCTPConfig;
89};
90} // namespace ctp
91} // namespace o2
92#endif
definition of CTPConfiguration and related CTP structures
definition of CTPDigit, CTPInputDigit
int addCTPDigit(uint32_t linkCRU, uint32_t triggerOrbit, gbtword80_t &diglet, gbtword80_t &pldmask, std::map< o2::InteractionRecord, CTPDigit > &digits)
static int shiftNew(const o2::InteractionRecord &irin, uint32_t TFOrbit, std::bitset< 48 > &inpmask, int64_t shift, int level, std::map< o2::InteractionRecord, CTPDigit > &digmap)
static void makeGBTWordInverse(std::vector< gbtword80_t > &diglets, gbtword80_t &GBTWord, gbtword80_t &remnant, uint32_t &size_gbt, uint32_t Npld)
int checkReadoutConsistentncy(o2::pmr::vector< CTPDigit > &digits, uint64_t trgclassmask=0xffffffffffffffff)
uint32_t getTCRRejected() const
std::vector< uint32_t > & getTFOrbits()
void setCTPConfig(CTPConfiguration cfg)
int setLumiInp(int lumiinp, std::string inp)
void setDoDigits(bool digi)
int decodeRaw(o2::framework::InputRecord &inputs, std::vector< o2::framework::InputSpec > &filter, o2::pmr::vector< CTPDigit > &digits, std::vector< LumiInfo > &lumiPointsHBF1)
CTPConfiguration & getCTPConfig()
static int shiftInputs(std::map< o2::InteractionRecord, CTPDigit > &digitsMap, o2::pmr::vector< CTPDigit > &digits, uint32_t TFOrbit, uint64_t trgclassmask=0xffffffffffffffff)
void setCheckConsistency(bool check)
void setDecodeInps(bool decodeinps)
void setDoLumi(bool lumi)
int decodeRawFatal(o2::framework::InputRecord &inputs, std::vector< o2::framework::InputSpec > &filter)
uint32_t getIRRejected() const
The input API of the Data Processing Layer This class holds the inputs which are valid for processing...
const GLfloat * m
Definition glcorearb.h:4066
const GLdouble * v
Definition glcorearb.h:832
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition glcorearb.h:1308
std::bitset< NGBT > gbtword80_t
Definition Digits.h:36
void check(const std::vector< std::string > &arguments, const std::vector< ConfigParamSpec > &workflowOptions, const std::vector< DeviceSpec > &deviceSpecs, CheckMatrix &matrix)
std::vector< T, o2::pmr::polymorphic_allocator< T > > vector
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LumiInfo lumi
std::vector< Digit > digits