23 ATH_MSG_FATAL(
"No data source is given to load the dead chamber data from. Please provide either a COOL folder or a json file");
24 return StatusCode::FAILURE;
30 return StatusCode::SUCCESS;
40 <<
" In theory this should not be called, but may happen"
41 <<
" if multiple concurrent events are being processed out of order.");
42 return StatusCode::SUCCESS;
45 std::unique_ptr<TgcCondDbData> writeCdo{std::make_unique<TgcCondDbData>(
m_idHelperSvc.get())};
50 return StatusCode::FAILURE;
54 const coral::AttributeList& atr = itr->second;
55 const std::string
data{*(
static_cast<const std::string*
>((atr[
"data"]).addressOfData()))};
56 nlohmann::json lines = nlohmann::json::parse(
data);
61 if (!inStream.good()) {
63 return StatusCode::FAILURE;
70 ATH_MSG_DEBUG(
"Recorded new " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
72 return StatusCode::SUCCESS;
77 for (
auto& corr : lines.items()) {
78 nlohmann::json line = corr.value();
80 const std::string stationType = line[
"station"];
81 const int stationPhi = line[
"phi"];
82 const int stationEta = line[
"eta"];
83 const int gasGap = line[
"gasGap"];
85 const Identifier id =
m_idHelperSvc->tgcIdHelper().channelID(stationType, stationEta, stationPhi, gasGap,
false, 1, is_valid);
87 ATH_MSG_FATAL(
"The Identifier identifier "<<stationType<<
", "<<stationEta<<
", "<<stationPhi<<
", "<<gasGap<<
" is invalid");
88 return StatusCode::FAILURE;
92 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Base class for conditions algorithms.
ChanAttrListMap::const_iterator const_iterator
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_readFromJSON
Load the detector status from a JSON file.
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDb
StatusCode parseDataFromJSON(const nlohmann::json &lines, TgcCondDbData &deadChannels) const
Load the detector status from cool.
SG::WriteCondHandleKey< TgcCondDbData > m_writeKey
TgcCondDbAlg(const std::string &name, ISvcLocator *svc)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Conditions object to mark switched-off Tgc gasGaps.
void setDeadGasGap(const Identifier &id)
Declare all channels wires + strips in a gasGap as dead.