CMS 3D CMS Logo

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

#include <StraightLinePropagator.h>

Inheritance diagram for StraightLinePropagator:
Propagator

Public Member Functions

StraightLinePropagatorclone () const override
 
const MagneticFieldmagneticField () const override
 
std::pair< TSOS, double > propagateWithPath (const FreeTrajectoryState &fts, const Plane &surface) const override
 
std::pair< TSOS, double > propagateWithPath (const FreeTrajectoryState &fts, const Cylinder &surface) const override
 
 StraightLinePropagator (const MagneticField *field, PropagationDirection aDir=alongMomentum)
 
 ~StraightLinePropagator () override
 
- 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 Types

typedef FreeTrajectoryState FTS
 
typedef TrajectoryStateOnSurface TSOS
 

Private Member Functions

AlgebraicMatrix55 jacobian (double &s) const
 
TrajectoryStateOnSurface propagatedState (const FreeTrajectoryState &fts, const Surface &surface, const AlgebraicMatrix55 &jacobian, const GlobalPoint &x, const GlobalVector &p) const
 
TrajectoryStateOnSurface propagatedState (const FreeTrajectoryState &fts, const Surface &surface, const AlgebraicMatrix55 &jacobian, const LocalPoint &x, const LocalVector &p) const
 
bool propagateParametersOnCylinder (const FreeTrajectoryState &fts, const Cylinder &cylinder, GlobalPoint &x, GlobalVector &p, double &s) const
 
bool propagateParametersOnPlane (const FreeTrajectoryState &fts, const Plane &plane, LocalPoint &x, LocalVector &p, double &s) const
 

Private Attributes

const MagneticFieldtheField
 

Detailed Description

As the name indicates, propagates track parameters according to a straight line model. Intended for test beams without magnetic field and similar cases.

Warning
The errors are NOT propagated.

Definition at line 16 of file StraightLinePropagator.h.

Member Typedef Documentation

Definition at line 18 of file StraightLinePropagator.h.

Definition at line 19 of file StraightLinePropagator.h.

Constructor & Destructor Documentation

StraightLinePropagator::StraightLinePropagator ( const MagneticField field,
PropagationDirection  aDir = alongMomentum 
)
inline

Definition at line 22 of file StraightLinePropagator.h.

Referenced by clone().

23  : Propagator(aDir), theField(field) {}
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
const MagneticField * theField
StraightLinePropagator::~StraightLinePropagator ( )
inlineoverride

Definition at line 25 of file StraightLinePropagator.h.

25 {}

Member Function Documentation

StraightLinePropagator* StraightLinePropagator::clone ( void  ) const
inlineoverridevirtual

Implements Propagator.

Definition at line 34 of file StraightLinePropagator.h.

References StraightLinePropagator().

34 { return new StraightLinePropagator(*this); }
StraightLinePropagator(const MagneticField *field, PropagationDirection aDir=alongMomentum)
AlgebraicMatrix55 StraightLinePropagator::jacobian ( double &  s) const
private

Definition at line 86 of file StraightLinePropagator.cc.

References alongMomentum, DeadROC_duringRun::dir, dqmiolumiharvest::j, Propagator::propagationDirection(), and alignCSCRings::s.

Referenced by propagateWithPath().

86  {
87  //Jacobian for 5*5 local error matrix
88  AlgebraicMatrix55 j = AlgebraicMatrixID(); //Jacobian
89 
90  double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
91  if (s * dir < 0.)
92  return j;
93 
94  j(3, 1) = s;
95  j(4, 2) = s;
96 
97  return j;
98 }
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
const MagneticField* StraightLinePropagator::magneticField ( ) const
inlineoverridevirtual

Implements Propagator.

Definition at line 36 of file StraightLinePropagator.h.

References theField.

36 { return theField; }
const MagneticField * theField
TrajectoryStateOnSurface StraightLinePropagator::propagatedState ( const FreeTrajectoryState fts,
const Surface surface,
const AlgebraicMatrix55 jacobian,
const GlobalPoint x,
const GlobalVector p 
) const
private

Definition at line 65 of file StraightLinePropagator.cc.

References FreeTrajectoryState::charge(), FreeTrajectoryState::hasError(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), LocalTrajectoryError::matrix(), theField, and createJobs::tmp.

