88 std::vector<int> dmus;
91 std::vector<int> errors;
98 int nBadConsecutiveModules = isTileErrorState ?
MAX_DMU : ((tileEventInfoFlag >>
MAX_DMU) & 0xF);
102 if (isTileErrorState) {
103 fill(
"TileEventsWithErrEventInfoLB", lumiBlock);
106 fill(
"TileConsecutiveBadModules", monitoredConsecutiveBad);
107 fill(
"TileConsecutiveBadModulesLB", monitoredConsecutiveBad, lumiBlock);
116 bool physicRun = (l1TriggerType == 0) || (((l1TriggerType >> Trig_b7) & 1) == 1);
125 ATH_MSG_WARNING(
"Tile raw channel units are not ADC counts => will not check neagative amplitudes!" );
130 int fragId = rawChannelCollection->identify();
131 int drawer = (fragId & 0x3F);
132 int ros = fragId >> 8;
135 monitoredModule = drawer;
144 float pedestal = rawChannel->pedestal();
145 float quality = std::abs(rawChannel->quality());
146 float amplitude = rawChannel->amplitude();
147 float time = rawChannel->uncorrTime();
149 monitoredChannel = channel;
152 && !(badChannels->getAdcStatus(adcId).isBad()
168 int dmu = channel / 3;
175 if (energy < minEnergy) {
176 int dmu = channel / 3;
187 int channelDividedBy2 = channel >> 1;
190 && (channelDividedBy2 == 0 || channelDividedBy2 == 6 || channelDividedBy2 == 9))
191 && !(
m_skipMasked && badChannels->getAdcStatus(adcId).isBad())) {
200 if (pedestal > 100000. && digitsContainer) {
205 if (digitsCollection) {
207 for (
const TileDigits* tile_digits : *digitsCollection) {
209 if (
m_tileHWID->channel(tile_digits->adc_HWID()) == channel) {
213 <<
" " << Tile::getDrawerString(ros, drawer)
214 << std::setfill(
' ') << std::setw(3) << channel
215 << ((gain) ?
" HG" :
" LG") <<
" negative amplitude: "
216 << std::setprecision(2) << std::fixed << std::setw(7)
217 << amplitude <<
" Samples: " << std::setprecision(0);
219 std::vector<float> samples = tile_digits->samples();
220 for (
float sample : samples) {
221 msg(MSG::INFO) << sample <<
" ";
233 if (!errors.empty()) {
241 if (digitsContainer) {
246 int fragId = digitsCollection->identify();
247 int drawer = (fragId & 0x3F);
248 int ros = fragId >> 8;
251 monitoredModule = drawer;
253 if (l1TriggerType != digitsCollection->getLvl1Type()) {
254 fill(
"TileMismatchedL1TriggerType", monitoredModule, monitoredROS);
257 if (l1TriggerType == 0x82) {
259 unsigned int nBadOrDisconnectedChannels(0);
260 for (
unsigned int channel = 0; channel < Tile::MAX_CHAN; ++channel) {
262 if (badChannels->getChannelStatus(channel_id).isBad()
263 || (
m_cabling->isDisconnected(ros, drawer, channel)) ) {
264 ++nBadOrDisconnectedChannels;
268 unsigned int nRequiredChannels(Tile::MAX_CHAN - nBadOrDisconnectedChannels);
269 if (digitsCollection->size() < nRequiredChannels) {
270 fill(
"TileNoAllDigits", monitoredModule, monitoredROS);
271 ATH_MSG_VERBOSE(
"No All channels with digits (Trigger Type: 0x82) in module "
272 << Tile::getDrawerString(ros, drawer)
273 <<
", present channels: " << digitsCollection->size()
274 <<
", required channels: " << nRequiredChannels);
283 for (
const TileDigits* tile_digits : *digitsCollection) {
292 monitoredChannel = channel;
297 !(
m_cabling->isDisconnected(ros, drawer, channel) || badChannels->getAdcStatus(adcId).isBad()) ) {
302 <<
" " << Tile::getDrawerString(ros, drawer)
303 << std::setfill(
' ') << std::setw(3) << channel
304 << ((gain) ?
" HG" :
" LG")
307 std::vector<float> samples = tile_digits->samples();
308 for (
float sample : samples) {
309 msg(MSG::DEBUG) << sample <<
" ";
321 corruptedData[
error - 1] |= 1u << (
unsigned int) (channel / 3);
326 bool fillCorruptedData(
false);
328 if (corruptedData[
error] > 0u) {
329 fillCorruptedData =
true;
330 for (
unsigned int dmu = 0u; dmu < 16u; ++dmu) {
331 if (corruptedData[
error] & (1u << dmu)) {
338 if (fillCorruptedData) {
345 std::vector<int> rosWithGloblaCRC;
346 std::vector<int> drawerWithGlobalCRC;
349 for (
unsigned int ros = 1; ros < Tile::MAX_ROS; ++ros) {
350 for (
unsigned int drawer = 0; drawer < Tile::MAX_DRAWER; ++drawer) {
353 bool isGoodModuleDCS(
true);
358 const std::vector<int>& maskedDrawers = badChannels->getMaskedDrawers();
359 if (!std::binary_search(maskedDrawers.begin(), maskedDrawers.end(), frag_id)) {
360 fractionOfBadDMUs = -1.0;
362 isGoodModuleDCS =
false;
373 float nBadNotMaskedDMUs = 0;
375 for (
int dmu = 0; dmu <
MAX_DMU; ++dmu) {
376 int channel = 3 * dmu;
381 TileBchStatus channelStatus1 = badChannels->getChannelStatus(
m_tileHWID->channel_id(ros, drawer, channel + 1) );
382 TileBchStatus channelStatus2 = badChannels->getChannelStatus(
m_tileHWID->channel_id(ros, drawer, channel + 2) );
386 if ((ros == 3 && drawer == 14) || (ros == 4 && drawer == 17)) {
392 if ((channelStatus0.
isBad() && channelStatus1.
isBad() && channelStatus2.
isBad())
394 || ((ros > 2 && ((channel == 18 && !specialEB) || channel == 33)) && channelStatus2.
isBad())
396 || ((ros < 3 && channel == 30) && channelStatus2.
isBad())
398 || ((ros < 3 && channel == 42) && channelStatus0.
isBad() && channelStatus2.
isBad())
400 || (ros > 2 && (channel == 24 || channel == 27 || channel == 42 || channel == 45))
401 || (specialEB && channel == 0)
403 || ((specialEB && channel == 3) && channelStatus1.
isBad() && channelStatus2.
isBad())) {
409 if (isGoodModuleDCS) {
414 || (dcsState->
isStatusBad(ros, drawer, channel + 1)
416 || (dcsState->
isStatusBad(ros, drawer, channel + 2)
427 || (ros > 2 && (dmu == 8 || dmu == 9 || dmu == 14 || dmu == 15))
428 || (specialEB && dmu == 0))) {
476 if (isGoodModuleDCS) {
477 fractionOfBadDMUs = nBadNotMaskedDMUs /
MAX_DMU;
491 rosWithGloblaCRC.push_back(ros);
492 drawerWithGlobalCRC.push_back(drawer);
497 if (!rosWithGloblaCRC.empty()) {
500 fill(
"TileBadGlobalCRC", monModule, monROS);
503 fill(
"TileDQFragMonExecuteTime", timer);
505 return StatusCode::SUCCESS;