21 ATH_MSG_FATAL(
"No data source is given to load the jitter constants 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<TgcDigitJitterData> writeCdo{std::make_unique<TgcDigitJitterData>()};
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;
69 ATH_MSG_DEBUG(
"Recorded new " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
70 return StatusCode::SUCCESS;
75 for (
auto& corr : lines.items()) {
76 nlohmann::json line = corr.value();
77 const double angle = line[
"angle"];
78 std::vector<double> values = line[
"values"];
81 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)
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
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
StatusCode parseDataFromJSON(const nlohmann::json &lines, TgcDigitJitterData &jitterChannels) const
Load the Jitter constants from the JSON format.
Gaudi::Property< std::string > m_readFromJSON
Use an external JSON file to load the Jitter constants from.
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDb
virtual StatusCode initialize() override
SG::WriteCondHandleKey< TgcDigitJitterData > m_writeKey
TgcDigitJitterCondAlg(const std::string &name, ISvcLocator *svc)
void cacheAngleInterval(const double minAngle, std::vector< double > &&timeProbs)