ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloClusterCorrection
src
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
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
16
#include "
CaloClusterBadChannelList.h
"
17
18
#include "
AthenaKernel/errorcheck.h
"
19
#include "CaloEvent/CaloClusterBadChannelData.h"
20
21
using
xAOD::CaloCluster
;
22
CaloClusterBadChannelList::CaloClusterBadChannelList
(
const
std::string&
type
,
23
const
std::string& name,
24
const
IInterface* parent)
25
:
CaloClusterCorrection
(
type
, name, parent)
26
{
27
}
28
29
StatusCode
CaloClusterBadChannelList::initialize
()
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"
);
36
return
CaloClusterCorrection::initialize
();
37
}
38
39
40
void
CaloClusterBadChannelList::makeCorrection
(
const
Context& myctx,
41
CaloCluster
* cluster)
const
42
{
43
xAOD::CaloClusterBadChannelList
badChanList;
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()) {
59
CaloBadChannel::setBit
(
CaloBadChannel::deadBit
,myword,
true
);
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
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloClusterBadChannelList.h
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
CaloBadChannel
Definition
CaloBadChannel.h:8
CaloBadChannel::deadBit
@ deadBit
Definition
CaloBadChannel.h:14
CaloBadChannel::BitWord
unsigned int BitWord
Definition
CaloBadChannel.h:12
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
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloClusterBadChannelList::CaloClusterBadChannelList
CaloClusterBadChannelList(const std::string &type, const std::string &name, const IInterface *parent)
Definition
CaloClusterBadChannelList.cxx:22
CaloClusterBadChannelList::makeCorrection
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Definition
CaloClusterBadChannelList.cxx:40
CaloClusterBadChannelList::initialize
virtual StatusCode initialize() override
Definition
CaloClusterBadChannelList.cxx:29
CaloClusterBadChannelList::m_badChannelTool
ToolHandle< ICaloBadChanTool > m_badChannelTool
Definition
CaloClusterBadChannelList.h:45
CaloClusterCorrection
Definition
CaloClusterCorrection.h:55
CaloClusterCorrection::initialize
virtual StatusCode initialize() override
Definition
CaloClusterCorrection.cxx:46
CaloCluster
Principal data class for CaloCell clusters.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
CaloCompositeCellBase::cell_end
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
CaloCompositeCellBase::cell_begin
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
CaloSampling::CaloSample
CaloSample
Definition
Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition
Control/AthContainers/AthContainers/Accessor.h:68
xAOD::CaloCluster_v1::cell_iterator
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version).
Definition
CaloCluster_v1.h:819
Identifier
Definition
IdentifierFieldParser.cxx:14
xAOD::CaloClusterBadChannelList
std::vector< CaloClusterBadChannelData > CaloClusterBadChannelList
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloClusterBadChannelData.h:19
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
type
Generated on
for ATLAS Offline Software by
1.17.0