CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
RKPropagatorInS Class Referencefinal

#include <RKPropagatorInS.h>

Inheritance diagram for RKPropagatorInS:
Propagator

Public Member Functions

Propagatorclone () const override
 
const MagneticFieldmagneticField () const override
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const final
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const reco::BeamSpot &beamSpot) const final
 
template<typename STA , typename SUR >
TrajectoryStateOnSurface propagate (STA const &state, SUR const &surface) const
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &, const Cylinder &) const=0
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &, const Plane &) const=0
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &, const Surface &) const final
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const
 Propagate to PCA to a line (given by 2 points) given a starting point. More...
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const reco::BeamSpot &beamSpot) const
 Propagate to PCA to a line (given by beamSpot position and slope) given a starting point. More...
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Cylinder &sur) const
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Plane &sur) const
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Surface &sur) const final
 
 RKPropagatorInS (const MagVolume &vol, PropagationDirection dir=alongMomentum, double tolerance=5.e-5)
 
 ~RKPropagatorInS () override
 
- Public Member Functions inherited from Propagator
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const final
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const reco::BeamSpot &beamSpot) const final
 
template<typename STA , typename SUR >
TrajectoryStateOnSurface propagate (STA const &state, SUR const &surface) const
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &, const Surface &) const final
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const
 Propagate to PCA to a line (given by 2 points) given a starting point. More...
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const reco::BeamSpot &beamSpot) const
 Propagate to PCA to a line (given by beamSpot position and slope) given a starting point. More...
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Cylinder &sur) const
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Plane &sur) const
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Surface &sur) const final
 
virtual PropagationDirection propagationDirection () const final
 
 Propagator (PropagationDirection dir=alongMomentum)
 
virtual bool setMaxDirectionChange (float phiMax)
 
virtual void setPropagationDirection (PropagationDirection dir)
 
virtual ~Propagator ()
 

Private Types

typedef std::pair< TrajectoryStateOnSurface, double > TsosWP
 

Private Member Functions

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

Private Attributes

double theTolerance
 
const MagVolumetheVolume
 

Detailed Description

Definition at line 19 of file RKPropagatorInS.h.

Member Typedef Documentation

◆ TsosWP

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

Definition at line 46 of file RKPropagatorInS.h.

Constructor & Destructor Documentation

◆ RKPropagatorInS()

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

Definition at line 25 of file RKPropagatorInS.h.

Referenced by clone().

◆ ~RKPropagatorInS()

RKPropagatorInS::~RKPropagatorInS ( )
inlineoverride

Definition at line 28 of file RKPropagatorInS.h.

28 {}

Member Function Documentation

◆ clone()

Propagator * RKPropagatorInS::clone ( void  ) const
overridevirtual

Implements Propagator.

Definition at line 312 of file RKPropagatorInS.cc.

312 { return new RKPropagatorInS(*this); }

References RKPropagatorInS().

◆ fieldProvider() [1/2]

RKLocalFieldProvider RKPropagatorInS::fieldProvider ( ) const
private

Definition at line 321 of file RKPropagatorInS.cc.

321 { return RKLocalFieldProvider(*theVolume); }

References theVolume.

Referenced by propagateParametersOnCylinder(), and propagateParametersOnPlane().

◆ fieldProvider() [2/2]

RKLocalFieldProvider RKPropagatorInS::fieldProvider ( const Cylinder cyl) const
private

Definition at line 323 of file RKPropagatorInS.cc.

323  {
324  return RKLocalFieldProvider(*theVolume, cyl);
325 }

References theVolume.

◆ globalMomentum()

GlobalVector RKPropagatorInS::globalMomentum ( const Basic3DVector< float > &  mom) const
private

Definition at line 354 of file RKPropagatorInS.cc.

356 {
357  if (theVolume != nullptr)
358  return theVolume->toGlobal(LocalVector(mom));
359  else
360  return GlobalVector(mom);
361 }

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

Referenced by gtpFromVolumeLocal().

◆ globalPosition()

GlobalPoint RKPropagatorInS::globalPosition ( const Basic3DVector< float > &  pos) const
private

Definition at line 347 of file RKPropagatorInS.cc.

347  {
348  if (theVolume != nullptr)
349  return theVolume->toGlobal(LocalPoint(pos));
350  else
351  return GlobalPoint(pos);
352 }

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

