Skip to content
Snippets Groups Projects
Commit 3c14adf4 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'master-SCT_DCSConditionsStatCondAlg' into 'master'

Define enums for DCS state word in SCT_DCSConditionsStatCondAlg for easier understanding.

See merge request atlas/athena!33886
parents eb587ef3 f83c14df
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,8 @@ StatusCode SCT_DCSConditionsStatCondAlg::execute(const EventContext& ctx) const
std::unique_ptr<SCT_DCSStatCondData> writeCdoState{std::make_unique<SCT_DCSStatCondData>()};
// Read state info
// Meaning of state word is found at
// https://twiki.cern.ch/twiki/bin/view/Atlas/SctDCSSoftware#Decoding_Status_words
std::string paramState{"STATE"};
CondAttrListCollection::const_iterator attrListState{readCdoState->begin()};
CondAttrListCollection::const_iterator endState{readCdoState->end()};
......@@ -92,11 +94,17 @@ StatusCode SCT_DCSConditionsStatCondAlg::execute(const EventContext& ctx) const
const CondAttrListCollection::AttributeList &payload{attrListState->second};
if (payload.exists(paramState) and not payload[paramState].isNull()) {
unsigned int val{payload[paramState].data<unsigned int>()};
unsigned int hvstate{val bitand 240};
unsigned int lvstate{val bitand 15};
if ( ( (m_chanstatCut=="NORM") and not ((hvstate==16 or hvstate==48) and (lvstate==1 or lvstate==3)) )
or ( (m_chanstatCut=="NSTBY") and not ((hvstate==16 or hvstate==48 or hvstate==32) and (lvstate==1 or lvstate==3 or lvstate==2)) )
or ( (m_chanstatCut=="LOOSE") and not ((hvstate==16 or hvstate==48 or hvstate==32 or hvstate==128) and (lvstate==1 or lvstate==3 or lvstate==2 or lvstate==8)) )) {
unsigned int hvstate{(val >> 4) & 0xF};
unsigned int lvstate{ val & 0xF};
if ( ((m_chanstatCut=="NORM")
and not ((hvstate==ON or hvstate==MANUAL)
and (lvstate==ON or lvstate==MANUAL)))
or ((m_chanstatCut=="NSTBY")
and not ((hvstate==ON or hvstate==MANUAL or hvstate==STANDBY)
and (lvstate==ON or lvstate==MANUAL or lvstate==STANDBY)))
or ((m_chanstatCut=="LOOSE")
and not ((hvstate==ON or hvstate==MANUAL or hvstate==STANDBY or hvstate==RAMPING)
and (lvstate==ON or lvstate==MANUAL or lvstate==STANDBY or lvstate==RAMPING)))) {
writeCdoState->fill(channelNumber, paramState);
} else {
writeCdoState->remove(channelNumber, paramState);
......
// -*- C++ -*-
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef SCT_DCSCONDITIONSSTATCONDALG
......@@ -30,6 +30,25 @@ class SCT_DCSConditionsStatCondAlg : public AthReentrantAlgorithm
virtual bool isClonable() const override { return true; }
private:
// Meaning of state word is found at
// https://twiki.cern.ch/twiki/bin/view/Atlas/SctDCSSoftware#Decoding_Status_words
enum StateWord {OFF=0x0,
ON=0x1,
STANDBY=0x2,
MANUAL=0x3,
MASK_OFF=0x4,
MASK_ON=0x5,
HARD_RESET=0x6,
DISABLED=0x7,
RAMPING=0x8,
INTERLOCKED=0x9,
TRIP_HW=0xA,
TRIP_SW=0xB,
LVCARD_LATCH=0xC,
NO_MATCH=0xD,
UNKNOWN=0xE,
ANY=0xF};
SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyHV{this, "ReadKeyHV", "/SCT/DCS/HV", "Key of input (raw) HV conditions folder"};
SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyState{this, "ReadKeyState", "/SCT/DCS/CHANSTAT", "Key of input (raw) State conditions folder"};
SG::WriteCondHandleKey<SCT_DCSStatCondData> m_writeKeyState{this, "WriteKeyState", "SCT_DCSStatCondData", "Key of output (derived) State conditions data"};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment