23 return StatusCode::SUCCESS;
31 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.
fullKey() <<
" is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order.");
32 return StatusCode::SUCCESS;
40 std::unique_ptr<PixelDCSHVData> writeCdo(std::make_unique<PixelDCSHVData>());
42 const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
43 const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
45 EventIDRange rangeW{start, stop};
50 if (readCdo==
nullptr) {
52 return StatusCode::FAILURE;
55 if (not readHandle.
range(rangeW)) {
57 return StatusCode::FAILURE;
59 ATH_MSG_INFO(
"Size of CondAttrListCollection " << readHandle.
fullKey() <<
" readCdo->size()= " << readCdo->
size());
63 std::string param(
"HV");
65 for (
const auto & attrList : *readCdo) {
68 if (payload.exists(param) and not payload[param].isNull()) {
69 float val = payload[param].data<
float>();
70 writeCdo -> setBiasVoltage((
int)channelNumber, val);
72 ATH_MSG_WARNING(param <<
" does not exist for ChanNum " << channelNumber);
73 writeCdo -> setChannelToDefault((
int)channelNumber);
77 writeCdo -> useDefault(
true);
80 if (writeHandle.
record(rangeW, std::move(writeCdo)).isFailure()) {
81 ATH_MSG_FATAL(
"Could not record PixelDCSHVData " << writeHandle.
key() <<
" with EventRange "
82 << writeHandle.
getRange() <<
" into Conditions Store");
83 return StatusCode::FAILURE;
86 <<
" into Conditions Store");
88 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
const ServiceHandle< StoreGateSvc > & detStore() const
Base class for conditions algorithms.
This class is a collection of AttributeLists where each one is associated with a channel number.
size_type size() const
number of Chan/AttributeList pairs
coral::AttributeList AttributeList
const PixelID * m_pixelID
SG::WriteCondHandleKey< PixelDCSHVData > m_writeKey
virtual StatusCode initialize() override final
SG::ReadCondHandleKey< PixelModuleData > m_moduleDataKey
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey
PixelDCSCondHVAlg(const std::string &name, ISvcLocator *pSvcLocator)
float getDefaultBiasVoltage() const
bool range(EventIDRange &r)
const std::string & key() const
const DataObjID & fullKey() const
const EventIDRange & getRange()
const std::string & key() const
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const