ATLAS Offline Software
Loading...
Searching...
No Matches
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
7NAME: CaloClusterBadChannelList.cxx
8
9AUTHORS: G.Unal
10CREATED: May 2008
11
12PURPOSE: Fill bad channels in cluster
13
14********************************************************************/
15// include header files
17
19#include "CaloEvent/CaloClusterBadChannelData.h"
20
23 const std::string& name,
24 const IInterface* parent)
25 : CaloClusterCorrection(type, name, 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
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
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".
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
CaloClusterBadChannelList(const std::string &type, const std::string &name, const IInterface *parent)
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
virtual StatusCode initialize() override
Initialize method.
ToolHandle< ICaloBadChanTool > m_badChannelTool
virtual StatusCode initialize() override
Initialize method.
Principal data class for CaloCell clusters.
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
Helper class to provide type-safe access to aux data.
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version)
std::vector< CaloClusterBadChannelData > CaloClusterBadChannelList
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
const EventContext & ctx() const