CMS 3D CMS Logo

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 58 of file CoordinateSets.h.

Constructor & Destructor Documentation

◆ Spherical2Cartesian()

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 63 of file CoordinateSets.h.

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

Member Function Documentation

◆ phi()

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

◆ r()

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

Definition at line 68 of file CoordinateSets.h.

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

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

68 { return r_; }

◆ theta()

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

◆ x()

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

◆ y()

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

◆ z()

template<typename T >
T Geom::Spherical2Cartesian< T >::z ( ) const
inline

Definition at line 72 of file CoordinateSets.h.

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

Referenced by geometryXMLparser.Alignable::pos(), and ntupleDataFormat._HitObject::r3D().

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

Member Data Documentation

◆ phi_

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

Definition at line 76 of file CoordinateSets.h.

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

◆ r_

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

Definition at line 77 of file CoordinateSets.h.

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

◆ theta_

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

Definition at line 75 of file CoordinateSets.h.

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

◆ transv_

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