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 FreeTrajectoryState &fts, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation with user-supplied propagator More...
 
TrajectoryStateOnSurface extrapolate (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx) const
 as above, but from TrajectoryStateOnSurface 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 FreeTrajectoryState &fts, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation of (single) FTS with (internal or user-supplied) propagator More...
 
TrajectoryStateOnSurface doExtrapolation (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation of (multi) TSOS 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) {}

◆ 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.

Member Function Documentation

◆ doExtrapolation() [1/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.

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 }

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

◆ doExtrapolation() [2/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.

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 }

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(), extraflags_cff::vtx, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by extrapolate().

◆ extrapolate() [1/4]

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

◆ extrapolate() [2/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.

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 }

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

◆ extrapolate() [3/4]

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

as above, but from TrajectoryStateOnSurface

Definition at line 28 of file TransverseImpactPointExtrapolator.cc.

29  {
30  if (!tsos.isValid())
31  return tsos;
32  return doExtrapolation(tsos, vtx, *thePropagator);
33 }

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

◆ 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.

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 }

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

◆ 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.

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 }

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

Member Data Documentation

◆ thePropagator

DeepCopyPointerByClone<Propagator> TransverseImpactPointExtrapolator::thePropagator
private
Vector3DBase
Definition: Vector3DBase.h:8
TransverseImpactPointExtrapolator::doExtrapolation
TrajectoryStateOnSurface doExtrapolation(const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
extrapolation of (multi) TSOS with (internal or user-supplied) propagator
Definition: TransverseImpactPointExtrapolator.cc:57
Point2DBase
Definition: Point2DBase.h:9
TkRotation< float >
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
anyDirection
Definition: PropagationDirection.h:4
TransverseImpactPointExtrapolator::tipSurface
ReferenceCountingPointer< Plane > tipSurface(const GlobalPoint &position, const GlobalVector &momentum, const double &signedTransverseRadius, const GlobalPoint &vtx) const
computation of the TIP surface
Definition: TransverseImpactPointExtrapolator.cc:121
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
SetPropagationDirection
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
Definition: HelperPropagatorUtility.cc:5
TrajectoryStateOnSurface::transverseCurvature
double transverseCurvature() const
Definition: TrajectoryStateOnSurface.h:70
ReferenceCountingPointer< Plane >
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
TrajectoryStateOnSurface::freeState
FreeTrajectoryState const * freeState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:58
FrontierCondition_GT_autoExpress_cfi.t0
t0
Definition: FrontierCondition_GT_autoExpress_cfi.py:149
Vector2DBase
Definition: Vector2DBase.h:8
Point3DBase< float, GlobalTag >
Propagator::setPropagationDirection
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
TransverseImpactPointExtrapolator::thePropagator
DeepCopyPointerByClone< Propagator > thePropagator
Definition: TransverseImpactPointExtrapolator.h:66
AnalyticalPropagator_cfi.AnalyticalPropagator
AnalyticalPropagator
Definition: AnalyticalPropagator_cfi.py:3
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Vector3DBase::cross
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
PlaneBuilder::plane
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:21
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
Propagator::clone
virtual Propagator * clone() const =0
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
PlaneBuilder
Definition: PlaneBuilder.h:13
FreeTrajectoryState::transverseCurvature
double transverseCurvature() const
Definition: FreeTrajectoryState.h:71
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54