19 ATH_MSG_FATAL(
"No data source is given to load efficiency maps 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;
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;
71 for (
auto& corr : lines.items()) {
72 nlohmann::json line = corr.value();
74 const std::string stationType = line[
"station"];
77 const int doubletR = line[
"doubletR"];
78 const int doubletZ = line[
"doubletZ"];
79 const int doubletPhi = line[
"doubletPhi"];
80 const int gasGap = line[
"gasGap"];
81 const int measuresPhi = line[
"measuresPhi"];
87 <<
", "<<doubletR<<
", "<<doubletZ<<
", "<<doubletPhi<<
", "<<gasGap<<
", "<<measuresPhi<<
" 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)
ChanAttrListMap::const_iterator const_iterator
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
StatusCode setEfficiency(const Identifier §ionId, const double effi, bool isInnerQ1=false)
Sets the efficiency for a given minimal section of the dector.
StatusCode parseDataFromJSON(const nlohmann::json &lines, Muon::DigitEffiData &effiData) const
Parse efficiency data from COOL.
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDb
Gaudi::Property< double > m_defaultEffi
SG::WriteCondHandleKey< Muon::DigitEffiData > m_writeKey
Gaudi::Property< std::string > m_readFromJSON
Load the gasGap efficiencies from a JSON file.
virtual StatusCode initialize() override
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual StatusCode execute(const EventContext &ctx) const override
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
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.