ATLAS Offline Software
Loading...
Searching...
No Matches
TileDQstatus.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
4*/
5/*
6 */
14
15
16#ifndef TILEEVENT_TILEDQSTATUS_H
17#define TILEEVENT_TILEDQSTATUS_H
18
19
21#include <vector>
22
23
27class MsgStream;
28
29
30
31* @class TileDQstatus
32* @brief Class that holds Data Quality fragment information and provides functions to extract the data quality status for channels
33* Checks for the following types of errors stored in the Data Quality fragment:
34* - Global CRC
35* - ROD CRC
36* - Front End CRC
37* - BCID Mismatch
38* - Header Format
39* - Header Parity
40* - Sample Format
41* - Sample Parity
42* - Single Strobe
43* - Double Strobe
44*
45* Also holds a few other pieces of information, such as trigger type,
46* calibration mode, and CIS parameters.
47*/
49{
50 friend class TileDQstatusTool;
51
52public:
53
56
58 inline bool isFilled () const { return m_isFilled; }
60 inline bool isBiGain () const { return m_isBiGain; }
62 inline bool nonZeroCounter () const { return m_counter; }
65 bool isAdcDQgood (int partition, int drawer, int ch, int gain) const;
67 bool isChanDQgood (int partition, int drawer, int ch) const;
69 static int isChEmpty (int partition, int drawer, int ch);
71 inline int checkEmptyEvent(int partition, int drawer, int dmu) const {
72 return (m_EmptyEventArray[partition][drawer][dmu][0]+((m_EmptyEventArray[partition][drawer][dmu][1]) << 1));
73 }
74
76 inline int checkGlobalErr(int partition, int drawer, int gain) const {
77 return m_GlobalCRCErrArray[partition][drawer][gain];
78 }
79
80 inline int checkGlobalCRCErr(int partition, int drawer, int gain) const {
81 return m_GlobalCRCErrArray[partition][drawer][gain] & 1;
82 }
83
84 inline int checkROD_CRCErr(int partition, int drawer, int dmu, int gain) const {
85 return (1 - ((m_ROD_DMUmaskArray[partition][drawer][gain] >> dmu) & 1));
86 }
87
88 inline int checkFE_CRCErr(int partition, int drawer, int dmu, int gain) const {
89 return (1 - ((m_FE_DMUmaskArray[partition][drawer][gain] >> dmu) & 1));
90 }
91
100 inline int checkBCIDErr(int partition, int drawer, int dmu, int gain) const {
101 return ((m_BCIDErrArray[partition][drawer][gain] & 0x2) && m_checkDigi)
102 ? this->checkBCIDErrDetail(partition,drawer,dmu,gain) :
103 ((m_BCIDErrArray[partition][drawer][gain] >> dmu) & 1);
104 }
105
109 inline int checkBCIDErrDetail(int partition, int drawer, int dmu, int gain) const {
110 return (m_BCIDErrArrayDetail[partition][drawer][gain] >> dmu) & 1;
111 }
112
113 inline int checkHeaderFormatErr(int partition, int drawer, int dmu, int gain) const {
114 return (m_HeaderFormatErrArray[partition][drawer][gain] >> dmu) & 1;
115 }
116
117 inline int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const {
118 return (m_HeaderParityErrArray[partition][drawer][gain] >> dmu) & 1;
119 }
120
121 inline int checkSampleFormatErr(int partition, int drawer, int dmu, int gain) const {
122 return (m_SampleFormatErrArray[partition][drawer][gain] >> dmu) & 1;
123 }
124
125 inline int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const {
126 return (m_SampleParityErrArray[partition][drawer][gain] >> dmu) & 1;
127 }
128
129 inline int checkMemoryParityErr(int partition, int drawer, int dmu, int gain) const {
130 return (m_MemoryParityErrArray[partition][drawer][gain] >> dmu) & 1;
131 }
132
133 inline int checkSingleStrobeErr(int partition, int drawer, int dmu, int gain) const {
134 return (m_SingleStrobeErrArray[partition][drawer][gain] >> dmu) & 1;
135 }
136
137 inline int checkDoubleStrobeErr(int partition, int drawer, int dmu, int gain) const {
138 return (m_DoubleStrobeErrArray[partition][drawer][gain] >> dmu) & 1;
139 }
140
142
144 bool incompleteDigits() const { return m_incompleteDigits;}
145 void setIncompleteDigits (bool incomplete);
146
148 uint32_t calibMode() const { return m_calibMode; }
149 void setCalibMode (uint32_t calibMode);
150
152 const uint32_t* cispar() const { return m_cispar; }
153 uint32_t* cispar();
154
156 int trigType() const { return m_trigType; }
157 void setTrigType (int trigType);
158
159 uint32_t RODBCID() const {return m_BCID;}
160
161
162protected:
163
165 void setFilled(bool filled) {m_isFilled=filled;}
167 void setBiGain(bool biGain) {m_isBiGain=biGain;}
169 void setAllGood();
171 void setRODBCID(uint32_t BCID) {m_BCID=BCID;}
173 inline void setEmptyEvent(int partition, int drawer, int dmu, int gain, int isEmpty) {
174 m_EmptyEventArray[partition][drawer][dmu][gain]=isEmpty;
175 m_counter+=isEmpty;
176 }
177
178 void fillArrays(const TileRawChannelCollection * coll,
179 const TileDigitsContainer* digitsCnt, int gain, unsigned short fragBCID);
180 void fillBCIDErrDetail(const TileDigitsContainer* digitsCnt,
181 int frag, int gain);
182 void fillTrips(unsigned int partition, const std::vector<float>& trips, double* rndmVec,
183 MsgStream& msg);
184
185 private:
193 uint32_t m_BCID;
197 short m_EmptyEventArray [5][64][16][2];
199 short m_GlobalCRCErrArray [5][64][2];
201 short m_FE_DMUmaskArray [5][64][2];
203 short m_ROD_DMUmaskArray [5][64][2];
205 short m_BCIDErrArray [5][64][2];
207 short m_BCIDErrArrayDetail [5][64][2];
209 short m_HeaderFormatErrArray[5][64][2];
211 short m_HeaderParityErrArray[5][64][2];
213 short m_SampleFormatErrArray[5][64][2];
215 short m_SampleParityErrArray[5][64][2];
217 short m_MemoryParityErrArray[5][64][2];
219 short m_SingleStrobeErrArray[5][64][2];
221 short m_DoubleStrobeErrArray[5][64][2];
222
225
227 uint32_t m_calibMode;
228
230 uint32_t m_cispar[110];
231
234
235 static const int s_ch2dmuLB[48];
236 static const int s_ch2dmuEB[48];
237 static const int s_ch2dmuEBspecial[48];
238};
239
240
241// if PMT does not exist, returns 1
242// if DMU does not exist, returns 2
243__attribute__((always_inline)) inline
244int TileDQstatus::isChEmpty(int partition, int drawer, int ch) {
245
246 switch (partition) {
247 case 1:
248 return s_ch2dmuLB[ch];
249 case 2:
250 return s_ch2dmuLB[ch];
251 case 3:
252 return (drawer != 14) ? s_ch2dmuEB[ch] : s_ch2dmuEBspecial[ch];
253 case 4:
254 return (drawer != 17) ? s_ch2dmuEB[ch] : s_ch2dmuEBspecial[ch];
255 default:
256 return 0;
257 }
258}
259
260
261CLASS_DEF (TileDQstatus, 221767675, 0)
262
263
264#endif // not TILEEVENT_TILEDQSTATUS_H
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
__attribute__((always_inline)) inline int TileDQstatus
Class that holds Data Quality fragment information and provides functions to extract the data quality...
short m_BCIDErrArrayDetail[5][64][2]
Array of bit masks storing BCID errors for all DMUs (from comparison with Digits)
short m_EmptyEventArray[5][64][16][2]
Array storing whether event is empty.
void fillArrays(const TileRawChannelCollection *coll, const TileDigitsContainer *digitsCnt, int gain, unsigned short fragBCID)
parses DQ fragments and fill error arrays for event
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
bool m_incompleteDigits
True if not all digits are available.
uint32_t m_cispar[110]
CIS parameters.
short m_BCIDErrArray[5][64][2]
Array of bit masks storing BCID errors for all DMUs (from comparison with DMU1)
short m_SampleFormatErrArray[5][64][2]
Array of bit masks storing Sample Format errors for all DMUs.
int checkHeaderFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word format error
bool nonZeroCounter() const
returns True if there are any errors in event
void setCalibMode(uint32_t calibMode)
bool isChanDQgood(int partition, int drawer, int ch) const
returns status of single channel (if bigain, returns AND of ADCs' status
uint32_t m_BCID
Event bunch crossing identification.
short m_HeaderParityErrArray[5][64][2]
Array of bit masks storing Header Parity errors for all DMUs.
int checkBCIDErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has BCID mismatch between DMU and ROD Since BCID errors in the DQ fragment are det...
void setFilled(bool filled)
sets flag that DQ status instance has been filled for this event
int checkGlobalErr(int partition, int drawer, int gain) const
returns 1 if adc channel has any global error
int checkDoubleStrobeErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has double strobe error
void setBiGain(bool biGain)
sets flag of gain mode of run
short m_MemoryParityErrArray[5][64][2]
Array of bit masks storing Memory Parity errors for all DMUs.
short m_HeaderFormatErrArray[5][64][2]
Array of bit masks storing Header Format errors for all DMUs.
short m_FE_DMUmaskArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.
bool m_isBiGain
Boolean storing gain mode of run.
int trigType() const
Trigger type.
void fillTrips(unsigned int partition, const std::vector< float > &trips, double *rndmVec, MsgStream &msg)
bool m_isFilled
Boolean storing if DQ fragment has been parsed already.
int checkGlobalCRCErr(int partition, int drawer, int gain) const
returns 1 if adc channel has global CRC error
uint32_t RODBCID() const
short m_ROD_DMUmaskArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.
int checkSampleFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word format error
static const int s_ch2dmuEB[48]
int checkBCIDErrDetail(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has BCID mismatch between DMU and ROD This method accesses the TileDigitsContainer i...
int checkSingleStrobeErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has single strobe error
TileDQstatus()
Default constructor.
bool m_checkDigi
Boolean flag to control TileDigitsContainer access.
int checkROD_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in ROD
friend class TileDQstatusTool
uint32_t calibMode() const
Calibration mode.
void setRODBCID(uint32_t BCID)
sets the ROD BCID stored and used in DQStatus
static const int s_ch2dmuLB[48]
int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word parity error
bool incompleteDigits() const
A few extra items (from TileBeamInfoProvider).
int checkEmptyEvent(int partition, int drawer, int dmu) const
returns 0 if event is ok, 1 if empty LG event, 2 if empty HG event, 3 if empty event in both gains
short m_SingleStrobeErrArray[5][64][2]
Array of bit masks storing Single Strobe errors for all DMUs.
void setIncompleteDigits(bool incomplete)
int m_counter
Counter of non-zero elements in all error arrays.
bool isFilled() const
returns whether TileDQStatus has been filled with data from TileDQ fragment
short m_SampleParityErrArray[5][64][2]
Array of bit masks storing Sample Parity errors for all DMUs.
short m_GlobalCRCErrArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.
void setTrigType(int trigType)
uint32_t m_calibMode
Calibration mode.
int m_trigType
Trigger type.
short m_DoubleStrobeErrArray[5][64][2]
Array of bit masks storing Double Strobe errors for all DMUs.
static int isChEmpty(int partition, int drawer, int ch)
True if channel is not fully implemented.
void setEmptyEvent(int partition, int drawer, int dmu, int gain, int isEmpty)
sets flag that DMU sent an empty event (0xFFFFFFFF)
const uint32_t * cispar() const
CIS parameters.
int checkFE_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in FE electronics
int checkMemoryParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has memory parity error
void fillBCIDErrDetail(const TileDigitsContainer *digitsCnt, int frag, int gain)
bool isBiGain() const
returns gain mode of run
void setAllGood()
mark all channels/ADC's as DQ good
static const int s_ch2dmuEBspecial[48]
int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word parity error
MsgStream & msg
Definition testRead.cxx:32