ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterBadChannelList.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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{
27}
28
30{
31 CHECK( m_badChannelTool.retrieve() );
32 // Make sure the variable used list is declared to the auxiliary
33 // variable registry. Otherwise, if there are no clusters in the first event,
34 // then we can get warnings from AuxSelection.
35 SG::Accessor<xAOD::CaloClusterBadChannelList> accBCL("BadChannelList");
37}
38
39
41 CaloCluster* cluster) const
42{
44
45 CaloCluster::cell_iterator cellIter = cluster->cell_begin();
46 CaloCluster::cell_iterator cellIterEnd = cluster->cell_end();
47 for( ;cellIter!=cellIterEnd;cellIter++) {
48 const CaloCell* cell = (*cellIter);
49 const Identifier id = cell->ID();
50 CaloBadChannel status = m_badChannelTool->caloStatus(myctx.ctx(),id);
51 bool isBad = cell->badcell();
52 if (status.dead() || status.noisy() || isBad ) {
53 const float eta = cell->eta();
54 const float phi = cell->phi();
55 const CaloSampling::CaloSample layer = cell->caloDDE()->getSampling();
56 // in case cell is bad, add explicitly the dead bit to the status
57 CaloBadChannel::BitWord myword = status.packedData();
58 if (isBad && !status.dead()) {
60 }
61 ATH_MSG_DEBUG(" bad channel found eta,phi,layer,status "
62 << eta << " " << phi << " " << layer << " " << myword);
63 badChanList.emplace_back(eta, phi, layer, myword);
64 }
65 } // end loop over cells
66 cluster->setBadChannelList(badChanList);
67}
68
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
ToolHandle< ICaloBadChanTool > m_badChannelTool
virtual StatusCode initialize() override
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.