ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterBadChannelList Class Reference

#include <CaloClusterBadChannelList.h>

Inheritance diagram for CaloClusterBadChannelList:
Collaboration diagram for CaloClusterBadChannelList:

Public Member Functions

 CaloClusterBadChannelList (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
virtual void makeCorrection (const Context &myctx, xAOD::CaloCluster *cluster) const override
virtual void setsample (xAOD::CaloCluster *cluster, CaloSampling::CaloSample sampling, float em, float etam, float phim, float emax, float etamax, float phimax, float etas, float phis) const
virtual void setenergy (xAOD::CaloCluster *cluster, float energy) const
StatusCode execute (const EventContext &ctx, xAOD::CaloCluster *cluster) const override
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const
 Execute on an entire collection of clusters.

Protected Attributes

SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}

Private Attributes

ToolHandle< ICaloBadChanToolm_badChannelTool

Detailed Description

Definition at line 25 of file CaloClusterBadChannelList.h.

Constructor & Destructor Documentation

◆ CaloClusterBadChannelList()

CaloClusterBadChannelList::CaloClusterBadChannelList ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 22 of file CaloClusterBadChannelList.cxx.

25 : CaloClusterCorrection(type, name, parent)
26{
27}

Member Function Documentation

◆ execute() [1/2]

StatusCode CaloClusterCorrection::execute ( const EventContext & ctx,
xAOD::CaloCluster * cluster ) const
overrideinherited

Definition at line 53 of file CaloClusterCorrection.cxx.

55{
56 this->makeCorrection (context(ctx), cluster);
57
58#if 0
59 ATH_MSG_DEBUG( " ...... e, et " << cluster->e() << " " << cluster->et() << endmsg);
60 ATH_MSG_DEBUG( " ...... eta, etaBE, etaSmp " << cluster->eta() << " " << cluster->etaBE(2)
61 << " " << cluster->etaSample(CaloSampling::EMB1)
62 << " " << cluster->etaSample(CaloSampling::EMB2)
63 << " " << cluster->etaSample(CaloSampling::EMB3) << endmsg);
64 ATH_MSG_DEBUG( " ...... phi, phiBE, phiSmp " << cluster->phi() << " " << cluster->phiBE(2)
65 << " " << cluster->phiSample(CaloSampling::EMB1)
66 << " " << cluster->phiSample(CaloSampling::EMB2)
67 << " " << cluster->phiSample(CaloSampling::EMB3) << endmsg);
68#endif
69
70 return StatusCode::SUCCESS;
71}
#define endmsg
#define ATH_MSG_DEBUG(x)
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *) const =0
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.

◆ execute() [2/2]

StatusCode CaloClusterProcessor::execute ( const EventContext & ctx,
xAOD::CaloClusterContainer * collection ) const
inherited

Execute on an entire collection of clusters.

Parameters
collectionThe container of clusters.

This will iterate over all the clusters in collection and call execute on each one individually.

Parameters
collectionThe container of clusters.
ctxThe event context.

This will iterate over all the clusters in collection and call execute on each one individually.

Definition at line 65 of file CaloClusterProcessor.cxx.

47{
48 for (xAOD::CaloCluster* clu : *collection) {
49 ATH_CHECK( execute (ctx, clu) );
50 }
51 return StatusCode::SUCCESS;
52}
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const override
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ initialize()

StatusCode CaloClusterBadChannelList::initialize ( )
overridevirtual

Reimplemented from CaloClusterCorrection.

Definition at line 29 of file CaloClusterBadChannelList.cxx.

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}
#define CHECK(...)
Evaluate an expression and check for errors.
ToolHandle< ICaloBadChanTool > m_badChannelTool
virtual StatusCode initialize() override
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573

◆ makeCorrection()

void CaloClusterBadChannelList::makeCorrection ( const Context & myctx,
xAOD::CaloCluster * cluster ) const
overridevirtual

Implements CaloClusterCorrection.

