#include <DataFormats/GeometryVector/interface/Phi.h>
Public Member Functions | |
T | degrees () const |
Phi & | operator *= (const T &a) |
template<class T1> | |
operator Phi< T1 > () | |
Template argument conversion. | |
operator T () const | |
conversion operator makes transparent use possible. | |
Phi & | operator+= (const Phi &a) |
Phi & | operator+= (const T &a) |
Standard arithmetics. | |
Phi & | operator-= (const Phi &a) |
Phi & | operator-= (const T &a) |
Phi & | operator/= (const T &a) |
Phi (const T &val) | |
Constructor from T, does not provide automatic conversion. | |
Phi () | |
Default constructor does not initialise - just as double. | |
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 Phi<T> is tranparant due to the implicit conversion to T Constructs like cos(phi) work as with float or double. The difference with respect to built-in types is that Phi is kept in the range (-pi, pi], and this is consistently implemented in aritmetic operations. In other words, Phi implements "modulo(2 pi)" arithmetics.
Definition at line 20 of file Phi.h.
T Geom::Phi< T >::degrees | ( | ) | const [inline] |
Definition at line 57 of file Phi.h.
Referenced by Geom::Phi< float >::operator *=(), Geom::Phi< float >::operator+=(), Geom::Phi< float >::operator-=(), Geom::Phi< float >::operator/=(), and Geom::Phi< float >::Phi().
00057 { 00058 if( theValue > twoPi() || theValue < -twoPi()) { 00059 theValue = fmod( theValue, (T) twoPi()); 00060 } 00061 if (theValue <= -pi()) theValue += twoPi(); 00062 if (theValue > pi()) theValue -= twoPi(); 00063 }
Geom::Phi< T >::operator T | ( | ) | const [inline] |
conversion operator makes transparent use possible.
Definition at line 32 of file Phi.h.
References Geom::Phi< T >::theValue.
00032 { return theValue;}
T Geom::Phi< T >::value | ( | ) | const [inline] |
Explicit access to value in case implicit conversion not OK.
Definition at line 38 of file Phi.h.
Referenced by Basic3DVector< T >::Basic3DVector(), Geom::Phi< float >::operator+=(), Geom::operator-(), Geom::Phi< float >::operator-=(), Geom::operator/(), and PhiBorderFinder::PhiBorderFinder().
00038 { return theValue;}
Definition at line 55 of file Phi.h.
Referenced by Geom::Phi< float >::degrees(), Geom::Phi< float >::normalize(), Geom::Phi< float >::operator *=(), Geom::Phi< float >::operator Phi< T1 >(), Geom::Phi< T >::operator T(), Geom::Phi< float >::operator+=(), Geom::Phi< float >::operator-=(), Geom::Phi< float >::operator/=(), and Geom::Phi< float >::value().