Referenced by gtpFromVolumeLocal(), and propagateParametersOnPlane().

◆ gtpFromLocal()

GlobalTrajectoryParameters RKPropagatorInS::gtpFromLocal ( const Basic3DVector< float > &  lpos,
const Basic3DVector< float > &  lmom,
TrackCharge  ch,
const Surface surf 
) const
private

Definition at line 314 of file RKPropagatorInS.cc.

317  {
318  return GlobalTrajectoryParameters(surf.toGlobal(LocalPoint(lpos)), surf.toGlobal(LocalVector(lmom)), ch, theVolume);
319 }

References theVolume, and Surface::toGlobal().

Referenced by propagateParametersOnCylinder().

◆ gtpFromVolumeLocal()

GlobalTrajectoryParameters RKPropagatorInS::gtpFromVolumeLocal ( const CartesianStateAdaptor state,
TrackCharge  charge 
) const
private

◆ invertDirection()

PropagationDirection RKPropagatorInS::invertDirection ( PropagationDirection  dir) const
private

Definition at line 327 of file RKPropagatorInS.cc.

327  {
328  if (dir == anyDirection)
329  return dir;
331 }

References alongMomentum, anyDirection, DeadROC_duringRun::dir, and oppositeToMomentum.

Referenced by propagateParametersOnCylinder(), and propagateParametersOnPlane().

◆ magneticField()

const MagneticField* RKPropagatorInS::magneticField ( ) const
inlineoverridevirtual

Implements Propagator.

Definition at line 43 of file RKPropagatorInS.h.

43 { return theVolume; }

References theVolume.

◆ propagate() [1/4]

virtual FreeTrajectoryState Propagator::propagate
inlinefinal

Definition at line 109 of file Propagator.h.

109  {
110  return propagateWithPath(ftsStart, pDest).first;
111  }

◆ propagate() [2/4]

virtual FreeTrajectoryState Propagator::propagate
inlinefinal

Definition at line 112 of file Propagator.h.

114  {
115  return propagateWithPath(ftsStart, pDest1, pDest2).first;
116  }

◆ propagate() [3/4]

virtual FreeTrajectoryState Propagator::propagate
inlinefinal

Definition at line 117 of file Propagator.h.

118  {
119  return propagateWithPath(ftsStart, beamSpot).first;
120  }

◆ propagate() [4/4]

template<typename STA , typename SUR >
TrajectoryStateOnSurface Propagator::propagate ( typename STA  ,
typename SUR   
)
inline

Definition at line 50 of file Propagator.h.

50  {
51  return propagateWithPath(state, surface).first;
52  }

Referenced by HGCal_helpers::SimpleTrackPropagator::propagate().

◆ propagateParametersOnCylinder()

GlobalParametersWithPath RKPropagatorInS::propagateParametersOnCylinder ( const FreeTrajectoryState ts,
const Cylinder cyl 
) const
private

Definition at line 191 of file RKPropagatorInS.cc.

