CMS 3D CMS Logo

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

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() [1/2]

AnalyticalImpactPointExtrapolator::AnalyticalImpactPointExtrapolator ( const MagneticField field)

constructor with default geometrical propagator

Definition at line 12 of file AnalyticalImpactPointExtrapolator.cc.

◆ AnalyticalImpactPointExtrapolator() [2/2]

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

constructor with alternative propagator

Definition at line 15 of file AnalyticalImpactPointExtrapolator.cc.

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

Member Function Documentation

◆ extrapolate() [1/2]

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

extrapolation from FreeTrajectoryState

Definition at line 21 of file AnalyticalImpactPointExtrapolator.cc.

References extrapolateSingleState(), and extraflags_cff::vtx.

22  {
23  // static TimingReport::Item& timer = detailedDetTimer("AnalyticalImpactPointExtrapolator");
24  // TimeMe t(timer,false);
25 
26  return extrapolateSingleState(fts, vtx);
27 }
TrajectoryStateOnSurface extrapolateSingleState(const FreeTrajectoryState &fts, const GlobalPoint &vertex) const
extrapolation of (single) FTS

◆ extrapolate() [2/2]

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

as above, but from TrajectoryStateOnSurface

Definition at line 29 of file AnalyticalImpactPointExtrapolator.cc.

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

30  {
31  if (tsos.isValid())
32  return extrapolateFullState(tsos, vtx);
33  else
34  return tsos;
35 }
TrajectoryStateOnSurface extrapolateFullState(const TrajectoryStateOnSurface tsos, const GlobalPoint &vertex) const
extrapolation of (multi) TSOS

◆ extrapolateFullState()

TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolateFullState ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vertex 
) const
private

extrapolation of (multi) TSOS

Definition at line 37 of file AnalyticalImpactPointExtrapolator.cc.

References extrapolateSingleState(), TrajectoryStateOnSurface::freeTrajectoryState(), TrajectoryStateOnSurface::isValid(), Propagator::propagate(), TrajectoryStateOnSurface::singleState(), TrajectoryStateOnSurface::surface(), thePropagator, and bphysicsOniaDQM_cfi::vertex.

Referenced by extrapolate().

38  {
39  //
40  // first determine IP plane using propagation with (single) FTS
41  // could be optimised (will propagate errors even if duplicated below)
42  //
44  if (!singleState.isValid() || tsos.singleState())
45  return singleState;
46  //
47  // propagate multiTsos to plane found above
48  //
49  return thePropagator->propagate(tsos, singleState.surface());
50 }
TrajectoryStateOnSurface extrapolateSingleState(const FreeTrajectoryState &fts, const GlobalPoint &vertex) const
extrapolation of (single) FTS
const SurfaceType & surface() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
DeepCopyPointerByClone< Propagator > thePropagator

◆ extrapolateSingleState()

TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolateSingleState ( const FreeTrajectoryState fts,
const GlobalPoint vertex 
) const
private

extrapolation of (single) FTS

Definition at line 52 of file AnalyticalImpactPointExtrapolator.cc.

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

Referenced by extrapolate(), and extrapolateFullState().

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

◆ propagateWithHelix()

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 111 of file AnalyticalImpactPointExtrapolator.cc.

References IterativeHelixExtrapolatorToLine::direction(), Basic3DVector< T >::mag(), AlCaHLTBitMon_ParallelJobs::p, IterativeHelixExtrapolatorToLine::pathLength(), IterativeHelixExtrapolatorToLine::position(), alignCSCRings::s, bphysicsOniaDQM_cfi::vertex, and x.

Referenced by extrapolateSingleState().

115  {
116  //
117  // save absolute value of momentum
118  //
119  double pmag(p.mag());
120  //
121  // get path length to solution
122  //
123  std::pair<bool, double> propResult = extrapolator.pathLength(vertex);
124  if (!propResult.first)
125  return false;
126  s = propResult.second;
127  //
128  // get point and (normalised) direction from path length
129  //
130  HelixLineExtrapolation::PositionType xGen = extrapolator.position(s);
132  //
133  // Fix normalisation and convert back to GlobalPoint / GlobalVector
134  //
135  x = GlobalPoint(xGen);
136  pGen *= pmag / pGen.mag();
137  p = GlobalVector(pGen);
138  //
139  return true;
140 }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PositionType position(double s) const override
DirectionType direction(double s) const override
std::pair< bool, double > pathLength(const GlobalPoint &point) const override
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

◆ theField

const MagneticField* AnalyticalImpactPointExtrapolator::theField
private

Definition at line 53 of file AnalyticalImpactPointExtrapolator.h.

Referenced by extrapolateSingleState().

◆ thePropagator

DeepCopyPointerByClone<Propagator> AnalyticalImpactPointExtrapolator::thePropagator
private