ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
PFClusterWidthDecorator.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
#include "
PFClusterWidthDecorator.h
"
6
7
#include "CaloEvent/CaloCluster.h"
8
9
PFClusterWidthDecorator::PFClusterWidthDecorator
(
const
std::string& name, ISvcLocator* pSvcLocator) :
10
AthReentrantAlgorithm
(name, pSvcLocator)
11
{}
12
13
StatusCode
PFClusterWidthDecorator::initialize
() {
14
ATH_CHECK
(
m_clusterContainerWidthEtaKey
.initialize());
15
ATH_CHECK
(
m_clusterContainerWidthPhiKey
.initialize());
16
return
StatusCode::SUCCESS;
17
}
18
19
StatusCode
PFClusterWidthDecorator::execute
(
const
EventContext &ctx)
const
{
20
21
SG::WriteDecorHandle<xAOD::CaloClusterContainer,float>
clusterContainerWidthEta(
m_clusterContainerWidthEtaKey
, ctx);
22
if
(!clusterContainerWidthEta.isValid()) {
23
ATH_MSG_WARNING
(
"Invalid cluster container with name "
<<
m_clusterContainerWidthEtaKey
.key());
24
return
StatusCode::SUCCESS;
25
}
26
27
SG::WriteDecorHandle<xAOD::CaloClusterContainer,float>
clusterContainerWidthPhi(
m_clusterContainerWidthPhiKey
, ctx);
28
if
(!clusterContainerWidthPhi.isValid()) {
29
ATH_MSG_WARNING
(
"Invalid cluster container with name "
<<
m_clusterContainerWidthPhiKey
.key());
30
return
StatusCode::SUCCESS;
31
}
32
33
for
(
const
auto
*
const
thisCluster : *clusterContainerWidthEta) {
34
const
CaloClusterCellLink
* theCellLinks = thisCluster->getCellLinks();
35
if
(!theCellLinks) {
36
ATH_MSG_WARNING
(
"No cell links found for cluster"
);
37
continue
;
38
}
39
40
std::vector<double>
eta
,
phi
;
41
size_t
ncells = theCellLinks->
size
();
42
eta
.reserve(ncells);
43
phi
.reserve(ncells);
44
for
(
CaloClusterCellLink::const_iterator
it=theCellLinks->
begin
(); it!=theCellLinks->
end
(); ++it){
45
const
CaloCell
* cell = *it;
46
eta
.push_back(cell->eta());
47
phi
.push_back(cell->phi());
48
}
49
50
PFClusterWidth
width
=
m_clusterWidthCalculator
.getPFClusterCoordinateWidth(
eta
,
phi
, thisCluster->eta(), thisCluster->phi(), ncells);
51
clusterContainerWidthEta(*thisCluster) =
width
.etaVariance;
52
clusterContainerWidthPhi(*thisCluster) =
width
.phiVariance;
53
54
}
55
56
return
StatusCode::SUCCESS;
57
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
PFClusterWidthDecorator.h
width
const double width
Definition
TTileTripReader.cxx:24
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloClusterCellLink::const_iterator
const_iterator to loop over cells belonging to a cluster
Definition
CaloClusterCellLink.h:57
CaloClusterCellLink
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Definition
CaloClusterCellLink.h:24
CaloClusterCellLink::end
const_iterator end() const
const end method
Definition
CaloClusterCellLink.h:112
CaloClusterCellLink::size
size_t size() const
size method
Definition
CaloClusterCellLink.h:117
CaloClusterCellLink::begin
const_iterator begin() const
const begin method
Definition
CaloClusterCellLink.h:107
PFClusterWidthDecorator::initialize
StatusCode initialize() override
Definition
PFClusterWidthDecorator.cxx:13
PFClusterWidthDecorator::m_clusterWidthCalculator
PFClusterWidthCalculator m_clusterWidthCalculator
Definition
PFClusterWidthDecorator.h:25
PFClusterWidthDecorator::PFClusterWidthDecorator
PFClusterWidthDecorator(const std::string &name, ISvcLocator *pSvcLocator)
Definition
PFClusterWidthDecorator.cxx:9
PFClusterWidthDecorator::m_clusterContainerWidthEtaKey
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_clusterContainerWidthEtaKey
Definition
PFClusterWidthDecorator.h:23
PFClusterWidthDecorator::m_clusterContainerWidthPhiKey
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_clusterContainerWidthPhiKey
Definition
PFClusterWidthDecorator.h:24
PFClusterWidthDecorator::execute
StatusCode execute(const EventContext &ctx) const override
Definition
PFClusterWidthDecorator.cxx:19
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
PFClusterWidth
Definition
PFClusterWidthCalculator.h:11
Generated on
for ATLAS Offline Software by
1.17.0