ATLAS Offline Software
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
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 }

◆ ~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 }

◆ 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 
49  const LArBadFebCont* bfCont{*bfContHdl};
50  return (0x1 << LArBadFebEnum::ProblemType::deadAllBit) & (bfCont->status(febId)).packedData();
51 }

◆ febStatus()

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

Definition at line 62 of file LArBadFebMasker.cxx.

62  {
63 
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 
30  ATH_CHECK(m_bfContKey.initialize(m_doMasking));
31 
32  if(!m_doMasking) return StatusCode::SUCCESS; //Do nothing
33 
34  buildBitMask();
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 }

◆ 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 
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:
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
LArBadFebMasker::buildBitMask
void buildBitMask()
Definition: LArBadFebMasker.cxx:69
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
skel.it
it
Definition: skel.GENtoEVGEN.py:423
LArBadXCont::status
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
LArBadFebMasker::m_doMasking
bool m_doMasking
Definition: LArBadFebMasker.h:44
LArBadFebMasker::m_bitMask
BitWord m_bitMask
Definition: LArBadFebMasker.h:42
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LArBadFebMasker::m_problemWords
std::vector< std::string > m_problemWords
Definition: LArBadFebMasker.h:43
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArBadFebBitPacking::setBit
void setBit(ProblemType pb, BitWord &word, bool value=true) const
Definition: LArBadFebBitPacking.cxx:58
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
LArBadFeb
Definition: LArBadFeb.h:10
Base_Fragment.defaults
dictionary defaults
This includes now the top quark, the leptons and the bosons.
Definition: GeneratorFilters/share/common/Base_Fragment.py:79
LArBadFebBitPacking
Definition: LArBadFebBitPacking.h:16
LArBadFebMasker::defaultProblems
static const std::vector< std::string > & defaultProblems()
Definition: LArBadFebMasker.cxx:84
LArBadFebMasker::m_bfContKey
SG::ReadCondHandleKey< LArBadFebCont > m_bfContKey
Definition: LArBadFebMasker.h:41
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArBadFebBitPacking::stringStatus
std::string stringStatus(const LArBadFeb &bc) const
Definition: LArBadFebBitPacking.cxx:86
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15