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

Inherits from IPFClusterCollectionTool and AthAlgTool. More...

#include <PFClusterCollectionTool.h>

Inheritance diagram for PFClusterCollectionTool:
Collaboration diagram for PFClusterCollectionTool:

Public Member Functions

 PFClusterCollectionTool (const std::string &type, const std::string &name, const IInterface *parent)
 ~PFClusterCollectionTool ()
StatusCode initialize ()
std::unique_ptr< xAOD::CaloClusterContainerexecute (eflowCaloObjectContainer &theEflowCaloObjectContainer, bool useNonModifiedClusters)
std::unique_ptr< eflowRecClusterContainerretrieve (eflowCaloObjectContainer &theEflowCaloObjectContainer, bool useNonModifiedClusters)
StatusCode finalize ()

Detailed Description

Inherits from IPFClusterCollectionTool and AthAlgTool.

Creates containers of eflowRecClusters or xAOD::CaloCluster, which can be used in the methods to apply LC weights to the neutral PFO objects in PFLCCalibTool. The xAOD::CaloCluster container is also needed to calculate new cluster moments for the modified calorimeter clusters, which is done in PFMomentCalculatorTool.

Definition at line 14 of file PFClusterCollectionTool.h.

Constructor & Destructor Documentation

◆ PFClusterCollectionTool()

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

Definition at line 9 of file PFClusterCollectionTool.cxx.

9 : base_class( type, name, parent)
10{
11}

◆ ~PFClusterCollectionTool()

PFClusterCollectionTool::~PFClusterCollectionTool ( )
inline

Definition at line 20 of file PFClusterCollectionTool.h.

20{};

Member Function Documentation

◆ execute()

std::unique_ptr< xAOD::CaloClusterContainer > PFClusterCollectionTool::execute ( eflowCaloObjectContainer & theEflowCaloObjectContainer,
bool useNonModifiedClusters )

Definition at line 41 of file PFClusterCollectionTool.cxx.

41 {
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}
#define ATH_MSG_DEBUG(x)
bool isTouchable() const
xAOD::CaloCluster * getCluster()
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.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ finalize()

StatusCode PFClusterCollectionTool::finalize ( )

Definition at line 68 of file PFClusterCollectionTool.cxx.

68 {
69 return StatusCode::SUCCESS;
70}

◆ initialize()

StatusCode PFClusterCollectionTool::initialize ( )

Definition at line 13 of file PFClusterCollectionTool.cxx.

13 {
14 return StatusCode::SUCCESS;
15}

◆ retrieve()

std::unique_ptr< eflowRecClusterContainer > PFClusterCollectionTool::retrieve ( eflowCaloObjectContainer & theEflowCaloObjectContainer,
bool useNonModifiedClusters )

Definition at line 17 of file PFClusterCollectionTool.cxx.

17 {
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}

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