ATLAS Offline Software
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  */
16 #ifndef TILEEVENT_TILEDQSTATUS_H
17 #define TILEEVENT_TILEDQSTATUS_H
18 
19 
20 #include "AthenaKernel/CLASS_DEF.h"
21 #include <vector>
22 
23 
24 class TileDQstatusTool;
27 class MsgStream;
28 
29 
49 {
50  friend class TileDQstatusTool;
51 
52 public:
53 
55  TileDQstatus();
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 {
78  }
80  inline int checkGlobalCRCErr(int partition, int drawer, int gain) const {
82  }
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  }
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  }
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  }
109  inline int checkBCIDErrDetail(int partition, int drawer, int dmu, int gain) const {
110  return (m_BCIDErrArrayDetail[partition][drawer][gain] >> dmu) & 1;
111  }
113  inline int checkHeaderFormatErr(int partition, int drawer, int dmu, int gain) const {
114  return (m_HeaderFormatErrArray[partition][drawer][gain] >> dmu) & 1;
115  }
117  inline int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const {
118  return (m_HeaderParityErrArray[partition][drawer][gain] >> dmu) & 1;
119  }
121  inline int checkSampleFormatErr(int partition, int drawer, int dmu, int gain) const {
122  return (m_SampleFormatErrArray[partition][drawer][gain] >> dmu) & 1;
123  }
125  inline int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const {
126  return (m_SampleParityErrArray[partition][drawer][gain] >> dmu) & 1;
127  }
129  inline int checkMemoryParityErr(int partition, int drawer, int dmu, int gain) const {
130  return (m_MemoryParityErrArray[partition][drawer][gain] >> dmu) & 1;
131  }
133  inline int checkSingleStrobeErr(int partition, int drawer, int dmu, int gain) const {
134  return (m_SingleStrobeErrArray[partition][drawer][gain] >> dmu) & 1;
135  }
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; }
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 
162 protected:
163 
167  void setBiGain(bool biGain) {m_isBiGain=biGain;}
169  void setAllGood();
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  }
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:
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 
228 
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
244 int 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 
261 CLASS_DEF (TileDQstatus, 221767675, 0)
262 
263 
264 #endif // not TILEEVENT_TILEDQSTATUS_H
TileDQstatus::m_isFilled
bool m_isFilled
Boolean storing if DQ fragment has been parsed already.
Definition: TileDQstatus.h:187
TileDQstatus::setTrigType
void setTrigType(int trigType)
Definition: TileDQstatus.cxx:327
TileDQstatus::m_GlobalCRCErrArray
short m_GlobalCRCErrArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.
Definition: TileDQstatus.h:199
TileDQstatus::fillArrays
void fillArrays(const TileRawChannelCollection *coll, const TileDigitsContainer *digitsCnt, int gain, unsigned short fragBCID)
parses DQ fragments and fill error arrays for event
Definition: TileDQstatus.cxx:72
TileDQstatus::m_BCIDErrArrayDetail
short m_BCIDErrArrayDetail[5][64][2]
Array of bit masks storing BCID errors for all DMUs (from comparison with Digits)
Definition: TileDQstatus.h:207
TileDQstatus::checkBCIDErr
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...
Definition: TileDQstatus.h:100
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
Merge_LAr_blobs.filled
list filled
Definition: Merge_LAr_blobs.py:43
TileDQstatusTool
Definition: TileDQstatusTool.h:30
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TileDQstatus::isChanDQgood
bool isChanDQgood(int partition, int drawer, int ch) const
returns status of single channel (if bigain, returns AND of ADCs' status
Definition: TileDQstatus.cxx:240
TileDQstatus::setBiGain
void setBiGain(bool biGain)
sets flag of gain mode of run
Definition: TileDQstatus.h:167
TileDQstatus::checkBCIDErrDetail
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...
Definition: TileDQstatus.h:109
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
TileDQstatus::calibMode
uint32_t calibMode() const
Calibration mode.
Definition: TileDQstatus.h:148
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
TileDQstatus::setFilled
void setFilled(bool filled)
sets flag that DQ status instance has been filled for this event
Definition: TileDQstatus.h:165
TileDQstatus::isFilled
bool isFilled() const
returns whether TileDQStatus has been filled with data from TileDQ fragment
Definition: TileDQstatus.h:58
TileDQstatus::isBiGain
bool isBiGain() const
returns gain mode of run
Definition: TileDQstatus.h:60
TileDQstatus::TileDQstatus
TileDQstatus()
Default constructor.
Definition: TileDQstatus.cxx:37
TileDQstatus::m_SampleParityErrArray
short m_SampleParityErrArray[5][64][2]
Array of bit masks storing Sample Parity errors for all DMUs.
Definition: TileDQstatus.h:215
TileDQstatus::m_trigType
int m_trigType
Trigger type.
Definition: TileDQstatus.h:233
TileDQstatus::m_FE_DMUmaskArray
short m_FE_DMUmaskArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.
Definition: TileDQstatus.h:201
TileDigitsContainer
Definition: TileDigitsContainer.h:13
TileDQstatus::s_ch2dmuEB
static const int s_ch2dmuEB[48]
Definition: TileDQstatus.h:236
TileDQstatus::m_HeaderFormatErrArray
short m_HeaderFormatErrArray[5][64][2]
Array of bit masks storing Header Format errors for all DMUs.
Definition: TileDQstatus.h:209
TileDQstatus::m_MemoryParityErrArray
short m_MemoryParityErrArray[5][64][2]
Array of bit masks storing Memory Parity errors for all DMUs.
Definition: TileDQstatus.h:217
TileDQstatus::isChEmpty
static int isChEmpty(int partition, int drawer, int ch)
True if channel is not fully implemented.
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileDQstatus::m_calibMode
uint32_t m_calibMode
Calibration mode.
Definition: TileDQstatus.h:227
TileDQstatus::checkGlobalCRCErr
int checkGlobalCRCErr(int partition, int drawer, int gain) const
returns 1 if adc channel has global CRC error
Definition: TileDQstatus.h:80
TileDQstatus::m_HeaderParityErrArray
short m_HeaderParityErrArray[5][64][2]
Array of bit masks storing Header Parity errors for all DMUs.
Definition: TileDQstatus.h:211
TileDQstatus::setRODBCID
void setRODBCID(uint32_t BCID)
sets the ROD BCID stored and used in DQStatus
Definition: TileDQstatus.h:171
__attribute__
__attribute__((always_inline)) inline int TileDQstatus
Definition: TileDQstatus.h:243
TileDQstatus::checkROD_CRCErr
int checkROD_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in ROD
Definition: TileDQstatus.h:84
PixelByteStreamErrors::BCID
@ BCID
Definition: PixelByteStreamErrors.h:13
TileDQstatus::trigType
int trigType() const
Trigger type.
Definition: TileDQstatus.h:156
TileDQstatus::m_isBiGain
bool m_isBiGain
Boolean storing gain mode of run.
Definition: TileDQstatus.h:189
TileDQstatus::incompleteDigits
bool incompleteDigits() const
A few extra items (from TileBeamInfoProvider).
Definition: TileDQstatus.h:144
TileDQstatus::RODBCID
uint32_t RODBCID() const
Definition: TileDQstatus.h:159
TileDQstatus
Class that holds Data Quality fragment information and provides functions to extract the data quality...
Definition: TileDQstatus.h:49
TileDQstatus::fillBCIDErrDetail
void fillBCIDErrDetail(const TileDigitsContainer *digitsCnt, int frag, int gain)
Definition: TileDQstatus.cxx:249
TileDQstatus::s_ch2dmuLB
static const int s_ch2dmuLB[48]
Definition: TileDQstatus.h:235
TileDQstatus::m_EmptyEventArray
short m_EmptyEventArray[5][64][16][2]
Array storing whether event is empty.
Definition: TileDQstatus.h:197
TileDQstatus::m_incompleteDigits
bool m_incompleteDigits
True if not all digits are available.
Definition: TileDQstatus.h:224
TileDQstatus::m_checkDigi
bool m_checkDigi
Boolean flag to control TileDigitsContainer access
Definition: TileDQstatus.h:191
TileDQstatus::nonZeroCounter
bool nonZeroCounter() const
returns True if there are any errors in event
Definition: TileDQstatus.h:62
TileDQstatus::m_BCID
uint32_t m_BCID
Event bunch crossing identification.
Definition: TileDQstatus.h:193
TileDQstatus::checkHeaderFormatErr
int checkHeaderFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word format error
Definition: TileDQstatus.h:113
TileDQstatus::m_counter
int m_counter
Counter of non-zero elements in all error arrays.
Definition: TileDQstatus.h:195
TileDQstatus::isAdcDQgood
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
Definition: TileDQstatus.cxx:178
TileDQstatus::m_cispar
uint32_t m_cispar[110]
CIS parameters.
Definition: TileDQstatus.h:230
TileDQstatus::m_BCIDErrArray
short m_BCIDErrArray[5][64][2]
Array of bit masks storing BCID errors for all DMUs (from comparison with DMU1)
Definition: TileDQstatus.h:205
Muon::nsw::incomplete
@ incomplete
Definition: NSWTriggerElink.h:37
TileDQstatus::checkGlobalErr
int checkGlobalErr(int partition, int drawer, int gain) const
returns 1 if adc channel has any global error
Definition: TileDQstatus.h:76
TileDQstatus::setEmptyEvent
void setEmptyEvent(int partition, int drawer, int dmu, int gain, int isEmpty)
sets flag that DMU sent an empty event (0xFFFFFFFF)
Definition: TileDQstatus.h:173
TileDQstatus::checkSampleParityErr
int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word parity error
Definition: TileDQstatus.h:125
TileRawChannelCollection
Definition: TileRawChannelCollection.h:12
TileDQstatus::checkHeaderParityErr
int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word parity error
Definition: TileDQstatus.h:117
TileDQstatus::checkSampleFormatErr
int checkSampleFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word format error
Definition: TileDQstatus.h:121
TileDQstatus::cispar
const uint32_t * cispar() const
CIS parameters.
Definition: TileDQstatus.h:152
TileDQstatus::setAllGood
void setAllGood()
mark all channels/ADC's as DQ good
Definition: TileDQstatus.cxx:49
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
StateLessPT_NewConfig.partition
partition
Definition: StateLessPT_NewConfig.py:49
TileDQstatus::m_DoubleStrobeErrArray
short m_DoubleStrobeErrArray[5][64][2]
Array of bit masks storing Double Strobe errors for all DMUs.
Definition: TileDQstatus.h:221
TileDQstatus::fillTrips
void fillTrips(unsigned int partition, const std::vector< float > &trips, double *rndmVec, MsgStream &msg)
Definition: TileDQstatus.cxx:291
TileDQstatus::s_ch2dmuEBspecial
static const int s_ch2dmuEBspecial[48]
Definition: TileDQstatus.h:237
TileDQstatus::setIncompleteDigits
void setIncompleteDigits(bool incomplete)
Definition: TileDQstatus.cxx:309
TileDQstatus::checkSingleStrobeErr
int checkSingleStrobeErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has single strobe error
Definition: TileDQstatus.h:133
TileDQstatus::checkEmptyEvent
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
Definition: TileDQstatus.h:71
TileDQstatus::m_ROD_DMUmaskArray
short m_ROD_DMUmaskArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.
Definition: TileDQstatus.h:203
TileDQstatus::checkDoubleStrobeErr
int checkDoubleStrobeErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has double strobe error
Definition: TileDQstatus.h:137
TileDQstatus::checkMemoryParityErr
int checkMemoryParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has memory parity error
Definition: TileDQstatus.h:129
TileDQstatus::checkFE_CRCErr
int checkFE_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in FE electronics
Definition: TileDQstatus.h:88
TileDQstatus::m_SingleStrobeErrArray
short m_SingleStrobeErrArray[5][64][2]
Array of bit masks storing Single Strobe errors for all DMUs.
Definition: TileDQstatus.h:219
CLASS_DEF.h
macros to associate a CLID to a type
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TileDQstatus::m_SampleFormatErrArray
short m_SampleFormatErrArray[5][64][2]
Array of bit masks storing Sample Format errors for all DMUs.
Definition: TileDQstatus.h:213
TileDQstatus::setCalibMode
void setCalibMode(uint32_t calibMode)
Definition: TileDQstatus.cxx:315