Crombie Tools
EtaPhiMap< T > Class Template Reference

#include <EtaPhiMap.h>

Public Member Functions

 EtaPhiMap (double spacing, double maxeta=5.0, std::function< double(const T *)> eta=[](const T *p){ return p->eta();}, std::function< double(const T *)> phi=[](const T *p){ return p->phi();})
 
template<typename C >
void AddParticles (C &collection)
 Add a collection of particles to the grid. Call once per event, because this gets cleared. More...
 
std::vector< const T * > GetParticles (double eta, double phi, double dr) const
 Get particles within dr of a given eta, phi. More...
 

Private Member Functions

unsigned bin (double eta, double phi) const
 Get the bin number. More...
 
unsigned bin (unsigned eta_bin, unsigned phi_bin) const
 
void clear ()
 Reset the particles in each grid point. More...
 
unsigned etabin (double eta) const
 Get eta bin. More...
 
unsigned phibin (double phi) const
 Get phi bin. More...
 

Private Attributes

double _maxeta
 Max eta of grid (has overflow and underflow bins) More...
 
double _spacing
 Spacing of each grid. More...
 
std::function< double(const T *)> geteta
 Function for getting eta from pointers. More...
 
std::function< double(const T *)> getphi
 Function for getting phi from pointers. More...
 
unsigned n_etabins
 Number of eta bins. More...
 
unsigned n_phibins
 Number of phi bins. More...
 
std::vector< std::vector< const T * > > particles
 Stores all of the particles. More...
 

Detailed Description

template<typename T>
class EtaPhiMap< T >

Definition at line 13 of file EtaPhiMap.h.

Constructor & Destructor Documentation

§ EtaPhiMap()

template<typename T >
EtaPhiMap< T >::EtaPhiMap ( double  spacing,
double  maxeta = 5.0,
std::function< double(const T *)>  eta = [](const T* p){ return p->eta(); },
std::function< double(const T *)>  phi = [](const T* p){ return p->phi(); } 
)
inline

Member Function Documentation

§ AddParticles()

template<typename T >
template<typename C >
void EtaPhiMap< T >::AddParticles ( C &  collection)

Add a collection of particles to the grid. Call once per event, because this gets cleared.

Definition at line 65 of file EtaPhiMap.h.

References EtaPhiMap< T >::bin(), EtaPhiMap< T >::clear(), EtaPhiMap< T >::geteta, EtaPhiMap< T >::getphi, and EtaPhiMap< T >::particles.

Referenced by EtaPhiMap< T >::EtaPhiMap().

§ bin() [1/2]

template<typename T >
unsigned EtaPhiMap< T >::bin ( double  eta,
double  phi 
) const
private

Get the bin number.

Definition at line 111 of file EtaPhiMap.h.

References EtaPhiMap< T >::etabin(), and EtaPhiMap< T >::phibin().

Referenced by EtaPhiMap< T >::AddParticles(), and EtaPhiMap< T >::GetParticles().

§ bin() [2/2]

template<typename T >
unsigned EtaPhiMap< T >::bin ( unsigned  eta_bin,
unsigned  phi_bin 
) const
private

Definition at line 116 of file EtaPhiMap.h.

References EtaPhiMap< T >::n_etabins.

§ clear()

template<typename T >
void EtaPhiMap< T >::clear ( )
private

Reset the particles in each grid point.

Definition at line 132 of file EtaPhiMap.h.

References EtaPhiMap< T >::particles.

Referenced by EtaPhiMap< T >::AddParticles().

§ etabin()

template<typename T >
unsigned EtaPhiMap< T >::etabin ( double  eta) const
private

Get eta bin.

Definition at line 121 of file EtaPhiMap.h.

References EtaPhiMap< T >::_spacing, and EtaPhiMap< T >::n_etabins.

Referenced by EtaPhiMap< T >::bin(), and EtaPhiMap< T >::GetParticles().

§ GetParticles()

template<typename T >
std::vector< const T * > EtaPhiMap< T >::GetParticles ( double  eta,
double  phi,
double  dr 
) const

§ phibin()

template<typename T >
unsigned EtaPhiMap< T >::phibin ( double  phi) const
private

Get phi bin.

Definition at line 126 of file EtaPhiMap.h.

References EtaPhiMap< T >::_spacing.

Referenced by EtaPhiMap< T >::bin(), and EtaPhiMap< T >::GetParticles().

Member Data Documentation

§ _maxeta

template<typename T >
double EtaPhiMap< T >::_maxeta
private

Max eta of grid (has overflow and underflow bins)

Definition at line 40 of file EtaPhiMap.h.

Referenced by EtaPhiMap< T >::EtaPhiMap().

§ _spacing

template<typename T >
double EtaPhiMap< T >::_spacing
private

Spacing of each grid.

Definition at line 38 of file EtaPhiMap.h.

Referenced by EtaPhiMap< T >::etabin(), EtaPhiMap< T >::EtaPhiMap(), and EtaPhiMap< T >::phibin().

§ geteta

template<typename T >
std::function<double(const T*)> EtaPhiMap< T >::geteta
private

Function for getting eta from pointers.

Definition at line 47 of file EtaPhiMap.h.

Referenced by EtaPhiMap< T >::AddParticles(), EtaPhiMap< T >::EtaPhiMap(), and EtaPhiMap< T >::GetParticles().

§ getphi

template<typename T >
std::function<double(const T*)> EtaPhiMap< T >::getphi
private

Function for getting phi from pointers.

Definition at line 48 of file EtaPhiMap.h.

Referenced by EtaPhiMap< T >::AddParticles(), EtaPhiMap< T >::EtaPhiMap(), and EtaPhiMap< T >::GetParticles().

§ n_etabins

template<typename T >
unsigned EtaPhiMap< T >::n_etabins
private

Number of eta bins.

Definition at line 43 of file EtaPhiMap.h.

Referenced by EtaPhiMap< T >::bin(), EtaPhiMap< T >::etabin(), and EtaPhiMap< T >::EtaPhiMap().

§ n_phibins

template<typename T >
unsigned EtaPhiMap< T >::n_phibins
private

Number of phi bins.

Definition at line 45 of file EtaPhiMap.h.

Referenced by EtaPhiMap< T >::EtaPhiMap(), and EtaPhiMap< T >::GetParticles().

§ particles

template<typename T >
std::vector<std::vector<const T*> > EtaPhiMap< T >::particles
private

Stores all of the particles.

Definition at line 36 of file EtaPhiMap.h.

Referenced by EtaPhiMap< T >::AddParticles(), EtaPhiMap< T >::clear(), EtaPhiMap< T >::EtaPhiMap(), and EtaPhiMap< T >::GetParticles().


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