CMS 3D CMS Logo

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

#include <RKPropagatorInZ.h>

Inheritance diagram for RKPropagatorInZ:
Propagator

Public Member Functions

Propagatorclone () const override
 
const MagneticFieldmagneticField () const override
 
TrajectoryStateOnSurface myPropagate (const FreeTrajectoryState &, const Plane &) const
 
TrajectoryStateOnSurface myPropagate (const FreeTrajectoryState &, const Cylinder &) const
 
std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &, const Plane &) const override
 
std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &, const Cylinder &) const override
 
 RKPropagatorInZ (const MagVolume &vol, PropagationDirection dir=alongMomentum)
 
- Public Member Functions inherited from Propagator
template<typename STA , typename SUR >
TrajectoryStateOnSurface propagate (STA const &state, SUR const &surface) const
 
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
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &, const Surface &) const final
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Surface &sur) const final
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Plane &sur) const
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Cylinder &sur) const
 
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 PropagationDirection propagationDirection () const final
 
 Propagator (PropagationDirection dir=alongMomentum)
 
virtual bool setMaxDirectionChange (float phiMax)
 
virtual void setPropagationDirection (PropagationDirection dir)
 
virtual ~Propagator ()
 

Private Attributes

const MagVolumetheVolume
 

Detailed Description

Definition at line 7 of file RKPropagatorInZ.h.

Constructor & Destructor Documentation

◆ RKPropagatorInZ()

RKPropagatorInZ::RKPropagatorInZ ( const MagVolume vol,
PropagationDirection  dir = alongMomentum 
)
inline

Definition at line 9 of file RKPropagatorInZ.h.

Referenced by clone().

9 : Propagator(dir), theVolume(&vol) {}
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
const MagVolume * theVolume

Member Function Documentation

◆ clone()

Propagator * RKPropagatorInZ::clone ( void  ) const
overridevirtual

Implements Propagator.

Definition at line 73 of file RKPropagatorInZ.cc.

References RKPropagatorInZ().

73 { return new RKPropagatorInZ(*this); }
RKPropagatorInZ(const MagVolume &vol, PropagationDirection dir=alongMomentum)

◆ magneticField()

const MagneticField* RKPropagatorInZ::magneticField ( ) const
inlineoverridevirtual

Implements Propagator.

Definition at line 23 of file RKPropagatorInZ.h.

References theVolume.

23 { return theVolume; }
const MagVolume * theVolume

◆ myPropagate() [1/2]

TrajectoryStateOnSurface RKPropagatorInZ::myPropagate ( const FreeTrajectoryState ts,
const Plane plane 
) const

Definition at line 12 of file RKPropagatorInZ.cc.

References FreeTrajectoryState::charge(), MillePedeFileConverter_cfg::e, HLT_2022v12_cff::eps, PV3DBase< T, PVType, FrameType >::mag(), FreeTrajectoryState::momentum(), FreeTrajectoryState::position(), command_line::start, theVolume, GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

12  {
13  //typedef RK4PreciseSolver<double,5> Solver;
14  //typedef RKAdaptiveSolver<double,RKOne4OrderStep, 5> Solver;
16  typedef Solver::Vector RKVector;
17 
18  GlobalPoint pos(ts.position());
19  GlobalVector mom(ts.momentum());
20 
21  // cout << "RKPropagatorInZ: starting from FTS " << ts << endl;
22 
23  LocalPoint startpos = plane.toLocal(pos);
24  LocalVector startmom = plane.toLocal(mom);
25  double pzSign = startmom.z() > 0 ? 1.0 : -1.0;
26 
27  // cout << "In local plane coordinates: " << startpos << ", momentum " << startmom << endl;
28 
29  RKVector start;
30  start(0) = startpos.x();
31  start(1) = startpos.y();
32  start(2) = startmom.x() / startmom.z();
33  start(3) = startmom.y() / startmom.z();
34  start(4) = pzSign * ts.charge() / startmom.mag();
35 
36  // cout << "RKPropagatorInZ: Solving with par " << startpos.z() << " and state " << start << endl;
37 
38  RKLocalFieldProvider localField(*theVolume, plane);
39 
40  CurvilinearLorentzForce<double, 5> deriv(localField);
42  double eps = 1.e-5;
43  Solver solver;
44  try {
45  RKVector rkresult = solver(startpos.z(), start, -startpos.z(), deriv, dist, eps);
46 
48  LocalTrajectoryParameters(rkresult(4), rkresult(2), rkresult(3), rkresult(0), rkresult(1), pzSign),
49  plane,
50  theVolume);
51  } catch (CurvilinearLorentzForceException& e) {
52  // the propagation failed due to momentum almost parallel to the plane.
53  // This does not mean the propagation is impossible, but it should be done
54  // in a different parametrization (e.g. s)
55  return TrajectoryStateOnSurface();
56  }
57 }
T z() const
Definition: PV3DBase.h:61
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
LocalPoint toLocal(const GlobalPoint &gp) const
GlobalPoint position() const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
const MagVolume * theVolume
TrackCharge charge() const
T mag() const
Definition: PV3DBase.h:64
GlobalVector momentum() const

◆ myPropagate() [2/2]

TrajectoryStateOnSurface RKPropagatorInZ::myPropagate ( const FreeTrajectoryState ,
const Cylinder  
) const

Definition at line 59 of file RKPropagatorInZ.cc.

◆ propagateWithPath() [1/2]

std::pair< TrajectoryStateOnSurface, double > RKPropagatorInZ::propagateWithPath ( const FreeTrajectoryState ,
const Plane  
) const
overridevirtual

Implements Propagator.

Definition at line 63 of file RKPropagatorInZ.cc.

64  {
65  return std::pair<TrajectoryStateOnSurface, double>();
66 }

◆ propagateWithPath() [2/2]

std::pair< TrajectoryStateOnSurface, double > RKPropagatorInZ::propagateWithPath ( const FreeTrajectoryState ,
const Cylinder  
) const
overridevirtual

Implements Propagator.

Definition at line 68 of file RKPropagatorInZ.cc.

69  {
70  return std::pair<TrajectoryStateOnSurface, double>();
71 }

Member Data Documentation

◆ theVolume

const MagVolume* RKPropagatorInZ::theVolume
private

Definition at line 26 of file RKPropagatorInZ.h.

Referenced by magneticField(), and myPropagate().