ATLAS Offline Software
Loading...
Searching...
No Matches
LArBadFebMasker Class Reference

#include <LArBadFebMasker.h>

Inheritance diagram for LArBadFebMasker:
Collaboration diagram for LArBadFebMasker:

Public Member Functions

 LArBadFebMasker (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~LArBadFebMasker ()
virtual StatusCode initialize () override
virtual bool febMissing (const HWIdentifier &febId) const override final
virtual bool shouldbeMasked (const HWIdentifier &febId) const override final
virtual LArBadFeb febStatus (const HWIdentifier &febId) const override final
virtual bool isMaskingOn () const override final

Private Types

typedef LArBadFebEnum::BitWord BitWord

Private Member Functions

 LArBadFebMasker ()
void buildBitMask ()

Static Private Member Functions

static const std::vector< std::string > & defaultProblems ()

Private Attributes

SG::ReadCondHandleKey< LArBadFebContm_bfContKey
BitWord m_bitMask
std::vector< std::string > m_problemWords
bool m_doMasking

Detailed Description

Definition at line 16 of file LArBadFebMasker.h.

Member Typedef Documentation

◆ BitWord

Definition at line 34 of file LArBadFebMasker.h.

Constructor & Destructor Documentation

◆ LArBadFebMasker() [1/2]

LArBadFebMasker::LArBadFebMasker ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 10 of file LArBadFebMasker.cxx.

11 :
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}
SG::ReadCondHandleKey< LArBadFebCont > m_bfContKey
static const std::vector< std::string > & defaultProblems()
std::vector< std::string > m_problemWords

◆ ~LArBadFebMasker()

LArBadFebMasker::~LArBadFebMasker ( )
virtualdefault

◆ LArBadFebMasker() [2/2]

LArBadFebMasker::LArBadFebMasker ( )
private

Member Function Documentation

◆ buildBitMask()

void LArBadFebMasker::buildBitMask ( )
private

Definition at line 69 of file LArBadFebMasker.cxx.

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}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
void setBit(ProblemType pb, BitWord &word, bool value=true) const

◆ defaultProblems()

const std::vector< std::string > & LArBadFebMasker::defaultProblems ( )
staticprivate

Definition at line 84 of file LArBadFebMasker.cxx.

85{
86 const static std::vector<std::string> defaults = { "deadAllBit" };
87 return defaults;
88}

◆ febMissing()

bool LArBadFebMasker::febMissing ( const HWIdentifier & febId) const
finaloverridevirtual

Definition at line 44 of file LArBadFebMasker.cxx.

44 {
45
46 if(!m_doMasking) return false;
47
48 SG::ReadCondHandle<LArBadFebCont> bfContHdl{m_bfContKey};
49 const LArBadFebCont* bfCont{*bfContHdl};
50 return (0x1 << LArBadFebEnum::ProblemType::deadAllBit) & (bfCont->status(febId)).packedData();
51}
LArBadXCont< LArBadFeb > LArBadFebCont
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.

◆ febStatus()

LArBadFeb LArBadFebMasker::febStatus ( const HWIdentifier & febId) const
finaloverridevirtual

Definition at line 62 of file LArBadFebMasker.cxx.

62 {
63
64 SG::ReadCondHandle<LArBadFebCont> bfContHdl{m_bfContKey};
65 const LArBadFebCont* bfCont{*bfContHdl};
66 return bfCont->status(febId);
67}

◆ initialize()

StatusCode LArBadFebMasker::initialize ( )
overridevirtual

Definition at line 26 of file LArBadFebMasker.cxx.

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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
std::string stringStatus(const LArBadFeb &bc) const

◆ isMaskingOn()

virtual bool LArBadFebMasker::isMaskingOn ( ) const
inlinefinaloverridevirtual

Definition at line 29 of file LArBadFebMasker.h.

30 {return m_doMasking;}

◆ shouldbeMasked()

bool LArBadFebMasker::shouldbeMasked ( const HWIdentifier & febId) const
finaloverridevirtual

Definition at line 53 of file LArBadFebMasker.cxx.

53 {
54
55 if(!m_doMasking) return false;
56
57 SG::ReadCondHandle<LArBadFebCont> bfContHdl{m_bfContKey};
58 const LArBadFebCont* bfCont{*bfContHdl};
59 return m_bitMask & (bfCont->status(febId)).packedData();
60}

Member Data Documentation

◆ m_bfContKey

SG::ReadCondHandleKey<LArBadFebCont> LArBadFebMasker::m_bfContKey
private

Definition at line 41 of file LArBadFebMasker.h.

◆ m_bitMask

BitWord LArBadFebMasker::m_bitMask
private

Definition at line 42 of file LArBadFebMasker.h.

◆ m_doMasking

bool LArBadFebMasker::m_doMasking
private

Definition at line 44 of file LArBadFebMasker.h.

◆ m_problemWords

std::vector<std::string> LArBadFebMasker::m_problemWords
private

Definition at line 43 of file LArBadFebMasker.h.


The documentation for this class was generated from the following files: