ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
PFClusterCollectionTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PFClusterCollectionTool.h
"
6
#include "
eflowCaloObject.h
"
7
#include "
eflowRecCluster.h
"
8
9
PFClusterCollectionTool::PFClusterCollectionTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) : base_class(
type
, name, parent)
10
{
11
}
12
13
StatusCode
PFClusterCollectionTool::initialize
(){
14
return
StatusCode::SUCCESS;
15
}
16
17
std::unique_ptr<eflowRecClusterContainer>
PFClusterCollectionTool::retrieve
(
eflowCaloObjectContainer
& theEflowCaloObjectContainer,
bool
useNonModifiedClusters)
const
{
18
19
std::unique_ptr<eflowRecClusterContainer> result = std::make_unique<eflowRecClusterContainer>();
20
21
/* Loop over all eflowCaloObjects */
22
for
(
auto
thisEflowCaloObject : theEflowCaloObjectContainer){
23
24
/* Add all clusters on the eflowCaloObject to the container */
25
unsigned
int
nClusters = thisEflowCaloObject->nClusters();
26
for
(
unsigned
int
iCluster = 0; iCluster < nClusters; ++iCluster) {
27
eflowRecCluster
* thisEfRecCluster = thisEflowCaloObject->efRecCluster(iCluster);
28
29
/* Only add clusters if should run calibration tools or if touchable (i.e. we modified them */
30
if
(!useNonModifiedClusters && !thisEfRecCluster->
isTouchable
() ) {
31
continue
;
32
}
33
34
result->push_back(thisEfRecCluster);
35
}
36
}
37
return
result;
38
}
39
40
41
std::unique_ptr<xAOD::CaloClusterContainer>
PFClusterCollectionTool::execute
(
eflowCaloObjectContainer
& theEflowCaloObjectContainer,
bool
useNonModifiedClusters)
const
{
42
43
std::unique_ptr<xAOD::CaloClusterContainer> result = std::make_unique<xAOD::CaloClusterContainer>(
SG::VIEW_ELEMENTS
);
44
45
/* Loop over all eflowCaloObjects */
46
for
(
auto
thisEflowCaloObject : theEflowCaloObjectContainer){
47
48
/* Add all clusters on the eflowCaloObject to the container */
49
unsigned
int
nClusters = thisEflowCaloObject->nClusters();
50
for
(
unsigned
int
iCluster = 0; iCluster < nClusters; ++iCluster) {
51
eflowRecCluster
* thisEfRecCluster = thisEflowCaloObject->efRecCluster(iCluster);
52
53
/* Only add clusters if should run calibration tools or if touchable (i.e. we modified them */
54
if
(!useNonModifiedClusters && !thisEfRecCluster->
isTouchable
() ) {
55
continue
;
56
}
57
58
xAOD::CaloCluster
* thisCluster = thisEfRecCluster->
getCluster
();
59
result->push_back(thisCluster);
60
61
ATH_MSG_DEBUG
(
"Adding cluster with E, eta and phi to moments maker "
<< thisCluster->
e
() <<
", "
<< thisCluster->
eta
() <<
" and "
<< thisCluster->
phi
());
62
}
63
}
64
std::sort
(result->begin(), result->end(), [](
xAOD::CaloCluster
* c1,
xAOD::CaloCluster
* c2) {return c1->e()>c2->e();});
65
return
result;
66
}
67
68
StatusCode
PFClusterCollectionTool::finalize
(){
69
return
StatusCode::SUCCESS;
70
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
PFClusterCollectionTool.h
PFClusterCollectionTool::finalize
StatusCode finalize()
Definition
PFClusterCollectionTool.cxx:68
PFClusterCollectionTool::execute
std::unique_ptr< xAOD::CaloClusterContainer > execute(eflowCaloObjectContainer &theEflowCaloObjectContainer, bool useNonModifiedClusters) const
Definition
PFClusterCollectionTool.cxx:41
PFClusterCollectionTool::retrieve
std::unique_ptr< eflowRecClusterContainer > retrieve(eflowCaloObjectContainer &theEflowCaloObjectContainer, bool useNonModifiedClusters) const
Definition
PFClusterCollectionTool.cxx:17
PFClusterCollectionTool::PFClusterCollectionTool
PFClusterCollectionTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
PFClusterCollectionTool.cxx:9
PFClusterCollectionTool::initialize
StatusCode initialize()
Definition
PFClusterCollectionTool.cxx:13
eflowCaloObjectContainer
Definition
eflowCaloObject.h:102
eflowRecCluster
This class extends the information about a xAOD::CaloCluster.
Definition
eflowRecCluster.h:40
eflowRecCluster::isTouchable
bool isTouchable() const
Definition
eflowRecCluster.h:91
eflowRecCluster::getCluster
xAOD::CaloCluster * getCluster()
Definition
eflowRecCluster.h:49
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition
CaloCluster_v1.cxx:251
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition
CaloCluster_v1.cxx:265
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition
CaloCluster_v1.cxx:256
eflowCaloObject.h
eflowRecCluster.h
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition
OwnershipPolicy.h:18
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition
DVL_algorithms.h:554
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