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

#include <RegSelRoI.h>

Collaboration diagram for RegSelRoI:

Public Member Functions

 RegSelRoI ()
 RegSelRoI (double zMin, double zMax, double phiMin, double phiMax, double etaMin, double etaMax)
 ~RegSelRoI ()=default
double getzMin () const
double getzMax () const
double getphiMin () const
double getphiMax () const
double getetaMin () const
double getetaMax () const
double getaMin () const
double getaMax () const
bool getsplit () const
double getphiWidth () const
double getzWidth () const
double getzMin (const double r) const
double getzMax (const double r) const
double getrMin (const double z) const
double getrMax (const double z) const
double etaMinLimit (double r) const
 find the min eta limits for an object fully contained within an roi, bounded with the specifed radius
double etaMaxLimit (double r) const
 find the max eta limits for an object fully contained within an roi, bounded with the specifed radius

Private Attributes

double m_zMin
double m_zMax
double m_phiMin
double m_phiMax
double m_etaMin
double m_etaMax
double m_invaMin
double m_invaMax
double m_aMin
double m_aMax
bool m_split

Detailed Description

Definition at line 32 of file RegSelRoI.h.

Constructor & Destructor Documentation

◆ RegSelRoI() [1/2]

RegSelRoI::RegSelRoI ( )
inline

Definition at line 36 of file RegSelRoI.h.

36{ }

◆ RegSelRoI() [2/2]

RegSelRoI::RegSelRoI ( double zMin,
double zMax,
double phiMin,
double phiMax,
double etaMin,
double etaMax )

prefer std::fabs here since want manifest double precision

shouldn't be needed now if the float(M_PI) tests work but leave for more guaranteed robustness

Definition at line 31 of file RegSelRoI.cxx.

34 : m_zMin(zMin), m_zMax(zMax),
35 m_phiMin(phiMin), m_phiMax(phiMax),
36 m_etaMin(etaMin), m_etaMax(etaMax),
37 m_split(false)
38{
39 // calculate and store inverses
40 m_invaMin = std::tan(2*atan(exp(-m_etaMin)));
41 m_invaMax = std::tan(2*atan(exp(-m_etaMax)));
42 m_aMin = 1/m_invaMin;
43 m_aMax = 1/m_invaMax;
44
45 // just check explicitly, in case either range individually
46 // is set to pi
47 if ( m_phiMin==float(-M_PI) ) m_phiMin=-M_PI;
48 if ( m_phiMax==float( M_PI) ) m_phiMax= M_PI;
49
50 // AAARGH!!!! Check that the roi is in the correct range
51 double deltaphi = m_phiMax-m_phiMin;
52
53 if ( m_phiMax<m_phiMin ) deltaphi+=M_2PI;
54
56 if ( std::fabs(deltaphi-M_2PI)>1e-6 ) {
57 if ( m_phiMin> M_PI ) m_phiMin -= M_2PI;
58 if ( m_phiMin<-M_PI ) m_phiMin += M_2PI;
59
60 if ( m_phiMax> M_PI ) m_phiMax -= M_2PI;
61 if ( m_phiMax<-M_PI ) m_phiMax += M_2PI;
62 }
63 else {
66 m_phiMin = -M_PI;
67 m_phiMax = M_PI;
68 }
69
71
72}
#define M_PI
#define M_2PI
double m_etaMin
Definition RegSelRoI.h:92
double m_aMin
Definition RegSelRoI.h:94
double m_zMax
Definition RegSelRoI.h:90
double m_phiMax
Definition RegSelRoI.h:91
double m_aMax
Definition RegSelRoI.h:94
double m_invaMax
Definition RegSelRoI.h:93
double m_invaMin
Definition RegSelRoI.h:93
bool m_split
Definition RegSelRoI.h:96
double m_zMin
Definition RegSelRoI.h:90
double m_etaMax
Definition RegSelRoI.h:92
double m_phiMin
Definition RegSelRoI.h:91

◆ ~RegSelRoI()

RegSelRoI::~RegSelRoI ( )
default

Member Function Documentation

◆ etaMaxLimit()

double RegSelRoI::etaMaxLimit ( double r) const
inline

find the max eta limits for an object fully contained within an roi, bounded with the specifed radius

Definition at line 79 of file RegSelRoI.h.

79 {
80 double x = r*m_aMax+getzWidth();
81 if ( x==0 ) return 0;
82 double tantheta = r/x;
83 double theta = std::atan(tantheta);
84 if ( theta<0 ) theta += M_PI;
85 return -std::log(std::tan(0.5*theta));
86 }
Scalar theta() const
theta method
#define x
double getzWidth() const
Definition RegSelRoI.h:55
int r
Definition globals.cxx:22

