ATLAS Offline Software
CaloClusterBadChannelList.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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() );
35 }
36 
37 
39  CaloCluster* cluster) const
40 {
42 
43  CaloCluster::cell_iterator cellIter = cluster->cell_begin();
44  CaloCluster::cell_iterator cellIterEnd = cluster->cell_end();
45  for( ;cellIter!=cellIterEnd;cellIter++) {
46  const CaloCell* cell = (*cellIter);
47  const Identifier id = cell->ID();
48  CaloBadChannel status = m_badChannelTool->caloStatus(myctx.ctx(),id);
49  bool isBad = cell->badcell();
50  if (status.dead() || status.noisy() || isBad ) {
51  const float eta = cell->eta();
52  const float phi = cell->phi();
53  const CaloSampling::CaloSample layer = cell->caloDDE()->getSampling();
54  // in case cell is bad, add explicitly the dead bit to the status
55  CaloBadChannel::BitWord myword = status.packedData();
56  if (isBad && !status.dead()) {
58  }
59  ATH_MSG_DEBUG(" bad channel found eta,phi,layer,status "
60  << eta << " " << phi << " " << layer << " " << myword);
61  badChanList.emplace_back(eta, phi, layer, myword);
62  }
63  } // end loop over cells
64  cluster->setBadChannelList(badChanList);
65 }
66 
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
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
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
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
CaloClusterBadChannelList::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Definition: CaloClusterBadChannelList.cxx:38
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:195
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
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
merge.status
status
Definition: merge.py:17
CaloClusterCorrection
Definition: CaloClusterCorrection.h:55