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

#include <TransverseImpactPointExtrapolator.h>

Public Member Functions

TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
 extrapolation with default (=geometrical) propagator More...
 
TrajectoryStateOnSurface extrapolate (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx) const
 as above, but from TrajectoryStateOnSurface More...
 
TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &fts, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation with user-supplied propagator More...
 
TrajectoryStateOnSurface extrapolate (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
 as above, but from TrajectoryStateOnSurface More...
 
 TransverseImpactPointExtrapolator ()
 constructor with default geometrical propagator More...
 
 TransverseImpactPointExtrapolator (const MagneticField *field)
 constructor with default geometrical propagator More...
 
 TransverseImpactPointExtrapolator (const Propagator &u)
 constructor with user-supplied propagator More...
 

Private Member Functions

TrajectoryStateOnSurface doExtrapolation (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation of (multi) TSOS with (internal or user-supplied) propagator More...
 
TrajectoryStateOnSurface doExtrapolation (const FreeTrajectoryState &fts, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation of (single) FTS with (internal or user-supplied) propagator More...
 
ReferenceCountingPointer< PlanetipSurface (const GlobalPoint &position, const GlobalVector &momentum, const double &signedTransverseRadius, const GlobalPoint &vtx) const
 computation of the TIP surface More...
 

Private Attributes

DeepCopyPointerByClone
< Propagator
thePropagator
 

Detailed Description

Extrapolate to impact point with respect to vtx, i.e. point of closest approach to vtx in 2D. The surface of the returned TrajectoryStateOnSurface is chosen centred on vtx; the axes of the local coordinate system (x_loc, y_loc, z_loc) are z_loc // trajectory direction in transverse plane 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 25 of file TransverseImpactPointExtrapolator.h.

Constructor & Destructor Documentation

TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( )

constructor with default geometrical propagator

Definition at line 15 of file TransverseImpactPointExtrapolator.cc.

15  :
16  thePropagator(0) {}
DeepCopyPointerByClone< Propagator > thePropagator
TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( const MagneticField field)

constructor with default geometrical propagator

Definition at line 19 of file TransverseImpactPointExtrapolator.cc.

TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( const Propagator u)

constructor with user-supplied propagator

Definition at line 22 of file TransverseImpactPointExtrapolator.cc.

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

22  :
23  thePropagator(u.clone())
24 {
26 }
virtual Propagator * clone() const =0
DeepCopyPointerByClone< Propagator > thePropagator
virtual void setPropagationDirection(PropagationDirection dir) const
Definition: Propagator.h:134

Member Function Documentation

TrajectoryStateOnSurface TransverseImpactPointExtrapolator::doExtrapolation ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx,
const Propagator u 
) const
private

extrapolation of (multi) TSOS with (internal or user-supplied) propagator

Definition at line 69 of file TransverseImpactPointExtrapolator.cc.

References Vector3DBase< T, FrameTag >::cross(), TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), LogDebug, PlaneBuilder::plane(), Propagator::propagate(), idealTransformation::rotation, tipSurface(), FreeTrajectoryState::transverseCurvature(), TrajectoryStateOnSurface::transverseCurvature(), csvLumiCalc::unit, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by extrapolate().

72 {
73  //
74  // Compute tip surface
75  //
76  if (fabs(tsos.freeState()->transverseCurvature())<1.E-6){
77  LogDebug("TransverseImpactPointExtrapolator")<< "negligeable curvature: using a trick to extrapolate:\n"<<tsos;
78 
79  //0T field probably
80  //x is perpendicular to the momentum
81  GlobalVector xLocal = GlobalVector(-tsos.globalMomentum().y(),tsos.globalMomentum().x(),0).unit();
82  //y along global Z
83  GlobalVector yLocal(0.,0.,1.);
84  //z accordingly
85  GlobalVector zLocal(xLocal.cross(yLocal));
86 
87  Surface::PositionType origin(vtx);
88  Surface::RotationType rotation(xLocal,yLocal,zLocal);
90 
91  return p.propagate(*tsos.freeState(),*surface);
92  }else{
95  1./tsos.transverseCurvature(),vtx);
96  //
97  // propagate
98  //
99  return p.propagate(tsos,*surface);
100  }
101 }
#define LogDebug(id)
ReferenceCountingPointer< Plane > tipSurface(const GlobalPoint &position, const GlobalVector &momentum, const double &signedTransverseRadius, const GlobalPoint &vtx) const
computation of the TIP surface
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:22
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
FreeTrajectoryState * freeState(bool withErrors=true) const
string unit
Definition: csvLumiCalc.py:46
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
double transverseCurvature() const
GlobalVector globalMomentum() const
T x() const
Definition: PV3DBase.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::doExtrapolation ( const FreeTrajectoryState fts,
const GlobalPoint vtx,
const Propagator u 
) const
private

