ATLAS Offline Software
Loading...
Searching...
No Matches
LArBadFebMasker.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9
11 const std::string& name, const IInterface* parent) :
12 base_class(type, name, parent),
13 m_bfContKey("LArBadFeb"),
14 m_bitMask(0),
16 m_doMasking(false)
17{
18 declareProperty("BFKey",m_bfContKey,"Key of the BadFebContainer in the conditions store");
19 declareProperty("ProblemsToMask", m_problemWords, "List of FEB problems to be masked.");
20 declareProperty("DoMasking", m_doMasking, "Flag to turn FEB masking on or off.");
21}
22
24= default;
25
27{
28 ATH_MSG_DEBUG ( "in initialize()" );
29
31
32 if(!m_doMasking) return StatusCode::SUCCESS; //Do nothing
33
35
36 LArBadFeb tempBF(m_bitMask); //consider overloading the function
37 LArBadFebBitPacking bf_bitpack;
38 ATH_MSG_INFO ( "Cell masking is ON. The following problems will be masked: "
39 << bf_bitpack.stringStatus(tempBF) );
40
41 return StatusCode::SUCCESS;
42}
43
45
46 if(!m_doMasking) return false;
47
49 const LArBadFebCont* bfCont{*bfContHdl};
50 return (0x1 << LArBadFebEnum::ProblemType::deadAllBit) & (bfCont->status(febId)).packedData();
51}
52
54
55 if(!m_doMasking) return false;
56
58 const LArBadFebCont* bfCont{*bfContHdl};
59 return m_bitMask & (bfCont->status(febId)).packedData();
60}
61
63
65 const LArBadFebCont* bfCont{*bfContHdl};
66 return bfCont->status(febId);
67}
68
70{
71 m_bitMask = 0;
72
73 LArBadFebBitPacking bf_bitPacking;
74 for(std::vector<std::string>::const_iterator it = m_problemWords.begin();
75 it != m_problemWords.end(); ++it)
76 {
77 if(bf_bitPacking.setBit(*it,m_bitMask,true))
78 ATH_MSG_DEBUG("The problem flag '"<< (*it) << "' was set.");
79 else
80 ATH_MSG_WARNING ( "The problem flag '" << (*it) << "' was not recognized." );
81 }
82}
83
84const std::vector<std::string>& LArBadFebMasker::defaultProblems()
85{
86 const static std::vector<std::string> defaults = { "deadAllBit" };
87 return defaults;
88}
89
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
LArBadXCont< LArBadFeb > LArBadFebCont
void setBit(ProblemType pb, BitWord &word, bool value=true) const
std::string stringStatus(const LArBadFeb &bc) const
virtual bool shouldbeMasked(const HWIdentifier &febId) const override final
virtual StatusCode initialize() override
SG::ReadCondHandleKey< LArBadFebCont > m_bfContKey
virtual bool febMissing(const HWIdentifier &febId) const override final
virtual ~LArBadFebMasker()
static const std::vector< std::string > & defaultProblems()
virtual LArBadFeb febStatus(const HWIdentifier &febId) const override final
std::vector< std::string > m_problemWords
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.