ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArBadChannelTool
src
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
5
#include "
LArBadChannelTool/LArBadFebMasker.h
"
6
#include "
StoreGate/ReadCondHandle.h
"
7
#include "
LArRecConditions/LArBadFebBitPacking.h
"
8
9
10
LArBadFebMasker::LArBadFebMasker
(
const
std::string&
type
,
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
23
LArBadFebMasker::~LArBadFebMasker
()
24
=
default
;
25
26
StatusCode
LArBadFebMasker::initialize
()
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
48
SG::ReadCondHandle<LArBadFebCont>
bfContHdl{
m_bfContKey
};
49
const
LArBadFebCont
* bfCont{*bfContHdl};
50
return
(0x1 <<
LArBadFebEnum::ProblemType::deadAllBit
) & (bfCont->
status
(febId)).packedData();
51
}
52
53
bool
LArBadFebMasker::shouldbeMasked
(
const
HWIdentifier
& febId)
const
{
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
}
61
62
LArBadFeb
LArBadFebMasker::febStatus
(
const
HWIdentifier
& febId)
const
{
63
64
SG::ReadCondHandle<LArBadFebCont>
bfContHdl{
m_bfContKey
};
65
const
LArBadFebCont
* bfCont{*bfContHdl};
66
return
bfCont->
status
(febId);
67
}
68
69
void
LArBadFebMasker::buildBitMask
()
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
LArBadFebCont
LArBadXCont< LArBadFeb > LArBadFebCont
Definition
LArBadChannelCont.h:115
LArBadFebBitPacking.h
LArBadFebMasker.h
ReadCondHandle.h
HWIdentifier
Definition
HWIdentifier.h:13
LArBadFebBitPacking
Definition
LArBadFebBitPacking.h:16
LArBadFebBitPacking::setBit
void setBit(ProblemType pb, BitWord &word, bool value=true) const
Definition
LArBadFebBitPacking.cxx:58
LArBadFebBitPacking::stringStatus
std::string stringStatus(const LArBadFeb &bc) const
Definition
LArBadFebBitPacking.cxx:86
LArBadFebEnum::deadAllBit
@ deadAllBit
Definition
LArBadFebEnum.h:16
LArBadFebMasker::shouldbeMasked
virtual bool shouldbeMasked(const HWIdentifier &febId) const override final
Definition
LArBadFebMasker.cxx:53
LArBadFebMasker::buildBitMask
void buildBitMask()
Definition
LArBadFebMasker.cxx:69
LArBadFebMasker::initialize
virtual StatusCode initialize() override
Definition
LArBadFebMasker.cxx:26
LArBadFebMasker::m_bfContKey
SG::ReadCondHandleKey< LArBadFebCont > m_bfContKey
Definition
LArBadFebMasker.h:41
LArBadFebMasker::febMissing
virtual bool febMissing(const HWIdentifier &febId) const override final
Definition
LArBadFebMasker.cxx:44
LArBadFebMasker::m_doMasking
bool m_doMasking
Definition
LArBadFebMasker.h:44
LArBadFebMasker::m_bitMask
BitWord m_bitMask
Definition
LArBadFebMasker.h:42
LArBadFebMasker::~LArBadFebMasker
virtual ~LArBadFebMasker()
LArBadFebMasker::defaultProblems
static const std::vector< std::string > & defaultProblems()
Definition
LArBadFebMasker.cxx:84
LArBadFebMasker::febStatus
virtual LArBadFeb febStatus(const HWIdentifier &febId) const override final
Definition
LArBadFebMasker.cxx:62
LArBadFebMasker::LArBadFebMasker
LArBadFebMasker()
LArBadFebMasker::m_problemWords
std::vector< std::string > m_problemWords
Definition
LArBadFebMasker.h:43
LArBadFeb
Definition
LArBadFeb.h:10
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.
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
defaults
Definition
MSVtxValidationAlg.h:44
type
Generated on
for ATLAS Offline Software by
1.17.0