Project
Loading...
Searching...
No Matches
RawDecoder.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#ifndef ALICEO2_CPV_RAWDECODER_H
12#define ALICEO2_CPV_RAWDECODER_H
13
14#include <iosfwd>
15#include <gsl/span>
16#include <string>
17#include <utility>
20class Digits;
21
22namespace o2
23{
24namespace cpv
25{
26
28 RawDecoderError() = default; //Constructors for vector::emplace_back methods
29 RawDecoderError(short c, short d, short g, short p, RawErrorType_t e) : ccId(c), dil(d), gas(g), pad(p), errortype(e) {}
30 RawDecoderError(const RawDecoderError& e) = default;
31 ~RawDecoderError() = default;
32
33 short ccId;
34 short dil;
35 short gas;
36 short pad;
38};
39
41 uint32_t mDataWord;
42 struct {
43 uint32_t Address : 18;
44 uint32_t Charge : 14;
45 };
46};
47
49struct BCRecord {
50 BCRecord() = default;
51 BCRecord(uint16_t bunchCrossing, unsigned int first, unsigned int last) : bc(bunchCrossing), firstDigit(first), lastDigit(last) {}
52 uint16_t bc;
53 unsigned int firstDigit;
54 unsigned int lastDigit;
55};
56
66
68{
69 public:
73
75 ~RawDecoder() = default;
76
86
89 const std::vector<uint32_t>& getDigits() const { return mDigits; };
90
93 const std::vector<o2::cpv::BCRecord>& getBCRecords() const { return mBCRecords; };
94
97 const std::vector<o2::cpv::RawDecoderError>& getErrors() const { return mErrors; }
98
100 void muteErrors() { mIsMuteErrors = true; }
101
102 protected:
105
106 private:
107 bool addDigit(uint32_t padWord, short ddl, uint16_t bc);
108 void removeLastNDigits(int n);
109
110 RawReaderMemory& mRawReader;
111 std::vector<uint32_t> mDigits;
112 std::vector<o2::cpv::BCRecord> mBCRecords;
113 std::vector<RawDecoderError> mErrors;
114 bool mChannelsInitialized;
115 bool mIsMuteErrors;
116
117 ClassDefNV(RawDecoder, 3);
118};
119
120} // namespace cpv
121
122} // namespace o2
123
124#endif
uint64_t bc
Definition RawEventData.h:5
uint32_t c
Definition RawData.h:2
Decoder of the ALTRO data in the raw page.
Definition RawDecoder.h:68
RawErrorType_t readChannels()
Read channels for the current event in the raw buffer.
const std::vector< uint32_t > & getDigits() const
Get the reference to the digits container.
Definition RawDecoder.h:89
const std::vector< o2::cpv::RawDecoderError > & getErrors() const
Get the reference to the list of decoding errors.
Definition RawDecoder.h:97
RawErrorType_t decode()
Decode the raw cpv payload stream.
void muteErrors()
mute error reporting
Definition RawDecoder.h:100
const std::vector< o2::cpv::BCRecord > & getBCRecords() const
Get the reference to the BC records.
Definition RawDecoder.h:93
~RawDecoder()=default
Destructor.
Reader for raw data produced by the Readout application in in-memory format.
GLdouble n
Definition glcorearb.h:1982
GLboolean GLboolean g
Definition glcorearb.h:1233
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
BC reference to digits.
Definition RawDecoder.h:49
BCRecord()=default
unsigned int lastDigit
Definition RawDecoder.h:54
BCRecord(uint16_t bunchCrossing, unsigned int first, unsigned int last)
Definition RawDecoder.h:51
unsigned int firstDigit
Definition RawDecoder.h:53
RawDecoderError(const RawDecoderError &e)=default
RawErrorType_t errortype
Definition RawDecoder.h:37
RawDecoderError(short c, short d, short g, short p, RawErrorType_t e)
Definition RawDecoder.h:29
uint32_t Charge
Bits 18 - 32 : charge.
Definition RawDecoder.h:44
uint32_t Address
Bits 0 - 17 : Address.
Definition RawDecoder.h:43