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