#include <DataFormats/GeometryVector/interface/OnePiRange.h>
Public Member Functions | |
T | degrees () const |
T | eta () const |
Return the pseudorapidity. | |
OnePiRange (const T &val) | |
Constructor from T, does not provide automatic conversion. | |
OnePiRange () | |
Default constructor does not initialise - just as double. | |
OnePiRange & | operator *= (const T &a) |
template<class T1> | |
operator OnePiRange< T1 > () | |
Template argument conversion. | |
operator T () const | |
conversion operator makes transparent use possible. | |
OnePiRange & | operator+= (const OnePiRange &a) |
OnePiRange & | operator+= (const T &a) |
OnePiRange & | operator-= (const OnePiRange &a) |
OnePiRange & | operator-= (const T &a) |
OnePiRange & | operator/= (const T &a) |
T | value () const |
Explicit access to value in case implicit conversion not OK. | |
Private Member Functions | |
void | normalize () |
Private Attributes | |
T | theValue |
The use of OnePiRange<T> is tranparant due to the implicit conversion to T Constructs like cos(theta) work as with float or double. The difference with respect to built-in types is that OnePiRange is kept in the range [0, pi], and this is consistently implemented in aritmetic operations. In other words, OnePiRange implements "modulo(pi)" arithmetics.
Definition at line 20 of file OnePiRange.h.
Geom::OnePiRange< T >::OnePiRange | ( | ) | [inline] |
Default constructor does not initialise - just as double.
Definition at line 24 of file OnePiRange.h.
Geom::OnePiRange< T >::OnePiRange | ( | const T & | val | ) | [inline, explicit] |
Constructor from T, does not provide automatic conversion.
Definition at line 27 of file OnePiRange.h.
References Geom::OnePiRange< T >::normalize().
T Geom::OnePiRange< T >::degrees | ( | ) | const [inline] |
Definition at line 49 of file OnePiRange.h.
References Geom::pi(), and Geom::OnePiRange< T >::theValue.
T Geom::OnePiRange< T >::eta | ( | ) | const [inline] |
Return the pseudorapidity.
Definition at line 53 of file OnePiRange.h.
References funct::log(), funct::tan(), and Geom::OnePiRange< T >::theValue.
void Geom::OnePiRange< T >::normalize | ( | ) | [inline, private] |
Definition at line 60 of file OnePiRange.h.
References Geom::pi(), and Geom::OnePiRange< T >::theValue.
Referenced by Geom::OnePiRange< T >::OnePiRange(), Geom::OnePiRange< T >::operator *=(), Geom::OnePiRange< T >::operator+=(), Geom::OnePiRange< T >::operator-=(), and Geom::OnePiRange< T >::operator/=().
00060 { 00061 if( theValue > (T) pi() || theValue < 0) { 00062 theValue = fmod( theValue, (T) pi()); 00063 } 00064 if (theValue < 0.) theValue += pi(); 00065 }
OnePiRange& Geom::OnePiRange< T >::operator *= | ( | const T & | a | ) | [inline] |
Definition at line 45 of file OnePiRange.h.
References Geom::OnePiRange< T >::normalize(), and Geom::OnePiRange< T >::theValue.
Template argument conversion.
Definition at line 33 of file OnePiRange.h.
References Geom::OnePiRange< T >::theValue.
00033 { return OnePiRange<T1>(theValue);}
Geom::OnePiRange< T >::operator T | ( | ) | const [inline] |
conversion operator makes transparent use possible.
Definition at line 30 of file OnePiRange.h.
References Geom::OnePiRange< T >::theValue.
00030 { return theValue;}
OnePiRange& Geom::OnePiRange< T >::operator+= | ( | const OnePiRange< T > & | a | ) | [inline] |
Definition at line 40 of file OnePiRange.h.
References Geom::OnePiRange< T >::operator+=(), and Geom::OnePiRange< T >::value().
00040 {return operator+=(a.value());}
OnePiRange& Geom::OnePiRange< T >::operator+= | ( | const T & | a | ) | [inline] |
Definition at line 39 of file OnePiRange.h.
References Geom::OnePiRange< T >::normalize(), and Geom::OnePiRange< T >::theValue.
Referenced by Geom::OnePiRange< T >::operator+=().
OnePiRange& Geom::OnePiRange< T >::operator-= | ( | const OnePiRange< T > & | a | ) | [inline] |
Definition at line 43 of file OnePiRange.h.
References Geom::OnePiRange< T >::operator-=(), and Geom::OnePiRange< T >::value().
00043 {return operator-=(a.value());}
OnePiRange& Geom::OnePiRange< T >::operator-= | ( | const T & | a | ) | [inline] |
Definition at line 42 of file OnePiRange.h.
References Geom::OnePiRange< T >::normalize(), and Geom::OnePiRange< T >::theValue.
Referenced by Geom::OnePiRange< T >::operator-=().
OnePiRange& Geom::OnePiRange< T >::operator/= | ( | const T & | a | ) | [inline] |
Definition at line 47 of file OnePiRange.h.
References Geom::OnePiRange< T >::normalize(), and Geom::OnePiRange< T >::theValue.
T Geom::OnePiRange< T >::value | ( | ) | const [inline] |
Explicit access to value in case implicit conversion not OK.
Definition at line 36 of file OnePiRange.h.
References Geom::OnePiRange< T >::theValue.
Referenced by Geom::OnePiRange< T >::operator+=(), Geom::operator-(), Geom::OnePiRange< T >::operator-=(), and Geom::operator/().
00036 { return theValue;}
T Geom::OnePiRange< T >::theValue [private] |
Definition at line 58 of file OnePiRange.h.
Referenced by Geom::OnePiRange< T >::degrees(), Geom::OnePiRange< T >::eta(), Geom::OnePiRange< T >::normalize(), Geom::OnePiRange< T >::operator *=(), Geom::OnePiRange< T >::operator OnePiRange< T1 >(), Geom::OnePiRange< T >::operator T(), Geom::OnePiRange< T >::operator+=(), Geom::OnePiRange< T >::operator-=(), Geom::OnePiRange< T >::operator/=(), and Geom::OnePiRange< T >::value().