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 Vector operator() (Scalar startPar, const Vector &startState) const=0
 
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

◆ Base

Definition at line 12 of file CartesianLorentzForce.h.

◆ Scalar

Definition at line 13 of file CartesianLorentzForce.h.

◆ Vector

Definition at line 14 of file CartesianLorentzForce.h.

Constructor & Destructor Documentation

◆ CartesianLorentzForce()

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

Definition at line 16 of file CartesianLorentzForce.h.

16 : theField(field), theCharge(ch) {}

Member Function Documentation

◆ operator()()

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

Derivative d(pos)/ds is simply normalized momentum

Lorentz force in absence of electric field

Definition at line 26 of file CartesianLorentzForce.h.

26  {
27  // derivatives in case S is the free parameter
29  auto bfield = theField.inTesla(RKLocalFieldProvider::LocalPoint(start.position()));
30  constexpr float k = 2.99792458e-3; // conversion to [cm]
31 
33  auto dpos = start.momentum().unit();
34 
36  auto dmom = (k * theCharge) * dpos.cross(bfield);
37 
38  return CartesianStateAdaptor::rkstate(dpos, dmom);
39 }

References RKLocalFieldProvider::inTesla(), dqmdumpme::k, CartesianStateAdaptor::rkstate(), command_line::start, theCharge, and theField.

Member Data Documentation

◆ theCharge

float CartesianLorentzForce::theCharge
private

Definition at line 22 of file CartesianLorentzForce.h.

Referenced by operator()().

◆ theField

const RKLocalFieldProvider& CartesianLorentzForce::theField
private

Definition at line 21 of file CartesianLorentzForce.h.

Referenced by operator()().

start
Definition: start.py:1
RKLocalFieldProvider::inTesla
Vector inTesla(const LocalPoint &lp) const
the argument lp is in the local frame specified in the constructor
Definition: RKLocalFieldProvider.cc:11
CartesianLorentzForce::theCharge
float theCharge
Definition: CartesianLorentzForce.h:22
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, LocalTag >
CartesianStateAdaptor::rkstate
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
Definition: CartesianStateAdaptor.h:22
CartesianLorentzForce::theField
const RKLocalFieldProvider & theField
Definition: CartesianLorentzForce.h:21
CartesianStateAdaptor
Definition: CartesianStateAdaptor.h:8
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
command_line.start
start
Definition: command_line.py:167