192  {
194  typedef Solver::Vector RKVector;
195 
196  const GlobalPoint& sp = cyl.position();
197  if
198  UNLIKELY(sp.x() != 0. || sp.y() != 0.) { throw PropagationException("Cannot propagate to an arbitrary cylinder"); }
199 
200  GlobalPoint gpos(ts.position());
201  GlobalVector gmom(ts.momentum());
202  LocalPoint pos(cyl.toLocal(gpos));
203  LocalVector mom(cyl.toLocal(gmom));
204  double startR = cyl.radius() - pos.perp();
205 
206  // LogDebug("RKPropagatorInS") << "RKPropagatorInS: starting from FTS " << ts ;
207 
208  // (transverse) curvature
209  double rho = ts.transverseCurvature();
210  //
211  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um
212  // difference in transversal position at 10m.
213  //
214  if
215  UNLIKELY(fabs(rho) < 1.e-10) {
216  //
217  // Instantiate auxiliary object for finding intersection.
218  // Frame-independant point and vector are created explicitely to
219  // avoid confusing gcc (refuses to compile with temporary objects
220  // in the constructor).
221  //
222 
223  StraightLineBarrelCylinderCrossing cylCrossing(gpos, gmom, propagationDirection());
224 
225  //
226  // get solution
227  //
228  std::pair<bool, double> propResult = cylCrossing.pathLength(cyl);
229  if
230  LIKELY(propResult.first && theVolume != nullptr) {
231  double s = propResult.second;
232  // point (reconverted to GlobalPoint)
233  GlobalPoint x(cylCrossing.position(s));
235  LogDebug("RKPropagatorInS") << "Straight line propagation to cylinder succeeded !!";
236  return GlobalParametersWithPath(res, s);
237  }
238 
239  //do someting
240  edm::LogError("RKPropagatorInS") << "Straight line propagation to cylinder failed !!";
241  return GlobalParametersWithPath();
242  }
243 
245  // StraightLineCylinderCrossing pathLength( pos, mom, propagationDirection());
246  CartesianLorentzForce deriv(field, ts.charge());
247 
248  RKCartesianDistance dist;
249  double eps = theTolerance;
250  Solver solver;
251  double stot = 0;
252  PropagationDirection currentDirection = propagationDirection();
253 
254  RKVector start(CartesianStateAdaptor::rkstate(pos.basicVector(), mom.basicVector()));
255  int safeGuard = 0;
256  while (safeGuard++ < 100) {
257  CartesianStateAdaptor startState(start);
258  StraightLineCylinderCrossing pathLength(
259  LocalPoint(startState.position()), LocalVector(startState.momentum()), currentDirection, eps);
260 
261  std::pair<bool, double> path = pathLength.pathLength(cyl);
262  if
263  UNLIKELY(!path.first) {
264  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Path length calculation to cylinder failed!"
265  << "Radius " << cyl.radius() << " pos.perp() "
266  << LocalPoint(startState.position()).perp();
267  return GlobalParametersWithPath();
268  }
269 
270  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Path lenght to cylinder is " << path.second << " from point (R,z) "
271  << startState.position().perp() << ", " << startState.position().z() << " to R "
272  << cyl.radius();
273 
274  double sstep = path.second;
275  if
276  UNLIKELY(std::abs(sstep) < eps) {
277  LogDebug("RKPropagatorInS") << "accuracy not reached, but pathLength calculation says we are there! "
278  << path.second;
279 
280  GlobalTrajectoryParameters res(gtpFromLocal(startState.position(), startState.momentum(), ts.charge(), cyl));
281  return GlobalParametersWithPath(res, stot);
282  }
283 
284  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Solving for " << sstep << " current distance to cylinder is "
285  << startR;
286 
287  RKVector rkresult = solver(0, start, sstep, deriv, dist, eps);
288  stot += sstep;
289  CartesianStateAdaptor cur(rkresult);
290  double remainingR = cyl.radius() - cur.position().perp();
291 
292  if (fabs(remainingR) < eps) {
293  LogDebug("RKPropagatorInS") << "Accuracy reached! " << remainingR;
294  GlobalTrajectoryParameters res(gtpFromLocal(cur.position(), cur.momentum(), ts.charge(), cyl));
295  return GlobalParametersWithPath(res, stot);
296  }
297 
298  start = rkresult;
299  if (remainingR * startR > 0) {
300  LogDebug("RKPropagatorInS") << "Accuracy not reached yet, trying in same direction again " << remainingR;
301  } else {
302  LogDebug("RKPropagatorInS") << "Accuracy not reached yet, trying in opposite direction " << remainingR;
303  currentDirection = invertDirection(currentDirection);
304  }
305  startR = remainingR;
306  }
307 
308  edm::LogError("FailedPropagation") << " too many iterations trying to reach cylinder ";
309  return GlobalParametersWithPath();
310 }

References funct::abs(), FreeTrajectoryState::charge(), MillePedeFileConverter_cfg::e, fieldProvider(), gtpFromLocal(), invertDirection(), LIKELY, LogDebug, CartesianStateAdaptor::momentum(), FreeTrajectoryState::momentum(), castor_dqm_sourceclient_file_cfg::path, StraightLineBarrelCylinderCrossing::pathLength(), StraightLineCylinderCrossing::pathLength(), Basic3DVector< T >::perp(), perp(), CartesianStateAdaptor::position(), StraightLineBarrelCylinderCrossing::position(), GloballyPositioned< T >::position(), FreeTrajectoryState::position(), Propagator::propagationDirection(), Cylinder::radius(), rho, CartesianStateAdaptor::rkstate(), alignCSCRings::s, command_line::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().

◆ propagateParametersOnPlane()

GlobalParametersWithPath RKPropagatorInS::propagateParametersOnPlane ( const FreeTrajectoryState ts,
const Plane plane 
) const
private

