ATLAS Offline Software
Loading...
Searching...
No Matches
EtaPhiBase Class Reference

base class, with just the eta-phi limits and the overlap functionality More...

#include <RegSelEtaPhiModule.h>

Inheritance diagram for EtaPhiBase:
Collaboration diagram for EtaPhiBase:

Public Member Functions

 EtaPhiBase (double etamin, double etamax, double phimin, double phimax)
virtual ~EtaPhiBase ()=default
 destructor
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

Detailed Description

base class, with just the eta-phi limits and the overlap functionality

Definition at line 27 of file RegSelEtaPhiModule.h.

Constructor & Destructor Documentation

◆ EtaPhiBase()

EtaPhiBase::EtaPhiBase ( double etamin,
double etamax,
double phimin,
double phimax )
inline

Definition at line 31 of file RegSelEtaPhiModule.h.

32 : m_boundary(false) {
33
34 static const double twopi = 2*M_PI;
35
36 m_eta[0] = etamin;
37 m_eta[1] = etamax;
38
39 m_phi[0] = phimin;
40 m_phi[1] = phimax;
41
42 if ( m_phi[0]<0 ) m_phi[0] += twopi;
43 if ( m_phi[1]<0 ) m_phi[1] += twopi;
44
45 if ( m_phi[0]>twopi ) m_phi[0] -= twopi;
46 if ( m_phi[1]>twopi ) m_phi[1] -= twopi;
47
48 if ( m_phi[0]>m_phi[1] ) m_boundary = true;
49 }
#define M_PI
constexpr double twopi
double phimax() const
double etamin() const
accessors
double etamax() const
double phimin() const
double m_eta[2]
eta and phi limits for the module

◆ ~EtaPhiBase()

virtual EtaPhiBase::~EtaPhiBase ( )
virtualdefault

destructor

Member Function Documentation

◆ etamax()

double EtaPhiBase::etamax ( ) const
inline

Definition at line 56 of file RegSelEtaPhiModule.h.

56{ return m_eta[1]; }

◆ etamin()

double EtaPhiBase::etamin ( ) const
inline

accessors

Definition at line 55 of file RegSelEtaPhiModule.h.

55{ return m_eta[0]; }

◆ overlap()

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

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 }

◆ phimax()

double EtaPhiBase::phimax ( ) const
inline

Definition at line 59 of file RegSelEtaPhiModule.h.

59{ return m_phi[1]; }

◆ phimin()

double EtaPhiBase::phimin ( ) const
inline

Definition at line 58 of file RegSelEtaPhiModule.h.

58{ return m_phi[0]; }

Member Data Documentation

◆ m_boundary

bool EtaPhiBase::m_boundary
protected

Definition at line 103 of file RegSelEtaPhiModule.h.

◆ m_eta

double EtaPhiBase::m_eta[2]
protected

eta and phi limits for the module

Definition at line 100 of file RegSelEtaPhiModule.h.

◆ m_phi

double EtaPhiBase::m_phi[2]
protected

Definition at line 101 of file RegSelEtaPhiModule.h.


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