test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
Geom::Spherical2Cartesian< T > Class Template Reference

#include <CoordinateSets.h>

Public Member Functions

const Tphi () const
 
const Tr () const
 
 Spherical2Cartesian (const T &theta, const T &phi, const T &mag)
 
const Ttheta () const
 
T x () const
 
T y () const
 
T z () const
 

Private Attributes

T phi_
 
T r_
 
T theta_
 
T transv_
 

Detailed Description

template<typename T>
class Geom::Spherical2Cartesian< T >

Converts spherical (or polar 3D) coordinates to cartesian coordinates.

Definition at line 60 of file CoordinateSets.h.

Constructor & Destructor Documentation

template<typename T >
Geom::Spherical2Cartesian< T >::Spherical2Cartesian ( const T theta,
const T phi,
const T mag 
)
inline
Construct from polar angle, azimuthal angle, and radius.

The radius in the spherical frame is the magnitude of the vector.

Definition at line 65 of file CoordinateSets.h.

65  :
66  theta_(theta), phi_(phi), r_(mag),
67  transv_( sin(theta)*mag) {}
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const T & phi() const
const T & theta() const

Member Function Documentation

template<typename T >
const T& Geom::Spherical2Cartesian< T >::phi ( ) const
inline
template<typename T >
const T& Geom::Spherical2Cartesian< T >::r ( ) const
inline

Definition at line 71 of file CoordinateSets.h.

References Geom::Spherical2Cartesian< T >::r_.

Referenced by Geom::Spherical2Cartesian< T >::z().

template<typename T >
const T& Geom::Spherical2Cartesian< T >::theta ( ) const
inline
template<typename T >
T Geom::Spherical2Cartesian< T >::x ( ) const
inline
template<typename T >
T Geom::Spherical2Cartesian< T >::y ( ) const
inline
template<typename T >
T Geom::Spherical2Cartesian< T >::z ( ) const
inline

Definition at line 75 of file CoordinateSets.h.

References funct::cos(), Geom::Spherical2Cartesian< T >::r(), and Geom::Spherical2Cartesian< T >::theta().

Referenced by geometryXMLparser.Alignable::pos().

75 {return cos(theta()) * r();}
const T & r() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
const T & theta() const

Member Data Documentation

template<typename T >
T Geom::Spherical2Cartesian< T >::phi_
private

Definition at line 79 of file CoordinateSets.h.

Referenced by Geom::Spherical2Cartesian< T >::phi().

template<typename T >
T Geom::Spherical2Cartesian< T >::r_
private

Definition at line 80 of file CoordinateSets.h.

Referenced by Geom::Spherical2Cartesian< T >::r().

template<typename T >
T Geom::Spherical2Cartesian< T >::theta_
private

Definition at line 78 of file CoordinateSets.h.

Referenced by Geom::Spherical2Cartesian< T >::theta().

template<typename T >
T Geom::Spherical2Cartesian< T >::transv_
private