ATLAS Offline Software
Loading...
Searching...
No Matches
PFClusterWidthDecorator.cxx
Go to the documentation of this file.
1
3
4#include "CaloEvent/CaloCluster.h"
5
6PFClusterWidthDecorator::PFClusterWidthDecorator(const std::string& name, ISvcLocator* pSvcLocator) :
7 AthAlgorithm(name, pSvcLocator)
8{}
9
13 return StatusCode::SUCCESS;
14}
15
17
19 if (!clusterContainerWidthEta.isValid()) {
20 ATH_MSG_WARNING("Invalid cluster container with name " << m_clusterContainerWidthEtaKey.key());
21 return StatusCode::SUCCESS;
22 }
23
25 if (!clusterContainerWidthPhi.isValid()) {
26 ATH_MSG_WARNING("Invalid cluster container with name " << m_clusterContainerWidthPhiKey.key());
27 return StatusCode::SUCCESS;
28 }
29
30 for (const auto *const thisCluster : *clusterContainerWidthEta) {
31 const CaloClusterCellLink* theCellLinks = thisCluster->getCellLinks();
32 if (!theCellLinks) {
33 ATH_MSG_WARNING("No cell links found for cluster");
34 continue;
35 }
36
37 std::vector<double> eta,phi;
38 for (CaloClusterCellLink::const_iterator it=theCellLinks->begin(); it!=theCellLinks->end(); ++it){
39 const CaloCell* cell = *it;
40 eta.push_back(cell->eta());
41 phi.push_back(cell->phi());
42 }
43
44 std::pair<double,double> width = m_clusterWidthCalculator.getPFClusterCoordinateWidth(eta, phi, thisCluster->eta(), thisCluster->phi(), theCellLinks->size());
45 clusterContainerWidthEta(*thisCluster) = width.first;
46 clusterContainerWidthPhi(*thisCluster) = width.second;
47
48 }
49
50 return StatusCode::SUCCESS;
51}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
const double width
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
PFClusterWidthCalculator m_clusterWidthCalculator
PFClusterWidthDecorator(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_clusterContainerWidthEtaKey
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_clusterContainerWidthPhiKey
Handle class for adding a decoration to an object.