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
StraightLinePropagator Class Reference

#include <StraightLinePropagator.h>

Inheritance diagram for StraightLinePropagator:
Propagator

Public Member Functions

virtual StraightLinePropagatorclone () const override
 
virtual 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 ()
 
- 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
 
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
 
 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 17 of file StraightLinePropagator.h.

Member Typedef Documentation

Definition at line 21 of file StraightLinePropagator.h.

Definition at line 22 of file StraightLinePropagator.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file StraightLinePropagator.h.

Referenced by clone().

27  :
28  Propagator(aDir), theField(field) {}
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:48
const MagneticField * theField
StraightLinePropagator::~StraightLinePropagator ( )
inline

Definition at line 30 of file StraightLinePropagator.h.

30 {}

Member Function Documentation

virtual StraightLinePropagator* StraightLinePropagator::clone ( void  ) const
inlineoverridevirtual

Implements Propagator.

Definition at line 42 of file StraightLinePropagator.h.

References StraightLinePropagator().

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

Definition at line 93 of file StraightLinePropagator.cc.

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

Referenced by propagateWithPath().

93  {
94  //Jacobian for 5*5 local error matrix
95  AlgebraicMatrix55 j = AlgebraicMatrixID(); //Jacobian
96 
97  double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
98  if (s*dir < 0.) return j;
99 
100  j(3,1) = s;
101  j(4,2) = s;
102 
103  return j;
104 }
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:155
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
int j
Definition: DBlmapReader.cc:9
dbl *** dir
Definition: mlp_gen.cc:35
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
virtual const MagneticField* StraightLinePropagator::magneticField ( ) const
inlineoverridevirtual

Implements Propagator.

Definition at line 47 of file StraightLinePropagator.h.

References theField.

