CMS 3D CMS Logo

StraightLinePropagator Class Reference

As the name indicates, propagates track parameters according to a straight line model. More...

#include <TrackingTools/GeomPropagators/interface/StraightLinePropagator.h>

Inheritance diagram for StraightLinePropagator:

Propagator

List of all members.

Public Member Functions

virtual StraightLinePropagatorclone () const
virtual const MagneticFieldmagneticField () const
virtual TSOS propagate (const FreeTrajectoryState &fts, const Cylinder &cylinder) const
virtual TSOS propagate (const FreeTrajectoryState &fts, const Plane &plane) const
virtual TSOS propagate (const FreeTrajectoryState &fts, const Surface &surface) const
 Propagate from a free state (e.g.
std::pair< TSOS, double > propagateWithPath (const FreeTrajectoryState &fts, const Cylinder &surface) const
std::pair< TSOS, double > propagateWithPath (const FreeTrajectoryState &fts, const Plane &surface) const
std::pair< TSOS, double > propagateWithPath (const FreeTrajectoryState &fts, const Surface &surface) const
 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.
 StraightLinePropagator (const MagneticField *field, PropagationDirection aDir=alongMomentum)
 ~StraightLinePropagator ()

Private Types

typedef FreeTrajectoryState FTS
typedef TrajectoryStateOnSurface TSOS

Private Member Functions

AlgebraicMatrix55 jacobian (double &s) const
AlgebraicMatrix jacobian_old (double &s) const
TrajectoryStateOnSurface propagatedState (const FreeTrajectoryState &fts, const Surface &surface, const AlgebraicMatrix55 &jacobian, const LocalPoint &x, const LocalVector &p) 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 AlgebraicMatrix &jacobian, const LocalPoint &x, const LocalVector &p) const
TrajectoryStateOnSurface propagatedState (const FreeTrajectoryState &fts, const Surface &surface, const AlgebraicMatrix &jacobian, const GlobalPoint &x, const GlobalVector &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

typedef FreeTrajectoryState StraightLinePropagator::FTS [private]

Definition at line 21 of file StraightLinePropagator.h.

typedef TrajectoryStateOnSurface StraightLinePropagator::TSOS [private]

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().

00027                                                                      : 
00028     Propagator(aDir), theField(field) {}

StraightLinePropagator::~StraightLinePropagator (  )  [inline]

Definition at line 30 of file StraightLinePropagator.h.

00030 {}


Member Function Documentation

virtual StraightLinePropagator* StraightLinePropagator::clone ( void   )  const [inline, virtual]

Implements Propagator.

Definition at line 58 of file StraightLinePropagator.h.

References StraightLinePropagator().

00058                                                  {
00059     return new StraightLinePropagator(*this);
00060   }

AlgebraicMatrix55 StraightLinePropagator::jacobian ( double &  s  )  const [private]

Definition at line 115 of file StraightLinePropagator.cc.

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

Referenced by jacobian_old(), and propagateWithPath().

00115                                                                   {
00116   //Jacobian for 5*5 local error matrix
00117   AlgebraicMatrix55 j = AlgebraicMatrixID(); //Jacobian
00118   
00119   double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
00120   if (s*dir < 0.) return j;
00121 
00122   j(3,1) = s; 
00123   j(4,2) = s; 
00124 
00125   return j;
00126 }

AlgebraicMatrix StraightLinePropagator::jacobian_old ( double &  s  )  const [private]

Definition at line 111 of file StraightLinePropagator.cc.

References asHepMatrix(), and jacobian().

00111                                                                     {
00112     return asHepMatrix(jacobian(s));
00113 }

virtual const MagneticField* StraightLinePropagator::magneticField (  )  const [inline, virtual]

Implements Propagator.

Definition at line 63 of file StraightLinePropagator.h.

References theField.

00063 {return theField;}

virtual TSOS StraightLinePropagator::propagate ( const FreeTrajectoryState fts,
const Cylinder cylinder 
) const [inline, virtual]

Implements Propagator.

Definition at line 42 of file StraightLinePropagator.h.

References propagateWithPath().

00043                                                          {
00044     return propagateWithPath(fts,cylinder).first;
00045   }

virtual TSOS StraightLinePropagator::propagate ( const FreeTrajectoryState fts,
const Plane plane 
) const [inline, virtual]

Implements Propagator.

Definition at line 37 of file StraightLinePropagator.h.

References propagateWithPath().

00038                                                    {
00039     return propagateWithPath(fts,plane).first;
00040   }

virtual TSOS StraightLinePropagator::propagate ( const FreeTrajectoryState state,
const Surface sur 
) const [inline, virtual]

Propagate from a free state (e.g.

position and momentum in in global cartesian coordinates) to a surface. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.

Reimplemented from Propagator.

Definition at line 32 of file StraightLinePropagator.h.

References Propagator::propagate().

Referenced by MultipleScatteringGeometry::detLayers().

00033                                                        {
00034     return Propagator::propagate(fts, surface);
00035   }

TrajectoryStateOnSurface StraightLinePropagator::propagatedState ( const FreeTrajectoryState fts,
const Surface surface,
const AlgebraicMatrix55 jacobian,
const LocalPoint x,
const LocalVector p 
) const [private]

TrajectoryStateOnSurface StraightLinePropagator::propagatedState ( const FreeTrajectoryState fts,
const Surface surface,
const AlgebraicMatrix55 jacobian,
const GlobalPoint x,
const GlobalVector p 
) const [private]

Definition at line 60 of file StraightLinePropagator.cc.

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

00064                                                                     {
00065   if(fts.hasError()) {
00066     // propagate error
00067     TSOS tmp( fts, surface);
00068     const AlgebraicSymMatrix55 & eLocal =tmp.localError().matrix();
00069     AlgebraicSymMatrix55 lte = ROOT::Math::Similarity(jacobian,eLocal);
00070     LocalTrajectoryError eloc(lte);
00071     LocalTrajectoryParameters ltp(x, p, fts.charge());
00072     return TSOS(ltp, eloc, surface, theField);
00073   } else {
00074     // return state without errors
00075     return TSOS(LocalTrajectoryParameters(x, p, fts.charge()), surface, theField);
00076   }
00077 }

TrajectoryStateOnSurface StraightLinePropagator::propagatedState ( const FreeTrajectoryState fts,
const Surface surface,
const AlgebraicMatrix jacobian,
const LocalPoint x,
const LocalVector p 
) const [private]

TrajectoryStateOnSurface StraightLinePropagator::propagatedState ( const FreeTrajectoryState fts,
const Surface surface,
const AlgebraicMatrix jacobian,
const GlobalPoint x,
const GlobalVector p 
) const [private]

Definition at line 51 of file StraightLinePropagator.cc.

Referenced by propagateWithPath().

00055                                                                     {
00056     return propagatedState(fts,surface,asSMatrix<5,5>(jacobian),x,p);
00057 }

bool StraightLinePropagator::propagateParametersOnCylinder ( const FreeTrajectoryState fts,
const Cylinder cylinder,
GlobalPoint x,
GlobalVector p,
double &  s 
) const [private]

Definition at line 128 of file StraightLinePropagator.cc.

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

00132                                                                             {
00133   GlobalPoint sp = cylinder.toGlobal(LocalPoint(0., 0.));
00134   if (sp.x()!=0. || sp.y()!=0.) {
00135     throw PropagationException("Cannot propagate to an arbitrary cylinder");
00136   }
00137 
00138   x = fts.position();
00139   p = fts.momentum();
00140   s = cylinder.radius() - x.perp();
00141 
00142   double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
00143   if(s*dir < 0.) return false;
00144 
00145   double dt = s/p.perp();
00146   x = GlobalPoint(x.x() + p.x()*dt, 
00147                   x.y() + p.y()*dt, 
00148                   x.z() + p.z()*dt);
00149 
00150   return true;
00151 }

bool StraightLinePropagator::propagateParametersOnPlane ( const FreeTrajectoryState fts,
const Plane plane,
LocalPoint x,
LocalVector p,
double &  s 
) const [private]

Definition at line 153 of file StraightLinePropagator.cc.

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

Referenced by propagateWithPath().

00157                                                                          {
00158   
00159   //Do extrapolation in local frame of plane
00160   //  LocalPoint sp = plane.toLocal(plane.position());
00161   x = plane.toLocal(fts.position());
00162   p = plane.toLocal(fts.momentum());
00163   s = -x.z(); // sp.z() - x.z(); local z of plane always 0
00164   
00165   //double dir = (propagationDirection() == alongMomentum) ? 1. : -1.;
00166   //if(s*dir < 0.) return false;
00167 
00168   x = LocalPoint( x.x() + (p.x()/p.z())*s,
00169                   x.y() + (p.y()/p.z())*s,
00170                   x.z() + s);    
00171 
00172   return true;
00173 }

std::pair< TrajectoryStateOnSurface, double > StraightLinePropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Cylinder surface 
) const [virtual]

