CMS 3D CMS Logo

Geom::Spherical2Cartesian< T > Class Template Reference

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

#include <DataFormats/GeometryVector/interface/CoordinateSets.h>

List of all members.

Public Member Functions

const T & phi () const
const T & r () const
 Spherical2Cartesian (const T &theta, const T &phi, const T &mag)
 Construct from polar angle, azimuthal angle, and radius.
const T & theta () const
x () const
y () const
z () const

Private Attributes

phi_
r_
theta_
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.

00065                                                                          :
00066             theta_(theta), phi_(phi), r_(mag), 
00067             transv_( sin(theta)*mag) {}


Member Function Documentation

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

Definition at line 70 of file CoordinateSets.h.

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

Referenced by Geom::Spherical2Cartesian< T >::x(), and Geom::Spherical2Cartesian< T >::y().

00070 {return phi_;}

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().

00071 {return r_;}

template<typename T>
const T& Geom::Spherical2Cartesian< T >::theta (  )  const [inline]

Definition at line 69 of file CoordinateSets.h.

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

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

00069 {return theta_;}

template<typename T>
T Geom::Spherical2Cartesian< T >::x (  )  const [inline]

Definition at line 73 of file CoordinateSets.h.

References funct::cos(), Geom::Spherical2Cartesian< T >::phi(), and Geom::Spherical2Cartesian< T >::transv_.

00073 {return transv_ * cos(phi());}

template<typename T>
T Geom::Spherical2Cartesian< T >::y (  )  const [inline]

Definition at line 74 of file CoordinateSets.h.

References Geom::Spherical2Cartesian< T >::phi(), funct::sin(), and Geom::Spherical2Cartesian< T >::transv_.

00074 {return transv_ * sin(phi());}

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().

00075 {return cos(theta()) * r();}


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]

Definition at line 81 of file CoordinateSets.h.

Referenced by Geom::Spherical2Cartesian< T >::x(), and Geom::Spherical2Cartesian< T >::y().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:47:16 2009 for CMSSW by  doxygen 1.5.4