Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:34

0001 #ifndef GeometryVector_Geom_Theta_h
0002 #define GeometryVector_Geom_Theta_h
0003 
0004 namespace Geom {
0005 
0006   /** A class for polar angle represantation.
0007  *  So far only useful to differentiate from double, for
0008  * example in function overloading.
0009  */
0010 
0011   template <class T>
0012   class Theta {
0013   public:
0014     /// Default constructor does not initialise - just as double.
0015     Theta() {}
0016 
0017     /// Constructor from T, does not provide automatic conversion.
0018     explicit Theta(const T& val) : theValue(val) {}
0019 
0020     /// conversion operator makes transparent use possible.
0021     operator T() const { return theValue; }
0022 
0023     /// Explicit access to value in case implicit conversion not OK
0024     T value() const { return theValue; }
0025 
0026   private:
0027     T theValue;
0028   };
0029 
0030 }  // namespace Geom
0031 #endif