Definition at line 51 of file RKPropagatorInS.cc.

52  {
53  GlobalPoint gpos(ts.position());
54  GlobalVector gmom(ts.momentum());
55  double startZ = plane.localZ(gpos);
56  // (transverse) curvature
57  double rho = ts.transverseCurvature();
58  //
59  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um
60  // difference in transversal position at 10m.
61  //
62  if
63  UNLIKELY(fabs(rho) < 1.e-10) {
64  //
65  // Instantiate auxiliary object for finding intersection.
66  // Frame-independant point and vector are created explicitely to
67  // avoid confusing gcc (refuses to compile with temporary objects
68  // in the constructor).
69  //
70  LogDebug("RKPropagatorInS") << " startZ = " << startZ;
71 
72  if
73  UNLIKELY(fabs(startZ) < 1e-5) {
74  LogDebug("RKPropagatorInS") << "Propagation is not performed: state is already on final surface.";
76  return GlobalParametersWithPath(res, 0.0);
77  }
78 
82  //
83  // get solution
84  //
85  std::pair<bool, double> propResult = planeCrossing.pathLength(plane);
86  if
87  LIKELY(propResult.first && theVolume != nullptr) {
88  double s = propResult.second;
89  // point (reconverted to GlobalPoint)
90  GlobalPoint x(planeCrossing.position(s));
93  }
94  //do someting
95  LogDebug("RKPropagatorInS") << "Straight line propgation to plane failed !!";
96  return GlobalParametersWithPath();
97  }
98 
99 #ifdef EDM_ML_DEBUG
100  if (theVolume != 0) {
101  LogDebug("RKPropagatorInS") << "RKPropagatorInS: starting prop to plane in volume with pos "
102  << theVolume->position() << " Z axis " << theVolume->toGlobal(LocalVector(0, 0, 1));
103 
104  LogDebug("RKPropagatorInS") << "The starting position is " << ts.position() << " (global) "
105  << theVolume->toLocal(ts.position()) << " (local) ";
106 
107  FrameChanger changer;
108  auto localPlane = changer.transformPlane(plane, *theVolume);
109  LogDebug("RKPropagatorInS") << "The plane position is " << plane.position() << " (global) " << localPlane.position()
110  << " (local) ";
111 
112  LogDebug("RKPropagatorInS") << "The initial distance to plane is " << plane.localZ(ts.position());
113 
115  std::pair<bool, double> res3 = cross.pathLength(plane);
116  LogDebug("RKPropagatorInS") << "straight line distance " << res3.first << " " << res3.second;
117  }
118 #endif
119 
121  typedef Solver::Vector RKVector;
122 
124  PathToPlane2Order pathLength(field, &field.frame());
125  CartesianLorentzForce deriv(field, ts.charge());
126 
127  RKCartesianDistance dist;
128  double eps = theTolerance;
129  Solver solver;
130  double stot = 0;
131  PropagationDirection currentDirection = propagationDirection();
132 
133  // in magVolume frame
135  int safeGuard = 0;
136  while (safeGuard++ < 100) {
137  CartesianStateAdaptor startState(start);
138 
139  std::pair<bool, double> path =
140  pathLength(plane, startState.position(), startState.momentum(), (double)ts.charge(), currentDirection);
141  if
142  UNLIKELY(!path.first) {
143  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Path length calculation to plane failed!"
144  << "...distance to plane " << plane.localZ(globalPosition(startState.position()))
145  << "...Local starting position in volume " << startState.position()
146  << "...Magnetic field " << field.inTesla(startState.position());
147 
148  return GlobalParametersWithPath();
149  }
150 
151  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Path lenght to plane is " << path.second;
152 
153  double sstep = path.second;
154  if
155  UNLIKELY(std::abs(sstep) < eps) {
156  LogDebug("RKPropagatorInS") << "On-surface accuracy not reached, but pathLength calculation says we are there! "
157  << "path " << path.second << " distance to plane is " << startZ;
159  return GlobalParametersWithPath(res, stot);
160  }
161 
162  LogDebug("RKPropagatorInS") << "RKPropagatorInS: Solving for " << sstep << " current distance to plane is "
163  << startZ;
164 
165  RKVector rkresult = solver(0, start, sstep, deriv, dist, eps);
166  stot += sstep;
167  CartesianStateAdaptor cur(rkresult);
168  double remainingZ = plane.localZ(globalPosition(cur.position()));
169 
170  if (fabs(remainingZ) < eps) {
171  LogDebug("RKPropagatorInS") << "On-surface accuracy reached! " << remainingZ;
173  return GlobalParametersWithPath(res, stot);
174  }
175 
176  start = rkresult;
177 
178  if (remainingZ * startZ > 0) {
179  LogDebug("RKPropagatorInS") << "Accuracy not reached yet, trying in same direction again " << remainingZ;
180  } else {
181  LogDebug("RKPropagatorInS") << "Accuracy not reached yet, trying in opposite direction " << remainingZ;
182  currentDirection = invertDirection(currentDirection);
183  }
184  startZ = remainingZ;
185  }
186 
187  edm::LogError("FailedPropagation") << " too many iterations trying to reach plane ";
188  return GlobalParametersWithPath();
189 }

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

