ATLAS Offline Software
Loading...
Searching...
No Matches
TileDQstatus Class Reference

Class that holds Data Quality fragment information and provides functions to extract the data quality status for channels Checks for the following types of errors stored in the Data Quality fragment: More...

#include <TileDQstatus.h>

Collaboration diagram for TileDQstatus:

Public Member Functions

 TileDQstatus ()
 Default constructor.
bool isFilled () const
 returns whether TileDQStatus has been filled with data from TileDQ fragment
bool isBiGain () const
 returns gain mode of run
bool nonZeroCounter () const
 returns True if there are any errors in 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 isChanDQgood (int partition, int drawer, int ch) const
 returns status of single channel (if bigain, returns AND of ADCs' status
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
int checkGlobalErr (int partition, int drawer, int gain) const
 returns 1 if adc channel has any global error
int checkGlobalCRCErr (int partition, int drawer, int gain) const
 returns 1 if adc channel has global CRC error
int checkROD_CRCErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has CRC error originating in ROD
int checkFE_CRCErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has CRC error originating in FE electronics
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 determined by comparison of each DMU to DMU1, if DMU1 is bad and DMUX is also bad, we must compare the individual DMU's BCID to the actual (ROD) BCID.
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 in order to explicitly check the DMU BCID with the ROD BCID.
int checkHeaderFormatErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has header word format error
int checkHeaderParityErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has header word parity error
int checkSampleFormatErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has data word format error
int checkSampleParityErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has data word parity error
int checkMemoryParityErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has memory parity error
int checkSingleStrobeErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has single strobe error
int checkDoubleStrobeErr (int partition, int drawer, int dmu, int gain) const
 returns 1 if DMU has double strobe error
bool incompleteDigits () const
 A few extra items (from TileBeamInfoProvider).
void setIncompleteDigits (bool incomplete)
uint32_t calibMode () const
 Calibration mode.
void setCalibMode (uint32_t calibMode)
const uint32_t * cispar () const
 CIS parameters.
uint32_t * cispar ()
int trigType () const
 Trigger type.
void setTrigType (int trigType)
uint32_t RODBCID () const

Static Public Member Functions

static int isChEmpty (int partition, int drawer, int ch)
 True if channel is not fully implemented.

Protected Member Functions

void setFilled (bool filled)
 sets flag that DQ status instance has been filled for this event
void setBiGain (bool biGain)
 sets flag of gain mode of run
void setAllGood ()
 mark all channels/ADC's as DQ good
void setRODBCID (uint32_t BCID)
 sets the ROD BCID stored and used in DQStatus
void setEmptyEvent (int partition, int drawer, int dmu, int gain, int isEmpty)
 sets flag that DMU sent an empty event (0xFFFFFFFF)
void fillArrays (const TileRawChannelCollection *coll, const TileDigitsContainer *digitsCnt, int gain, unsigned short fragBCID)
 parses DQ fragments and fill error arrays for event
void fillBCIDErrDetail (const TileDigitsContainer *digitsCnt, int frag, int gain)
void fillTrips (unsigned int partition, const std::vector< float > &trips, double *rndmVec, MsgStream &msg)

Private Attributes

bool m_isFilled
 Boolean storing if DQ fragment has been parsed already.
bool m_isBiGain
 Boolean storing gain mode of run.
bool m_checkDigi
 Boolean flag to control TileDigitsContainer access.
uint32_t m_BCID
 Event bunch crossing identification.
int m_counter
 Counter of non-zero elements in all error arrays.
short m_EmptyEventArray [5][64][16][2]
 Array storing whether event is empty.
short m_GlobalCRCErrArray [5][64][2]
 Array of bit masks storing CRC errors for all DMUs.
short m_FE_DMUmaskArray [5][64][2]
 Array of bit masks storing CRC errors for all DMUs.
short m_ROD_DMUmaskArray [5][64][2]
 Array of bit masks storing CRC errors for all DMUs.
short m_BCIDErrArray [5][64][2]
 Array of bit masks storing BCID errors for all DMUs (from comparison with DMU1)
short m_BCIDErrArrayDetail [5][64][2]
 Array of bit masks storing BCID errors for all DMUs (from comparison with Digits)
short m_HeaderFormatErrArray [5][64][2]
 Array of bit masks storing Header Format errors for all DMUs.
short m_HeaderParityErrArray [5][64][2]
 Array of bit masks storing Header Parity errors for all DMUs.
short m_SampleFormatErrArray [5][64][2]
 Array of bit masks storing Sample Format errors for all DMUs.
short m_SampleParityErrArray [5][64][2]
 Array of bit masks storing Sample Parity errors for all DMUs.
short m_MemoryParityErrArray [5][64][2]
 Array of bit masks storing Memory Parity errors for all DMUs.
short m_SingleStrobeErrArray [5][64][2]
 Array of bit masks storing Single Strobe errors for all DMUs.
short m_DoubleStrobeErrArray [5][64][2]
 Array of bit masks storing Double Strobe errors for all DMUs.
bool m_incompleteDigits
 True if not all digits are available.
uint32_t m_calibMode
 Calibration mode.
uint32_t m_cispar [110]
 CIS parameters.
int m_trigType
 Trigger type.

Static Private Attributes

static const int s_ch2dmuLB [48]
static const int s_ch2dmuEB [48]
static const int s_ch2dmuEBspecial [48]

Friends

class TileDQstatusTool

Detailed Description

Class that holds Data Quality fragment information and provides functions to extract the data quality status for channels Checks for the following types of errors stored in the Data Quality fragment:

  • Global CRC
  • ROD CRC
  • Front End CRC
  • BCID Mismatch
  • Header Format
  • Header Parity
  • Sample Format
  • Sample Parity
  • Single Strobe
  • Double Strobe

Also holds a few other pieces of information, such as trigger type, calibration mode, and CIS parameters.

Definition at line 48 of file TileDQstatus.h.

Constructor & Destructor Documentation

◆ TileDQstatus()

TileDQstatus::TileDQstatus ( )

Default constructor.

Definition at line 37 of file TileDQstatus.cxx.

38 : m_isBiGain(false),
39 m_checkDigi(false),
40 m_BCID(0),
42 m_calibMode(0xFFFFFFFF),
43 m_cispar{0},
44 m_trigType(0)
45{
46 setAllGood();
47}
bool m_incompleteDigits
True if not all digits are available.
uint32_t m_cispar[110]
CIS parameters.
uint32_t m_BCID
Event bunch crossing identification.
bool m_isBiGain
Boolean storing gain mode of run.
bool m_checkDigi
Boolean flag to control TileDigitsContainer access.
uint32_t m_calibMode
Calibration mode.
int m_trigType
Trigger type.
void setAllGood()
mark all channels/ADC's as DQ good

Member Function Documentation

◆ calibMode()

uint32_t TileDQstatus::calibMode ( ) const
inline

Calibration mode.

Definition at line 148 of file TileDQstatus.h.

148{ return m_calibMode; }

◆ checkBCIDErr()

int TileDQstatus::checkBCIDErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has BCID mismatch between DMU and ROD
Since BCID errors in the DQ fragment are determined by comparison of each DMU to DMU1, if DMU1 is bad and DMUX is also bad, we must compare the individual DMU's BCID to the actual (ROD) BCID.

This is due to the fact that DMU1 is checked against the ROD, while the others DMUs are checked against DMU1. This requires access to the digits in the function checkBCIDErrDetail. If this behavior is undesired set m_checkDigi to false in TileBeamInfoProvider. Setting m_checkDigi=false would cause any BCID errors simultaneous with DMU1 to be flagged as BAD (conservative approach)

Definition at line 100 of file TileDQstatus.h.

100 {
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 }
short m_BCIDErrArray[5][64][2]
Array of bit masks storing BCID errors for all DMUs (from comparison with DMU1)
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...

◆ checkBCIDErrDetail()

int TileDQstatus::checkBCIDErrDetail ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has BCID mismatch between DMU and ROD This method accesses the TileDigitsContainer in order to explicitly check the DMU BCID with the ROD BCID.

Definition at line 109 of file TileDQstatus.h.

109 {
110 return (m_BCIDErrArrayDetail[partition][drawer][gain] >> dmu) & 1;
111 }
short m_BCIDErrArrayDetail[5][64][2]
Array of bit masks storing BCID errors for all DMUs (from comparison with Digits)

◆ checkDoubleStrobeErr()

int TileDQstatus::checkDoubleStrobeErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has double strobe error

Definition at line 137 of file TileDQstatus.h.

137 {
138 return (m_DoubleStrobeErrArray[partition][drawer][gain] >> dmu) & 1;
139 }
short m_DoubleStrobeErrArray[5][64][2]
Array of bit masks storing Double Strobe errors for all DMUs.

◆ checkEmptyEvent()

int TileDQstatus::checkEmptyEvent ( int partition,
int drawer,
int dmu ) const
inline

returns 0 if event is ok, 1 if empty LG event, 2 if empty HG event, 3 if empty event in both gains

Definition at line 71 of file TileDQstatus.h.

71 {
72 return (m_EmptyEventArray[partition][drawer][dmu][0]+((m_EmptyEventArray[partition][drawer][dmu][1]) << 1));
73 }
short m_EmptyEventArray[5][64][16][2]
Array storing whether event is empty.

◆ checkFE_CRCErr()

int TileDQstatus::checkFE_CRCErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has CRC error originating in FE electronics

Definition at line 88 of file TileDQstatus.h.

88 {
89 return (1 - ((m_FE_DMUmaskArray[partition][drawer][gain] >> dmu) & 1));
90 }
short m_FE_DMUmaskArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.

◆ checkGlobalCRCErr()

int TileDQstatus::checkGlobalCRCErr ( int partition,
int drawer,
int gain ) const
inline

returns 1 if adc channel has global CRC error

Definition at line 80 of file TileDQstatus.h.

80 {
82 }
short m_GlobalCRCErrArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.

◆ checkGlobalErr()

int TileDQstatus::checkGlobalErr ( int partition,
int drawer,
int gain ) const
inline

returns 1 if adc channel has any global error

Definition at line 76 of file TileDQstatus.h.

76 {
78 }

◆ checkHeaderFormatErr()

int TileDQstatus::checkHeaderFormatErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has header word format error

Definition at line 113 of file TileDQstatus.h.

113 {
114 return (m_HeaderFormatErrArray[partition][drawer][gain] >> dmu) & 1;
115 }
short m_HeaderFormatErrArray[5][64][2]
Array of bit masks storing Header Format errors for all DMUs.

◆ checkHeaderParityErr()

int TileDQstatus::checkHeaderParityErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has header word parity error

Definition at line 117 of file TileDQstatus.h.

117 {
118 return (m_HeaderParityErrArray[partition][drawer][gain] >> dmu) & 1;
119 }
short m_HeaderParityErrArray[5][64][2]
Array of bit masks storing Header Parity errors for all DMUs.

◆ checkMemoryParityErr()

int TileDQstatus::checkMemoryParityErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has memory parity error

Definition at line 129 of file TileDQstatus.h.

129 {
130 return (m_MemoryParityErrArray[partition][drawer][gain] >> dmu) & 1;
131 }
short m_MemoryParityErrArray[5][64][2]
Array of bit masks storing Memory Parity errors for all DMUs.

◆ checkROD_CRCErr()

int TileDQstatus::checkROD_CRCErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has CRC error originating in ROD

Definition at line 84 of file TileDQstatus.h.

84 {
85 return (1 - ((m_ROD_DMUmaskArray[partition][drawer][gain] >> dmu) & 1));
86 }
short m_ROD_DMUmaskArray[5][64][2]
Array of bit masks storing CRC errors for all DMUs.

◆ checkSampleFormatErr()

int TileDQstatus::checkSampleFormatErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has data word format error

Definition at line 121 of file TileDQstatus.h.

121 {
122 return (m_SampleFormatErrArray[partition][drawer][gain] >> dmu) & 1;
123 }
short m_SampleFormatErrArray[5][64][2]
Array of bit masks storing Sample Format errors for all DMUs.

◆ checkSampleParityErr()

int TileDQstatus::checkSampleParityErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has data word parity error

Definition at line 125 of file TileDQstatus.h.

125 {
126 return (m_SampleParityErrArray[partition][drawer][gain] >> dmu) & 1;
127 }
short m_SampleParityErrArray[5][64][2]
Array of bit masks storing Sample Parity errors for all DMUs.

◆ checkSingleStrobeErr()

int TileDQstatus::checkSingleStrobeErr ( int partition,
int drawer,
int dmu,
int gain ) const
inline

returns 1 if DMU has single strobe error

Definition at line 133 of file TileDQstatus.h.

133 {
134 return (m_SingleStrobeErrArray[partition][drawer][gain] >> dmu) & 1;
135 }
short m_SingleStrobeErrArray[5][64][2]
Array of bit masks storing Single Strobe errors for all DMUs.

◆ cispar() [1/2]

uint32_t * TileDQstatus::cispar ( )

Definition at line 321 of file TileDQstatus.cxx.

322{
323 return m_cispar;
324}

◆ cispar() [2/2]

const uint32_t * TileDQstatus::cispar ( ) const
inline

CIS parameters.

Definition at line 152 of file TileDQstatus.h.

152{ return m_cispar; }

◆ fillArrays()

void TileDQstatus::fillArrays ( const TileRawChannelCollection * coll,
const TileDigitsContainer * digitsCnt,
int gain,
unsigned short fragBCID )
protected

parses DQ fragments and fill error arrays for event

Definition at line 72 of file TileDQstatus.cxx.

75{
76 if (digitsCnt) {
77 m_checkDigi = true;
78 }
79
80 int frag = coll->identify();
81 int partition = (frag >> 8); // 0=AUX,1=LBA,2=LBC,3=EBA,4=EBC
82 int drawer = (frag & 0x3F); // 0-63
83 bool eb = (frag > 0x2ff); // true if ext.barrel
84 bool ebsp = (frag == 0x30e || frag == 0x411);// EBA15 or EBC18
85
86 m_isBiGain |= (coll->size() > 48);
87 // attention! it's assignment below, i.e. only single "=", not "=="
88 // LF: ... which is something very dangerous. Does it provide any speed advantage?
89 if ((m_GlobalCRCErrArray[partition][drawer][gain] = coll->getFragGlobalCRC())) ++m_counter;
90 if ((m_BCIDErrArray[partition][drawer][gain] = fragBCID)) ++m_counter;
91 if ((m_MemoryParityErrArray[partition][drawer][gain] = coll->getFragMemoryPar())) ++m_counter;
92 if ((m_SingleStrobeErrArray[partition][drawer][gain] = coll->getFragSstrobe())) ++m_counter;
93 if ((m_DoubleStrobeErrArray[partition][drawer][gain] = coll->getFragDstrobe())) ++m_counter;
94 if ((m_HeaderFormatErrArray[partition][drawer][gain] = coll->getFragHeaderBit())) ++m_counter;
95 if ((m_HeaderParityErrArray[partition][drawer][gain] = coll->getFragHeaderPar())) ++m_counter;
96 if ((m_SampleFormatErrArray[partition][drawer][gain] = coll->getFragSampleBit())) ++m_counter;
97 if ((m_SampleParityErrArray[partition][drawer][gain] = coll->getFragSamplePar())) ++m_counter;
98 if ((m_ROD_DMUmaskArray[partition][drawer][gain] = coll->getFragRODChipMask())) ++m_counter;
99// special treatment of FE DMU mask - take into account that some DMUs in Ext.barrel do not exist
100 if(uint32_t FE_DMUmask = coll->getFragFEChipMask()) {
101 if (eb) { // EBA or EBC
102 if (ebsp) FE_DMUmask <<= 1; // shift by one DMU in EBA15 EBC18
103 FE_DMUmask = (FE_DMUmask & 0xFF) | ((FE_DMUmask & 0xF00) << 2); // shift upper half by two DMUs
104 }
105 m_FE_DMUmaskArray[partition][drawer][gain] = FE_DMUmask;
106 ++m_counter;
107 }
108
109 unsigned short BCIDerr = fragBCID;
110
111 if (BCIDerr & 0x2) { // DMU1 (second DMU) is bad - can not trust others
113 } else {
114 // additional check if DQ frag BCID is the same as event BCID
115 uint32_t DSPBCID = coll->getFragDSPBCID();
116 if (DSPBCID != 0xDEAD && DSPBCID != m_BCID) { // DSP BCID doesn't match! all wrong
117 m_BCIDErrArray[partition][drawer][gain] = -1; // I preferred 0xFFFF; but variable is decleared as signed!
118 ++m_counter;
119 } else {
120 int n_badMB = 0;
121 if (eb) { // do not count non-existing DMUs in EB
122 if (ebsp) {
123 BCIDerr &= 0x3cfe;
124 } else {
125 BCIDerr &= 0x3cff;
126 }
127 }
128 while (BCIDerr) {
129 if (BCIDerr & 0xF)
130 ++n_badMB;
131 BCIDerr >>= 4;
132 }
133 if (n_badMB == 4) { // BCID errors in all 4 motherboards - assume that all DMUs are bad
135#ifdef TILECELL_DEBUG
136 std::cout << "masking whole drawer " << drawer << " in partition " << partition << " because all 4 MB have BCID errors"
137 << std::endl;
138#endif
139 }
140 }
141 }
142
143 if ((m_BCIDErrArray[partition][drawer][gain] & 0x2) && digitsCnt) {
144 fillBCIDErrDetail(digitsCnt, frag, gain);
145 } else {
147 }
148
149 if (m_HeaderFormatErrArray[partition][drawer][gain]
150 || m_HeaderParityErrArray[partition][drawer][gain]
151 || m_SampleFormatErrArray[partition][drawer][gain]
152 || m_SampleParityErrArray[partition][drawer][gain]) {
153 // can not trust FE mask, assume that FE is good
155 }
156
157#ifdef TILECELL_DEBUG
158 std::cout << std::hex
159 << " " << coll->getFragGlobalCRC()
160 << " " << coll->getFragFEChipMask()
161 << " " << coll->getFragRODChipMask()
162 << " " << coll->getFragDSPBCID()
163 << " " << coll->getFragBCID()
164 << " " << coll->getFragMemoryPar()
165 << " " << coll->getFragSstrobe()
166 << " " << coll->getFragDstrobe()
167 << " " << coll->getFragHeaderBit()
168 << " " << coll->getFragHeaderPar()
169 << " " << coll->getFragSampleBit()
170 << " " << coll->getFragSamplePar()
171 << " counter is " << std::dec << m_counter << std::endl;
172#endif
173
174}
size_type size() const noexcept
Returns the number of elements in the collection.
int m_counter
Counter of non-zero elements in all error arrays.
void fillBCIDErrDetail(const TileDigitsContainer *digitsCnt, int frag, int gain)
uint32_t getFragGlobalCRC() const
Various get methods.
setEventNumber uint32_t

◆ fillBCIDErrDetail()

void TileDQstatus::fillBCIDErrDetail ( const TileDigitsContainer * digitsCnt,
int frag,
int gain )
protected

Definition at line 249 of file TileDQstatus.cxx.

251{
252 int partition = (frag >> 8);
253 int drawer = (frag & 0x3F);
255 m_BCIDErrArray[partition][drawer][gain]; //initialize
256 if (digitsCnt == NULL)
257 // by default a conservative return value of 1 (channel Mask)
259 else {
260 TileDigitsContainer::const_iterator collItr = digitsCnt->begin();
261 TileDigitsContainer::const_iterator lastColl = digitsCnt->end();
262
263 for (; collItr != lastColl; ++collItr) { // Loop over TileModules
264 if ((*collItr)->identify() != frag)
265 continue;
266
267 std::vector < uint32_t > data;
268 if ( isBiGain() && gain ) //high Gain in bigain run
269 data = (*collItr)->getFragChipHeaderWordsHigh();
270 else
271 data = (*collItr)->getFragChipHeaderWords();
272
273 unsigned int dataSize = std::min(16u, (unsigned int) data.size());
274 short bcidCheck = 0x0;
275 uint32_t rodbcid = (*collItr)->getRODBCID();
276 for (unsigned int dmu = 0; dmu < dataSize; ++dmu) {
277 bcidCheck |= ((data[dmu] & 0xFFF) != rodbcid) << dmu;
278#ifdef TILECELL_DEBUG
279 std::cout << "Part: " << partition << " Drawer: " << drawer << " DMU: " << dmu << (gain?"HG":"LG")
280 << " DMU BCID: " << (data[dmu] & 0xFFF) << " ROD BCID: " << rodbcid << std::endl;
281#endif
282 }
283 if (dataSize > 0)
285 break; // break after the digit is found
286 }
287 }
288}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
bool isBiGain() const
returns gain mode of run
size_t dataSize(TDA::PayloadIterator start)
Size in bytes of the buffer that is needed to decode next fragment data content.

◆ fillTrips()

void TileDQstatus::fillTrips ( unsigned int partition,
const std::vector< float > & trips,
double * rndmVec,
MsgStream & msg )
protected

Definition at line 291 of file TileDQstatus.cxx.

295{
296 for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) {
297 if (trips[drawer] > rndmVec[drawer]) {
298 msg << MSG::DEBUG
299 << "The drawer has been tripped (simulation): "
300 << TileCalibUtils::getDrawerString(partition, drawer) << endmsg;
303 m_counter += 2;
304 }
305 }
306}
#define endmsg
static std::string getDrawerString(unsigned int ros, unsigned int drawer)
Return the drawer name, e.g.
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
MsgStream & msg
Definition testRead.cxx:32