extrapolation of (single) FTS with (internal or user-supplied) propagator

Definition at line 104 of file TransverseImpactPointExtrapolator.cc.

References Vector3DBase< T, FrameTag >::cross(), LogDebug, FreeTrajectoryState::momentum(), PlaneBuilder::plane(), FreeTrajectoryState::position(), Propagator::propagate(), idealTransformation::rotation, tipSurface(), FreeTrajectoryState::transverseCurvature(), csvLumiCalc::unit, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

107 {
108  //
109  // Compute tip surface
110  //
111  if (fabs(fts.transverseCurvature())<1.E-6){
112  LogDebug("TransverseImpactPointExtrapolator")<< "negligeable curvature: using a trick to extrapolate:\n"<<fts;
113 
114  //0T field probably
115  //x is perpendicular to the momentum
116  GlobalVector xLocal = GlobalVector(-fts.momentum().y(),fts.momentum().x(),0).unit();
117  //y along global Z
118  GlobalVector yLocal(0.,0.,1.);
119  //z accordingly
120  GlobalVector zLocal(xLocal.cross(yLocal));
121 
122  Surface::PositionType origin(vtx);
123  Surface::RotationType rotation(xLocal,yLocal,zLocal);
125 
126  return p.propagate(fts,*surface);
127  }else{
129  tipSurface(fts.position(),fts.momentum(),
130  1./fts.transverseCurvature(),vtx);
131  //
132  // propagate
133  //
134  return p.propagate(fts,*surface);
135  }
136 }
#define LogDebug(id)
ReferenceCountingPointer< Plane > tipSurface(const GlobalPoint &position, const GlobalVector &momentum, const double &signedTransverseRadius, const GlobalPoint &vtx) const
computation of the TIP surface
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:22
T y() const
Definition: PV3DBase.h:63
string unit
Definition: csvLumiCalc.py:46
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
GlobalVector momentum() const
GlobalPoint position() const
double transverseCurvature() const
T x() const
Definition: PV3DBase.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const FreeTrajectoryState fts,
const GlobalPoint vtx 
) const
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx 
) const

as above, but from TrajectoryStateOnSurface

Definition at line 36 of file TransverseImpactPointExtrapolator.cc.

References doExtrapolation(), TrajectoryStateOnSurface::isValid(), and thePropagator.

38 {
39  if ( !tsos.isValid() ) return tsos;
40  return doExtrapolation(tsos, vtx, *thePropagator);
41 }
TrajectoryStateOnSurface doExtrapolation(const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
extrapolation of (multi) TSOS with (internal or user-supplied) propagator
DeepCopyPointerByClone< Propagator > thePropagator
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const FreeTrajectoryState fts,
const GlobalPoint vtx,
const Propagator u 
) const

extrapolation with user-supplied propagator

Definition at line 44 of file TransverseImpactPointExtrapolator.cc.

References anyDirection, and doExtrapolation().