Referenced by propagateWithPath().

69  {
70  if (fts.hasError()) {
71  // propagate error
72  TSOS tmp(fts, surface);
73  const AlgebraicSymMatrix55& eLocal = tmp.localError().matrix();
74  AlgebraicSymMatrix55 lte = ROOT::Math::Similarity(jacobian, eLocal);
75  LocalTrajectoryError eloc(lte);
76 
77  TSOS tmp2(tmp.localParameters(), eloc, surface, theField);
78  GlobalTrajectoryParameters gtp(x, p, fts.charge(), theField);
79  return TSOS(gtp, tmp2.cartesianError(), surface);
80  } else {
81  // return state without errors
82  return TSOS(GlobalTrajectoryParameters(x, p, fts.charge(), theField), surface);
83  }
84 }
TrackCharge charge() const
const MagneticField * theField
AlgebraicMatrix55 jacobian(double &s) const
TrajectoryStateOnSurface TSOS
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
tmp
align.sh
Definition: createJobs.py:716
TrajectoryStateOnSurface StraightLinePropagator::propagatedState ( const FreeTrajectoryState fts,
const Surface surface,
const AlgebraicMatrix55 jacobian,
const LocalPoint x,
const LocalVector p 
) const
private

Definition at line 46 of file StraightLinePropagator.cc.

References FreeTrajectoryState::charge(), FreeTrajectoryState::hasError(), TrajectoryStateOnSurface::localError(), LocalTrajectoryError::matrix(), theField, and createJobs::tmp.

50  {
51  if (fts.hasError()) {
52  // propagate error
53  TSOS tmp(fts, surface);
54  const AlgebraicSymMatrix55& eLocal = tmp.localError().matrix();
55  AlgebraicSymMatrix55 lte = ROOT::Math::Similarity(jacobian, eLocal);
56  LocalTrajectoryError eloc(lte);
57  LocalTrajectoryParameters ltp(x, p, fts.charge());
58  return TSOS(ltp, eloc, surface, theField);
59  } else {
60  // return state without errors
61  return TSOS(LocalTrajectoryParameters(x, p, fts.charge()), surface, theField);
62  }
63 }
TrackCharge charge() const
const MagneticField * theField
AlgebraicMatrix55 jacobian(double &s) const
TrajectoryStateOnSurface TSOS
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
tmp
align.sh
Definition: createJobs.py:716
bool StraightLinePropagator::propagateParametersOnCylinder ( const FreeTrajectoryState fts,
const Cylinder cylinder,
GlobalPoint x,
GlobalVector p,
double &  s 
) const
private

Definition at line 100 of file StraightLinePropagator.cc.

References alongMomentum, DeadROC_duringRun::dir, dt, FreeTrajectoryState::momentum(), PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), Propagator::propagationDirection(), Cylinder::radius(), Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by propagateWithPath().

