35 ". Note: UseHV Overrides hv limit and chanstat values in joboptions!!");
38 return StatusCode::SUCCESS;
45 return StatusCode::SUCCESS;
53 <<
". In theory this should not be called, but may happen"
54 <<
" if multiple concurrent events are being processed out of order.");
55 return StatusCode::SUCCESS;
61 if (readCdoState==
nullptr) {
62 ATH_MSG_FATAL(
"Null pointer to the read conditions object (state)");
63 return StatusCode::FAILURE;
67 ATH_MSG_INFO(
"Size of CondAttrListCollection " << readHandleState.
fullKey() <<
" readCdo->size()= " << readCdoState->
size());
71 std::unique_ptr<SCT_DCSStatCondData> writeCdoState{std::make_unique<SCT_DCSStatCondData>()};
76 std::string paramState{
"STATE"};
80 for (; attrListState!=endState; ++attrListState) {
84 if (payload.exists(paramState) and not payload[paramState].isNull()) {
85 unsigned int val{payload[paramState].data<
unsigned int>()};
86 unsigned int hvstate{(val >> 4) & 0xF};
87 unsigned int lvstate{ val & 0xF};
89 and not ((hvstate==
ON or hvstate==
MANUAL)
90 and (lvstate==
ON or lvstate==
MANUAL)))
97 writeCdoState->fill(channelNumber, paramState);
99 writeCdoState->remove(channelNumber, paramState);
102 ATH_MSG_WARNING(paramState <<
" does not exist for ChanNum " << channelNumber);
110 if (readCdoHV==
nullptr) {
111 ATH_MSG_FATAL(
"Null pointer to the read conditions object (HV)");
112 return StatusCode::FAILURE;
116 ATH_MSG_INFO(
"Size of CondAttrListCollection " << readHandleHV.
fullKey() <<
" readCdo->size()= " << readCdoHV->
size());
119 std::string paramHV{
"HVCHVOLT_RECV"};
123 for (; attrListHV!=endHV; ++attrListHV) {
127 if (payload.exists(paramHV) and not payload[paramHV].isNull()) {
128 float hvval{payload[paramHV].data<
float>()};
130 writeCdoState->fill(channelNumber, paramHV);
132 writeCdoState->remove(channelNumber, paramHV);
135 ATH_MSG_WARNING(paramHV <<
" does not exist for ChanNum " << channelNumber);
141 if (writeHandle.
record(std::move(writeCdoState)).isFailure()) {
143 <<
" with EventRange " << writeHandle.
getRange()
144 <<
" into Conditions Store");
145 return StatusCode::FAILURE;
147 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
149 return StatusCode::SUCCESS;
155 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Base class for conditions algorithms.
This class is a collection of AttributeLists where each one is associated with a channel number.
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
size_type size() const
number of Chan/AttributeList pairs
ChanAttrListMap::const_iterator const_iterator
coral::AttributeList AttributeList
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyState
StringProperty m_chanstatCut
FloatProperty m_useHVLowLimit
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyHV
BooleanProperty m_useDefaultHV
SCT_DCSConditionsStatCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteCondHandleKey< SCT_DCSStatCondData > m_writeKeyState
virtual StatusCode execute(const EventContext &ctx) const override final
BooleanProperty m_returnHVTemp
virtual StatusCode finalize() override final
BooleanProperty m_readAllDBFolders
StringProperty m_useHVChanCut
FloatProperty m_hvUpLimit
virtual StatusCode initialize() override final
FloatProperty m_hvLowLimit
FloatProperty m_useHVUpLimit
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