CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
RKPropagatorInS Class Reference

#include <RKPropagatorInS.h>

Inheritance diagram for RKPropagatorInS:
Propagator

Public Member Functions

virtual Propagatorclone () const
 
virtual const MagneticFieldmagneticField () const
 
virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState &, const Plane &) const
 
virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState &, const Cylinder &) const
 
TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &ts, const Plane &plane) const
 
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &, const Plane &) const
 
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &, const Cylinder &) const
 
 RKPropagatorInS (const MagVolume &vol, PropagationDirection dir=alongMomentum, double tolerance=5.e-5)
 
 ~RKPropagatorInS ()
 
- Public Member Functions inherited from Propagator
virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState &, const Surface &) const
 
virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &, const Surface &) const
 
virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &, const Cylinder &) const
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &, const reco::BeamSpot &) const
 
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &, const Surface &) const
 
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &, const Surface &) const
 
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &, const Plane &) const
 
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &, const Cylinder &) const
 
virtual std::pair
< FreeTrajectoryState, double > 
propagateWithPath (const FreeTrajectoryState &, const GlobalPoint &, const GlobalPoint &) const
 
virtual PropagationDirection propagationDirection () const
 
 Propagator (PropagationDirection dir=alongMomentum)
 
virtual bool setMaxDirectionChange (float phiMax)
 
virtual void setPropagationDirection (PropagationDirection dir) const
 
virtual ~Propagator ()
 

Private Types

typedef std::pair
< TrajectoryStateOnSurface,
double > 
TsosWP
 

Private Member Functions

RKLocalFieldProvider fieldProvider () const
 
RKLocalFieldProvider fieldProvider (const Cylinder &cyl) const dso_internal
 
GlobalVector globalMomentum (const Basic3DVector< double > &mom) const dso_internal
 
GlobalPoint globalPosition (const Basic3DVector< double > &pos) const dso_internal
 
GlobalTrajectoryParameters gtpFromLocal (const Basic3DVector< double > &lpos, const Basic3DVector< double > &lmom, TrackCharge ch, const Surface &surf) const dso_internal
 
GlobalTrajectoryParameters gtpFromVolumeLocal (const CartesianStateAdaptor &state, TrackCharge charge) const dso_internal
 
PropagationDirection invertDirection (PropagationDirection dir) const dso_internal
 
GlobalParametersWithPath propagateParametersOnCylinder (const FreeTrajectoryState &ts, const Cylinder &cyl) const dso_internal
 
GlobalParametersWithPath propagateParametersOnPlane (const FreeTrajectoryState &ts, const Plane &plane) const dso_internal
 
Basic3DVector< double > rkMomentum (const GlobalVector &mom) const dso_internal
 
Basic3DVector< double > rkPosition (const GlobalPoint &pos) const dso_internal
 

Private Attributes

double theTolerance
 
const MagVolumetheVolume
 

Detailed Description

Definition at line 20 of file RKPropagatorInS.h.

Member Typedef Documentation

typedef std::pair<TrajectoryStateOnSurface,double> RKPropagatorInS::TsosWP
private

Definition at line 61 of file RKPropagatorInS.h.

Constructor & Destructor Documentation

RKPropagatorInS::RKPropagatorInS ( const MagVolume vol,
PropagationDirection  dir = alongMomentum,
double  tolerance = 5.e-5 
)
inlineexplicit

Definition at line 27 of file RKPropagatorInS.h.

Referenced by clone().

28  :
29  Propagator(dir), theVolume( &vol), theTolerance( tolerance) {}
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:41
const MagVolume * theVolume
dbl *** dir
Definition: mlp_gen.cc:35
RKPropagatorInS::~RKPropagatorInS ( )
inline

Definition at line 31 of file RKPropagatorInS.h.

31 {}

Member Function Documentation

Propagator * RKPropagatorInS::clone ( void  ) const
virtual

Implements Propagator.

Definition at line 345 of file RKPropagatorInS.cc.

References RKPropagatorInS().

346 {
347  return new RKPropagatorInS(*this);
348 }
RKPropagatorInS(const MagVolume &vol, PropagationDirection dir=alongMomentum, double tolerance=5.e-5)
RKLocalFieldProvider RKPropagatorInS::fieldProvider ( ) const
private

Definition at line 358 of file RKPropagatorInS.cc.

References theVolume.

Referenced by propagateParametersOnCylinder(), and propagateParametersOnPlane().

359 {
361 }
const MagVolume * theVolume
RKLocalFieldProvider RKPropagatorInS::fieldProvider ( const Cylinder cyl) const
private

Definition at line 363 of file RKPropagatorInS.cc.

References theVolume.

364 {
365  return RKLocalFieldProvider( *theVolume, cyl);
366 }
const MagVolume * theVolume
GlobalVector RKPropagatorInS::globalMomentum ( const Basic3DVector< double > &  mom) const
private

Definition at line 392 of file RKPropagatorInS.cc.

References theVolume, and GloballyPositioned< T >::toGlobal().

Referenced by gtpFromVolumeLocal().

394 {
395  if (theVolume != 0) return theVolume->toGlobal( LocalVector(mom));
396  else return GlobalVector(mom);
397 }
Local3DVector LocalVector
Definition: LocalVector.h:12
const MagVolume * theVolume
GlobalPoint toGlobal(const LocalPoint &lp) const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
GlobalPoint RKPropagatorInS::globalPosition ( const Basic3DVector< double > &  pos) const
private

Definition at line 386 of file RKPropagatorInS.cc.

References theVolume, and GloballyPositioned< T >::toGlobal().

Referenced by gtpFromVolumeLocal(), and propagateParametersOnPlane().

387 {
388  if (theVolume != 0) return theVolume->toGlobal( LocalPoint(pos));
389  else return GlobalPoint(pos);
390 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const MagVolume * theVolume
GlobalPoint toGlobal(const LocalPoint &lp) const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
GlobalTrajectoryParameters RKPropagatorInS::gtpFromLocal ( const Basic3DVector< double > &  lpos,
const Basic3DVector< double > &  lmom,
TrackCharge  ch,
const Surface surf 
) const
private

Definition at line 350 of file RKPropagatorInS.cc.

References theVolume, and Surface::toGlobal().

Referenced by propagateParametersOnCylinder().

353 {
354  return GlobalTrajectoryParameters( surf.toGlobal( LocalPoint( lpos)),
355  surf.toGlobal( LocalVector( lmom)), ch, theVolume);
356 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
Local3DVector LocalVector
Definition: LocalVector.h:12
const MagVolume * theVolume
GlobalTrajectoryParameters RKPropagatorInS::gtpFromVolumeLocal ( const CartesianStateAdaptor state,
TrackCharge  charge 
) const
private

Definition at line 400 of file RKPropagatorInS.cc.

References globalMomentum(), globalPosition(), CartesianStateAdaptor::momentum(), CartesianStateAdaptor::position(), and theVolume.

Referenced by propagateParametersOnPlane().

402 {
404  globalMomentum(state.momentum()),
405  charge, theVolume);
406 }
double charge(const std::vector< uint8_t > &Ampls)
GlobalPoint globalPosition(const Basic3DVector< double > &pos) const dso_internal
const Vector3D & momentum() const
const MagVolume * theVolume
GlobalVector globalMomentum(const Basic3DVector< double > &mom) const dso_internal
const Vector3D & position() const
PropagationDirection RKPropagatorInS::invertDirection ( PropagationDirection  dir) const
private
virtual const MagneticField* RKPropagatorInS::magneticField ( ) const
inlinevirtual

Implements Propagator.

Definition at line 57 of file RKPropagatorInS.h.

References theVolume.

Referenced by NavPropagator::propagateInVolume().

57 {return theVolume;}
const MagVolume * theVolume
TrajectoryStateOnSurface RKPropagatorInS::propagate ( const FreeTrajectoryState fts,
const Plane plane 
) const
virtual

Implements Propagator.

Definition at line 334 of file RKPropagatorInS.cc.

References propagateWithPath().

335 {
336  return propagateWithPath( fts, plane).first;
337 }
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Plane &) const
TrajectoryStateOnSurface RKPropagatorInS::propagate ( const FreeTrajectoryState fts,
const Cylinder cyl 
) const
virtual

Implements Propagator.

Definition at line 340 of file RKPropagatorInS.cc.

References propagateWithPath().

341 {
342  return propagateWithPath( fts, cyl).first;
343 }
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Plane &) const
TrajectoryStateOnSurface RKPropagatorInS::propagate ( const TrajectoryStateOnSurface ts,
const Plane plane 
) const
inlinevirtual

Reimplemented from Propagator.

Definition at line 48 of file RKPropagatorInS.h.

References first, TrajectoryStateOnSurface::freeState(), and propagateWithPath().

49  {
50  return propagateWithPath( *ts.freeState(),plane).first;
51  }
FreeTrajectoryState * freeState(bool withErrors=true) const
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Plane &) const
bool first
Definition: L1TdeRCT.cc:94
GlobalParametersWithPath RKPropagatorInS::propagateParametersOnCylinder ( const FreeTrajectoryState ts,
const Cylinder cyl 
) const
private

Definition at line 200 of file RKPropagatorInS.cc.

References abs, FreeTrajectoryState::charge(), alignCSCRings::e, fieldProvider(), gtpFromLocal(), invertDirection(), likely, LogDebug, CartesianStateAdaptor::momentum(), FreeTrajectoryState::momentum(), scaleCards::path, StraightLineCylinderCrossing::pathLength(), StraightLineBarrelCylinderCrossing::pathLength(), Basic3DVector< T >::perp(), perp(), pos, CartesianStateAdaptor::position(), StraightLineBarrelCylinderCrossing::position(), GloballyPositioned< T >::position(), FreeTrajectoryState::position(), Propagator::propagationDirection(), Cylinder::radius(), rho, CartesianStateAdaptor::rkstate(), alignCSCRings::s, errorMatrix2Lands_multiChannel::start, theTolerance, theVolume, GloballyPositioned< T >::toLocal(), FreeTrajectoryState::transverseCurvature(), unlikely, x, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and Basic3DVector< T >::z().

Referenced by propagateWithPath().

201  {
202 
204  typedef Solver::Vector RKVector;
205 
206 
207  GlobalPoint sp = cyl.position();
208  if unlikely(sp.x()!=0. || sp.y()!=0.) {
209  throw PropagationException("Cannot propagate to an arbitrary cylinder");
210  }
211 
212  GlobalPoint gpos( ts.position());
213  GlobalVector gmom( ts.momentum());
214  LocalPoint pos(cyl.toLocal(gpos));
215  LocalVector mom(cyl.toLocal(gmom));
216  double startR = cyl.radius() - pos.perp();
217 
218  // LogDebug("RKPropagatorInS") << "RKPropagatorInS: starting from FTS " << ts ;
219 
220 
221  // (transverse) curvature
222  double rho = ts.transverseCurvature();
223  //
224  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um
225  // difference in transversal position at 10m.
226  //
227  if unlikely( fabs(rho)<1.e-10 ) {
228  //
229  // Instantiate auxiliary object for finding intersection.
230  // Frame-independant point and vector are created explicitely to
231  // avoid confusing gcc (refuses to compile with temporary objects
232  // in the constructor).
233  //
234 
236 
237  //
238  // get solution
239  //
240  std::pair<bool,double> propResult = cylCrossing.pathLength(cyl);
241  if likely( propResult.first && theVolume !=0) {
242  double s = propResult.second;
243  // point (reconverted to GlobalPoint)
244  GlobalPoint x (cylCrossing.position(s));
245  GlobalTrajectoryParameters res( x, gmom, ts.charge(), theVolume);
246  LogDebug("RKPropagatorInS") << "Straight line propagation to cylinder succeeded !!";
247  return GlobalParametersWithPath( res, s);
248  }
249 
250  //do someting
251  edm::LogError("RKPropagatorInS") <<"Straight line propagation to cylinder failed !!";
252  return GlobalParametersWithPath( );
253 
254  }
255 
256 
257  RKLocalFieldProvider field( fieldProvider(cyl));
258  // StraightLineCylinderCrossing pathLength( pos, mom, propagationDirection());
259  CartesianLorentzForce deriv(field, ts.charge());
260 
261  RKCartesianDistance dist;
262  double eps = theTolerance;
263  Solver solver;
264  double stot = 0;
265  PropagationDirection currentDirection = propagationDirection();
266 
267  RKVector start( CartesianStateAdaptor::rkstate( pos.basicVector(), mom.basicVector()));
268  int safeGuard = 0;
269  while (safeGuard++<100) {
270  CartesianStateAdaptor startState(start);
271  StraightLineCylinderCrossing pathLength( LocalPoint(startState.position()),
272  LocalVector(startState.momentum()),
273  currentDirection, eps);
274 
275  std::pair<bool,double> path = pathLength.pathLength( cyl);
276  if unlikely(!path.first) {
277  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Path length calculation to cylinder failed!"
278  << "Radius " << cyl.radius() << " pos.perp() " << LocalPoint(startState.position()).perp() ;
279  return GlobalParametersWithPath();
280  }
281 
282  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Path lenght to cylinder is " << path.second
283  << " from point (R,z) " << startState.position().perp()
284  << ", " << startState.position().z()
285  << " to R " << cyl.radius()
286  ;
287 
288 
289  double sstep = path.second;
290  if unlikely( std::abs(sstep) < eps) {
291  LogDebug("RKPropagatorInS") << "accuracy not reached, but pathLength calculation says we are there! "
292  << path.second ;
293 
294  GlobalTrajectoryParameters res( gtpFromLocal( startState.position(),
295  startState.momentum(),
296  ts.charge(), cyl));
297  return GlobalParametersWithPath( res, stot);
298  }
299 
300  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Solving for " << sstep
301  << " current distance to cylinder is " << startR ;
302 
303  RKVector rkresult = solver( 0, start, sstep, deriv, dist, eps);
304  stot += sstep;
305  CartesianStateAdaptor cur( rkresult);
306  double remainingR = cyl.radius() - cur.position().perp();
307 
308  if ( fabs(remainingR) < eps) {
309  LogDebug("RKPropagatorInS") << "Accuracy reached! " << remainingR ;
310  GlobalTrajectoryParameters res( gtpFromLocal( cur.position(),
311  cur.momentum(),
312  ts.charge(), cyl));
313  return GlobalParametersWithPath( res, stot);
314  }
315 
316  start = rkresult;
317  if (remainingR * startR > 0) {
318  LogDebug("RKPropagatorInS") << "Accuracy not reached yet, trying in same direction again "
319  << remainingR ;
320  }
321  else {
322  LogDebug("RKPropagatorInS") << "Accuracy not reached yet, trying in opposite direction "
323  << remainingR ;
324  currentDirection = invertDirection( currentDirection);
325  }
326  startR = remainingR;
327  }
328 
329  edm::LogError("FailedPropagation") << " too many iterations trying to reach cylinder ";
330  return GlobalParametersWithPath();
331 }
#define LogDebug(id)
Local3DVector LocalVector
Definition: LocalVector.h:12
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:28
Definition: DDAxes.h:10
RKLocalFieldProvider fieldProvider() const
T y() const
Definition: PV3DBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
PropagationDirection
TrackCharge charge() const
#define unlikely(x)
Definition: Likely.h:21
list path
Definition: scaleCards.py:51
Estimator of the distance between two state vectors, e.g. for convergence test.
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:55
LocalPoint toLocal(const GlobalPoint &gp) const
Derivative calculation for the 6D cartesian case.
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
const MagVolume * theVolume
Common base class.
GlobalVector momentum() const
GlobalPoint position() const
GlobalTrajectoryParameters gtpFromLocal(const Basic3DVector< double > &lpos, const Basic3DVector< double > &lmom, TrackCharge ch, const Surface &surf) const dso_internal
double transverseCurvature() const
T perp() const
Magnitude of transverse component.
#define likely(x)
Definition: Likely.h:20
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
Definition: DDAxes.h:10
PropagationDirection invertDirection(PropagationDirection dir) const dso_internal
T x() const
Definition: PV3DBase.h:61
const PositionType & position() const
GlobalParametersWithPath RKPropagatorInS::propagateParametersOnPlane ( const FreeTrajectoryState ts,
const Plane plane 
) const
private

Definition at line 53 of file RKPropagatorInS.cc.

References abs, PV3DBase< T, PVType, FrameType >::basicVector(), FreeTrajectoryState::charge(), cross(), dir, alignCSCRings::e, fieldProvider(), RKLocalFieldProvider::frame(), globalPosition(), gtpFromVolumeLocal(), RKLocalFieldProvider::inTesla(), invertDirection(), likely, Plane::localZ(), LogDebug, CartesianStateAdaptor::momentum(), FreeTrajectoryState::momentum(), scaleCards::path, StraightLinePlaneCrossing::pathLength(), pos, CartesianStateAdaptor::position(), StraightLinePlaneCrossing::position(), GloballyPositioned< T >::position(), FreeTrajectoryState::position(), Propagator::propagationDirection(), rho, rkMomentum(), rkPosition(), CartesianStateAdaptor::rkstate(), alignCSCRings::s, errorMatrix2Lands_multiChannel::start, theTolerance, theVolume, GloballyPositioned< T >::toGlobal(), GloballyPositioned< T >::toLocal(), FrameChanger::transformPlane(), FreeTrajectoryState::transverseCurvature(), unlikely, and x.

Referenced by propagateWithPath().

55 {
56 
57  GlobalPoint gpos( ts.position());
58  GlobalVector gmom( ts.momentum());
59  double startZ = plane.localZ(gpos);
60  // (transverse) curvature
61  double rho = ts.transverseCurvature();
62  //
63  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um
64  // difference in transversal position at 10m.
65  //
66  if unlikely( fabs(rho)<1.e-10 ) {
67  //
68  // Instantiate auxiliary object for finding intersection.
69  // Frame-independant point and vector are created explicitely to
70  // avoid confusing gcc (refuses to compile with temporary objects
71  // in the constructor).
72  //
73  LogDebug("RKPropagatorInS")<<" startZ = "<<startZ;
74 
75  if unlikely(fabs(startZ) < 1e-5){
76  LogDebug("RKPropagatorInS")<< "Propagation is not performed: state is already on final surface.";
77  GlobalTrajectoryParameters res( gpos, gmom, ts.charge(),
78  theVolume);
79  return GlobalParametersWithPath( res, 0.0);
80  }
81 
85  //
86  // get solution
87  //
88  std::pair<bool,double> propResult = planeCrossing.pathLength(plane);
89  if likely( propResult.first && theVolume !=0) {
90  double s = propResult.second;
91  // point (reconverted to GlobalPoint)
92  GlobalPoint x (planeCrossing.position(s));
93  GlobalTrajectoryParameters res( x, gmom, ts.charge(), theVolume);
94  return GlobalParametersWithPath( res, s);
95  }
96  //do someting
97  LogDebug("RKPropagatorInS")<< "Straight line propgation to plane failed !!";
98  return GlobalParametersWithPath( );
99 
100  }
101 
102 
103 #ifdef EDM_LM_DEBUG
104  if (theVolume != 0) {
105  LogDebug("RKPropagatorInS") << "RKPropagatorInS: starting prop to plane in volume with pos " << theVolume->position()
106  << " Z axis " << theVolume->toGlobal( LocalVector(0,0,1)) ;
107 
108  LogDebug("RKPropagatorInS") << "The starting position is " << ts.position() << " (global) "
109  << theVolume->toLocal(ts.position()) << " (local) " ;
110 
111  FrameChanger changer;
112  FrameChanger::PlanePtr localPlane = changer.transformPlane( plane, *theVolume);
113  LogDebug("RKPropagatorInS") << "The plane position is " << plane.position() << " (global) "
114  << localPlane->position() << " (local) " ;
115 
116  LogDebug("RKPropagatorInS") << "The initial distance to plane is " << plane.localZ( ts.position()) ;
117 
119  std::pair<bool,double> res3 = cross.pathLength(plane);
120  LogDebug("RKPropagatorInS") << "straight line distance " << res3.first << " " << res3.second ;
121  }
122 #endif
123 
125  typedef Solver::Vector RKVector;
126 
128  PathToPlane2Order pathLength( field, &field.frame());
129  CartesianLorentzForce deriv(field, ts.charge());
130 
131  RKCartesianDistance dist;
132  double eps = theTolerance;
133  Solver solver;
134  double stot = 0;
135  PropagationDirection currentDirection = propagationDirection();
136 
137  // in magVolume frame
138  RKVector start( CartesianStateAdaptor::rkstate( rkPosition(gpos), rkMomentum(gmom)));
139  int safeGuard = 0;
140  while (safeGuard++<100) {
141  CartesianStateAdaptor startState(start);
142 
143  std::pair<bool,double> path = pathLength( plane, startState.position(),
144  startState.momentum(),
145  (double) ts.charge(), currentDirection);
146  if unlikely(!path.first) {
147  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Path length calculation to plane failed!"
148  << "...distance to plane " << plane.localZ( globalPosition(startState.position()))
149  << "...Local starting position in volume " << startState.position()
150  << "...Magnetic field " << field.inTesla( startState.position()) ;
151 
152 
153  return GlobalParametersWithPath();
154  }
155 
156  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Path lenght to plane is " << path.second ;
157 
158 
159  double sstep = path.second;
160  if unlikely( std::abs(sstep) < eps) {
161  LogDebug("RKPropagatorInS") << "On-surface accuracy not reached, but pathLength calculation says we are there! "
162  << "path " << path.second << " distance to plane is " << startZ ;
163  GlobalTrajectoryParameters res( gtpFromVolumeLocal( startState, ts.charge()));
164  return GlobalParametersWithPath( res, stot);
165  }
166 
167  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Solving for " << sstep
168  << " current distance to plane is " << startZ ;
169 
170  RKVector rkresult = solver( 0, start, sstep, deriv, dist, eps);
171  stot += sstep;
172  CartesianStateAdaptor cur( rkresult);
173  double remainingZ = plane.localZ( globalPosition(cur.position()));
174 
175  if ( fabs(remainingZ) < eps) {
176  LogDebug("RKPropagatorInS") << "On-surface accuracy reached! " << remainingZ ;
178  return GlobalParametersWithPath( res, stot);
179  }
180 
181  start = rkresult;
182 
183  if (remainingZ * startZ > 0) {
184  LogDebug("RKPropagatorInS") << "Accuracy not reached yet, trying in same direction again "
185  << remainingZ ;
186  }
187  else {
188  LogDebug("RKPropagatorInS") << "Accuracy not reached yet, trying in opposite direction "
189  << remainingZ ;
190  currentDirection = invertDirection( currentDirection);
191  }
192  startZ = remainingZ;
193  }
194 
195  edm::LogError("FailedPropagation") << " too many iterations trying to reach plane ";
196  return GlobalParametersWithPath();
197 }
#define LogDebug(id)
Local3DVector LocalVector
Definition: LocalVector.h:12
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
Basic3DVector< double > rkPosition(const GlobalPoint &pos) const dso_internal
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:28
Definition: DDAxes.h:10
RKLocalFieldProvider fieldProvider() const
float localZ(const GlobalPoint &gp) const
Fast access to distance from plane for a point.
Definition: Plane.h:52
#define abs(x)
Definition: mlp_lapack.h:159
PropagationDirection
TrackCharge charge() const
GlobalPoint globalPosition(const Basic3DVector< double > &pos) const dso_internal
#define unlikely(x)
Definition: Likely.h:21
list path
Definition: scaleCards.py:51
Estimator of the distance between two state vectors, e.g. for convergence test.
LocalPoint toLocal(const GlobalPoint &gp) const
Derivative calculation for the 6D cartesian case.
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
const MagVolume * theVolume
GlobalVector momentum() const
GlobalPoint toGlobal(const LocalPoint &lp) const
GlobalPoint position() const
static Plane transformPlane(const Plane &plane, const GloballyPositioned< T > &frame)
Definition: FrameChanger.h:15
Basic3DVector< double > rkMomentum(const GlobalVector &mom) const dso_internal
double transverseCurvature() const
GlobalTrajectoryParameters gtpFromVolumeLocal(const CartesianStateAdaptor &state, TrackCharge charge) const dso_internal
#define likely(x)
Definition: Likely.h:20
dbl *** dir
Definition: mlp_gen.cc:35
Definition: DDAxes.h:10
PropagationDirection invertDirection(PropagationDirection dir) const dso_internal
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
const PositionType & position() const
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or &quot;cross&quot; product, with a vector of same type.
std::pair< TrajectoryStateOnSurface, double > RKPropagatorInS::propagateWithPath ( const FreeTrajectoryState fts,
const Plane plane 
) const
virtual

Implements Propagator.

Definition at line 27 of file RKPropagatorInS.cc.

References SurfaceSideDefinition::afterSurface, alongMomentum, SurfaceSideDefinition::beforeSurface, GlobalParametersWithPath::parameters(), propagateParametersOnPlane(), Propagator::propagationDirection(), GlobalParametersWithPath::s(), and unlikely.

Referenced by propagate(), and NavPropagator::propagateInVolume().

29 {
32 
33  SurfaceSideDefinition::SurfaceSide side = PropagationDirectionFromPath()(gp.s(),propagationDirection())==alongMomentum
34  ? SurfaceSideDefinition::beforeSurface : SurfaceSideDefinition::afterSurface;
36  return errorprop( fts, plane, side, gp.parameters(),gp.s());
37 }
dictionary parameters
Definition: Parameters.py:2
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
#define unlikely(x)
Definition: Likely.h:21
GlobalParametersWithPath propagateParametersOnPlane(const FreeTrajectoryState &ts, const Plane &plane) const dso_internal
std::pair< TrajectoryStateOnSurface, double > TsosWP
std::pair< TrajectoryStateOnSurface, double > RKPropagatorInS::propagateWithPath ( const FreeTrajectoryState fts,
const Cylinder cyl 
) const
virtual

Implements Propagator.

Definition at line 40 of file RKPropagatorInS.cc.

References SurfaceSideDefinition::afterSurface, alongMomentum, SurfaceSideDefinition::beforeSurface, GlobalParametersWithPath::parameters(), propagateParametersOnCylinder(), Propagator::propagationDirection(), GlobalParametersWithPath::s(), and unlikely.

41 {
44 
45  SurfaceSideDefinition::SurfaceSide side = PropagationDirectionFromPath()(gp.s(),propagationDirection())==alongMomentum
46  ? SurfaceSideDefinition::beforeSurface : SurfaceSideDefinition::afterSurface;
48  return errorprop( fts, cyl, side, gp.parameters(),gp.s());
49 
50 }
dictionary parameters
Definition: Parameters.py:2
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
GlobalParametersWithPath propagateParametersOnCylinder(const FreeTrajectoryState &ts, const Cylinder &cyl) const dso_internal
#define unlikely(x)
Definition: Likely.h:21
std::pair< TrajectoryStateOnSurface, double > TsosWP
Basic3DVector< double > RKPropagatorInS::rkMomentum ( const GlobalVector mom) const
private

Definition at line 380 of file RKPropagatorInS.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), theVolume, and GloballyPositioned< T >::toLocal().

Referenced by propagateParametersOnPlane().

381 {
382  if (theVolume != 0) return theVolume->toLocal( mom).basicVector();
383  else return mom.basicVector();
384 }
LocalPoint toLocal(const GlobalPoint &gp) const
const MagVolume * theVolume
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
Basic3DVector< double > RKPropagatorInS::rkPosition ( const GlobalPoint pos) const
private

Definition at line 374 of file RKPropagatorInS.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), theVolume, and GloballyPositioned< T >::toLocal().

Referenced by propagateParametersOnPlane().

375 {
376  if (theVolume != 0) return theVolume->toLocal( pos).basicVector();
377  else return pos.basicVector();
378 }
LocalPoint toLocal(const GlobalPoint &gp) const
const MagVolume * theVolume
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56

Member Data Documentation

double RKPropagatorInS::theTolerance
private

Definition at line 64 of file RKPropagatorInS.h.

Referenced by propagateParametersOnCylinder(), and propagateParametersOnPlane().

const MagVolume* RKPropagatorInS::theVolume
private