◆ incompleteDigits()

bool TileDQstatus::incompleteDigits ( ) const
inline

A few extra items (from TileBeamInfoProvider).

True if not all digits are available.

Definition at line 144 of file TileDQstatus.h.

144{ return m_incompleteDigits;}

◆ isAdcDQgood()

bool TileDQstatus::isAdcDQgood ( int partition,
int drawer,
int ch,
int gain ) const

returns status of single ADC returns False if there are any errors

Definition at line 178 of file TileDQstatus.cxx.

178 {
179
180 int dmu = ch/3;
181
182#ifdef TILECELL_DEBUG
183
184 int errorArray[11];
185 errorArray[0] = checkGlobalCRCErr (partition,drawer,gain);
186 errorArray[1] = checkROD_CRCErr (partition,drawer,dmu,gain);
187 errorArray[2] = (m_isBiGain) ? 0 : checkFE_CRCErr(partition,drawer,dmu,gain); // Skip FE CRC for bigain runs
188 errorArray[3] = checkBCIDErr (partition,drawer,dmu,gain);
189 errorArray[4] = checkHeaderFormatErr (partition,drawer,dmu,gain);
190 errorArray[5] = checkHeaderParityErr (partition,drawer,dmu,gain);
191 errorArray[6] = checkSampleFormatErr (partition,drawer,dmu,gain);
192 errorArray[7] = checkSampleParityErr (partition,drawer,dmu,gain);
193 errorArray[8] = checkMemoryParityErr (partition,drawer,dmu,gain);
194 errorArray[9] = checkSingleStrobeErr (partition,drawer,dmu,gain);
195 errorArray[10]= checkDoubleStrobeErr (partition,drawer,dmu,gain);
196
197 int nError=0;
198 for(int i=0;i<9;++i){ // exclude Strobe errors from decision
199 nError += errorArray[i];
200 }
201 std::cout << std::dec <<"Part: " << partition << " Drawer: " << drawer+1 << " DMU: " << dmu << " ch: " << ch << std::endl;
202 std::cout << "IsBigain " << m_isBiGain << std::endl;
203 std::cout << "EmptyEvent (LG) " << m_EmptyEventArray[partition][drawer][dmu][0] << std::endl;
204 std::cout << "EmptyEvent (HG) " << m_EmptyEventArray[partition][drawer][dmu][1] << std::endl;
205 std::cout << "GlobalCRCErr " << errorArray[0] << std::endl;
206 std::cout << "ROD_CRCmask (LG) " << std::hex << m_ROD_DMUmaskArray[partition][drawer][0] << std::endl;
207 std::cout << "ROD_CRCmask (HG) " << std::hex << m_ROD_DMUmaskArray[partition][drawer][1] << std::endl;
208 std::cout << "ROD_CRCErr " << std::dec << errorArray[1] << std::endl;
209 std::cout << "FE_CRCmask (LG) " << std::hex << m_FE_DMUmaskArray[partition][drawer][0] << std::endl;
210 std::cout << "FE_CRCmask (HG) " << std::hex << m_FE_DMUmaskArray[partition][drawer][1] << std::endl;
211 std::cout << "FE_CRCErr " << std::dec << errorArray[2] << std::endl;
212 std::cout << "BCIDErr " << std::dec << errorArray[3] << std::endl;
213 std::cout << "HeaderFormatErr " << std::dec << errorArray[4] << std::endl;
214 std::cout << "HeaderParityErr " << std::dec << errorArray[5] << std::endl;
215 std::cout << "SampleFormatErr " << std::dec << errorArray[6] << std::endl;
216 std::cout << "SampleParityErr " << std::dec << errorArray[7] << std::endl;
217 std::cout << "MemoryParityErr " << std::dec << errorArray[8] << std::endl;
218 std::cout << "SingleStrobeErr " << std::dec << errorArray[9] << std::endl;
219 std::cout << "DoubleStrobeErr " << std::dec << errorArray[10] << std::endl;
220 std::cout << "Total number of errors: " << std::dec << nError << std::endl;
221
222#endif
223
224 if (checkGlobalCRCErr(partition, drawer, gain)
225 || checkROD_CRCErr(partition, drawer, dmu, gain)
226 || ((m_isBiGain) ? 0 : checkFE_CRCErr(partition, drawer, dmu, gain)) // Skip FE CRC for bigain runs
227 || checkBCIDErr(partition, drawer, dmu, gain)
228 || checkHeaderFormatErr(partition, drawer, dmu, gain)
229 || checkHeaderParityErr(partition, drawer, dmu, gain)
230 || checkSampleFormatErr(partition, drawer, dmu, gain)
231 || checkSampleParityErr(partition, drawer, dmu, gain)
232 || checkMemoryParityErr(partition, drawer, dmu, gain)) {
233 return false;
234 }
235
236 return true;
237}
int checkHeaderFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word format error
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...
int checkDoubleStrobeErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has double strobe error
int checkGlobalCRCErr(int partition, int drawer, int gain) const
returns 1 if adc channel has global CRC error
int checkSampleFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word format error
int checkSingleStrobeErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has single strobe error
int checkROD_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in ROD
int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word parity error
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
int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word parity error

