CMS 3D CMS Logo

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< PropagatorthePropagator
 

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 26 of file TransverseImpactPointExtrapolator.h.

Constructor & Destructor Documentation

◆ TransverseImpactPointExtrapolator() [1/3]

TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( )

constructor with default geometrical propagator

Definition at line 14 of file TransverseImpactPointExtrapolator.cc.

14 : thePropagator(nullptr) {}
DeepCopyPointerByClone< Propagator > thePropagator

◆ TransverseImpactPointExtrapolator() [2/3]

TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( const MagneticField field)

constructor with default geometrical propagator

Definition at line 16 of file TransverseImpactPointExtrapolator.cc.

◆ TransverseImpactPointExtrapolator() [3/3]

TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( const Propagator u)

constructor with user-supplied propagator

Definition at line 19 of file TransverseImpactPointExtrapolator.cc.

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

19  : thePropagator(u.clone()) {
21 }
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
virtual Propagator * clone() const =0
DeepCopyPointerByClone< Propagator > thePropagator

Member Function Documentation

◆ doExtrapolation() [1/2]

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 57 of file TransverseImpactPointExtrapolator.cc.

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

Referenced by extrapolate().

59  {
60  //
61  // Compute tip surface
62  //
63  if (fabs(tsos.freeState()->transverseCurvature()) < 1.E-6) {
64  LogDebug("TransverseImpactPointExtrapolator") << "negligeable curvature: using a trick to extrapolate:\n" << tsos;
65 
66  //0T field probably
67  //x is perpendicular to the momentum
68  GlobalVector xLocal = GlobalVector(-tsos.globalMomentum().y(), tsos.globalMomentum().x(), 0).unit();
69  //y along global Z
70  GlobalVector yLocal(0., 0., 1.);
71  //z accordingly
72  GlobalVector zLocal(xLocal.cross(yLocal));
73 
74  const Surface::PositionType& origin(vtx);
75  Surface::RotationType rotation(xLocal, yLocal, zLocal);
77 
78  return p.propagate(*tsos.freeState(), *surface);
79  } else {
81  tipSurface(tsos.globalPosition(), tsos.globalMomentum(), 1. / tsos.transverseCurvature(), vtx);
82  //
83  // propagate
84  //
85  return p.propagate(tsos, *surface);
86  }
87 }
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:21
ReferenceCountingPointer< Plane > tipSurface(const GlobalPoint &position, const GlobalVector &momentum, const double &signedTransverseRadius, const GlobalPoint &vtx) const
computation of the TIP surface
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalPoint globalPosition() const
Basic3DVector unit() const
double transverseCurvature() const
GlobalVector globalMomentum() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
#define LogDebug(id)

◆ doExtrapolation() [2/2]

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 89 of file TransverseImpactPointExtrapolator.cc.

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

91  {
92  //
93  // Compute tip surface
94  //
95  if (fabs(fts.transverseCurvature()) < 1.E-6) {
96  LogDebug("TransverseImpactPointExtrapolator") << "negligeable curvature: using a trick to extrapolate:\n" << fts;
97 
98  //0T field probably
99  //x is perpendicular to the momentum
100  GlobalVector xLocal = GlobalVector(-fts.momentum().y(), fts.momentum().x(), 0).unit();
101  //y along global Z
102  GlobalVector yLocal(0., 0., 1.);
103  //z accordingly
104  GlobalVector zLocal(xLocal.cross(yLocal));
105 
106  const Surface::PositionType& origin(vtx);
107  Surface::RotationType rotation(xLocal, yLocal, zLocal);
109 
110  return p.propagate(fts, *surface);
111  } else {
113  tipSurface(fts.position(), fts.momentum(), 1. / fts.transverseCurvature(), vtx);
114  //
115  // propagate
116  //
117  return p.propagate(fts, *surface);
118  }
119 }
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:21
ReferenceCountingPointer< Plane > tipSurface(const GlobalPoint &position, const GlobalVector &momentum, const double &signedTransverseRadius, const GlobalPoint &vtx) const
computation of the TIP surface
GlobalPoint position() const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalVector momentum() const
Basic3DVector unit() const
double transverseCurvature() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
#define LogDebug(id)

◆ extrapolate() [1/4]

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

extrapolation with default (=geometrical) propagator

Definition at line 23 of file TransverseImpactPointExtrapolator.cc.

References doExtrapolation(), thePropagator, and L1BJetProducer_cff::vtx.

Referenced by GroupedCkfTrajectoryBuilder::advanceOneLayer(), reco::TransientTrackFromFTS::calculateTSOSAtVertex(), reco::GsfTransientTrack::calculateTSOSAtVertex(), MuonCkfTrajectoryBuilder::collectMeasurement(), MultiRefittedTS::computeFreeTrajectoryState(), GsfConstraintAtVertex::constrainAtPoint(), SimpleNavigableLayer::crossingState(), MultiTrajectoryStateTransform::extrapolatedState(), GsfTrackProducerBase::fillMode(), CkfTrajectoryBuilder::findCompatibleMeasurements(), reco::CandidatePtrTransientTrack::impactPointState(), reco::TrackTransientTrack::impactPointState(), KFBasedPixelFitter::run(), reco::TransientTrackFromFTS::stateOnSurface(), reco::CandidatePtrTransientTrack::stateOnSurface(), reco::TrackTransientTrack::stateOnSurface(), reco::GsfTransientTrack::stateOnSurface(), and IPTools::transverseExtrapolate().

