38 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.
fullKey() <<
" is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order.");
39 return StatusCode::SUCCESS;
44 std::unique_ptr<PixelDeadMapCondData> writeCdo(std::make_unique<PixelDeadMapCondData>());
46 const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0,
47 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
48 const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1,
49 EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
51 EventIDRange rangeW{start, stop};
56 if (readCdo==
nullptr) {
58 return StatusCode::FAILURE;
61 if (not readHandle.
range(rangeW)) {
63 return StatusCode::FAILURE;
66 for (
const auto & attrList : *readCdo) {
70 if (payload.exists(
"data_array") and not payload[
"data_array"].isNull()) {
71 const std::string &stringStatus = payload[
"data_array"].data<std::string>();
74 for (
const auto & [hash, status] : hashStatusVector){
76 if (status==0) writeCdo->setModuleStatus(hash, 1);
78 else writeCdo->setChipStatus(hash, status);
87 if (!json_file.is_open()) {
88 ATH_MSG_ERROR(
"Failed to open the json file with dead pixel modules");
89 return StatusCode::FAILURE;
92 json dead_module_data = json::parse(json_file);
94 for (
const auto& i : dead_module_data) {
95 std::string id_mod = i[
"Decimal_ID"];
96 unsigned long long idull = std::stoull(id_mod);
105 writeCdo->setModuleStatus(idhash,1);
109 ATH_MSG_DEBUG(
"No readKey and jsonFile have been passed to PixelDeadMapCondAlg.");
112 if (rangeW.stop().isValid() and rangeW.start()>rangeW.stop()) {
114 return StatusCode::FAILURE;
117 if (writeHandle.
record(rangeW, std::move(writeCdo)).isFailure()) {
118 ATH_MSG_FATAL(
"Could not record PixelDeadMapCondData " << writeHandle.
key() <<
" with EventRange " << rangeW <<
" into Conditions Store");
119 return StatusCode::FAILURE;
122 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.
key() <<
" with range " << rangeW <<
" into Conditions Store");
124 return StatusCode::SUCCESS;