ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloBadChannelTool
src
CaloBadChanTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
CaloBadChannelTool/CaloBadChanTool.h
"
6
7
//#include "GaudiKernel/MsgStream.h"
8
9
CaloBadChanTool::CaloBadChanTool
(
const
std::string&
type
,
const
std::string& name,
10
const
IInterface* parent) :
11
AthAlgTool
(
type
, name, parent),
12
m_caloID
(nullptr)
13
{
14
declareInterface<ICaloBadChanTool>(
this
);
15
}
16
17
18
CaloBadChanTool::~CaloBadChanTool
() =
default
;
19
20
StatusCode
CaloBadChanTool::initialize
()
21
{
22
ATH_MSG_DEBUG
(
"in initialize()"
);
23
24
StatusCode
sc
=
m_larBCKey
.initialize();
25
if
(
sc
.isFailure()) {
26
ATH_MSG_WARNING
(
"Unable to initialize LAr bad channels key: no LAr bad channel info will be provided "
);
27
}
28
else
29
ATH_MSG_DEBUG
(
"LAr bad channels key initialized"
);
30
31
32
sc
=
m_tileBCT
.retrieve();
33
if
(
sc
.isFailure()) {
34
ATH_MSG_WARNING
(
"Unable to get TileBadChannelTool: no Tile bad channel info will be provided "
);
35
}
36
else
37
ATH_MSG_DEBUG
(
"TileBadChannelTool retrieved"
);
38
39
ATH_CHECK
(
detStore
()->retrieve(
m_caloID
,
"CaloCell_ID"
) );
40
return
StatusCode::SUCCESS;
41
}
42
43
CaloBadChannel
44
CaloBadChanTool::caloStatus
(
const
EventContext& ctx,
Identifier
id
)
const
45
{
46
if
(
m_tileBCT
&&
m_caloID
->is_tile(
id
)) {
47
return
m_tileBCT
->caloStatus(ctx,
id
);
48
}
else
if
(
m_caloID
->is_lar(
id
)) {
49
SG::ReadCondHandle<LArBadChannelCont>
bch{
m_larBCKey
, ctx };
50
const
LArBadChannelCont
* bcCont{ *bch };
51
if
(bcCont) {
52
CaloBadChannel::BitWord
res
= 0;
53
LArBadChannel
lbc = bcCont->
offlineStatus
(
id
);
54
55
if
(lbc.
reallyNoisy
() || lbc.
sporadicBurstNoise
()) {
56
CaloBadChannel::setBit
(
CaloBadChannel::noisyBit
,
res
);
57
}
58
if
(lbc.
deadReadout
() || lbc.
deadPhys
()) {
59
CaloBadChannel::setBit
(
CaloBadChannel::deadBit
,
res
);
60
}
else
if
(!lbc.
good
()) {
61
CaloBadChannel::setBit
(
CaloBadChannel::affectedBit
,
res
);
62
}
63
return
{
res
};
64
}
else
{
65
CaloBadChannel
empty
;
66
return
empty
;
67
}
68
}
else
{
69
CaloBadChannel
empty
;
70
return
empty
;
71
}
72
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x,...)
Definition
AthMsgStreamMacros.h:46
CaloBadChanTool.h
res
std::pair< std::vector< unsigned int >, bool > res
Definition
JetGroupProductTest.cxx:11
LArBadChannelCont
LArBadXCont< LArBadChannel > LArBadChannelCont
Definition
LArBadChannelCont.h:108
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
empty
static const Attributes_t empty
Definition
XmlStreamer.cxx:16
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
CaloBadChanTool::~CaloBadChanTool
virtual ~CaloBadChanTool() override
CaloBadChanTool::m_larBCKey
SG::ReadCondHandleKey< LArBadChannelCont > m_larBCKey
Definition
CaloBadChanTool.h:34
CaloBadChanTool::m_caloID
const CaloCell_ID * m_caloID
Definition
CaloBadChanTool.h:44
CaloBadChanTool::caloStatus
virtual CaloBadChannel caloStatus(const EventContext &ctx, Identifier id) const override
Definition
CaloBadChanTool.cxx:44
CaloBadChanTool::initialize
virtual StatusCode initialize() override
Definition
CaloBadChanTool.cxx:20
CaloBadChanTool::m_tileBCT
ToolHandle< ICaloBadChanTool > m_tileBCT
Definition
CaloBadChanTool.h:40
CaloBadChanTool::CaloBadChanTool
CaloBadChanTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
CaloBadChanTool.cxx:9
CaloBadChannel
Definition
CaloBadChannel.h:8
CaloBadChannel::affectedBit
@ affectedBit
Definition
CaloBadChannel.h:14
CaloBadChannel::deadBit
@ deadBit
Definition
CaloBadChannel.h:14
CaloBadChannel::noisyBit
@ noisyBit
Definition
CaloBadChannel.h:14
CaloBadChannel::BitWord
unsigned int BitWord
Definition
CaloBadChannel.h:12
CaloBadChannel::setBit
static void setBit(ProblemType pb, BitWord &word, bool value=true)
Sets the bit corresponding to "pb" inside the word passed as second argument to "value".
Definition
CaloBadChannel.h:38
LArBadChannel
Definition
LArBadChannel.h:10
LArBadChannel::deadReadout
bool deadReadout() const
Definition
LArBadChannel.h:110
LArBadChannel::reallyNoisy
bool reallyNoisy() const
Definition
LArBadChannel.h:136
LArBadChannel::sporadicBurstNoise
bool sporadicBurstNoise() const
Definition
LArBadChannel.h:129
LArBadChannel::deadPhys
bool deadPhys() const
Definition
LArBadChannel.h:112
LArBadChannel::good
bool good() const
Returns true if no problems at all (all bits at zero).
Definition
LArBadChannel.h:91
LArBadXCont::offlineStatus
LArBC_t offlineStatus(const Identifier id) const
Query the status of a particular channel by offline ID This is the main client access method.
SG::ReadCondHandle
Definition
ReadCondHandle.h:39
Identifier
Definition
IdentifierFieldParser.cxx:14
type
Generated on
for ATLAS Offline Software by
1.17.0