test
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 Member Functions | Private Attributes
AnalyticalImpactPointExtrapolator Class Reference

#include <AnalyticalImpactPointExtrapolator.h>

Public Member Functions

 AnalyticalImpactPointExtrapolator (const MagneticField *field)
 constructor with default geometrical propagator More...
 
 AnalyticalImpactPointExtrapolator (const Propagator &, const MagneticField *)
 constructor with alternative propagator More...
 
TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
 extrapolation from FreeTrajectoryState More...
 
TrajectoryStateOnSurface extrapolate (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx) const
 as above, but from TrajectoryStateOnSurface More...
 

Private Member Functions

TrajectoryStateOnSurface extrapolateFullState (const TrajectoryStateOnSurface tsos, const GlobalPoint &vertex) const
 extrapolation of (multi) TSOS More...
 
TrajectoryStateOnSurface extrapolateSingleState (const FreeTrajectoryState &fts, const GlobalPoint &vertex) const
 extrapolation of (single) FTS More...
 
bool propagateWithHelix (const IterativeHelixExtrapolatorToLine &extrapolator, const GlobalPoint &vertex, GlobalPoint &x, GlobalVector &p, double &s) const
 the actual propagation to a new point & momentum vector More...
 

Private Attributes

const MagneticFieldtheField
 
DeepCopyPointerByClone
< Propagator
thePropagator
 

Detailed Description

Extrapolate to impact point with respect to vtx, i.e. to the point of closest approach to vtx in 3D. It is slightly faster than the ImpactPointExtrapolator. The helix model is explicitely used in the determination of the target surface. This target surface is centered on vtx; the axes of the local coordinate system (x_loc, y_loc, z_loc) are z_loc // trajectory direction at impact point; x_loc normal to trajectory and along impact vector (impact point - vtx); y_loc forms a right-handed system with the other axes.

Definition at line 26 of file AnalyticalImpactPointExtrapolator.h.

Constructor & Destructor Documentation

AnalyticalImpactPointExtrapolator::AnalyticalImpactPointExtrapolator ( const MagneticField field)

constructor with default geometrical propagator

Definition at line 12 of file AnalyticalImpactPointExtrapolator.cc.

AnalyticalImpactPointExtrapolator::AnalyticalImpactPointExtrapolator ( const Propagator propagator,
const MagneticField field 
)

constructor with alternative propagator

Definition at line 17 of file AnalyticalImpactPointExtrapolator.cc.

References anyDirection, Propagator::setPropagationDirection(), and thePropagator.

18  :
19  thePropagator(propagator.clone()),
20  theField(field)
21 {
23 }
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:144
virtual Propagator * clone() const =0
DeepCopyPointerByClone< Propagator > thePropagator

Member Function Documentation

TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolate ( const FreeTrajectoryState fts,
const GlobalPoint vtx 
) const

extrapolation from FreeTrajectoryState

Definition at line 26 of file AnalyticalImpactPointExtrapolator.cc.

References extrapolateSingleState().

28 {
29 // static TimingReport::Item& timer = detailedDetTimer("AnalyticalImpactPointExtrapolator");
30 // TimeMe t(timer,false);
31 
32  return extrapolateSingleState(fts, vtx);
33 }
TrajectoryStateOnSurface extrapolateSingleState(const FreeTrajectoryState &fts, const GlobalPoint &vertex) const
extrapolation of (single) FTS
TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolate ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx 
) const

as above, but from TrajectoryStateOnSurface

Definition at line 36 of file AnalyticalImpactPointExtrapolator.cc.

References extrapolateFullState(), and TrajectoryStateOnSurface::isValid().

38 {
39  if ( tsos.isValid() ) return extrapolateFullState(tsos,vtx);
40  else return tsos;
41 }
TrajectoryStateOnSurface extrapolateFullState(const TrajectoryStateOnSurface tsos, const GlobalPoint &vertex) const
extrapolation of (multi) TSOS
TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolateFullState ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vertex 
) const
private

extrapolation of (multi) TSOS

Definition at line 44 of file AnalyticalImpactPointExtrapolator.cc.

References TrajectoryStateOnSurface::components(), extrapolateSingleState(), TrajectoryStateOnSurface::freeTrajectoryState(), TrajectoryStateOnSurface::isValid(), Propagator::propagate(), TrajectoryStateOnSurface::surface(), and thePropagator.

Referenced by extrapolate().

46 {
47  //
48  // first determine IP plane using propagation with (single) FTS
49  // could be optimised (will propagate errors even if duplicated below)
50  //
51  TrajectoryStateOnSurface singleState =
53  if ( !singleState.isValid() || tsos.components().size()==1 ) return singleState;
54  //
55  // propagate multiTsos to plane found above
56  //
57  return thePropagator->propagate(tsos,singleState.surface());
58 }
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:119
TrajectoryStateOnSurface extrapolateSingleState(const FreeTrajectoryState &fts, const GlobalPoint &vertex) const
extrapolation of (single) FTS
const SurfaceType & surface() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
DeepCopyPointerByClone< Propagator > thePropagator
std::vector< TrajectoryStateOnSurface > components() const
TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolateSingleState ( const FreeTrajectoryState fts,
const GlobalPoint vertex 
) const
private

extrapolation of (single) FTS

Definition at line 61 of file AnalyticalImpactPointExtrapolator.cc.

References anyDirection, FreeTrajectoryState::charge(), FreeTrajectoryState::curvilinearError(), alignCSCRings::e, FreeTrajectoryState::hasError(), CurvilinearTrajectoryError::matrix(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::parameters(), PlaneBuilder::plane(), GlobalTrajectoryParameters::position(), FreeTrajectoryState::position(), propagateWithHelix(), rho, makeMuonMisalignmentScenario::rot, alignCSCRings::s, theField, FreeTrajectoryState::transverseCurvature(), and x.

Referenced by extrapolate(), and extrapolateFullState().

63 {
64  //
65  // initialisation of position, momentum and transverse curvature
66  //
67  GlobalPoint x(fts.position());
68  GlobalVector p(fts.momentum());
69  double rho = fts.transverseCurvature();
70  //
71  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um
72  // difference in transversal position at 10m.
73  //
74  double s(0);
75  if( fabs(rho)<1.e-10 ) {
76  GlobalVector dx(p.dot(vertex-x)/p.mag2()*p);
77  x += dx;
78  float sign = p.dot(dx);
79  s = sign>0 ? dx.mag() : -dx.mag();
80  }
81  //
82  // Helix case
83  //
84  else {
87  IterativeHelixExtrapolatorToLine extrapolator(helixPos,helixDir,rho,anyDirection);
88  if ( !propagateWithHelix(extrapolator,vertex,x,p,s) ) return TrajectoryStateOnSurface();
89  }
90  //
91  // Define target surface: origin on line, x_local from line
92  // to helix at closest approach, z_local along the helix
93  // and y_local to complete right-handed system
94  //
95  GlobalVector zLocal(p.unit());
96  GlobalVector yLocal(zLocal.cross(x-vertex).unit());
97  GlobalVector xLocal(yLocal.cross(zLocal));
98  Surface::RotationType rot(xLocal,yLocal,zLocal);
99  PlaneBuilder::ReturnType surface = PlaneBuilder().plane(vertex,rot);
100  //
101  // Compute propagated state
102  //
104  if (fts.hasError()) {
105  //
106  // compute jacobian
107  //
108  AnalyticalCurvilinearJacobian analyticalJacobian(fts.parameters(), gtp.position(), gtp.momentum(), s);
109  CurvilinearTrajectoryError cte( ROOT::Math::Similarity( analyticalJacobian.jacobian(),
110  fts.curvilinearError().matrix()) );
111  return TrajectoryStateOnSurface(gtp,cte,*surface);
112  }
113  else {
114  //
115  // return state without errors
116  //
117  return TrajectoryStateOnSurface(gtp,*surface);
118  }
119 }
const GlobalTrajectoryParameters & parameters() const
Definition: DDAxes.h:10
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:22
bool propagateWithHelix(const IterativeHelixExtrapolatorToLine &extrapolator, const GlobalPoint &vertex, GlobalPoint &x, GlobalVector &p, double &s) const
the actual propagation to a new point &amp; momentum vector
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
GlobalVector momentum() const
GlobalPoint position() const
double transverseCurvature() const
const AlgebraicSymMatrix55 & matrix() const
Definition: DDAxes.h:10
bool AnalyticalImpactPointExtrapolator::propagateWithHelix ( const IterativeHelixExtrapolatorToLine extrapolator,
const GlobalPoint vertex,
GlobalPoint x,
GlobalVector p,
double &  s 
) const
private

the actual propagation to a new point & momentum vector

Definition at line 122 of file AnalyticalImpactPointExtrapolator.cc.

References IterativeHelixExtrapolatorToLine::direction(), PV3DBase< T, PVType, FrameType >::mag(), Basic3DVector< T >::mag(), IterativeHelixExtrapolatorToLine::pathLength(), and IterativeHelixExtrapolatorToLine::position().

Referenced by extrapolateSingleState().

124  {
125  //
126  // save absolute value of momentum
127  //
128  double pmag(p.mag());
129  //
130  // get path length to solution
131  //
132  std::pair<bool,double> propResult = extrapolator.pathLength(vertex);
133  if ( !propResult.first ) return false;
134  s = propResult.second;
135  //
136  // get point and (normalised) direction from path length
137  //
138  HelixLineExtrapolation::PositionType xGen = extrapolator.position(s);
140  //
141  // Fix normalisation and convert back to GlobalPoint / GlobalVector
142  //
143  x = GlobalPoint(xGen);
144  pGen *= pmag/pGen.mag();
145  p = GlobalVector(pGen);
146  //
147  return true;
148 }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual PositionType position(double s) const
virtual DirectionType direction(double s) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual std::pair< bool, double > pathLength(const GlobalPoint &point) const
T mag() const
Definition: PV3DBase.h:67
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

const MagneticField* AnalyticalImpactPointExtrapolator::theField
private

Definition at line 57 of file AnalyticalImpactPointExtrapolator.h.

Referenced by extrapolateSingleState().

DeepCopyPointerByClone<Propagator> AnalyticalImpactPointExtrapolator::thePropagator
private