7#include "CoralBase/Blob.h"
21 return StatusCode::SUCCESS;
30 <<
" In theory this should not be called, but may happen"
31 <<
" if multiple concurrent events are being processed out of order.");
32 return StatusCode::SUCCESS;
35 std::unique_ptr<NswPassivationDbData> writeCdo{std::make_unique<NswPassivationDbData>(
m_idHelperSvc->mmIdHelper())};
38 if (!inStream.good()) {
40 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
53 ATH_MSG_DEBUG(
"Size of CondAttrListCollection " << readHandle.
fullKey() <<
" readCdo->size()= " << readHandle->size());
57 unsigned int nObjs = 0;
59 itr != readHandle->end(); ++itr) {
61 const coral::AttributeList& atr = itr->second;
62 const std::string&
data{*(
static_cast<const std::string *
>((atr[
"data"]).addressOfData()))};
71 if (writeHandle.
record(std::move(writeCdo)).isFailure()) {
73 <<
" with EventRange " << writeHandle.
getRange()
74 <<
" into Conditions Store");
75 return StatusCode::FAILURE;
77 ATH_MSG_DEBUG(
"Recorded new " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
79 return StatusCode::SUCCESS;
83 unsigned int nChns = 0;
84 for (
const auto &kt :
json.items()) {
85 nlohmann::json jt = kt.value();
87 Identifier channelId =
m_idHelperSvc->mmIdHelper().pcbID(
int(jt[
"stationName"]), jt[
"stationEta"], jt[
"stationPhi"], jt[
"multiLayer"], jt[
"gasGap"], jt[
"pcbPos"],
isValid);
90 return StatusCode::FAILURE;
92 writeCdo.
setData(channelId, jt[
"pcbPos"], jt[
"indiv"], jt[
"extra"], jt[
"position"]);
96 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
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 initialize() override
Gaudi::Property< std::string > m_readFromJSON
virtual StatusCode execute(const EventContext &) const override
StatusCode parseData(const nlohmann::json &json, NswPassivationDbData &writeCdo) const
readKey_t m_readKey_data_mm
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
NswPassivationDbAlg(const std::string &name, ISvcLocator *pSvcLocator)
void setData(const Identifier &chnlId, const int pcb, const float indiv, const float extra, const std::string &position)
const DataObjID & fullKey() const
const EventIDRange & getRange()
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