35 ATH_MSG_FATAL(
"The event data (PixelDetElStatusEventDataBaseKey) and cond data (PixelDetElStatusCondDataBaseKey) keys cannot be set at the same time.");
53 return StatusCode::FAILURE;
56 ATH_MSG_FATAL(
"Logic error: status id too large. Cannot be represented by a bit");
57 return StatusCode::FAILURE;
64 if (isActiveStatus==
"OK") {
m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::OK); }
68 else if (isActiveStatus==
"NOSTATUS") {
m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::NOSTATUS); }
70 ATH_MSG_ERROR(
"No matching DCS status " << isActiveStatus <<
" in DCSModuleStatus");
71 return StatusCode::FAILURE;
74 ATH_MSG_FATAL(
"Logic error: status id too large. Cannot be represented by a bit");
75 return StatusCode::FAILURE;
80 return StatusCode::SUCCESS;
89 if (not idcErrCont.
isValid()) {
return nullptr; }
91 return idcErrCont.
cptr();
98 if (idcErrContPtr==
nullptr) {
99 cacheEntry->
reset(ctx.evt(),
nullptr);
102 cacheEntry->
reset(ctx.evt(), idcErrContPtr->cache());
104 ATH_MSG_VERBOSE(
"PixelConditionsSummaryTool Cache for the event reset " << cacheEntry->
eventId <<
" with IDC container" << idcErrContPtr);
110 std::scoped_lock<std::mutex>
lock{*m_cacheMutex.get(ctx)};
127 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
136 const EventContext& ctx,
145 const EventContext& ctx,
152 if (cacheEntry ==
nullptr){
153 std::scoped_lock<std::mutex>
lock{*m_cacheMutex.get(ctx)};
156 const auto *idcCachePtr = cacheEntry->
IDCCache;
157 if (idcCachePtr==
nullptr) {
168 return hasBSError(p_design,moduleHash, ctx,cacheEntry);
173 const EventContext& ctx,
195 if (
hasBSError(p_design, moduleHash, ctx, cacheEntry)) {
return true; }
199 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
205 int indexFE = (1+chFE)*maxHash+
static_cast<int>(moduleHash);
229 if (useByteStream &&
getBSErrorWord(moduleHash,moduleHash+52736,ctx)!=1) {
return false; }
232 bool isDCSActive =
false;
234 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
236 if (!isDCSActive) {
return false; }
250 if (useByteStream &&
getBSErrorWord(moduleHash,moduleHash+52736,ctx)!=1) {
return false; }
253 bool isDCSActive =
false;
255 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
257 if (!isDCSActive) {
return false; }
274 if (
hasBSError(moduleHash, ctx)) {
return false; }
277 bool isDCSActive =
false;
279 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
281 if (!isDCSActive) {
return false; }
284 bool isDCSGood =
false;
286 if (activeStatus==dcsstatus_data->
getModuleStatus(moduleHash)) { isDCSGood=
true; }
288 if (!isDCSGood) {
return false; }
296 if (
hasBSError(moduleHash, elementId, ctx)) {
return false; }
303 inline void andStatus(
const std::unordered_map<int, int> &status_map,
unsigned int status_mask, std::vector<bool> &module_status) {
304 for (
const std::pair<const int, int> &elm : status_map ) {
306 module_status.at(elm.first) = module_status.at(elm.first) && (status_mask & (1<<elm.second));
309 inline void andNotStatus(
const std::unordered_map<int, int> &status_map, std::vector<bool> &module_status) {
310 for (
const std::pair<const int, int> &elm : status_map ) {
312 module_status.at(elm.first) = module_status.at(elm.first) && (elm.second==0);
324 throw std::runtime_error(
"Object is not of expected type InDet::PixelDetectorElementStatus");
329 std::unique_ptr<InDet::SiDetectorElementStatus>
337 return std::make_unique<InDet::PixelDetectorElementStatus>(*castToDerived(input_element_status.cptr()));
341 return std::make_unique<InDet::PixelDetectorElementStatus>(*castToDerived(input_element_status.cptr()));
345 if (not pixelDetEleHandle.
isValid() ) {
346 std::stringstream
msg;
348 throw std::runtime_error(
msg.str());
354 return std::make_unique<InDet::PixelDetectorElementStatus>(*elements);
358 std::unique_ptr<InDet::SiDetectorElementStatus>
367 chip_status.resize(
status.size(),0);
400 unsigned int element_i=0;
407 assert( chip_mask != 0 );
408 std::bitset<16> dead_chip_mask(dead_map->
getChipStatus(element_i));
409 chip_status[element_i] = chip_mask & (~static_cast<InDet::ChipFlags_t>(dead_chip_mask.to_ulong()));
422 if (readout_technology_mask) {
424 ATH_MSG_ERROR(
"PixelConditionsSummaryTool not configured for use with conditions objects");
427 std::scoped_lock<std::mutex>
lock{*m_cacheMutex.get(ctx)};
430 if (idcCachePtr==
nullptr) {
461 unsigned int element_offset_i = (active_only ? 52736 : 0);
463 unsigned int element_i=0;
471 status.at(element_i) =
status.at(element_i) && not ( readout_technology_flags
474 : idcCachePtr->
retrieve(element_i+element_offset_i)!=1 ));
480 assert( chip_mask != 0 );
483 for (
unsigned int chip_i =0; chip_i < number_of_chips; ++chip_i) {
485 unsigned int indexFE = (1+chip_i)*maxHash + element_i;
488 bs_status_flags |= (chip_flag << chip_i);
491 chip_status[element_i] &= (bs_status_flags & chip_mask);
494 chip_status[element_i] = 0;
500 return element_status;
505 if (
hasBSError(moduleHash, ctx)) {
return false; }
508 bool isDCSActive =
false;
510 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
512 if (!isDCSActive) {
return false; }
515 bool isDCSGood =
false;
517 if (activeStatus==dcsstatus_data->
getModuleStatus(moduleHash)) { isDCSGood=
true; }
519 if (!isDCSGood) {
return false; }
530 if (
hasBSError(moduleHash, ctx, cacheEntry)) {
return false; }
533 bool isDCSActive =
false;
535 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
537 if (!isDCSActive) {
return false; }
540 bool isDCSGood =
false;
542 if (activeStatus==dcsstatus_data->
getModuleStatus(moduleHash)) { isDCSGood=
true; }
544 if (!isDCSGood) {
return false; }
552 if (
hasBSError(moduleHash, elementId, ctx, cacheEntry)) {
return false; }
559 if (!
isGood(moduleHash, ctx)) {
return 0.0; }
569 double nTotal = (std::abs(phiStart-phiEnd)+1.0)*(std::abs(etaStart-etaEnd)+1.0);