CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/PhysicsTools/Utilities/interface/Tan.h

Go to the documentation of this file.
00001 #ifndef PhysicsTools_Utilities_Tan_h
00002 #define PhysicsTools_Utilities_Tan_h
00003 #include <cmath>
00004 
00005 namespace funct {
00006 
00007   template<typename T> 
00008   struct TanStruct {
00009     TanStruct(const T& t) : _(t) { }
00010     inline double operator()() const { return ::tan(_()); }
00011     inline operator double() const { return ::tan(_()); }
00012     T _; 
00013   };
00014 
00015   template<typename T> 
00016   struct Tan {
00017     typedef TanStruct<T> type;
00018     inline static type compose(const T& t) { return type(t); }
00019   };
00020 
00021   template<typename T>
00022   inline typename Tan<T>::type tan(const T & t) { 
00023     return Tan<T>::compose(t); 
00024   }
00025   
00026 }
00027 
00028 #endif