Implements Propagator.

Definition at line 30 of file StraightLinePropagator.cc.

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

00032 {
00033   // propagate parameters
00034   GlobalPoint x;
00035   GlobalVector p;
00036   double s = 0;
00037   bool parametersOK = propagateParametersOnCylinder(fts, cylinder,  x, p, s);
00038   if(!parametersOK) return std::make_pair(TrajectoryStateOnSurface(), 0.);
00039 
00040   // compute propagated state
00041   if (fts.hasError()) {
00042     return std::make_pair( propagatedState(fts, cylinder, jacobian(s), x,  p), s);
00043   } else {
00044     // return state without errors
00045     return std::make_pair(TSOS(GlobalTrajectoryParameters(x, p, fts.charge(),theField),
00046                           cylinder), s);
00047   }
00048 }

std::pair< TrajectoryStateOnSurface, double > StraightLinePropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Plane surface 
) const [virtual]

Implements Propagator.

Definition at line 9 of file StraightLinePropagator.cc.

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

00011 {
00012   // propagate parameters
00013   LocalPoint x;
00014   LocalVector p;
00015   double s = 0;
00016   bool parametersOK = propagateParametersOnPlane(fts, plane, x, p, s);
00017   if(!parametersOK) return std::make_pair(TrajectoryStateOnSurface(), 0.);
00018 
00019   // compute propagated state
00020   if (fts.hasError()) {
00021     return std::make_pair( propagatedState(fts, plane, jacobian(s), x,  p), s);
00022   } else {
00023     // return state without errors
00024     return std::make_pair(TSOS(LocalTrajectoryParameters(x, p, fts.charge()), 
00025                           plane, theField), s);
00026   }
00027 }

std::pair<TSOS,double> StraightLinePropagator::propagateWithPath ( const FreeTrajectoryState state,
const Surface sur 
) const [inline, virtual]

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.

Reimplemented from Propagator.

Definition at line 47 of file StraightLinePropagator.h.

References Propagator::propagateWithPath().

Referenced by propagate().

00048                                                                     {
00049     return Propagator::propagateWithPath(fts,surface);
00050   }


Member Data Documentation

const MagneticField* StraightLinePropagator::theField [private]

Definition at line 67 of file StraightLinePropagator.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:54 2009 for CMSSW by  doxygen 1.5.4