19 ATH_MSG_FATAL(
"No data source is given to load the as build parameters. Please provide either a COOL folder or a json file");
20 return StatusCode::FAILURE;
27 return StatusCode::SUCCESS;
37 <<
" In theory this should not be called, but may happen"
38 <<
" if multiple concurrent events are being processed out of order.");
39 return StatusCode::SUCCESS;
42 std::unique_ptr<sTGCAsBuiltData> writeCdo{std::make_unique<sTGCAsBuiltData>(
m_idHelperSvc.get())};
47 return StatusCode::FAILURE;
51 const coral::AttributeList& atr = itr->second;
52 const std::string
data{*(
static_cast<const std::string*
>((atr[
"data"]).addressOfData()))};
53 nlohmann::json lines = nlohmann::json::parse(
data);
58 if (!inStream.good()) {
60 return StatusCode::FAILURE;
67 ATH_MSG_DEBUG(
"Recorded new " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
68 return StatusCode::SUCCESS;
72 for (
auto& corr : lines.items()) {
73 nlohmann::json line = corr.value();
75 const std::string stationType = line[
"station"];
76 const int stationPhi = line[
"phi"];
77 const int stationEta = line[
"eta"];
78 const int multiLayer = line[
"multilayer"];
79 const int gasGap = line[
"gasGap"];
84 ATH_MSG_FATAL(
"The Identifier identifier "<<stationType<<
", "<<stationEta<<
", "<<stationPhi
85 <<
", "<<multiLayer<<
", "<<gasGap<<
" is invalid");
86 return StatusCode::FAILURE;
90 pars.offset = line[
"offset"];
91 pars.rotation = line[
"rotation"];
92 pars.scale = line[
"scale"];
93 pars.nonPara = line[
"nonPara"];
97 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.
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
SG::WriteCondHandleKey< sTGCAsBuiltData > m_writeKey
virtual StatusCode initialize() override
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDb
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.
StatusCode parseDataFromJSON(const nlohmann::json &lines, sTGCAsBuiltData &effiData) const
Parse efficiency data from COOL.
Class holding the sTGC as built conditions data and applying it.
StatusCode setParameters(const Identifier &gasGapId, const Parameters &pars)