◆ isBiGain()

bool TileDQstatus::isBiGain ( ) const
inline

returns gain mode of run

Definition at line 60 of file TileDQstatus.h.

60{ return m_isBiGain; }

◆ isChanDQgood()

bool TileDQstatus::isChanDQgood ( int partition,
int drawer,
int ch ) const

returns status of single channel (if bigain, returns AND of ADCs' status

Definition at line 240 of file TileDQstatus.cxx.

240 {
241 bool isGood = isAdcDQgood(partition, drawer, ch, 0);
242
243 if (m_isBiGain)
244 isGood &= isAdcDQgood(partition, drawer, ch, 1);
245
246 return isGood;
247}
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors

◆ isChEmpty()

int TileDQstatus::isChEmpty ( int partition,
int drawer,
int ch )
static

True if channel is not fully implemented.

◆ isFilled()

bool TileDQstatus::isFilled ( ) const
inline

returns whether TileDQStatus has been filled with data from TileDQ fragment

Definition at line 58 of file TileDQstatus.h.

58{ return m_isFilled; }
bool m_isFilled
Boolean storing if DQ fragment has been parsed already.

◆ nonZeroCounter()

bool TileDQstatus::nonZeroCounter ( ) const
inline

returns True if there are any errors in event

Definition at line 62 of file TileDQstatus.h.

62{ return m_counter; }

◆ RODBCID()

uint32_t TileDQstatus::RODBCID ( ) const
inline

Definition at line 159 of file TileDQstatus.h.

159{return m_BCID;}

◆ setAllGood()

void TileDQstatus::setAllGood ( )
protected

mark all channels/ADC's as DQ good

Definition at line 49 of file TileDQstatus.cxx.

49 {
50 // Intitalize all arrays to no errors
51 m_isFilled = false;
52 //m_isBiGain = false; //BAD!
53 m_counter = 0;
54 memset(m_EmptyEventArray, 0, sizeof(m_EmptyEventArray));
55 memset(m_GlobalCRCErrArray, 0, sizeof(m_GlobalCRCErrArray));
56 memset(m_FE_DMUmaskArray, -1, sizeof(m_FE_DMUmaskArray));
57 memset(m_ROD_DMUmaskArray, -1, sizeof(m_ROD_DMUmaskArray));
58 memset(m_BCIDErrArray, 0, sizeof(m_BCIDErrArray));
67}

◆ setBiGain()

void TileDQstatus::setBiGain ( bool biGain)
inlineprotected

sets flag of gain mode of run

Definition at line 167 of file TileDQstatus.h.

167{m_isBiGain=biGain;}

◆ setCalibMode()

void TileDQstatus::setCalibMode ( uint32_t calibMode)

Definition at line 315 of file TileDQstatus.cxx.

316{
318}
uint32_t calibMode() const
Calibration mode.

◆ setEmptyEvent()

void TileDQstatus::setEmptyEvent ( int partition,
int drawer,
int dmu,
int gain,
int isEmpty )
inlineprotected

sets flag that DMU sent an empty event (0xFFFFFFFF)

Definition at line 173 of file TileDQstatus.h.

173 {
174 m_EmptyEventArray[partition][drawer][dmu][gain]=isEmpty;
175 m_counter+=isEmpty;
176 }

◆ setFilled()

void TileDQstatus::setFilled ( bool filled)
inlineprotected

sets flag that DQ status instance has been filled for this event

Definition at line 165 of file TileDQstatus.h.

◆ setIncompleteDigits()

void TileDQstatus::setIncompleteDigits ( bool incomplete)

Definition at line 309 of file TileDQstatus.cxx.

◆ setRODBCID()

void TileDQstatus::setRODBCID ( uint32_t BCID)
inlineprotected

sets the ROD BCID stored and used in DQStatus

Definition at line 171 of file TileDQstatus.h.

◆ setTrigType()

void TileDQstatus::setTrigType ( int trigType)

Definition at line 327 of file TileDQstatus.cxx.

328{
330}
int trigType() const
Trigger type.

◆ trigType()

int TileDQstatus::trigType ( ) const
inline

Trigger type.

Definition at line 156 of file TileDQstatus.h.

156{ return m_trigType; }

◆ TileDQstatusTool

friend class TileDQstatusTool
friend

Definition at line 50 of file TileDQstatus.h.

Member Data Documentation

◆ m_BCID

uint32_t TileDQstatus::m_BCID
private

Event bunch crossing identification.

Definition at line 193 of file TileDQstatus.h.

◆ m_BCIDErrArray

short TileDQstatus::m_BCIDErrArray[5][64][2]
private

Array of bit masks storing BCID errors for all DMUs (from comparison with DMU1)

Definition at line 205 of file TileDQstatus.h.

◆ m_BCIDErrArrayDetail

short TileDQstatus::m_BCIDErrArrayDetail[5][64][2]
private

Array of bit masks storing BCID errors for all DMUs (from comparison with Digits)

Definition at line 207 of file TileDQstatus.h.

◆ m_calibMode

uint32_t TileDQstatus::m_calibMode
private

Calibration mode.

Definition at line 227 of file TileDQstatus.h.

◆ m_checkDigi

bool TileDQstatus::m_checkDigi
private

Boolean flag to control TileDigitsContainer access.

Definition at line 191 of file TileDQstatus.h.

◆ m_cispar

uint32_t TileDQstatus::m_cispar[110]
private

CIS parameters.

Definition at line 230 of file TileDQstatus.h.

◆ m_counter

int TileDQstatus::m_counter
private

Counter of non-zero elements in all error arrays.

Definition at line 195 of file TileDQstatus.h.

◆ m_DoubleStrobeErrArray

short TileDQstatus::m_DoubleStrobeErrArray[5][64][2]
private

Array of bit masks storing Double Strobe errors for all DMUs.

Definition at line 221 of file TileDQstatus.h.

◆ m_EmptyEventArray

short TileDQstatus::m_EmptyEventArray[5][64][16][2]
private

Array storing whether event is empty.

Definition at line 197 of file TileDQstatus.h.

◆ m_FE_DMUmaskArray

short TileDQstatus::m_FE_DMUmaskArray[5][64][2]
private

Array of bit masks storing CRC errors for all DMUs.

Definition at line 201 of file TileDQstatus.h.

◆ m_GlobalCRCErrArray

short TileDQstatus::m_GlobalCRCErrArray[5][64][2]
private

Array of bit masks storing CRC errors for all DMUs.

Definition at line 199 of file TileDQstatus.h.

◆ m_HeaderFormatErrArray

short TileDQstatus::m_HeaderFormatErrArray[5][64][2]
private

Array of bit masks storing Header Format errors for all DMUs.

Definition at line 209 of file TileDQstatus.h.

◆ m_HeaderParityErrArray

short TileDQstatus::m_HeaderParityErrArray[5][64][2]
private

Array of bit masks storing Header Parity errors for all DMUs.

Definition at line 211 of file TileDQstatus.h.

◆ m_incompleteDigits

bool TileDQstatus::m_incompleteDigits
private

True if not all digits are available.

Definition at line 224 of file TileDQstatus.h.

◆ m_isBiGain

bool TileDQstatus::m_isBiGain
private

Boolean storing gain mode of run.

Definition at line 189 of file TileDQstatus.h.

◆ m_isFilled

bool TileDQstatus::m_isFilled
private

Boolean storing if DQ fragment has been parsed already.

Definition at line 187 of file TileDQstatus.h.

◆ m_MemoryParityErrArray

short TileDQstatus::m_MemoryParityErrArray[5][64][2]
private

Array of bit masks storing Memory Parity errors for all DMUs.

Definition at line 217 of file TileDQstatus.h.

◆ m_ROD_DMUmaskArray

short TileDQstatus::m_ROD_DMUmaskArray[5][64][2]
private

Array of bit masks storing CRC errors for all DMUs.

Definition at line 203 of file TileDQstatus.h.

◆ m_SampleFormatErrArray

short TileDQstatus::m_SampleFormatErrArray[5][64][2]
private

Array of bit masks storing Sample Format errors for all DMUs.

Definition at line 213 of file TileDQstatus.h.

◆ m_SampleParityErrArray

short TileDQstatus::m_SampleParityErrArray[5][64][2]
private

Array of bit masks storing Sample Parity errors for all DMUs.

Definition at line 215 of file TileDQstatus.h.

◆ m_SingleStrobeErrArray

short TileDQstatus::m_SingleStrobeErrArray[5][64][2]
private

Array of bit masks storing Single Strobe errors for all DMUs.

Definition at line 219 of file TileDQstatus.h.

◆ m_trigType

int TileDQstatus::m_trigType
private

Trigger type.

Definition at line 233 of file TileDQstatus.h.

◆ s_ch2dmuEB

const int TileDQstatus::s_ch2dmuEB
staticprivate
Initial value:
= { 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2,
2, 2, 2, 2, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2,
2, 2, 2, 2 }

Definition at line 26 of file TileDQstatus.h.

◆ s_ch2dmuEBspecial

const int TileDQstatus::s_ch2dmuEBspecial
staticprivate
Initial value:
= { 2, 2, 2, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
2, 2, 2, 2, 2, 2 }

Definition at line 31 of file TileDQstatus.h.

33 :
34* - Global CRC

◆ s_ch2dmuLB

const int TileDQstatus::s_ch2dmuLB
staticprivate
Initial value:
= { 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0 }

Definition at line 21 of file TileDQstatus.h.


The documentation for this class was generated from the following files: