CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 RKPropagatorInR::myPropagate (const FreeTrajectoryState& ts, const Cylinder& cyl) const
16 {
17  //typedef RK4PreciseSolver<double,5> Solver;
18  typedef RKAdaptiveSolver<double,RKOne4OrderStep, 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  RKVector start = startState.parameters();
31 
32  RKLocalFieldProvider localField( *theVolume, cyl);
33  CylindricalLorentzForce<double,5> deriv(localField);
34  RKCylindricalDistance<double,5> dist;
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 
56 RKPropagatorInR::myPropagate (const FreeTrajectoryState&, const Plane&) const
57 {
58  return TrajectoryStateOnSurface();
59 }
60 
61 std::pair< TrajectoryStateOnSurface, double>
62 RKPropagatorInR::propagateWithPath (const FreeTrajectoryState&, const Plane&) const
63 {
64  return std::pair< TrajectoryStateOnSurface, double>();
65 }
66 
67 std::pair< TrajectoryStateOnSurface, double>
68 RKPropagatorInR::propagateWithPath (const FreeTrajectoryState&, const Cylinder&) const
69 {
70  return std::pair< TrajectoryStateOnSurface, double>();
71 }
72 
74 {
75  return new RKPropagatorInR(*this);
76 }
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
double Scalar
Definition: Definitions.h:27
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
TrackCharge charge() const
Definition: Plane.h:17
int TrackCharge
Definition: TrackCharge.h:4
GlobalVector momentum() const
GlobalPoint position() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135