Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

FastShower::Phi Class Reference

Utility class to implement the cyclic nature of the phi variable in the range -Pi <-> Pi. More...

#include <Phi.h>

List of all members.


Public Methods

 Phi ()
 Phi (double init)
 Phi (const Phi &src)
Phi & operator= (const Phi &rhs)
Phi & operator+= (Phi &rhs)
Phi & operator-= (Phi &in)
Phi operator+ (Phi &in) const
Phi operator- (Phi &in) const
bool operator< (Phi &in) const
bool operator> (Phi &in) const
 operator double () const
double lowerLimit () const
double upperLimit () const
double range () const
double val () const

Private Methods

void reduce ()

Private Attributes

double m_val

Static Private Attributes

const double s_upperLimit = M_PI
const double s_lowerLimit = -M_PI
const double s_range = s_upperLimit - s_lowerLimit

Detailed Description

Utility class to implement the cyclic nature of the phi variable in the range -Pi <-> Pi.

Definition at line 47 of file Phi.h.


Constructor & Destructor Documentation

FastShower::Phi::Phi   [inline]
 

Definition at line 66 of file Phi.h.

References m_val.

00066 { this->m_val = 0. ;  }

FastShower::Phi::Phi double    init [inline]
 

Definition at line 67 of file Phi.h.

References m_val, and reduce().

00067 { this->m_val = init ; this->reduce() ; }

FastShower::Phi::Phi const Phi &    src [inline]
 

Definition at line 68 of file Phi.h.

References m_val.

00068 { this->m_val = src.m_val ; } 

Member Function Documentation

void FastShower::Phi::reduce   [inline, private]
 

Definition at line 53 of file Phi.h.

References m_val, s_lowerLimit, s_range, and s_upperLimit.

Referenced by operator+=(), operator-=(), and Phi().

00053                   {
00054       while( m_val >  s_upperLimit )  { m_val -= s_range ; }
00055       while( m_val <= s_lowerLimit  ) { m_val += s_range ; }
00056     }

Phi& FastShower::Phi::operator= const Phi &    rhs [inline]
 

Definition at line 72 of file Phi.h.

References m_val.

00072                                       { 
00073       this->m_val = rhs.m_val; 
00074       return *this; 
00075     }

Phi& FastShower::Phi::operator+= Phi &    rhs [inline]
 

Definition at line 77 of file Phi.h.

References m_val, and reduce().

00077                                   { 
00078       this->m_val += rhs.m_val ; 
00079       reduce() ;
00080       return *this; 
00081     }

Phi& FastShower::Phi::operator-= Phi &    in [inline]
 

Definition at line 83 of file Phi.h.

References m_val, and reduce().

00083                                  { 
00084       this->m_val -= in.m_val;
00085       reduce() ;
00086       return *this; 
00087     }

Phi FastShower::Phi::operator+ Phi &    in const [inline]
 

Definition at line 89 of file Phi.h.

00089                                      { 
00090       Phi result( this->m_val + in.m_val ) ;
00091       return result ;
00092     }

Phi FastShower::Phi::operator- Phi &    in const [inline]
 

Definition at line 94 of file Phi.h.

00094                                      { 
00095       Phi result(this->m_val - in.m_val ) ;
00096       return result ;
00097     }

bool FastShower::Phi::operator< Phi &    in const [inline]
 

Definition at line 100 of file Phi.h.

References m_val.

00100 { return this->m_val < in.m_val ; }

bool FastShower::Phi::operator> Phi &    in const [inline]
 

Definition at line 101 of file Phi.h.

References m_val.

00101 { return this->m_val > in.m_val ; }

FastShower::Phi::operator double   const [inline]
 

Definition at line 104 of file Phi.h.

References m_val.

00104 { return this->m_val ; }

double FastShower::Phi::lowerLimit   const [inline]
 

Definition at line 106 of file Phi.h.

References s_lowerLimit.

Referenced by FastShower::operator<<().

00106 {return s_lowerLimit;}

double FastShower::Phi::upperLimit   const [inline]
 

Definition at line 107 of file Phi.h.

References s_upperLimit.

Referenced by FastShower::operator<<().

00107 {return s_upperLimit;}

double FastShower::Phi::range   const [inline]
 

Definition at line 108 of file Phi.h.

References s_range.

Referenced by FastShower::operator<<().

00108 {return s_range;}

double FastShower::Phi::val   const [inline]
 

Definition at line 109 of file Phi.h.

References m_val.

Referenced by FastShower::operator<<().

00109 {return m_val;}

Member Data Documentation

double FastShower::Phi::m_val [private]
 

Definition at line 51 of file Phi.h.

Referenced by operator double(), operator+=(), operator-=(), operator<(), operator=(), operator>(), Phi(), reduce(), and val().

const double FastShower::Phi::s_upperLimit = M_PI [static, private]
 

Definition at line 5 of file Phi.cxx.

Referenced by reduce(), and upperLimit().

const double FastShower::Phi::s_lowerLimit = -M_PI [static, private]
 

Definition at line 6 of file Phi.cxx.

Referenced by lowerLimit(), and reduce().

const double FastShower::Phi::s_range = s_upperLimit - s_lowerLimit [static, private]
 

Definition at line 7 of file Phi.cxx.

Referenced by range(), and reduce().


The documentation for this class was generated from the following files:
Generated on Tue Mar 18 11:56:45 2003 for FastShowerUtils by doxygen1.3-rc1