Referenced by propagateWithPath().

◆ propagateWithPath() [1/11]

std::pair< TrajectoryStateOnSurface, double > RKPropagatorInS::propagateWithPath ( const FreeTrajectoryState fts,
const Cylinder cyl 
) const
overrideprivatevirtual

◆ propagateWithPath() [2/11]

virtual std::pair<TrajectoryStateOnSurface, double> Propagator::propagateWithPath

◆ propagateWithPath() [3/11]

std::pair< TrajectoryStateOnSurface, double > RKPropagatorInS::propagateWithPath ( const FreeTrajectoryState fts,
const Plane plane 
) const
overrideprivatevirtual

◆ propagateWithPath() [4/11]

virtual std::pair<TrajectoryStateOnSurface, double> Propagator::propagateWithPath

◆ propagateWithPath() [5/11]

std::pair< TrajectoryStateOnSurface, double > Propagator::propagateWithPath
final

The methods propagateWithPath() are identical to the corresponding methods propagate() in what concerns the resulting TrajectoryStateOnSurface, but they provide in addition the exact path length along the trajectory. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.

Definition at line 10 of file Propagator.cc.

11  {
12  // try plane first, most probable case (disk "is a" plane too)
13  const Plane* bp = dynamic_cast<const Plane*>(&sur);
14  if (bp != nullptr)
15  return propagateWithPath(state, *bp);
16 
17  // if not plane try cylinder
18  const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
19  if (bc != nullptr)
20  return propagateWithPath(state, *bc);
21 
22  // unknown surface - can't do it!
23  throw PropagationException("The surface is neither Cylinder nor Plane");
24 }

◆ propagateWithPath() [6/11]

std::pair< FreeTrajectoryState, double > Propagator::propagateWithPath

implemented by Stepping Helix Propagate to PCA to point given a starting point

Definition at line 42 of file Propagator.cc.

43  {
44  throw cms::Exception("Propagator::propagate(FTS,GlobalPoint) not implemented");
45  return std::pair<FreeTrajectoryState, double>();
46 }

◆ propagateWithPath() [7/11]

std::pair< FreeTrajectoryState, double > Propagator::propagateWithPath

Propagate to PCA to a line (given by 2 points) given a starting point.

Definition at line 47 of file Propagator.cc.

49  {
50  throw cms::Exception("Propagator::propagate(FTS,GlobalPoint,GlobalPoint) not implemented");
51  return std::pair<FreeTrajectoryState, double>();
52 }

◆ propagateWithPath() [8/11]

std::pair< FreeTrajectoryState, double > Propagator::propagateWithPath

Propagate to PCA to a line (given by beamSpot position and slope) given a starting point.

Definition at line 53 of file Propagator.cc.

54  {
55  throw cms::Exception("Propagator::propagate(FTS,beamSpot) not implemented");
56  return std::pair<FreeTrajectoryState, double>();
57 }

◆ propagateWithPath() [9/11]

virtual std::pair<TrajectoryStateOnSurface, double> Propagator::propagateWithPath
inline

Definition at line 91 of file Propagator.h.

92  {
93  return propagateWithPath(*tsos.freeState(), sur);
94  }

◆ propagateWithPath() [10/11]

virtual std::pair<TrajectoryStateOnSurface, double> Propagator::propagateWithPath
inline

Definition at line 86 of file Propagator.h.

87  {
88  return propagateWithPath(*tsos.freeState(), sur);
89  }

◆ propagateWithPath() [11/11]

std::pair< TrajectoryStateOnSurface, double > Propagator::propagateWithPath
final

The following three methods are equivalent to the corresponding methods above, but if the starting state is a TrajectoryStateOnSurface, it's better to use it as such rather than use just the FreeTrajectoryState part. It may help some concrete propagators. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.

Definition at line 26 of file Propagator.cc.

27  {
28  // try plane first, most probable case (disk "is a" plane too)
29  const Plane* bp = dynamic_cast<const Plane*>(&sur);
30  if (bp != nullptr)
31  return propagateWithPath(state, *bp);
32 
33  // if not plane try cylinder
34  const Cylinder* bc = dynamic_cast<const Cylinder*>(&sur);
35  if (bc != nullptr)
36  return propagateWithPath(state, *bc);
37 
38  // unknown surface - can't do it!
39  throw PropagationException("The surface is neither Cylinder nor Plane");
40 }

◆ rkMomentum()

Basic3DVector< double > RKPropagatorInS::rkMomentum ( const GlobalVector mom) const
private

Definition at line 340 of file RKPropagatorInS.cc.

340  {
341  if (theVolume != nullptr)
342  return theVolume->toLocal(mom).basicVector();
343  else
344  return mom.basicVector();
345 }

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

Referenced by propagateParametersOnPlane().

◆ rkPosition()

Basic3DVector< double > RKPropagatorInS::rkPosition ( const GlobalPoint pos) const
private

Definition at line 333 of file RKPropagatorInS.cc.

333  {
334  if (theVolume != nullptr)
335  return theVolume->toLocal(pos).basicVector();
336  else
337  return pos.basicVector();
338 }

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

Referenced by propagateParametersOnPlane().

Member Data Documentation

◆ theTolerance

double RKPropagatorInS::theTolerance
private

Definition at line 49 of file RKPropagatorInS.h.

Referenced by propagateParametersOnCylinder(), and propagateParametersOnPlane().

◆ theVolume

