CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CylindricalState Class Reference

#include <CylindricalState.h>

Public Types

typedef double Scalar
 
typedef RKSmallVector< Scalar, 5 > Vector
 

Public Member Functions

Scalar charge () const
 
 CylindricalState ()
 
 CylindricalState (const LocalPoint &pos, const LocalVector &mom, Scalar ch)
 
 CylindricalState (Scalar rho, const Vector &par, Scalar prSign)
 
const LocalVector momentum () const
 
const Vectorparameters () const
 
const LocalPoint position () const
 
double prSign () const
 
Scalar rho () const
 

Private Attributes

Vector par_
 
Scalar prSign_
 sign of local p_r More...
 
Scalar rho_
 

Detailed Description

State for solving the equation of motion with radius (in cylindrical coordinates) as free variable. The dependent variables are phi - azimuthal angle z - z coordinate dphi/dr - derivative of phi versus r dz/dr - derivative of z versus r q/p - charge over momentum magnitude

The coordinate system is externally defined

Definition at line 20 of file CylindricalState.h.

Member Typedef Documentation

typedef double CylindricalState::Scalar

Definition at line 23 of file CylindricalState.h.

Definition at line 24 of file CylindricalState.h.

Constructor & Destructor Documentation

CylindricalState::CylindricalState ( )
inline

Definition at line 26 of file CylindricalState.h.

26 {}
CylindricalState::CylindricalState ( const LocalPoint pos,
const LocalVector mom,
Scalar  ch 
)
inline

Definition at line 28 of file CylindricalState.h.

References charge(), gather_cfg::cout, PV3DBase< T, PVType, FrameType >::mag(), momentum(), par_, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), position(), prSign_, rho_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

28  {
29  rho_ = pos.perp();
30  Scalar cosphi = pos.x() / rho_;
31  Scalar sinphi = pos.y() / rho_;
32  Scalar p_rho = mom.x() * cosphi + mom.y() * sinphi;
33  Scalar p_phi = -mom.x() * sinphi + mom.y() * cosphi;
34 
35  par_(0) = pos.phi();
36  par_(1) = pos.z();
37  par_(2) = p_phi / (p_rho * rho_);
38  par_(3) = mom.z() / p_rho;
39  par_(4) = ch / mom.mag();
40 
41  prSign_ = p_rho > 0 ? 1.0 : -1.0;
42 
43  std::cout << "CylindricalState built from pos " << pos << " mom " << mom << " charge " << ch << std::endl;
44  std::cout << "p_rho " << p_rho << " p_phi " << p_phi << " dphi_drho " << par_(2) << std::endl;
45  std::cout << "Which results in " << position() << " mom " << momentum()
46  << " charge " << charge() << std::endl;
47  }
const LocalPoint position() const
T perp() const
Definition: PV3DBase.h:66
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
T y() const
Definition: PV3DBase.h:57
Scalar prSign_
sign of local p_r
T mag() const
Definition: PV3DBase.h:61
T z() const
Definition: PV3DBase.h:58
Scalar charge() const
const LocalVector momentum() const
tuple cout
Definition: gather_cfg.py:41
T x() const
Definition: PV3DBase.h:56
CylindricalState::CylindricalState ( Scalar  rho,
const Vector par,
Scalar  prSign 
)
inline

Definition at line 49 of file CylindricalState.h.

49  :
50  par_(par), rho_(rho), prSign_(prSign) {}
Scalar prSign_
sign of local p_r
Scalar rho() const
double prSign() const
const double par[8 *NPar][4]

Member Function Documentation

Scalar CylindricalState::charge ( void  ) const
inline

Definition at line 73 of file CylindricalState.h.

References par_.

Referenced by CylindricalState().

73 { return par_(4) > 0 ? 1 : -1;}
const LocalVector CylindricalState::momentum ( ) const
inline

Definition at line 57 of file CylindricalState.h.

References abs, funct::cos(), P, par_, prSign_, query::result, rho_, funct::sin(), and mathSSE::sqrt().

Referenced by CylindricalState(), and RKCylindricalDistance< T, N >::operator()().

57  {
58  Scalar cosphi = cos( par_(0));
59  Scalar sinphi = sin( par_(0));
60  Scalar Q = sqrt(1 + rho_*rho_ * par_(2)*par_(2) + par_(3)*par_(3));
61  Scalar P = std::abs(1./par_(4));
62  Scalar p_rho = prSign_*P/Q;
63  Scalar p_phi = rho_*par_(2)*p_rho;
64  Scalar p_z = par_(3)*p_rho;
65  LocalVector result( p_rho*cosphi - p_phi*sinphi,
66  p_rho*sinphi + p_phi*cosphi,
67  p_z);
68  return result;
69  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define abs(x)
Definition: mlp_lapack.h:159
#define P
Scalar prSign_
sign of local p_r
T sqrt(T t)
Definition: SSEVec.h:28
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
const Vector& CylindricalState::parameters ( void  ) const
inline

Definition at line 71 of file CylindricalState.h.

References par_.

Referenced by RKPropagatorInR::propagate().

71 { return par_;}
const LocalPoint CylindricalState::position ( ) const
inline

Definition at line 53 of file CylindricalState.h.

References par_, and rho_.

Referenced by CylindricalState(), and RKCylindricalDistance< T, N >::operator()().

53  {
54  return LocalPoint( LocalPoint::Cylindrical( rho_, par_(0), par_(1)));
55  }
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
double CylindricalState::prSign ( ) const
inline

Definition at line 77 of file CylindricalState.h.

References prSign_.

77 {return prSign_;}
Scalar prSign_
sign of local p_r
Scalar CylindricalState::rho ( ) const
inline

Definition at line 75 of file CylindricalState.h.

References rho_.

75 {return rho_;}

Member Data Documentation

Vector CylindricalState::par_
private

Definition at line 81 of file CylindricalState.h.

Referenced by charge(), CylindricalState(), momentum(), parameters(), and position().

Scalar CylindricalState::prSign_
private

sign of local p_r

Definition at line 83 of file CylindricalState.h.

Referenced by CylindricalState(), momentum(), and prSign().

Scalar CylindricalState::rho_
private

Definition at line 82 of file CylindricalState.h.

Referenced by CylindricalState(), momentum(), position(), and rho().