21 ATH_MSG_FATAL(
"No data source is given to load the energy thresholds from. Please provide either a COOL folder or a json file");
22 return StatusCode::FAILURE;
28 return StatusCode::SUCCESS;
38 <<
" In theory this should not be called, but may happen"
39 <<
" if multiple concurrent events are being processed out of order.");
40 return StatusCode::SUCCESS;
43 std::unique_ptr<TgcDigitThresholdData> writeCdo{std::make_unique<TgcDigitThresholdData>(
m_idHelperSvc.get())};
48 return StatusCode::FAILURE;
52 const coral::AttributeList& atr = itr->second;
53 const std::string&
data{*(
static_cast<const std::string*
>((atr[
"data"]).addressOfData()))};
54 nlohmann::json lines = nlohmann::json::parse(
data);
59 if (!inStream.good()) {
61 return StatusCode::FAILURE;
68 ATH_MSG_DEBUG(
"Recorded new " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
69 return StatusCode::SUCCESS;
74 for (
auto& corr : lines.items()) {
75 nlohmann::json line = corr.value();
77 const std::string stationType = line[
"station"];
78 const int stationPhi = line[
"phi"];
79 const int stationEta = line[
"eta"];
80 const int gasGap = line[
"gasGap"];
81 const int isStrip = line[
"isStrip"];
82 const double threshold = line[
"threshold"];
84 const Identifier id =
m_idHelperSvc->tgcIdHelper().channelID(stationType, stationEta, stationPhi, gasGap, isStrip, 1, is_valid);
86 ATH_MSG_FATAL(
"The Identifier identifier "<<stationType<<
", "<<stationEta<<
", "<<stationPhi
87 <<
", "<<gasGap<<
", "<<isStrip<<
" 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
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteCondHandleKey< TgcDigitThresholdData > m_writeKey
StatusCode parseDataFromJSON(const nlohmann::json &lines, TgcDigitThresholdData &deadChannels) const
Load the threshold constants from the JSON blob.
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDb
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_readFromJSON
Use an external file to load the Jitter constants from.
TgcDigitEnergyThreshCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Conditions object to cache.
bool setThreshold(const Identifier &layerId, const double threshold)