ATLAS Offline Software
Public Member Functions | List of all members
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 }

◆ 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:
eflowRecCluster
This class extends the information about a xAOD::CaloCluster.
Definition: eflowRecCluster.h:40
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
get_generator_info.result
result
Definition: get_generator_info.py:21
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
extractSporadic.c1
c1
Definition: extractSporadic.py:134
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
eflowRecCluster::getCluster
xAOD::CaloCluster * getCluster()
Definition: eflowRecCluster.h:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
eflowRecCluster::isTouchable
bool isTouchable() const
Definition: eflowRecCluster.h:91
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265