47 {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 71 of file StraightLinePropagator.cc.

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

Referenced by propagateWithPath().

75  {
76 
77  if(fts.hasError()) {
78  // propagate error
79  TSOS tmp(fts, surface);
80  const AlgebraicSymMatrix55 & eLocal =tmp.localError().matrix();
81  AlgebraicSymMatrix55 lte = ROOT::Math::Similarity(jacobian,eLocal);
82  LocalTrajectoryError eloc(lte);
83 
84  TSOS tmp2(tmp.localParameters(), eloc, surface, theField);
85  GlobalTrajectoryParameters gtp(x, p, fts.charge(), theField);
86  return TSOS(gtp, tmp2.cartesianError(), surface);
87  } else {
88  // return state without errors
89  return TSOS(GlobalTrajectoryParameters(x, p, fts.charge(), theField), surface);
90  }
91 }
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
TrackCharge charge() const
const MagneticField * theField
AlgebraicMatrix55 jacobian(double &s) const
TrajectoryStateOnSurface TSOS
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
TrajectoryStateOnSurface StraightLinePropagator::propagatedState ( const FreeTrajectoryState fts,
const Surface surface,
const AlgebraicMatrix55 jacobian,
const LocalPoint x,
const LocalVector p 
) const
private

Definition at line 51 of file StraightLinePropagator.cc.

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

55  {
56  if(fts.hasError()) {
57  // propagate error
58  TSOS tmp( fts, surface);
59  const AlgebraicSymMatrix55 & eLocal =tmp.localError().matrix();
60  AlgebraicSymMatrix55 lte = ROOT::Math::Similarity(jacobian,eLocal);
61  LocalTrajectoryError eloc(lte);
62  LocalTrajectoryParameters ltp(x, p, fts.charge());
63  return TSOS(ltp, eloc, surface, theField);
64  } else {
65  // return state without errors
66  return TSOS(LocalTrajectoryParameters(x, p, fts.charge()), surface, theField);
67  }
68 }
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
TrackCharge charge() const
const MagneticField * theField
AlgebraicMatrix55 jacobian(double &s) const
TrajectoryStateOnSurface TSOS
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool StraightLinePropagator::propagateParametersOnCylinder ( const FreeTrajectoryState fts,
const Cylinder cylinder,
GlobalPoint x,
GlobalVector p,
double &  s 
) const
private

Definition at line 106 of file StraightLinePropagator.cc.

References alongMomentum, 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().

110  {
111  GlobalPoint sp = cylinder.toGlobal(LocalPoint(0., 0.));
112  if (sp.x()!=0. || sp.y()!=0.) {
113  throw PropagationException("Cannot propagate to an arbitrary cylinder");
114  }
115 
116  x = fts.position();
117  p = fts.momentum();
118  s = cylinder.radius() - x.perp();
119 
120  double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
121  if(s*dir < 0.) return false;
122 
123  double dt = s/p.perp();
124  x = GlobalPoint(x.x() + p.x()*dt,
125  x.y() + p.y()*dt,
126  x.z() + p.z()*dt);
127 
128  return true;
129 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
float dt
Definition: AMPTWrapper.h:126
T perp() const
Definition: PV3DBase.h:72
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:155
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
Scalar radius() const
Radius of the cylinder.
Definition: Cylinder.h:67
T z() const
Definition: PV3DBase.h:64
Common base class.
GlobalVector momentum() const
GlobalPoint position() const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62
bool StraightLinePropagator::propagateParametersOnPlane ( const FreeTrajectoryState fts,
const Plane plane,
LocalPoint x,
LocalVector p,
double &  s 
) const
private

Definition at line 131 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().

135  {
136 
137  //Do extrapolation in local frame of plane
138  // LocalPoint sp = plane.toLocal(plane.position());
139  x = plane.toLocal(fts.position());
140  p = plane.toLocal(fts.momentum());
141  s = -x.z(); // sp.z() - x.z(); local z of plane always 0
142 
143  //double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
144  //if(s*dir < 0.) return false;
145  if ((p.x() != 0 || p.y() != 0) && p.z() == 0 && s!= 0) return false;
146 
147  x = LocalPoint( x.x() + (p.x()/p.z())*s,
148  x.y() + (p.y()/p.z())*s,
149  x.z() + s);
150 
151  return true;
152 }
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:64
GlobalVector momentum() const
GlobalPoint position() const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
T x() const
Definition: PV3DBase.h:62
std::pair< TrajectoryStateOnSurface, double > StraightLinePropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Plane surface 
) const
overridevirtual

Implements Propagator.

Definition at line 9 of file StraightLinePropagator.cc.

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

11 {
12  // propagate parameters
13  LocalPoint x;
14  LocalVector p;
15  double s = 0;
16  bool parametersOK = propagateParametersOnPlane(fts, plane, x, p, s);
17  if(!parametersOK) return std::make_pair(TrajectoryStateOnSurface(), 0.);
18 
19  // compute propagated state
20  if (fts.hasError()) {
21  return std::make_pair( propagatedState(fts, plane, jacobian(s), x, p), s);
22  } else {
23  // return state without errors
24  return std::make_pair(TSOS(LocalTrajectoryParameters(x, p, fts.charge()),
25  plane, theField), s);
26  }
27 }
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
Definition: DDAxes.h:10
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 30 of file StraightLinePropagator.cc.

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

32 {
33  // propagate parameters
34  GlobalPoint x;
36  double s = 0;
37  bool parametersOK = propagateParametersOnCylinder(fts, cylinder, x, p, s);
38  if(!parametersOK) return std::make_pair(TrajectoryStateOnSurface(), 0.);
39 
40  // compute propagated state
41  if (fts.hasError()) {
42  return std::make_pair( propagatedState(fts, cylinder, jacobian(s), x, p), s);
43  } else {
44  // return state without errors
45  return std::make_pair(TSOS(GlobalTrajectoryParameters(x, p, fts.charge(),theField),
46  cylinder), s);
47  }
48 }
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
Definition: DDAxes.h:10

Member Data Documentation

const MagneticField* StraightLinePropagator::theField
private

Definition at line 51 of file StraightLinePropagator.h.

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