CMS 3D CMS Logo

RKPropagatorInR.cc
Go to the documentation of this file.
3 // #include "CommonReco/RKPropagators/interface/RK4PreciseSolver.h"
6 #include "RKLocalFieldProvider.h"
8 #include "RKAdaptiveSolver.h"
9 #include "RKOne4OrderStep.h"
10 #include "RKOneCashKarpStep.h"
11 #include "CylindricalState.h"
13 
16 {
17  //typedef RK4PreciseSolver<double,5> Solver;
19  //typedef RKAdaptiveSolver<Scalar,RKOneCashKarpStep, 5> Solver;
20  typedef double Scalar;
21  typedef Solver::Vector RKVector;
22 
23  GlobalPoint pos( ts.position());
24  GlobalVector mom( ts.momentum());
25 
26  LocalPoint startpos = cyl.toLocal(pos);
27  LocalVector startmom = cyl.toLocal(mom);
28 
29  CylindricalState startState( startpos, startmom, ts.charge());
30  const RKVector& start = startState.parameters();
31 
32  RKLocalFieldProvider localField( *theVolume, cyl);
33  CylindricalLorentzForce<double,5> deriv(localField);
35  double eps = 1.e-5;
36  Solver solver;
37  try {
38  Scalar step = cyl.radius() - startState.rho();
39  RKVector rkresult = solver( startState.rho(), start, step, deriv, dist, eps);
40  CylindricalState endState( cyl.radius(), rkresult, startState.prSign());
41  return TrajectoryStateOnSurface( GlobalTrajectoryParameters( cyl.toGlobal( endState.position()),
42  cyl.toGlobal( endState.momentum()),
43  TrackCharge(endState.charge()),
44  theVolume),
45  cyl);
46  }
47  catch (CylindricalLorentzForceException& e) {
48  // the propagation failed due to momentum almost parallel to the plane.
49  // This does not mean the propagation is impossible, but it should be done
50  // in a different parametrization (e.g. s)
51  return TrajectoryStateOnSurface();
52  }
53 }
54 
57 {
58  return TrajectoryStateOnSurface();
59 }
60 
61 std::pair< TrajectoryStateOnSurface, double>
63 {
64  return std::pair< TrajectoryStateOnSurface, double>();
65 }
66 
67 std::pair< TrajectoryStateOnSurface, double>
69 {
70  return std::pair< TrajectoryStateOnSurface, double>();
71 }
72 
74 {
75  return new RKPropagatorInR(*this);
76 }
Definition: start.py:1
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
double Scalar
Definition: Definitions.h:27
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Plane &) const override
TrackCharge charge() const
RKPropagatorInR(const MagVolume &vol, PropagationDirection dir=alongMomentum)
Definition: Plane.h:17
Propagator * clone() const override
int TrackCharge
Definition: TrackCharge.h:4
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:67
LocalPoint toLocal(const GlobalPoint &gp) const
const MagVolume * theVolume
GlobalVector momentum() const
GlobalPoint position() const
TrajectoryStateOnSurface myPropagate(const FreeTrajectoryState &, const Plane &) const
step