Derivative calculation for the 6D cartesian case. More...
#include <CartesianLorentzForce.h>
Public Types | |
typedef RKDerivative< double, 6 > | Base |
typedef Base::Scalar | Scalar |
typedef Base::Vector | Vector |
Public Member Functions | |
CartesianLorentzForce (const RKLocalFieldProvider &field, double ch) | |
virtual Vector | operator() (Scalar z, const Vector &state) const |
Private Attributes | |
double | theCharge |
const RKLocalFieldProvider & | theField |
Derivative calculation for the 6D cartesian case.
Definition at line 9 of file CartesianLorentzForce.h.
typedef RKDerivative< double,6> CartesianLorentzForce::Base |
Definition at line 12 of file CartesianLorentzForce.h.
Reimplemented from RKDerivative< double, 6 >.
Definition at line 13 of file CartesianLorentzForce.h.
Reimplemented from RKDerivative< double, 6 >.
Definition at line 14 of file CartesianLorentzForce.h.
CartesianLorentzForce::CartesianLorentzForce | ( | const RKLocalFieldProvider & | field, |
double | ch | ||
) | [inline] |
Definition at line 16 of file CartesianLorentzForce.h.
CartesianLorentzForce::Vector CartesianLorentzForce::operator() | ( | Scalar | z, |
const Vector & | state | ||
) | const [virtual] |
Derivative d(pos)/ds is simply normalized momentum
Lorentz force in absence of electric field
Implements RKDerivative< double, 6 >.
Definition at line 6 of file CartesianLorentzForce.cc.
References Basic3DVector< T >::cross(), RKLocalFieldProvider::inTesla(), gen::k, CartesianStateAdaptor::momentum(), CartesianStateAdaptor::position(), CartesianStateAdaptor::rkstate(), theCharge, and theField.
{ // derivatives in case S is the free parameter CartesianStateAdaptor start(state); RKLocalFieldProvider::Vector bfield = theField.inTesla( RKLocalFieldProvider::LocalPoint(start.position())); double k = 2.99792458e-3; // conversion to [cm] CartesianStateAdaptor::Vector3D dpos = start.momentum().unit(); CartesianStateAdaptor::Vector3D dmom = k*theCharge * dpos.cross( bfield); return CartesianStateAdaptor::rkstate( dpos, dmom); }
double CartesianLorentzForce::theCharge [private] |
Definition at line 24 of file CartesianLorentzForce.h.
Referenced by operator()().
const RKLocalFieldProvider& CartesianLorentzForce::theField [private] |
Definition at line 23 of file CartesianLorentzForce.h.
Referenced by operator()().