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

eflowAzimuth represents phi and has kinematic functions which correctly deal with phi wraparound etc. More...

#include <eflowUtil.h>

Collaboration diagram for eflowAzimuth:

Public Member Functions

 eflowAzimuth (double phi)
double operator() () const
double operator= (double phi)
eflowAzimuth operator+= (double deltaPhi)
eflowAzimuth operator-= (double deltaPhi)
double getAbsDifference (const eflowAzimuth &other) const
double cycle (const eflowAzimuth &other)
double cycle (double phi)

Private Member Functions

double adjustRange (double a)
void adjustRange ()

Private Attributes

double m_value {}

Detailed Description

eflowAzimuth represents phi and has kinematic functions which correctly deal with phi wraparound etc.

Definition at line 21 of file eflowUtil.h.

Constructor & Destructor Documentation

◆ eflowAzimuth()

eflowAzimuth::eflowAzimuth ( double phi)
inline

Definition at line 23 of file eflowUtil.h.

23: m_value(phi) { if (phi != -999. && !std::isnan(phi)) adjustRange(); }
Scalar phi() const
phi method
void adjustRange()
Definition eflowUtil.h:72
double m_value
Definition eflowUtil.h:61

Member Function Documentation

◆ adjustRange() [1/2]

void eflowAzimuth::adjustRange ( )
inlineprivate

Definition at line 72 of file eflowUtil.h.

72 {
73 if (m_value <= -M_PI) {
74 m_value+=(2*M_PI*std::floor(-(m_value-M_PI)/(2*M_PI)));
75 } else if (m_value > M_PI) {
76 m_value-=(2*M_PI*std::floor((m_value+M_PI)/(2*M_PI)));
77 }
78 }
#define M_PI

◆ adjustRange() [2/2]

double eflowAzimuth::adjustRange ( double a)
inlineprivate

Definition at line 63 of file eflowUtil.h.

63 {
64 if (a <= -M_PI) {
65 return a+(2*M_PI*std::floor(-(a-M_PI)/(2*M_PI)));
66 } else if (a > M_PI) {
67 return a-(2*M_PI*std::floor((a+M_PI)/(2*M_PI)));
68 } else {
69 return a;
70 }
71 }
static Double_t a

◆ cycle() [1/2]

double eflowAzimuth::cycle ( const eflowAzimuth & other)
inline

Definition at line 48 of file eflowUtil.h.

48{ return cycle(other.m_value); }
double cycle(const eflowAzimuth &other)
Definition eflowUtil.h:48

◆ cycle() [2/2]

double eflowAzimuth::cycle ( double phi)
inline

Definition at line 49 of file eflowUtil.h.

49 {
50 double plainDifference = phi-m_value;
51 if (plainDifference > M_PI) {
52 return m_value+2.0*M_PI;
53 } else if (plainDifference < -M_PI) {
54 return m_value-2.0*M_PI;
55 } else {
56 return m_value;
57 }
58 }

◆ getAbsDifference()

double eflowAzimuth::getAbsDifference ( const eflowAzimuth & other) const
inline

Definition at line 43 of file eflowUtil.h.

43 {
44 double plainAbsDifference = std::abs(m_value - other.m_value);
45 return plainAbsDifference <= M_PI ? plainAbsDifference : 2*M_PI - plainAbsDifference;
46 }

◆ operator()()

double eflowAzimuth::operator() ( ) const
inline

Definition at line 25 of file eflowUtil.h.

25{ return m_value; }

◆ operator+=()

eflowAzimuth eflowAzimuth::operator+= ( double deltaPhi)
inline

Definition at line 32 of file eflowUtil.h.

32 {
35 return *this;
36 }
Scalar deltaPhi(const MatrixBase< Derived > &vec) const

◆ operator-=()

eflowAzimuth eflowAzimuth::operator-= ( double deltaPhi)
inline

Definition at line 37 of file eflowUtil.h.

37 {
40 return *this;
41 }

◆ operator=()

double eflowAzimuth::operator= ( double phi)
inline

Definition at line 26 of file eflowUtil.h.

26 {
27 m_value = phi;
29 return m_value;
30 }

Member Data Documentation

◆ m_value

double eflowAzimuth::m_value {}
private

Definition at line 61 of file eflowUtil.h.

61{};

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