29 return StatusCode::SUCCESS;
40 if (writeHandle.isValid()) {
41 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
42 <<
". In theory this should not be called, but may happen"
43 <<
" if multiple concurrent events are being processed out of order.");
44 return StatusCode::SUCCESS;
48 std::unique_ptr<SCT_TdaqEnabledCondData> writeCdo{std::make_unique<SCT_TdaqEnabledCondData>()};
57 EventIDBase unfilledStart{0, 0, 0, 0};
59 EventIDRange unfilledRange{unfilledStart, unfilledStop};
60 rangeW = unfilledRange;
61 writeCdo->setNoneBad(
true);
62 writeCdo->setFilled(
true);
67 if (readCdo==
nullptr) {
69 return StatusCode::FAILURE;
72 ATH_MSG_INFO(
"Size of CondAttrListCollection readCdo->size()= " << readCdo->size());
77 for (; attrList!=
end; ++attrList) {
81 const std::string &enabled{
payload[
"class"].data<std::string>()};
82 const std::string& chanName{readCdo->chanName(channelNumber)};
87 if ((not enabled.empty()) and (not writeCdo->setGoodRod(rodNumber))) {
91 ATH_MSG_WARNING(
"Names in "<<
m_readKey.
key()<<
" should be of the form ROL-SCT-BA-00-210000 this channel, number "<<channelNumber<<
", is: "<<chanName);
95 if (writeCdo->getGoodRods().size()>
s_NRODS) {
96 ATH_MSG_FATAL(
"The number of rods declared as good appears to be greater than the permissible number of rods ("<<
s_NRODS<<
")");
97 writeCdo->setFilled(
false);
98 return StatusCode::FAILURE;
101 long unsigned int nBad{
s_NRODS-writeCdo->getGoodRods().size()};
106 writeCdo->setNoneBad(
nBad==0);
107 if (writeCdo->isNoneBad()) {
108 writeCdo->setFilled(
true);
112 std::vector<IdentifierHash> tmpIdVec{0};
114 for (
const auto& thisRod : writeCdo->getGoodRods()) {
117 writeCdo->setGoodModules(tmpIdVec);
119 writeCdo->setFilled(
true);
122 if (not readHandle.range(rangeW)) {
123 ATH_MSG_FATAL(
"Failed to retrieve validity range for " << readHandle.key());
124 return StatusCode::FAILURE;
128 if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) {
129 ATH_MSG_FATAL(
"Could not record SCT_TdaqEnabledCondData " << writeHandle.key()
130 <<
" with EventRange " << rangeW
131 <<
" into Conditions Store");
132 return StatusCode::FAILURE;
134 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.key() <<
" with range " << rangeW <<
" into Conditions Store");
136 return StatusCode::SUCCESS;
142 return StatusCode::SUCCESS;
146 const unsigned int runNumber{ctx.eventID().run_number()};
148 if (noDataExpected)
ATH_MSG_INFO(
"This run occurred before the /TDAQ/EnabledResources/ATLAS/SCT/Robins folder was filled in COOL; assuming the SCT is all ok.");
149 return noDataExpected;
156 const long unsigned int length{chanNameString.size()};
159 std::istringstream iss{chanNameString.substr(
length-6, 6)};
160 iss.exceptions(std::ios_base::badbit|std::ios_base::failbit);
163 }
catch (
const std::ios_base::failure&){
164 std::cerr<<
"Bad conversion of last 6 digits of "<<chanNameString<<
" to a hex number"<<std::endl;
165 throw(std::ios_base::failure(
"stringToInt failure in SCT_TdaqEnabledSvc"));
173 return std::string(
"No SCT rods were");
176 return std::string(
"One SCT rod was");