80 return StatusCode::SUCCESS;
83 EventIDRange eventRange;
86 std::unique_ptr<TileCalibData<TileCalibDrawerBch>> onlBchData
87 = std::make_unique<TileCalibData<TileCalibDrawerBch>>();
90 EventIDRange onlBchRange;
92 eventRange = EventIDRange::intersect(eventRange, onlBchRange);
95 std::unique_ptr<TileCalibData<TileCalibDrawerBch>> oflBchData
96 = std::make_unique<TileCalibData<TileCalibDrawerBch>>();
99 EventIDRange oflBchRange;
101 eventRange = EventIDRange::intersect(eventRange, oflBchRange);
105 std::unique_ptr<TileBadChannels> badChannelsData = std::make_unique<TileBadChannels>();
110 uint32_t adcBits(0), channelBits(0);
117 unsigned int drawerIdx(0);
118 unsigned int channel(0);
121 for (
IdentifierHash adcHash = 0; adcHash < maxAdcHash; adcHash += 1) {
123 if (tileHWID->
get_id(adcHash, adcId, &adcContext) == 0) {
125 if (tileHWID->
ros(adcId) == 0)
continue;
131 std::vector<const TileCalibDrawerBch*> calibDrawers;
134 calibDrawers.push_back( onlBchData->getCalibDrawer(drawerIdx) );
139 calibDrawers.push_back( oflBchData->getCalibDrawer(drawerIdx) );
144 calibDrawer->getStatusWords(channel, adc, adcBits, channelBits);
148 if (!adcStatus.
isGood()) {
151 badChannelsData->addAdcStatus(channelId, adcId, adcStatus);
181 ATH_MSG_INFO(
"Updating TileBchStatus::isBad() definition from DB" );
184 ATH_MSG_INFO(
"No TileBchStatus::isBad() definition found in DB, using defaults" );
191 ATH_MSG_INFO(
"Updating TileBchStatus::isNoisy() definition from DB" );
194 ATH_MSG_INFO(
"No TileBchStatus::isNoisy() definition found in DB, using defaults" );
201 ATH_MSG_INFO(
"Updating TileBchStatus::isNoGainL1() definition from DB" );
204 ATH_MSG_INFO(
"No TileBchStatus::isNoGainL1() definition found in DB, using defaults" );
212 ATH_MSG_INFO(
"Updating TileBchStatus::isBadTiming() definition from DB" );
215 ATH_MSG_INFO(
"No TileBchStatus::isBadTiming() definition found in DB, using defaults" );
222 ATH_MSG_INFO(
"Updating TileBchStatus::isWrongBCID() definition from DB" );
225 ATH_MSG_INFO(
"No TileBchStatus::isWrongBCID() definition found in DB, using defaults" );
231 ATH_MSG_INFO(
"TileBchStatus::isNoisy() is defined by: "
233 ATH_MSG_INFO(
"TileBchStatus::isNoGainL1() is defined by: "
235 ATH_MSG_INFO(
"TileBchStatus::isBadTiming() is defined by: "
237 ATH_MSG_INFO(
"TileBchStatus::isWrongBCID() is defined by: "
241 std::vector<int> maskedDrawers;
243 unsigned int maxChannels = cabling->getMaxChannels();
247 unsigned int channel = 0;
248 for ( ; channel < maxChannels; ++channel) {
252 cabling->h2s_cell_id_index(channelID,
index, pmt);
253 if (
index >= 0 && !badChannelsData->getChannelStatus(channelID).isBad()) {
257 if (channel == maxChannels) maskedDrawers.push_back(tileHWID->
frag(ros, drawer));
263 if (!maskedDrawers.empty()) {
264 msg(MSG::DEBUG) <<
"List of fully masked drawers: " << MSG::hex;
265 for(
int maskedDrawer : maskedDrawers) {
266 msg(MSG::DEBUG) <<
" 0x" << maskedDrawer;
270 msg(MSG::DEBUG) <<
"No bad drawers found" <<
endmsg;
274 if (!maskedDrawers.empty()) badChannelsData->setMaskedDrawers(std::move(maskedDrawers));
300 const float inv_denominator = 1. / denominator;
302 tripsProbs[ros - 1][mod] = ((float) tripsCalibDrawer->getData(ros, 0, mod)) * inv_denominator;
306 badChannelsData->setTripsProbabilities(std::move(tripsProbs));
309 ATH_MSG_INFO(
"No drawer trips probabilities found in DB");
314 return StatusCode::FAILURE;
320 if(badChannels.
record(eventRange, badChannelsData.release()).isFailure()) {
321 ATH_MSG_ERROR(
"Could not record TileBadChannels object with "
323 <<
" with EventRange " << eventRange
324 <<
" into Conditions Store");
325 return StatusCode::FAILURE;
330 <<
" with EventRange " << eventRange
331 <<
" into Conditions Store");
336 return StatusCode::SUCCESS;
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...