19 ATH_MSG_FATAL(
"No data source is given to load the energy thresholds from. Please provide either a COOL folder or a json file");
20 return StatusCode::FAILURE;
26 return StatusCode::SUCCESS;
36 <<
" In theory this should not be called, but may happen"
37 <<
" if multiple concurrent events are being processed out of order.");
38 return StatusCode::SUCCESS;
41 auto writeCdo{std::make_unique<TgcDigitThresholdData>(
m_idHelperSvc.get())};
46 return StatusCode::FAILURE;
50 const coral::AttributeList& atr = itr->second;
51 const std::string&
data{*(
static_cast<const std::string*
>((atr[
"data"]).addressOfData()))};
52 nlohmann::json lines = nlohmann::json::parse(
data);
57 if (!inStream.good()) {
59 return StatusCode::FAILURE;
66 ATH_MSG_DEBUG(
"Recorded new " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
67 return StatusCode::SUCCESS;
72 for (
auto& corr : lines.items()) {
73 nlohmann::json line = corr.value();
75 const std::string stationType = line[
"station"];
78 const int gasGap = line[
"gasGap"];
79 const int isStrip = line[
"isStrip"];
80 const double threshold = line[
"threshold"];
85 <<
", "<<gasGap<<
", "<<isStrip<<
" is invalid");
86 return StatusCode::FAILURE;
90 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)
ChanAttrListMap::const_iterator const_iterator
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_readFromJSON
Use an external file to load the Jitter constants from.
SG::WriteCondHandleKey< TgcDigitThresholdData > m_writeKey
virtual StatusCode execute(const EventContext &ctx) const override
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDb
StatusCode parseDataFromJSON(const nlohmann::json &lines, TgcDigitThresholdData &deadChannels) const
Load the threshold constants from the JSON blob.
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
Conditions object to cache.
bool setThreshold(const Identifier &layerId, const double threshold)
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.