ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
PFClusterWidthCalculator Class Reference

#include <PFClusterWidthCalculator.h>

Collaboration diagram for PFClusterWidthCalculator:

Public Member Functions

 PFClusterWidthCalculator ()
 
 ~PFClusterWidthCalculator ()=default
 
std::pair< double, double > getPFClusterCoordinateWidth (const std::vector< double > &eta, const std::vector< double > &phi, const double &clusterEta, const double &clusterPhi, unsigned int nCells)
 
double getEtaMean () const
 
double getPhiMean () const
 

Private Attributes

double m_etaPhiLowerLimit
 
double m_etaMean
 
double m_phiMean
 

Detailed Description

Definition at line 6 of file PFClusterWidthCalculator.h.

Constructor & Destructor Documentation

◆ PFClusterWidthCalculator()

PFClusterWidthCalculator::PFClusterWidthCalculator ( )

Definition at line 7 of file PFClusterWidthCalculator.cxx.

7 : m_etaPhiLowerLimit(0.0025),m_etaMean(0.0),m_phiMean(0.0) {}

◆ ~PFClusterWidthCalculator()

PFClusterWidthCalculator::~PFClusterWidthCalculator ( )
default

Member Function Documentation

◆ getEtaMean()

double PFClusterWidthCalculator::getEtaMean ( ) const
inline

Definition at line 14 of file PFClusterWidthCalculator.h.

14 {return m_etaMean;}

◆ getPFClusterCoordinateWidth()

std::pair< double, double > PFClusterWidthCalculator::getPFClusterCoordinateWidth ( const std::vector< double > &  eta,
const std::vector< double > &  phi,
const double &  clusterEta,
const double &  clusterPhi,
unsigned int  nCells 
)

Definition at line 11 of file PFClusterWidthCalculator.cxx.

11  {
12 
13  if (nCells <= 1) {
14  m_etaMean = clusterEta;
15  m_phiMean = clusterPhi;
16  return std::make_pair(m_etaPhiLowerLimit,m_etaPhiLowerLimit);
17  }
18 
19  double etaSum(0.0);
20  double etaSum2(0.0);
21  double phiSum(0.0);
22  double phiSum2(0.0);
23 
24  for(unsigned int iCell=0; iCell<nCells; ++iCell){
25  etaSum += eta[iCell];
26  etaSum2 += eta[iCell]*eta[iCell];
27  double thisCellPhi = eflowAzimuth(phi[iCell]).cycle(clusterPhi);
28  phiSum += thisCellPhi;
29  phiSum2 += thisCellPhi*thisCellPhi;
30 
31  }
32 
33  m_etaMean = etaSum/static_cast<double>(nCells);
34  m_phiMean = phiSum/static_cast<double>(nCells);
35 
36  double varianceCorrection = (double)nCells / (double)(nCells-1);
37  double etaVariance = std::max(m_etaPhiLowerLimit,varianceCorrection * (etaSum2/static_cast<double>(nCells) - m_etaMean*m_etaMean));
38  double phiVariance = std::max(m_etaPhiLowerLimit,varianceCorrection * (phiSum2/static_cast<double>(nCells) - m_phiMean*m_phiMean));
39 
40  return std::make_pair(etaVariance,phiVariance);
41 }

◆ getPhiMean()

double PFClusterWidthCalculator::getPhiMean ( ) const
inline

Definition at line 15 of file PFClusterWidthCalculator.h.

15 {return m_phiMean;}

Member Data Documentation

◆ m_etaMean

double PFClusterWidthCalculator::m_etaMean
private

Definition at line 20 of file PFClusterWidthCalculator.h.

◆ m_etaPhiLowerLimit

double PFClusterWidthCalculator::m_etaPhiLowerLimit
private

Definition at line 19 of file PFClusterWidthCalculator.h.

◆ m_phiMean

double PFClusterWidthCalculator::m_phiMean
private

Definition at line 21 of file PFClusterWidthCalculator.h.


The documentation for this class was generated from the following files:
PFClusterWidthCalculator::m_etaPhiLowerLimit
double m_etaPhiLowerLimit
Definition: PFClusterWidthCalculator.h:19
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
PFClusterWidthCalculator::m_etaMean
double m_etaMean
Definition: PFClusterWidthCalculator.h:20
eflowAzimuth::cycle
double cycle(const eflowAzimuth &other)
Definition: eflowUtil.h:51
xAOD::nCells
setRawEt setRawPhi nCells
Definition: TrigCaloCluster_v1.cxx:33
eflowAzimuth
eflowAzimuth represents phi and has kinematic functions which correctly deal with phi wraparound etc.
Definition: eflowUtil.h:21
PFClusterWidthCalculator::m_phiMean
double m_phiMean
Definition: PFClusterWidthCalculator.h:21
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159