17#include "GaudiKernel/MsgStream.h"
22 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
23 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
27 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2,
28 2, 2, 2, 2, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2,
32 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
33 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
74 int gain,
unsigned short fragBCID)
81 int partition = (frag >> 8);
82 int drawer = (frag & 0x3F);
83 bool eb = (frag > 0x2ff);
84 bool ebsp = (frag == 0x30e || frag == 0x411);
102 if (ebsp) FE_DMUmask <<= 1;
103 FE_DMUmask = (FE_DMUmask & 0xFF) | ((FE_DMUmask & 0xF00) << 2);
109 unsigned short BCIDerr = fragBCID;
116 if (DSPBCID != 0xDEAD && DSPBCID !=
m_BCID) {
136 std::cout <<
"masking whole drawer " << drawer <<
" in partition " << partition <<
" because all 4 MB have BCID errors"
143 if ((
m_BCIDErrArray[partition][drawer][gain] & 0x2) && digitsCnt) {
158 std::cout << std::hex
171 <<
" counter is " << std::dec <<
m_counter << std::endl;
188 errorArray[3] =
checkBCIDErr (partition,drawer,dmu,gain);
198 for(
int i=0;i<9;++i){
199 nError += errorArray[i];
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;
241 bool isGood =
isAdcDQgood(partition, drawer, ch, 0);
252 int partition = (frag >> 8);
253 int drawer = (frag & 0x3F);
256 if (digitsCnt == NULL)
263 for (; collItr != lastColl; ++collItr) {
264 if ((*collItr)->identify() != frag)
267 std::vector < uint32_t >
data;
269 data = (*collItr)->getFragChipHeaderWordsHigh();
271 data = (*collItr)->getFragChipHeaderWords();
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;
279 std::cout <<
"Part: " << partition <<
" Drawer: " << drawer <<
" DMU: " << dmu << (gain?
"HG":
"LG")
280 <<
" DMU BCID: " << (
data[dmu] & 0xFFF) <<
" ROD BCID: " << rodbcid << std::endl;
292 const std::vector<float>& trips,
297 if (trips[drawer] > rndmVec[drawer]) {
299 <<
"The drawer has been tripped (simulation): "
char data[hepevt_bytes_allocation_ATLAS]
Information produced by TileDQstatusAlg (used to be done by TileBeamInfoProvider).
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
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.
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
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...
int checkDoubleStrobeErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has double strobe error
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
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 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
uint32_t calibMode() const
Calibration mode.
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
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.
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.
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
uint32_t getFragSamplePar() const
uint32_t getFragDSPBCID() const
uint32_t getFragBCID() const
uint32_t getFragSampleBit() const
uint32_t getFragGlobalCRC() const
Various get methods.
uint32_t getFragFEChipMask() const
uint32_t getFragRODChipMask() const
uint32_t getFragSstrobe() const
uint32_t getFragMemoryPar() const
uint32_t getFragHeaderBit() const
uint32_t getFragHeaderPar() const
uint32_t getFragDstrobe() const