ATLAS Offline Software
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),
15  m_problemWords(defaultProblems()),
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 
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 }
43 
44 bool LArBadFebMasker::febMissing(const HWIdentifier& febId) const{
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 
84 const std::vector<std::string>& LArBadFebMasker::defaultProblems()
85 {
86  const static std::vector<std::string> defaults = { "deadAllBit" };
87  return defaults;
88 }
89 
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
LArBadFebMasker::initialize
virtual StatusCode initialize() override
Definition: LArBadFebMasker.cxx:26
skel.it
it
Definition: skel.GENtoEVGEN.py:396
LArBadFebMasker::~LArBadFebMasker
virtual ~LArBadFebMasker()
HWIdentifier
Definition: HWIdentifier.h:13
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.h
LArBadFebMasker::m_doMasking
bool m_doMasking
Definition: LArBadFebMasker.h:44
ReadCondHandle.h
LArBadFebMasker::m_bitMask
BitWord m_bitMask
Definition: LArBadFebMasker.h:42
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
LArBadFebMasker::febMissing
virtual bool febMissing(const HWIdentifier &febId) const override final
Definition: LArBadFebMasker.cxx:44
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
LArBadFebMasker::shouldbeMasked
virtual bool shouldbeMasked(const HWIdentifier &febId) const override final
Definition: LArBadFebMasker.cxx:53
LArBadFebMasker::LArBadFebMasker
LArBadFebMasker()
LArBadFebMasker::febStatus
virtual LArBadFeb febStatus(const HWIdentifier &febId) const override final
Definition: LArBadFebMasker.cxx:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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
LArBadFebBitPacking.h