6 #include "CLHEP/GenericFunctions/Variable.hh"
7 #include "CLHEP/GenericFunctions/FixedConstant.hh"
8 #include "CLHEP/GenericFunctions/RKIntegrator.hh"
9 #include "CLHEP/Geometry/Point3D.h"
10 #include "CLHEP/Vector/LorentzVector.h"
11 #include "CLHEP/Units/PhysicalConstants.h"
15 const Genfun::AbsFunction & By,
16 const Genfun::AbsFunction & Bz,
17 const HepGeom::Point3D<double> & x0,
18 const CLHEP::HepLorentzVector &
p0,
36 m_px = Genfun::FixedConstant(
p0.x()).clone();
37 m_py = Genfun::FixedConstant(
p0.y()).clone();
38 m_pz = Genfun::FixedConstant(
p0.z()).clone();
44 Genfun::RKIntegrator rkIntegrator;
45 Genfun::Variable Px(0,6),Py(1,6), Pz(2,6),
X(3,6),
Y(4,6),
Z(5,6);
46 Genfun::FixedConstant
I(1.0);
48 const double inv_E = 1. /
E;
52 Genfun::GENFUNCTION DxDt = Px*inv_E;
53 Genfun::GENFUNCTION DyDt = Py*inv_E;
54 Genfun::GENFUNCTION DzDt = Pz*inv_E;
56 rkIntegrator.addDiffEquation(&DPxDt,
"Px",
p0.x(),
p0.x(),
p0.x());
57 rkIntegrator.addDiffEquation(&DPyDt,
"Py",
p0.y(),
p0.y(),
p0.y());
58 rkIntegrator.addDiffEquation(&DPzDt,
"Pz",
p0.z(),
p0.z(),
p0.z());
59 rkIntegrator.addDiffEquation(&DxDt,
"x", x0.x(), x0.x(), x0.x());
60 rkIntegrator.addDiffEquation(&DyDt,
"y", x0.y(), x0.y(), x0.y());
61 rkIntegrator.addDiffEquation(&DzDt,
"z", x0.z(), x0.z(), x0.z());