CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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); }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
WorkSpace int float eps
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
TrackCharge charge() const
RKPropagatorInR(const MagVolume &vol, PropagationDirection dir=alongMomentum)
Definition: Plane.h:16
int TrackCharge
Definition: TrackCharge.h:4
Propagator * clone() const override
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:64
LocalPoint toLocal(const GlobalPoint &gp) const
const MagVolume * theVolume
GlobalVector momentum() const
GlobalPoint position() const
TrajectoryStateOnSurface myPropagate(const FreeTrajectoryState &, const Plane &) const
step
Definition: StallMonitor.cc:94