ATLAS Offline Software
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 
6 
7 //#include "GaudiKernel/MsgStream.h"
8 
9 CaloBadChanTool::CaloBadChanTool(const std::string& type, const std::string& name,
10  const IInterface* parent) :
12  m_caloID(nullptr)
13 {
14  declareInterface<ICaloBadChanTool>(this);
15 }
16 
17 
19 
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 
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)) {
50  const LArBadChannelCont* bcCont{ *bch };
51  if (bcCont) {
53  LArBadChannel lbc = bcCont->offlineStatus(id);
54 
55  if (lbc.reallyNoisy() || lbc.sporadicBurstNoise()) {
57  }
58  if (lbc.deadReadout() || lbc.deadPhys()) {
60  } else if (!lbc.good()) {
62  }
63  return {res};
64  } else {
66  return empty;
67  }
68  } else {
70  return empty;
71  }
72 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LArBadChannel::deadReadout
bool deadReadout() const
Definition: LArBadChannel.h:107
LArBadChannel::good
bool good() const
Returns true if no problems at all (all bits at zero)
Definition: LArBadChannel.h:89
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
AtlasDetectorID::is_lar
bool is_lar(Identifier id) const
Definition: AtlasDetectorID.h:689
CaloBadChanTool::initialize
virtual StatusCode initialize() override
Definition: CaloBadChanTool.cxx:20
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArBadChannel::sporadicBurstNoise
bool sporadicBurstNoise() const
Definition: LArBadChannel.h:126
CaloBadChannel::deadBit
@ deadBit
Definition: CaloBadChannel.h:14
CaloBadChanTool::caloStatus
virtual CaloBadChannel caloStatus(const EventContext &ctx, Identifier id) const override
Definition: CaloBadChanTool.cxx:44
CaloBadChannel::affectedBit
@ affectedBit
Definition: CaloBadChannel.h:14
CaloCell_Base_ID::is_tile
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
CaloBadChanTool::~CaloBadChanTool
virtual ~CaloBadChanTool() override
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
CaloBadChanTool::m_tileBCT
ToolHandle< ICaloBadChanTool > m_tileBCT
Definition: CaloBadChanTool.h:40
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
LArBadChannel
Definition: LArBadChannel.h:10
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloBadChannel::BitWord
unsigned int BitWord
Definition: CaloBadChannel.h:12
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ReadBchFromCool.bch
bch
Definition: ReadBchFromCool.py:446
LArBadChannel::reallyNoisy
bool reallyNoisy() const
Definition: LArBadChannel.h:132
CaloBadChannel::noisyBit
@ noisyBit
Definition: CaloBadChannel.h:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CaloBadChanTool::m_caloID
const CaloCell_ID * m_caloID
Definition: CaloBadChanTool.h:44
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
CaloBadChanTool::CaloBadChanTool
CaloBadChanTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloBadChanTool.cxx:9
CaloBadChanTool::m_larBCKey
SG::ReadCondHandleKey< LArBadChannelCont > m_larBCKey
Definition: CaloBadChanTool.h:34
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArBadChannel::deadPhys
bool deadPhys() const
Definition: LArBadChannel.h:109
CaloBadChannel
Definition: CaloBadChannel.h:8
CaloBadChanTool.h
AthAlgTool
Definition: AthAlgTool.h:26