CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
CartesianLorentzForce Class Referencefinal

Derivative calculation for the 6D cartesian case. More...

#include <CartesianLorentzForce.h>

Inheritance diagram for CartesianLorentzForce:
RKDerivative< double, 6 >

Public Types

typedef RKDerivative< double, 6 > Base
 
typedef Base::Scalar Scalar
 
typedef Base::Vector Vector
 
- Public Types inherited from RKDerivative< double, 6 >
typedef double Scalar
 
typedef RKSmallVector< double, NVector
 

Public Member Functions

 CartesianLorentzForce (const RKLocalFieldProvider &field, float ch)
 
Vector operator() (Scalar z, const Vector &state) const override
 
- Public Member Functions inherited from RKDerivative< double, 6 >
virtual ~RKDerivative ()
 

Private Attributes

float theCharge
 
const RKLocalFieldProvidertheField
 

Detailed Description

Derivative calculation for the 6D cartesian case.

Definition at line 10 of file CartesianLorentzForce.h.

Member Typedef Documentation

Definition at line 13 of file CartesianLorentzForce.h.

Definition at line 14 of file CartesianLorentzForce.h.

Definition at line 15 of file CartesianLorentzForce.h.

Constructor & Destructor Documentation

CartesianLorentzForce::CartesianLorentzForce ( const RKLocalFieldProvider field,
float  ch 
)
inline

Definition at line 17 of file CartesianLorentzForce.h.

References RKDerivative< T, N >::operator()(), and z.

17  :
18  theField(field), theCharge(ch) {}
const RKLocalFieldProvider & theField

Member Function Documentation

CartesianLorentzForce::Vector CartesianLorentzForce::operator() ( Scalar  z,
const Vector state 
) const
inlineoverridevirtual

Derivative d(pos)/ds is simply normalized momentum

Lorentz force in absence of electric field

Implements RKDerivative< double, 6 >.

Definition at line 33 of file CartesianLorentzForce.h.

References constexpr, Basic3DVector< T >::cross(), gen::k, CartesianStateAdaptor::momentum(), CartesianStateAdaptor::position(), CartesianStateAdaptor::rkstate(), command_line::start, AlignmentTrackSelector_cfi::theCharge, and Basic3DVector< T >::unit().

34 {
35  // derivatives in case S is the free parameter
37  auto bfield = theField.inTesla( RKLocalFieldProvider::LocalPoint(start.position()));
38  constexpr float k = 2.99792458e-3; // conversion to [cm]
39 
41  auto dpos = start.momentum().unit();
42 
44  auto dmom = (k*theCharge) * dpos.cross( bfield);
45 
46  return CartesianStateAdaptor::rkstate( dpos, dmom);
47 }
Definition: start.py:1
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
int k[5][pyjets_maxn]
const RKLocalFieldProvider & theField
#define constexpr
Vector inTesla(const LocalPoint &lp) const
the argument lp is in the local frame specified in the constructor

Member Data Documentation

float CartesianLorentzForce::theCharge
private

Definition at line 25 of file CartesianLorentzForce.h.

const RKLocalFieldProvider& CartesianLorentzForce::theField
private

Definition at line 24 of file CartesianLorentzForce.h.