101  {
102  GlobalPoint sp = cylinder.toGlobal(LocalPoint(0., 0.));
103  if (sp.x() != 0. || sp.y() != 0.) {
104  throw PropagationException("Cannot propagate to an arbitrary cylinder");
105  }
106 
107  x = fts.position();
108  p = fts.momentum();
109  s = cylinder.radius() - x.perp();
110 
111  double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
112  if (s * dir < 0.)
113  return false;
114 
115  double dt = s / p.perp();
116  x = GlobalPoint(x.x() + p.x() * dt, x.y() + p.y() * dt, x.z() + p.z() * dt);
117 
118  return true;
119 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
float dt
Definition: AMPTWrapper.h:136
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
T perp() const
Definition: PV3DBase.h:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:60
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:64
T z() const
Definition: PV3DBase.h:61
Common base class.
GlobalVector momentum() const
GlobalPoint position() const
T x() const
Definition: PV3DBase.h:59
bool StraightLinePropagator::propagateParametersOnPlane ( const FreeTrajectoryState fts,
const Plane plane,
LocalPoint x,
LocalVector p,
double &  s 
) const
private

Definition at line 121 of file StraightLinePropagator.cc.

References FreeTrajectoryState::momentum(), FreeTrajectoryState::position(), alignCSCRings::s, GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by propagateWithPath().

122  {
123  //Do extrapolation in local frame of plane
124  // LocalPoint sp = plane.toLocal(plane.position());
125  x = plane.toLocal(fts.position());
126  p = plane.toLocal(fts.momentum());
127  s = -x.z(); // sp.z() - x.z(); local z of plane always 0
128 
129  //double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
130  //if(s*dir < 0.) return false;
131  if ((p.x() != 0 || p.y() != 0) && p.z() == 0 && s != 0)
132  return false;
133 
134  x = LocalPoint(x.x() + (p.x() / p.z()) * s, x.y() + (p.y() / p.z()) * s, x.z() + s);
135 
136  return true;
137 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
T y() const
Definition: PV3DBase.h:60
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:61
GlobalVector momentum() const
GlobalPoint position() const
T x() const
Definition: PV3DBase.h:59
std::pair< TrajectoryStateOnSurface, double > StraightLinePropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Plane surface 
) const
overridevirtual

Implements Propagator.

Definition at line 8 of file StraightLinePropagator.cc.

References FreeTrajectoryState::charge(), FreeTrajectoryState::hasError(), jacobian(), AlCaHLTBitMon_ParallelJobs::p, propagatedState(), propagateParametersOnPlane(), alignCSCRings::s, theField, and x.

9  {
10  // propagate parameters
11  LocalPoint x;
12  LocalVector p;
13  double s = 0;
14  bool parametersOK = propagateParametersOnPlane(fts, plane, x, p, s);
15  if (!parametersOK)
16  return std::make_pair(TrajectoryStateOnSurface(), 0.);
17 
18  // compute propagated state
19  if (fts.hasError()) {
20  return std::make_pair(propagatedState(fts, plane, jacobian(s), x, p), s);
21  } else {
22  // return state without errors
23  return std::make_pair(TSOS(LocalTrajectoryParameters(x, p, fts.charge()), plane, theField), s);
24  }
25 }
TrackCharge charge() const
TrajectoryStateOnSurface propagatedState(const FreeTrajectoryState &fts, const Surface &surface, const AlgebraicMatrix55 &jacobian, const GlobalPoint &x, const GlobalVector &p) const
const MagneticField * theField
AlgebraicMatrix55 jacobian(double &s) const
TrajectoryStateOnSurface TSOS
bool propagateParametersOnPlane(const FreeTrajectoryState &fts, const Plane &plane, LocalPoint &x, LocalVector &p, double &s) const
std::pair< TrajectoryStateOnSurface, double > StraightLinePropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Cylinder surface 
) const
overridevirtual

Implements Propagator.

Definition at line 27 of file StraightLinePropagator.cc.

References FreeTrajectoryState::charge(), FreeTrajectoryState::hasError(), jacobian(), AlCaHLTBitMon_ParallelJobs::p, propagatedState(), propagateParametersOnCylinder(), alignCSCRings::s, theField, and x.

28  {
29  // propagate parameters
30  GlobalPoint x;
32  double s = 0;
33  bool parametersOK = propagateParametersOnCylinder(fts, cylinder, x, p, s);
34  if (!parametersOK)
35  return std::make_pair(TrajectoryStateOnSurface(), 0.);
36 
37  // compute propagated state
38  if (fts.hasError()) {
39  return std::make_pair(propagatedState(fts, cylinder, jacobian(s), x, p), s);
40  } else {
41  // return state without errors
42  return std::make_pair(TSOS(GlobalTrajectoryParameters(x, p, fts.charge(), theField), cylinder), s);
43  }
44 }
bool propagateParametersOnCylinder(const FreeTrajectoryState &fts, const Cylinder &cylinder, GlobalPoint &x, GlobalVector &p, double &s) const
TrackCharge charge() const
TrajectoryStateOnSurface propagatedState(const FreeTrajectoryState &fts, const Surface &surface, const AlgebraicMatrix55 &jacobian, const GlobalPoint &x, const GlobalVector &p) const
const MagneticField * theField
AlgebraicMatrix55 jacobian(double &s) const
TrajectoryStateOnSurface TSOS

Member Data Documentation

const MagneticField* StraightLinePropagator::theField
private

Definition at line 39 of file StraightLinePropagator.h.

Referenced by magneticField(), propagatedState(), and propagateWithPath().