ATLAS Offline Software
Loading...
Searching...
No Matches
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
9CaloBadChanTool::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
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
44CaloBadChanTool::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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
std::pair< std::vector< unsigned int >, bool > res
LArBadXCont< LArBadChannel > LArBadChannelCont
static Double_t sc
static const Attributes_t empty
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
virtual ~CaloBadChanTool() override
SG::ReadCondHandleKey< LArBadChannelCont > m_larBCKey
const CaloCell_ID * m_caloID
virtual CaloBadChannel caloStatus(const EventContext &ctx, Identifier id) const override
virtual StatusCode initialize() override
ToolHandle< ICaloBadChanTool > m_tileBCT
CaloBadChanTool(const std::string &type, const std::string &name, const IInterface *parent)
unsigned int BitWord
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".
bool deadReadout() const
bool reallyNoisy() const
bool sporadicBurstNoise() const
bool deadPhys() const
bool good() const
Returns true if no problems at all (all bits at zero)
LArBC_t offlineStatus(const Identifier id) const
Query the status of a particular channel by offline ID This is the main client access method.