◆ etaMinLimit()

double RegSelRoI::etaMinLimit ( double r) const
inline

find the min eta limits for an object fully contained within an roi, bounded with the specifed radius

Definition at line 68 of file RegSelRoI.h.

68 {
69 double x = r*m_aMin-getzWidth();
70 if ( x==0 ) return 0;
71 double tantheta = r/x;
72 double theta = std::atan(tantheta);
73 if ( theta<0 ) theta += M_PI;
74 return -std::log(std::tan(0.5*theta));
75 }

◆ getaMax()

double RegSelRoI::getaMax ( ) const
inline

Definition at line 51 of file RegSelRoI.h.

51{ return m_aMax; }

◆ getaMin()

double RegSelRoI::getaMin ( ) const
inline

Definition at line 50 of file RegSelRoI.h.

50{ return m_aMin; }

◆ getetaMax()

double RegSelRoI::getetaMax ( ) const
inline

Definition at line 49 of file RegSelRoI.h.

49{ return m_etaMax; }

◆ getetaMin()

double RegSelRoI::getetaMin ( ) const
inline

Definition at line 48 of file RegSelRoI.h.

48{ return m_etaMin; }

◆ getphiMax()

double RegSelRoI::getphiMax ( ) const
inline

Definition at line 47 of file RegSelRoI.h.

47{ return m_phiMax; }

◆ getphiMin()

double RegSelRoI::getphiMin ( ) const
inline

Definition at line 46 of file RegSelRoI.h.

46{ return m_phiMin; }

◆ getphiWidth()

double RegSelRoI::getphiWidth ( ) const
inline

Definition at line 54 of file RegSelRoI.h.

◆ getrMax()

double RegSelRoI::getrMax ( const double z) const
inline

Definition at line 63 of file RegSelRoI.h.

63{ return (z-m_zMax)*m_invaMax; }
#define z

◆ getrMin()

double RegSelRoI::getrMin ( const double z) const
inline

Definition at line 62 of file RegSelRoI.h.

62{ return (z-m_zMin)*m_invaMin; }

◆ getsplit()

bool RegSelRoI::getsplit ( ) const
inline

Definition at line 52 of file RegSelRoI.h.

52{ return m_split; }

◆ getzMax() [1/2]

double RegSelRoI::getzMax ( ) const
inline

Definition at line 45 of file RegSelRoI.h.

45{ return m_zMax; }

◆ getzMax() [2/2]

double RegSelRoI::getzMax ( const double r) const
inline

Definition at line 59 of file RegSelRoI.h.

59{ return r*m_aMax+m_zMax; }

◆ getzMin() [1/2]

double RegSelRoI::getzMin ( ) const
inline

Definition at line 44 of file RegSelRoI.h.

44{ return m_zMin; }

◆ getzMin() [2/2]

double RegSelRoI::getzMin ( const double r) const
inline

Definition at line 58 of file RegSelRoI.h.

58{ return r*m_aMin+m_zMin; }

◆ getzWidth()

double RegSelRoI::getzWidth ( ) const
inline

Definition at line 55 of file RegSelRoI.h.

55{ return m_zMax-m_zMin; }

Member Data Documentation

◆ m_aMax

double RegSelRoI::m_aMax
private

Definition at line 94 of file RegSelRoI.h.

◆ m_aMin

double RegSelRoI::m_aMin
private

Definition at line 94 of file RegSelRoI.h.

◆ m_etaMax

double RegSelRoI::m_etaMax
private

Definition at line 92 of file RegSelRoI.h.

◆ m_etaMin

double RegSelRoI::m_etaMin
private

Definition at line 92 of file RegSelRoI.h.

◆ m_invaMax

double RegSelRoI::m_invaMax
private

Definition at line 93 of file RegSelRoI.h.

◆ m_invaMin

double RegSelRoI::m_invaMin
private

Definition at line 93 of file RegSelRoI.h.

◆ m_phiMax

double RegSelRoI::m_phiMax
private

Definition at line 91 of file RegSelRoI.h.

◆ m_phiMin

double RegSelRoI::m_phiMin
private

Definition at line 91 of file RegSelRoI.h.

◆ m_split

bool RegSelRoI::m_split
private

Definition at line 96 of file RegSelRoI.h.

◆ m_zMax

double RegSelRoI::m_zMax
private

Definition at line 90 of file RegSelRoI.h.

◆ m_zMin

double RegSelRoI::m_zMin
private

Definition at line 90 of file RegSelRoI.h.


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