CMS 3D CMS Logo

CartesianLorentzForce.h
Go to the documentation of this file.
1 #ifndef CartesianLorentzForce_H
2 #define CartesianLorentzForce_H
3 
5 #include "RKDerivative.h"
6 #include "RKLocalFieldProvider.h"
7 
9 
10 class dso_internal CartesianLorentzForce final : public RKDerivative<double, 6> {
11 public:
15 
16  CartesianLorentzForce(const RKLocalFieldProvider& field, float ch) : theField(field), theCharge(ch) {}
17 
18  Vector operator()(Scalar z, const Vector& state) const override;
19 
20 private:
22  float theCharge;
23 };
24 
25 #include "CartesianStateAdaptor.h"
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 }
40 
41 #endif
CartesianLorentzForce::Vector
Base::Vector Vector
Definition: CartesianLorentzForce.h:14
Visibility.h
start
Definition: start.py:1
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
RKDerivative.h
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::CartesianLorentzForce
CartesianLorentzForce(const RKLocalFieldProvider &field, float ch)
Definition: CartesianLorentzForce.h:16
RKDerivative< double, 6 >::Scalar
double Scalar
Definition: RKDerivative.h:12
CartesianStateAdaptor.h
CartesianLorentzForce::theCharge
float theCharge
Definition: CartesianLorentzForce.h:22
align::Scalar
double Scalar
Definition: Definitions.h:25
Vector
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
RKLocalFieldProvider
Definition: RKLocalFieldProvider.h:10
CartesianLorentzForce::Base
RKDerivative< double, 6 > Base
Definition: CartesianLorentzForce.h:12
RKLocalFieldProvider.h
DDAxes::z
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CartesianLorentzForce::operator()
Vector operator()(Scalar z, const Vector &state) const override
Definition: CartesianLorentzForce.h:26
Point3DBase< float, LocalTag >
CartesianLorentzForce::Scalar
Base::Scalar Scalar
Definition: CartesianLorentzForce.h:13
RKDerivative::operator()
virtual Vector operator()(Scalar startPar, const Vector &startState) const =0
CartesianLorentzForce
Derivative calculation for the 6D cartesian case.
Definition: CartesianLorentzForce.h:10
CartesianStateAdaptor::rkstate
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
Definition: CartesianStateAdaptor.h:22
dso_internal
#define dso_internal
Definition: Visibility.h:13
CartesianLorentzForce::theField
const RKLocalFieldProvider & theField
Definition: CartesianLorentzForce.h:21
RKDerivative
Base class for derivative calculation.
Definition: RKDerivative.h:10
CartesianStateAdaptor
Definition: CartesianStateAdaptor.h:8
AlignmentTrackSelector_cfi.theCharge
theCharge
Definition: AlignmentTrackSelector_cfi.py:20
command_line.start
start
Definition: command_line.py:167
RKDerivative< double, 6 >::Vector
RKSmallVector< double, N > Vector
Definition: RKDerivative.h:13