CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

CartesianLorentzForce Class Reference

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

#include <CartesianLorentzForce.h>

Inheritance diagram for CartesianLorentzForce:
RKDerivative< double, 6 >

List of all members.

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 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.

Reimplemented from RKDerivative< double, 6 >.

Definition at line 14 of file CartesianLorentzForce.h.

Reimplemented from RKDerivative< double, 6 >.

Definition at line 15 of file CartesianLorentzForce.h.


Constructor & Destructor Documentation

CartesianLorentzForce::CartesianLorentzForce ( const RKLocalFieldProvider field,
double  ch 
) [inline]

Definition at line 17 of file CartesianLorentzForce.h.

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

Member Function Documentation

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(), dqm_diff::start, 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);
}

Member Data Documentation

Definition at line 25 of file CartesianLorentzForce.h.

Referenced by operator()().

Definition at line 24 of file CartesianLorentzForce.h.

Referenced by operator()().