ATLAS Offline Software
CaloClusterBadChannelList.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /********************************************************************
6 
7 NAME: CaloClusterBadChannelList.cxx
8 
9 AUTHORS: G.Unal
10 CREATED: May 2008
11 
12 PURPOSE: Fill bad channels in cluster
13 
14 ********************************************************************/
15 // include header files
17 
19 #include "CaloEvent/CaloClusterBadChannelData.h"
20 
21 using xAOD::CaloCluster;
23  const std::string& name,
24  const IInterface* parent)
26  m_badChannelTool("CaloBadChanTool", this)
27 {
28  declareProperty("badChannelTool",m_badChannelTool,"Tool handle for bad channel");
29 }
30 
32 {
33  CHECK( m_badChannelTool.retrieve() );
34  // Make sure the variable used list is declared to the auxiliary
35  // variable registry. Otherwise, if there are no clusters in the first event,
36  // then we can get warnings from AuxSelection.
37  SG::Accessor<xAOD::CaloClusterBadChannelList> accBCL("BadChannelList");
39 }
40 
41 
43  CaloCluster* cluster) const
44 {
46 
47  CaloCluster::cell_iterator cellIter = cluster->cell_begin();
48  CaloCluster::cell_iterator cellIterEnd = cluster->cell_end();
49  for( ;cellIter!=cellIterEnd;cellIter++) {
50  const CaloCell* cell = (*cellIter);
51  const Identifier id = cell->ID();
52  CaloBadChannel status = m_badChannelTool->caloStatus(myctx.ctx(),id);
53  bool isBad = cell->badcell();
54  if (status.dead() || status.noisy() || isBad ) {
55  const float eta = cell->eta();
56  const float phi = cell->phi();
57  const CaloSampling::CaloSample layer = cell->caloDDE()->getSampling();
58  // in case cell is bad, add explicitly the dead bit to the status
59  CaloBadChannel::BitWord myword = status.packedData();
60  if (isBad && !status.dead()) {
62  }
63  ATH_MSG_DEBUG(" bad channel found eta,phi,layer,status "
64  << eta << " " << phi << " " << layer << " " << myword);
65  badChanList.emplace_back(eta, phi, layer, myword);
66  }
67  } // end loop over cells
68  cluster->setBadChannelList(badChanList);
69 }
70 
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloUtils::ToolConstantsContext::ctx
const EventContext & ctx() const
Definition: ToolWithConstants.h:63
CaloBadChannel::deadBit
@ deadBit
Definition: CaloBadChannel.h:14
CaloCompositeCellBase::cell_end
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
CaloClusterCorrection::initialize
virtual StatusCode initialize() override
Initialize method.
Definition: CaloClusterCorrection.cxx:47
CaloClusterBadChannelList::m_badChannelTool
ToolHandle< ICaloBadChanTool > m_badChannelTool
Definition: CaloClusterBadChannelList.h:56
CaloCluster::cell_iterator
CaloCompositeCellBase< CaloClusterNavigable >::cell_iterator cell_iterator
Iterator on CaloCell s.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:115
xAOD::CaloClusterBadChannelList
std::vector< CaloClusterBadChannelData > CaloClusterBadChannelList
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterBadChannelData.h:19
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
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
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
CaloClusterBadChannelList::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Definition: CaloClusterBadChannelList.cxx:42
CaloClusterBadChannelList::initialize
virtual StatusCode initialize() override
Initialize method.
Definition: CaloClusterBadChannelList.cxx:31
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
CaloClusterBadChannelList::CaloClusterBadChannelList
CaloClusterBadChannelList(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloClusterBadChannelList.cxx:22
CaloBadChannel::BitWord
unsigned int BitWord
Definition: CaloBadChannel.h:12
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CaloCompositeCellBase::cell_begin
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
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
CaloClusterBadChannelList.h
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloBadChannel
Definition: CaloBadChannel.h:8
CaloUtils::ToolConstantsContext
Context object for retrieving ToolConstant values.
Definition: ToolWithConstants.h:61
merge.status
status
Definition: merge.py:17
CaloClusterCorrection
Definition: CaloClusterCorrection.h:55
Identifier
Definition: IdentifierFieldParser.cxx:14