24  {
25  return doExtrapolation(fts, vtx, *thePropagator);
26 }
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

◆ extrapolate() [2/4]

TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx 
) const

as above, but from TrajectoryStateOnSurface

Definition at line 28 of file TransverseImpactPointExtrapolator.cc.

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

29  {
30  if (!tsos.isValid())
31  return tsos;
32  return doExtrapolation(tsos, vtx, *thePropagator);
33 }
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

◆ extrapolate() [3/4]

TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const FreeTrajectoryState fts,
const GlobalPoint vtx,
const Propagator u 
) const

extrapolation with user-supplied propagator

Definition at line 35 of file TransverseImpactPointExtrapolator.cc.

References anyDirection, doExtrapolation(), AlCaHLTBitMon_ParallelJobs::p, SetPropagationDirection(), and L1BJetProducer_cff::vtx.

37  {
38  //
39  // set propagator for bidirectional propagation
40  //
41  std::unique_ptr<Propagator> p_cloned = SetPropagationDirection(p, anyDirection);
42  return doExtrapolation(fts, vtx, *(p_cloned.get()));
43 }
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
TrajectoryStateOnSurface doExtrapolation(const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
extrapolation of (multi) TSOS with (internal or user-supplied) propagator

◆ extrapolate() [4/4]

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

as above, but from TrajectoryStateOnSurface

Definition at line 45 of file TransverseImpactPointExtrapolator.cc.

References anyDirection, doExtrapolation(), TrajectoryStateOnSurface::isValid(), AlCaHLTBitMon_ParallelJobs::p, SetPropagationDirection(), and L1BJetProducer_cff::vtx.

47  {
48  if (!tsos.isValid())
49  return tsos;
50  //
51  // set propagator for bidirectional propagation
52  //
53  std::unique_ptr<Propagator> p_cloned = SetPropagationDirection(p, anyDirection);
54  return doExtrapolation(tsos, vtx, *(p_cloned.get()));
55 }
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
TrajectoryStateOnSurface doExtrapolation(const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
extrapolation of (multi) TSOS with (internal or user-supplied) propagator

◆ tipSurface()

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 121 of file TransverseImpactPointExtrapolator.cc.

References Vector3DBase< T, FrameTag >::cross(), LogDebug, PlaneBuilder::plane(), position, idealTransformation::rotation, FrontierCondition_GT_autoExpress_cfi::t0, bphysicsOniaDQM_cfi::vertex, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by doExtrapolation().

124  {
125  LogDebug("TransverseImpactPointExtrapolator") << position << "\n"
126  << momentum << "\n"
127  << "signedTransverseRadius : " << signedTransverseRadius << "\n"
128  << vertex;
129 
130  typedef Point2DBase<double, GlobalTag> PositionType2D;
131  typedef Vector2DBase<double, GlobalTag> DirectionType2D;
132 
133  PositionType2D x0(position.x(), position.y());
134  DirectionType2D t0(-momentum.y(), momentum.x());
135  t0 = t0 / t0.mag();
136 
137  PositionType2D xc(x0 + signedTransverseRadius * t0);
138 
139  DirectionType2D vtxDirection(xc.x() - vertex.x(), xc.y() - vertex.y());
140  double vtxDistance = vtxDirection.mag();
141 
142  const Surface::PositionType& origin(vertex);
143  GlobalVector xLocal(vtxDirection.x() / vtxDistance, vtxDirection.y() / vtxDistance, 0.);
144  if (vtxDistance < fabs(signedTransverseRadius)) {
145  LogDebug("TransverseImpactPointExtrapolator") << "Inverting the x axis.";
146  xLocal = -xLocal;
147  }
148  GlobalVector yLocal(0., 0., 1.);
149  GlobalVector zLocal(xLocal.cross(yLocal));
150  if (zLocal.dot(momentum) < 0.) {
151  LogDebug("TransverseImpactPointExtrapolator") << "Inverting the y,z frame.";
152  yLocal = -yLocal;
153  zLocal = -zLocal;
154  }
155  Surface::RotationType rotation(xLocal, yLocal, zLocal);
156 
157  LogDebug("TransverseImpactPointExtrapolator") << "plane center: " << origin << "\n"
158  << "plane rotation axis:\n"
159  << xLocal << "\n"
160  << yLocal << "\n"
161  << zLocal << "\n"
162  << "x0: " << x0 << "\n"
163  << "t0: " << t0 << "\n"
164  << "xc: " << xc << "\n"
165  << "vtxDirection: " << vtxDirection;
166 
167  return PlaneBuilder().plane(origin, rotation);
168 }
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:21
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
static int position[264][3]
Definition: ReadPGInfo.cc:289
#define LogDebug(id)

Member Data Documentation

◆ thePropagator

DeepCopyPointerByClone<Propagator> TransverseImpactPointExtrapolator::thePropagator
private