ATLAS Offline Software
Loading...
Searching...
No Matches
TRegSelEtaPhiModule< T > Class Template Reference

template class with payload added NB: >, <, == and != operators should be defined for the payload for the sorting when adding to an std::set could get away only with < operator, but there you go More...

#include <RegSelEtaPhiModule.h>

Inheritance diagram for TRegSelEtaPhiModule< T >:
Collaboration diagram for TRegSelEtaPhiModule< T >:

Public Member Functions

 TRegSelEtaPhiModule (double etamin, double etamax, double phimin, double phimax, const T &t)
virtual ~TRegSelEtaPhiModule ()
const T & payload () const
T & payload ()
template<class E>
bool operator< (const TRegSelEtaPhiModule< E > &e) const
 to allow "sorting" and uniqueness tests etc technically, only need a < operator, but there you go
template<class E>
bool operator> (const TRegSelEtaPhiModule< E > &e) const
template<class E>
bool operator== (const TRegSelEtaPhiModule< E > &e) const
template<class E>
bool operator!= (const TRegSelEtaPhiModule< E > &e) const
double etamin () const
 accessors
double etamax () const
double phimin () const
double phimax () const
bool overlap (const EtaPhiBase &e) const
 do two eta-phi regions overlap?

Protected Attributes

double m_eta [2]
 eta and phi limits for the module
double m_phi [2]
bool m_boundary

Private Attributes

m_t
 payload

Detailed Description

template<class T>
class TRegSelEtaPhiModule< T >

template class with payload added NB: >, <, == and != operators should be defined for the payload for the sorting when adding to an std::set could get away only with < operator, but there you go

Definition at line 125 of file RegSelEtaPhiModule.h.

Constructor & Destructor Documentation

◆ TRegSelEtaPhiModule()

template<class T>
TRegSelEtaPhiModule< T >::TRegSelEtaPhiModule ( double etamin,
double etamax,
double phimin,
double phimax,
const T & t )
inline

Definition at line 129 of file RegSelEtaPhiModule.h.

129 :
double phimax() const
double etamin() const
accessors
double etamax() const
EtaPhiBase(double etamin, double etamax, double phimin, double phimax)
double phimin() const
template class with payload added NB: >, <, == and != operators should be defined for the payload for...

◆ ~TRegSelEtaPhiModule()

template<class T>
virtual TRegSelEtaPhiModule< T >::~TRegSelEtaPhiModule ( )
inlinevirtual

Definition at line 132 of file RegSelEtaPhiModule.h.

132{ }

Member Function Documentation

◆ etamax()

double EtaPhiBase::etamax ( ) const
inlineinherited

Definition at line 56 of file RegSelEtaPhiModule.h.

56{ return m_eta[1]; }
double m_eta[2]
eta and phi limits for the module

◆ etamin()

double EtaPhiBase::etamin ( ) const
inlineinherited

accessors

Definition at line 55 of file RegSelEtaPhiModule.h.

55{ return m_eta[0]; }

◆ operator!=()

template<class T>
template<class E>
bool TRegSelEtaPhiModule< T >::operator!= ( const TRegSelEtaPhiModule< E > & e) const
inline

Definition at line 142 of file RegSelEtaPhiModule.h.

142{ return payload()!=e.payload(); }
const T & payload() const

◆ operator<()

template<class T>
template<class E>
bool TRegSelEtaPhiModule< T >::operator< ( const TRegSelEtaPhiModule< E > & e) const
inline

to allow "sorting" and uniqueness tests etc technically, only need a < operator, but there you go

Definition at line 139 of file RegSelEtaPhiModule.h.

139{ return payload()<e.payload(); }

◆ operator==()

template<class T>
template<class E>
bool TRegSelEtaPhiModule< T >::operator== ( const TRegSelEtaPhiModule< E > & e) const
inline

Definition at line 141 of file RegSelEtaPhiModule.h.

141{ return payload()==e.payload(); }

◆ operator>()

template<class T>
template<class E>
bool TRegSelEtaPhiModule< T >::operator> ( const TRegSelEtaPhiModule< E > & e) const
inline

Definition at line 140 of file RegSelEtaPhiModule.h.

140{ return payload()>e.payload(); }

◆ overlap()

bool EtaPhiBase::overlap ( const EtaPhiBase & e) const
inlineinherited

do two eta-phi regions overlap?

eta overlap is trivial

phi overlap is less trivial, because modules can span the 2pi boundary

don't need to worry about eta overlap since it is already true if we have got to this stage

Definition at line 63 of file RegSelEtaPhiModule.h.

63 {
64
65 static const double twopi = 2*M_PI;
66
67 // struct timeval timer = simpletimer_start();
68
70 if ( ! ( e.etamin()<etamax() && e.etamax()>etamin() ) ) return false;
71
74 bool inphi = false;
75
76 double phimin1 = phimin();
77 double phimax1 = phimax();
78
79 double phimin2 = e.phimin();
80 double phimax2 = e.phimax();
81
82 // check for phi wrapping and boundary intersection
83 if ( phimin1>phimax1 ) phimax1 += twopi;
84 if ( phimin2>phimax2 ) phimax2 += twopi;
85
86 if ( ( phimin1<phimax2 && phimax1>phimin2 ) ||
87 ( phimin1<(phimax2+twopi) && phimax1>(phimin2+twopi) ) ||
88 ( (phimin1+twopi)<phimax2 && (phimax1+twopi)>phimin2 ) ) inphi = true;
89
90 // double time = simpletimer_stop( timer );
91
94 return inphi;
95 }
#define M_PI
constexpr double twopi

◆ payload() [1/2]

template<class T>
T & TRegSelEtaPhiModule< T >::payload ( )
inline

Definition at line 135 of file RegSelEtaPhiModule.h.

135{ return m_t; }

◆ payload() [2/2]

template<class T>
const T & TRegSelEtaPhiModule< T >::payload ( ) const
inline

Definition at line 134 of file RegSelEtaPhiModule.h.

134{ return m_t; }

◆ phimax()

double EtaPhiBase::phimax ( ) const
inlineinherited

Definition at line 59 of file RegSelEtaPhiModule.h.

59{ return m_phi[1]; }

◆ phimin()

double EtaPhiBase::phimin ( ) const
inlineinherited

Definition at line 58 of file RegSelEtaPhiModule.h.

58{ return m_phi[0]; }

Member Data Documentation

◆ m_boundary

bool EtaPhiBase::m_boundary
protectedinherited

Definition at line 103 of file RegSelEtaPhiModule.h.

◆ m_eta

double EtaPhiBase::m_eta[2]
protectedinherited

eta and phi limits for the module

Definition at line 100 of file RegSelEtaPhiModule.h.

◆ m_phi

double EtaPhiBase::m_phi[2]
protectedinherited

Definition at line 101 of file RegSelEtaPhiModule.h.

◆ m_t

template<class T>
T TRegSelEtaPhiModule< T >::m_t
private

payload

Definition at line 147 of file RegSelEtaPhiModule.h.


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