21 ATH_MSG_FATAL(
"No data source is given to load efficiency maps 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;
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;
73 for (
auto& corr : lines.items()) {
74 nlohmann::json line = corr.value();
76 const std::string stationType = line[
"station"];
77 const int stationPhi = line[
"phi"];
78 const int stationEta = line[
"eta"];
79 const int multiLayer = line[
"multilayer"];
80 const int gasGap = line[
"gasGap"];
81 const int feb = line[
"frontEndBoard"];
85 multiLayer, gasGap, feb, is_valid);
87 ATH_MSG_FATAL(
"The Identifier identifier "<<stationType<<
", "<<stationEta<<
", "<<stationPhi
88 <<
", "<<multiLayer<<
", "<<gasGap<<
", "<<feb<<
" is invalid");
89 return StatusCode::FAILURE;
93 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.
virtual StatusCode execute(const EventContext &ctx) const override
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Gaudi::Property< std::string > m_readFromJSON
Load the gasGap efficiencies from a JSON file.
MmDigitEffiCondAlg(const std::string &name, ISvcLocator *svc)
SG::WriteCondHandleKey< Muon::DigitEffiData > m_writeKey
virtual StatusCode initialize() override
Gaudi::Property< double > m_defaultEffi
StatusCode parseDataFromJSON(const nlohmann::json &lines, Muon::DigitEffiData &effiData) const
Parse efficiency data from COOL.
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDb
StatusCode setEfficiency(const Identifier §ionId, const double effi, bool isInnerQ1=false)
Sets the efficiency for a given minimal section of the dector.
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="")