47 {
48  //
49  // set propagator for bidirectional propagation
50  //
52  return doExtrapolation(fts,vtx,p);
53 }
TrajectoryStateOnSurface doExtrapolation(const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
extrapolation of (multi) TSOS with (internal or user-supplied) propagator
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx,
const Propagator u 
) const

as above, but from TrajectoryStateOnSurface

Definition at line 56 of file TransverseImpactPointExtrapolator.cc.

References anyDirection, doExtrapolation(), and TrajectoryStateOnSurface::isValid().

59 {
60  if ( !tsos.isValid() ) return tsos;
61  //
62  // set propagator for bidirectional propagation
63  //
65  return doExtrapolation(tsos,vtx,p);
66 }
TrajectoryStateOnSurface doExtrapolation(const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
extrapolation of (multi) TSOS with (internal or user-supplied) propagator
ReferenceCountingPointer< Plane > TransverseImpactPointExtrapolator::tipSurface ( const GlobalPoint position,
const GlobalVector momentum,
const double &  signedTransverseRadius,
const GlobalPoint vtx 
) const
private

computation of the TIP surface

Definition at line 139 of file TransverseImpactPointExtrapolator.cc.

References Vector3DBase< T, FrameTag >::cross(), LogDebug, PV2DBase< T, PVType, FrameType >::mag(), PlaneBuilder::plane(), idealTransformation::rotation, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by doExtrapolation().

143 {
144 
145  LogDebug("TransverseImpactPointExtrapolator")<< position<<"\n"
146  <<momentum<<"\n"
147  <<"signedTransverseRadius : "<<signedTransverseRadius<<"\n"
148  <<vertex;
149 
150  typedef Point2DBase<double,GlobalTag> PositionType2D;
151  typedef Vector2DBase<double,GlobalTag> DirectionType2D;
152 
153  PositionType2D x0(position.x(),position.y());
154  DirectionType2D t0(-momentum.y(),momentum.x());
155  t0 = t0/t0.mag();
156 
157  PositionType2D xc(x0+signedTransverseRadius*t0);
158 
159  DirectionType2D vtxDirection(xc.x()-vertex.x(),xc.y()-vertex.y());
160  double vtxDistance = vtxDirection.mag();
161 
162  Surface::PositionType origin(vertex);
163  GlobalVector xLocal(vtxDirection.x()/vtxDistance,
164  vtxDirection.y()/vtxDistance,
165  0.);
166  if ( vtxDistance<fabs(signedTransverseRadius) ) {
167  LogDebug("TransverseImpactPointExtrapolator")<<"Inverting the x axis.";
168  xLocal = -xLocal;
169  }
170  GlobalVector yLocal(0.,0.,1.);
171  GlobalVector zLocal(xLocal.cross(yLocal));
172  if ( zLocal.dot(momentum)<0. ) {
173  LogDebug("TransverseImpactPointExtrapolator")<<"Inverting the y,z frame.";
174  yLocal = -yLocal;
175  zLocal = -zLocal;
176  }
177  Surface::RotationType rotation(xLocal,yLocal,zLocal);
178 
179  LogDebug("TransverseImpactPointExtrapolator")<<"plane center: "<<origin<<"\n"
180  <<"plane rotation axis:\n"
181  <<xLocal<<"\n"
182  <<yLocal<<"\n"
183  <<zLocal<<"\n"
184  <<"x0: "<<x0<<"\n"
185  <<"t0: "<<t0<<"\n"
186  <<"xc: "<<xc<<"\n"
187  <<"vtxDirection: "<<vtxDirection;
188 
189  return PlaneBuilder().plane(origin,rotation);
190 }
#define LogDebug(id)
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:22
T mag() const
Definition: PV2DBase.h:49
T y() const
Definition: PV3DBase.h:63
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

DeepCopyPointerByClone<Propagator> TransverseImpactPointExtrapolator::thePropagator
private