const MagVolume* RKPropagatorInS::theVolume
private
Vector3DBase
Definition: Vector3DBase.h:8
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
RKPropagatorInS::rkMomentum
Basic3DVector< double > rkMomentum(const GlobalVector &mom) const
Definition: RKPropagatorInS.cc:340
anyDirection
Definition: PropagationDirection.h:4
start
Definition: start.py:1
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
Cylinder::radius
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:64
RKPropagatorInS::globalMomentum
GlobalVector globalMomentum(const Basic3DVector< float > &mom) const
Definition: RKPropagatorInS.cc:354
RKPropagatorInS::propagateWithPath
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Plane &) const override
Definition: RKPropagatorInS.cc:25
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
PropagationException
Common base class.
Definition: PropagationExceptions.h:14
PropagationDirectionFromPath
Definition: PropagationDirectionFromPath.h:8
RKPropagatorInS::propagateParametersOnPlane
GlobalParametersWithPath propagateParametersOnPlane(const FreeTrajectoryState &ts, const Plane &plane) const
Definition: RKPropagatorInS.cc:51
pos
Definition: PixelAliasList.h:18
FreeTrajectoryState::charge
TrackCharge charge() const
Definition: FreeTrajectoryState.h:69
RKPropagatorInS::theTolerance
double theTolerance
Definition: RKPropagatorInS.h:49
oppositeToMomentum
Definition: PropagationDirection.h:4
SurfaceSideDefinition::SurfaceSide
SurfaceSide
Definition: SurfaceSideDefinition.h:8
RKAdaptiveSolver
Definition: RKAdaptiveSolver.h:11
SurfaceSideDefinition::afterSurface
Definition: SurfaceSideDefinition.h:8
DDAxes::x
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
RKPropagatorInS::fieldProvider
RKLocalFieldProvider fieldProvider() const
Definition: RKPropagatorInS.cc:321
analyticalErrorPropagation
std::pair< TrajectoryStateOnSurface, double > analyticalErrorPropagation(const FreeTrajectoryState &startingState, const Surface &surface, SurfaceSideDefinition::SurfaceSide side, const GlobalTrajectoryParameters &destParameters, const double &s)
Definition: AnalyticalErrorPropagation.h:14
Vector
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
RKLocalFieldProvider
Definition: RKLocalFieldProvider.h:10
RKPropagatorInS::gtpFromLocal
GlobalTrajectoryParameters gtpFromLocal(const Basic3DVector< float > &lpos, const Basic3DVector< float > &lmom, TrackCharge ch, const Surface &surf) const
Definition: RKPropagatorInS.cc:314
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
alignCSCRings.s
s
Definition: alignCSCRings.py:92
RKPropagatorInS::TsosWP
std::pair< TrajectoryStateOnSurface, double > TsosWP
Definition: RKPropagatorInS.h:46
SurfaceSideDefinition::beforeSurface
Definition: SurfaceSideDefinition.h:8
Propagator::propagationDirection
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
GlobalParametersWithPath
Definition: GlobalParametersWithPath.h:7
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, LocalTag >
FrameChanger
Definition: FrameChanger.h:8
DDAxes::rho
RKPropagatorInS::propagateParametersOnCylinder
GlobalParametersWithPath propagateParametersOnCylinder(const FreeTrajectoryState &ts, const Cylinder &cyl) const
Definition: RKPropagatorInS.cc:191
RKCartesianDistance
Estimator of the distance between two state vectors, e.g. for convergence test.
Definition: RKCartesianDistance.h:14
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
FrameChanger::transformPlane
static Plane transformPlane(const Plane &plane, const GloballyPositioned< T > &frame)
Definition: FrameChanger.h:14
CartesianStateAdaptor::position
const Vector3D & position() const
Definition: CartesianStateAdaptor.h:15
cross
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
Definition: Basic3DVectorLD.h:225
CartesianLorentzForce
Derivative calculation for the 6D cartesian case.
Definition: CartesianLorentzForce.h:10
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
CartesianStateAdaptor::rkstate
static RKSmallVector< double, 6 > rkstate(const Vector3D &pos, const Vector3D &mom)
Definition: CartesianStateAdaptor.h:22
StraightLineCylinderCrossing
Definition: StraightLineCylinderCrossing.h:17
Plane::localZ
float localZ(const GlobalPoint &gp) const
Definition: Plane.h:45
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
LocalVector
Local3DVector LocalVector
Definition: LocalVector.h:12
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:27
RKPropagatorInS::invertDirection
PropagationDirection invertDirection(PropagationDirection dir) const
Definition: RKPropagatorInS.cc:327
res
Definition: Electron.h:6
RKPropagatorInS::rkPosition
Basic3DVector< double > rkPosition(const GlobalPoint &pos) const
Definition: RKPropagatorInS.cc:333
CartesianStateAdaptor
Definition: CartesianStateAdaptor.h:8
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
CartesianStateAdaptor::momentum
const Vector3D & momentum() const
Definition: CartesianStateAdaptor.h:16
LIKELY
#define LIKELY(x)
Definition: Likely.h:20
GloballyPositioned::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
Exception
Definition: hltDiff.cc:246
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
RKPropagatorInS::RKPropagatorInS
RKPropagatorInS(const MagVolume &vol, PropagationDirection dir=alongMomentum, double tolerance=5.e-5)
Definition: RKPropagatorInS.h:25
Plane
Definition: Plane.h:16
PathToPlane2Order
Definition: PathToPlane2Order.h:21
RKPropagatorInS::gtpFromVolumeLocal
GlobalTrajectoryParameters gtpFromVolumeLocal(const CartesianStateAdaptor &state, TrackCharge charge) const
Definition: RKPropagatorInS.cc:363
Cylinder
Definition: Cylinder.h:19
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
command_line.start
start
Definition: command_line.py:167
RKPropagatorInS::globalPosition
GlobalPoint globalPosition(const Basic3DVector< float > &pos) const
Definition: RKPropagatorInS.cc:347
StraightLinePlaneCrossing
Definition: StraightLinePlaneCrossing.h:14
StraightLineBarrelCylinderCrossing
Definition: StraightLineBarrelCylinderCrossing.h:17
alongMomentum
Definition: PropagationDirection.h:4
FreeTrajectoryState::transverseCurvature
double transverseCurvature() const
Definition: FreeTrajectoryState.h:71
Basic3DVector< float >
GloballyPositioned::toGlobal
GlobalPoint toGlobal(const LocalPoint &lp) const
Definition: GloballyPositioned.h:66
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
Propagator::Propagator
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
RKPropagatorInS::theVolume
const MagVolume * theVolume
Definition: RKPropagatorInS.h:48