39 ATH_MSG_FATAL(
"The event data (PixelDetElStatusEventDataBaseKey) and cond data (PixelDetElStatusCondDataBaseKey) keys cannot be set at the same time.");
57 return StatusCode::FAILURE;
60 ATH_MSG_FATAL(
"Logic error: status id too large. Cannot be represented by a bit");
61 return StatusCode::FAILURE;
68 if (isActiveStatus==
"OK") {
m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::OK); }
72 else if (isActiveStatus==
"NOSTATUS") {
m_activeStatus.push_back(PixelDCSStatusData::DCSModuleStatus::NOSTATUS); }
74 ATH_MSG_ERROR(
"No matching DCS status " << isActiveStatus <<
" in DCSModuleStatus");
75 return StatusCode::FAILURE;
78 ATH_MSG_FATAL(
"Logic error: status id too large. Cannot be represented by a bit");
79 return StatusCode::FAILURE;
84 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);
122 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
133 std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
135 if (idcCachePtr==
nullptr) {
161 if (
hasBSError(moduleHash, ctx)) {
return true; }
168 int indexFE = (1+chFE)*maxHash+
static_cast<int>(moduleHash);
192 if (useByteStream &&
getBSErrorWord(moduleHash,moduleHash+52736,ctx)!=1) {
return false; }
195 bool isDCSActive =
false;
197 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
199 if (!isDCSActive) {
return false; }
213 if (useByteStream &&
getBSErrorWord(moduleHash,moduleHash+52736,ctx)!=1) {
return false; }
216 bool isDCSActive =
false;
218 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
220 if (!isDCSActive) {
return false; }
237 if (
hasBSError(moduleHash, ctx)) {
return false; }
240 bool isDCSActive =
false;
242 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
244 if (!isDCSActive) {
return false; }
247 bool isDCSGood =
false;
249 if (activeStatus==dcsstatus_data->
getModuleStatus(moduleHash)) { isDCSGood=
true; }
251 if (!isDCSGood) {
return false; }
259 if (
hasBSError(moduleHash, elementId, ctx)) {
return false; }
266 inline void andStatus(
const std::unordered_map<int, int> &status_map,
unsigned int status_mask, std::vector<bool> &module_status) {
267 for (
const std::pair<const int, int> &elm : status_map ) {
269 module_status.at(elm.first) = module_status.at(elm.first) && (status_mask & (1<<elm.second));
272 inline void andNotStatus(
const std::unordered_map<int, int> &status_map, std::vector<bool> &module_status) {
273 for (
const std::pair<const int, int> &elm : status_map ) {
275 module_status.at(elm.first) = module_status.at(elm.first) && (elm.second==0);
287 throw std::runtime_error(
"Object is not of expected type InDet::PixelDetectorElementStatus");
292 std::unique_ptr<InDet::SiDetectorElementStatus>
300 return std::make_unique<InDet::PixelDetectorElementStatus>(*castToDerived(input_element_status.cptr()));
304 return std::make_unique<InDet::PixelDetectorElementStatus>(*castToDerived(input_element_status.cptr()));
308 if (not pixelDetEleHandle.
isValid() ) {
309 std::stringstream
msg;
311 throw std::runtime_error(
msg.str());
317 return std::make_unique<InDet::PixelDetectorElementStatus>(*elements);
321 std::unique_ptr<InDet::SiDetectorElementStatus>
330 chip_status.resize(
status.size(),0);
363 unsigned int element_i=0;
370 assert( chip_mask != 0 );
371 std::bitset<16> dead_chip_mask(dead_map->
getChipStatus(element_i));
372 chip_status[element_i] = chip_mask & (~static_cast<InDet::ChipFlags_t>(dead_chip_mask.to_ulong()));
385 if (readout_technology_mask) {
387 ATH_MSG_ERROR(
"PixelConditionsSummaryTool not configured for use with conditions objects");
390 std::scoped_lock<std::mutex> lock{*m_cacheMutex.get(ctx)};
393 if (idcCachePtr==
nullptr) {
424 unsigned int element_offset_i = (active_only ? 52736 : 0);
426 unsigned int element_i=0;
434 status.at(element_i) =
status.at(element_i) && not ( readout_technology_flags
437 : idcCachePtr->
retrieve(element_i+element_offset_i)!=1 ));
443 assert( chip_mask != 0 );
446 for (
unsigned int chip_i =0; chip_i < number_of_chips; ++chip_i) {
448 unsigned int indexFE = (1+chip_i)*maxHash + element_i;
451 bs_status_flags |= (chip_flag << chip_i);
454 chip_status[element_i] &= (bs_status_flags & chip_mask);
457 chip_status[element_i] = 0;
463 return element_status;
468 if (
hasBSError(moduleHash, ctx)) {
return false; }
471 bool isDCSActive =
false;
473 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
475 if (!isDCSActive) {
return false; }
478 bool isDCSGood =
false;
480 if (activeStatus==dcsstatus_data->
getModuleStatus(moduleHash)) { isDCSGood=
true; }
482 if (!isDCSGood) {
return false; }
493 if (
hasBSError(moduleHash, ctx)) {
return false; }
496 bool isDCSActive =
false;
498 if (istate==dcsstate_data->
getModuleStatus(moduleHash)) { isDCSActive=
true; }
500 if (!isDCSActive) {
return false; }
503 bool isDCSGood =
false;
505 if (activeStatus==dcsstatus_data->
getModuleStatus(moduleHash)) { isDCSGood=
true; }
507 if (!isDCSGood) {
return false; }
515 if (
hasBSError(moduleHash, elementId, ctx)) {
return false; }
522 if (!
isGood(moduleHash, ctx)) {
return 0.0; }
532 double nTotal = (std::abs(phiStart-phiEnd)+1.0)*(std::abs(etaStart-etaEnd)+1.0);