Definition at line 40 of file CaloClusterBadChannelList.cxx.

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}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
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".
CaloClusterCellLink::iterator cell_iterator
Iterator of the underlying CaloClusterCellLink (non-const version).
const_cell_iterator cell_end() const
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version).
void setBadChannelList(const CaloClusterBadChannelList &bcl)
@ layer
Definition HitInfo.h:79
status
Definition merge.py:16
std::vector< CaloClusterBadChannelData > CaloClusterBadChannelList

◆ setenergy()

void CaloClusterCorrection::setenergy ( xAOD::CaloCluster * cluster,
float energy ) const
virtualinherited

Definition at line 94 of file CaloClusterCorrection.cxx.

95{
96 if (cluster->e() == 0) {
97 if (energy != 0)
98 REPORT_MESSAGE (MSG::WARNING)
99 << "Attempt to rescale zero-energy cluster to energy " << energy
100 << " ignored.";
101 return;
102 }
103
104 float correction = energy/cluster->e();
105 cluster->setE(energy);
106
107 // also correct individual sampling energies:
108
109 for (int iSample=CaloSampling::PreSamplerB;
110 iSample < CaloSampling::Unknown;
111 ++iSample)
112 {
113 CaloSampling::CaloSample sampling=static_cast<CaloSampling::CaloSample>(iSample);
114 if (cluster->hasSampling (sampling)) {
115 double e = cluster->eSample(sampling);
116 cluster->setEnergy(sampling,e*correction) ;
117 }
118 }
119}
#define REPORT_MESSAGE(LVL)
Report a message.
float eSample(const CaloSample sampling) const
bool setEnergy(const CaloSample sampling, const float e)
Set energy for a given sampling. Returns false if the sample isn't part of the cluster.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
correction(mu, runmode, campaign, run=None)
Definition zlumi_mc_cf.py:4

◆ setsample()

void CaloClusterCorrection::setsample ( xAOD::CaloCluster * cluster,
CaloSampling::CaloSample sampling,
float em,
float etam,
float phim,
float emax,
float etamax,
float phimax,
float etas,
float phis ) const
virtualinherited

Definition at line 74 of file CaloClusterCorrection.cxx.

79{
80 cluster->setEnergy(sampling, em);
81 cluster->setEta(sampling, etam);
82 cluster->setPhi(sampling, phim);
83
84 cluster->setEmax(sampling,emax);
85 cluster->setEtamax(sampling,etamax);
86 cluster->setPhimax(sampling,phimax);
87
88 cluster->setEtasize(sampling, etas);
89 cluster->setPhisize(sampling, phis);
90}
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool setEtasize(const CaloSample sampling, const float etaSize)
Set the cluster size in for a given sampling.
bool setPhisize(const CaloSample sampling, const float phiSize)
Set the cluster size in for a given sampling.
bool setPhimax(const CaloSample sampling, const float phiMax)
Set the phi of the cell with the highest energy in a particular sampling.
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool setEmax(const CaloSample sampling, const float eMax)
Set the Energy of the cell with the highest energy in a particular sampling.
bool setEtamax(const CaloSample sampling, const float etaMax)
Set the eta of the cell with the highest energy in a particular sampling.

Member Data Documentation

◆ m_badChannelTool

ToolHandle<ICaloBadChanTool> CaloClusterBadChannelList::m_badChannelTool
private
Initial value:
{this, "badChannelTool", "CaloBadChanTool"
, "Tool handle for bad channel"}

Definition at line 45 of file CaloClusterBadChannelList.h.

45 {this, "badChannelTool", "CaloBadChanTool"
46 , "Tool handle for bad channel"};

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> CaloClusterCorrection::m_caloMgrKey {this,"CaloDetDescrManager", "CaloDetDescrManager"}
protectedinherited

Definition at line 83 of file CaloClusterCorrection.h.

83{this,"CaloDetDescrManager", "CaloDetDescrManager"};

The documentation for this class was generated from the following files: