12 string2Vector(
const std::string&
s) {
14 std::istringstream inputStream{
s};
15 std::istream_iterator<T> vecRead{inputStream};
16 std::istream_iterator<T> endOfString;
17 std::copy(vecRead,endOfString, std::back_inserter(
v));
35 return StatusCode::SUCCESS;
44 if (writeHandle.isValid()) {
45 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
46 <<
". In theory this should not be called, but may happen"
47 <<
" if multiple concurrent events are being processed out of order.");
48 return StatusCode::SUCCESS;
54 if (readCdo==
nullptr) {
56 return StatusCode::FAILURE;
59 writeHandle.addDependency(readHandle);
60 ATH_MSG_INFO(
"Size of AthenaAttributeList " << readHandle.fullKey() <<
" readCdo->size()= " << readCdo->size());
61 ATH_MSG_INFO(
"Range of input is " << readHandle.getRange());
64 std::unique_ptr<SCT_ModuleVetoCondData> writeCdo{std::make_unique<SCT_ModuleVetoCondData>()};
67 const std::string &badModuleString{(*readCdo)[
"ModuleList"].data<std::string>()};
68 std::vector<unsigned long long>
v{string2Vector<unsigned long long>(badModuleString)};
69 unsigned long long numberInDb{
static_cast<unsigned long long>(
v.size())};
70 ATH_MSG_INFO(numberInDb <<
" elements were declared bad in the database.");
71 for (
const unsigned long long badWaferId:
v) {
72 writeCdo->setBadWaferId(
Identifier{badWaferId});
76 if (writeHandle.record(std::move(writeCdo)).isFailure()) {
77 ATH_MSG_FATAL(
"Could not record SCT_ModuleVetoCondData " << writeHandle.key()
78 <<
" with EventRange " << writeHandle.getRange()
79 <<
" into Conditions Store");
80 return StatusCode::FAILURE;
82 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.key() <<
" with range " << writeHandle.getRange() <<
" into Conditions Store");
84 return StatusCode::SUCCESS;
89 return StatusCode::SUCCESS;