CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
AnalyticalTrajectoryExtrapolatorToLine Class Reference

#include <AnalyticalTrajectoryExtrapolatorToLine.h>

Public Member Functions

 AnalyticalTrajectoryExtrapolatorToLine (const MagneticField *field)
 constructor with default geometrical propagator More...
 
 AnalyticalTrajectoryExtrapolatorToLine (const Propagator &)
 constructor with alternative propagator More...
 
TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &fts, const Line &L) const
 extrapolation from FreeTrajectoryState More...
 
TrajectoryStateOnSurface extrapolate (const TrajectoryStateOnSurface tsos, const Line &L) const
 extrapolation from TrajectoryStateOnSurface More...
 

Private Member Functions

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

Private Attributes

DeepCopyPointerByClone< PropagatorthePropagator
 

Detailed Description

Extrapolate to the closest approach w.r.t. a line. This class is faster than the TrajectoryExtrapolatorToLine. The helix model is explicitely used in the determination of the target surface. This target surface is centered on the point of closest approach on the line. The axes of the local coordinate system (x_loc, y_loc, z_loc) are z_loc // trajectory direction at point of closest approach; x_loc normal to trajectory and along impact vector (line->helix); y_loc forms a right-handed system with the other axes.

Definition at line 28 of file AnalyticalTrajectoryExtrapolatorToLine.h.

Constructor & Destructor Documentation

◆ AnalyticalTrajectoryExtrapolatorToLine() [1/2]

AnalyticalTrajectoryExtrapolatorToLine::AnalyticalTrajectoryExtrapolatorToLine ( const MagneticField field)

constructor with default geometrical propagator

Definition at line 14 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

◆ AnalyticalTrajectoryExtrapolatorToLine() [2/2]

AnalyticalTrajectoryExtrapolatorToLine::AnalyticalTrajectoryExtrapolatorToLine ( const Propagator propagator)

constructor with alternative propagator

Definition at line 17 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

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

Member Function Documentation

◆ extrapolate() [1/2]

TrajectoryStateOnSurface AnalyticalTrajectoryExtrapolatorToLine::extrapolate ( const FreeTrajectoryState fts,
const Line L 
) const

◆ extrapolate() [2/2]

TrajectoryStateOnSurface AnalyticalTrajectoryExtrapolatorToLine::extrapolate ( const TrajectoryStateOnSurface  tsos,
const Line L 
) const

extrapolation from TrajectoryStateOnSurface

Definition at line 27 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

28  {
29  if (tsos.isValid())
30  return extrapolateFullState(tsos, line);
31  else
32  return tsos;
33 }

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

◆ extrapolateFullState()

TrajectoryStateOnSurface AnalyticalTrajectoryExtrapolatorToLine::extrapolateFullState ( const TrajectoryStateOnSurface  tsos,
const Line line 
) const
private

extrapolation of (multi) TSOS

Definition at line 35 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

36  {
37  //
38  // first determine IP plane using propagation with (single) FTS
39  // could be optimised (will propagate errors even if duplicated below)
40  //
42  if (!singleState.isValid() || tsos.singleState())
43  return singleState;
44  //
45  // propagate multiTsos to plane found above
46  //
47  return thePropagator->propagate(tsos, singleState.surface());
48 }

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

Referenced by extrapolate().

◆ extrapolateSingleState()

TrajectoryStateOnSurface AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState ( const FreeTrajectoryState fts,
const Line line 
) const
private

extrapolation of (single) FTS

Definition at line 50 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

51  {
52  // static TimingReport::Item& timer = detailedDetTimer("AnalyticalTrajectoryExtrapolatorToLine");
53  // TimeMe t(timer,false);
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  Line tangent(x, p);
67  GlobalPoint xold(x);
68  x = tangent.closerPointToLine(line);
69  GlobalVector dx(x - xold);
70  float sign = p.dot(x - xold);
71  s = sign > 0 ? dx.mag() : -dx.mag();
72  }
73  //
74  // Helix case
75  //
76  else {
79  IterativeHelixExtrapolatorToLine extrapolator(helixPos, helixDir, rho, anyDirection);
80  if (!propagateWithHelix(extrapolator, line, x, p, s))
81  return TrajectoryStateOnSurface();
82  }
83  //
84  // Define target surface: origin on line, x_local from line
85  // to helix at closest approach, z_local along the helix
86  // and y_local to complete right-handed system
87  //
88  GlobalPoint origin(line.closerPointToLine(Line(x, p)));
89  GlobalVector zLocal(p.unit());
90  GlobalVector yLocal(zLocal.cross(x - origin).unit());
91  GlobalVector xLocal(yLocal.cross(zLocal));
92  Surface::RotationType rot(xLocal, yLocal, zLocal);
93  PlaneBuilder::ReturnType surface = PlaneBuilder().plane(origin, rot);
94  //
95  // Compute propagated state
96  //
98  if (fts.hasError()) {
99  //
100  // compute jacobian
101  //
102  AnalyticalCurvilinearJacobian analyticalJacobian(fts.parameters(), gtp.position(), gtp.momentum(), s);
103  const AlgebraicMatrix55& jacobian = analyticalJacobian.jacobian();
104  CurvilinearTrajectoryError cte(ROOT::Math::Similarity(jacobian, fts.curvilinearError().matrix()));
105  return TrajectoryStateOnSurface(gtp, cte, *surface);
106  } else {
107  //
108  // return state without errors
109  //
110  return TrajectoryStateOnSurface(gtp, *surface);
111  }
112 }

References anyDirection, FreeTrajectoryState::charge(), Line::closerPointToLine(), FreeTrajectoryState::curvilinearError(), PVValHelper::dx, MillePedeFileConverter_cfg::e, FreeTrajectoryState::hasError(), AnalyticalCurvilinearJacobian::jacobian(), mps_splice::line, Propagator::magneticField(), 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, thePropagator, FreeTrajectoryState::transverseCurvature(), and x.

Referenced by extrapolate(), and extrapolateFullState().

◆ propagateWithHelix()

bool AnalyticalTrajectoryExtrapolatorToLine::propagateWithHelix ( const IterativeHelixExtrapolatorToLine extrapolator,
const Line line,
GlobalPoint x,
GlobalVector p,
double &  s 
) const
private

the actual propagation to a new point & momentum vector

Definition at line 114 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

118  {
119  //
120  // save absolute value of momentum
121  //
122  double pmag(p.mag());
123  //
124  // get path length to solution
125  //
126  std::pair<bool, double> propResult = extrapolator.pathLength(line);
127  if (!propResult.first)
128  return false;
129  s = propResult.second;
130  //
131  // get point and (normalised) direction from path length
132  //
133  HelixLineExtrapolation::PositionType xGen = extrapolator.position(s);
135  //
136  // Fix normalisation and convert back to GlobalPoint / GlobalVector
137  //
138  x = GlobalPoint(xGen);
139  pGen *= pmag / pGen.mag();
140  p = GlobalVector(pGen);
141  //
142  return true;
143 }

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

Referenced by extrapolateSingleState().

Member Data Documentation

◆ thePropagator

DeepCopyPointerByClone<Propagator> AnalyticalTrajectoryExtrapolatorToLine::thePropagator
private
Vector3DBase
Definition: Vector3DBase.h:8
TkRotation< float >
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
TrajectoryStateOnSurface::freeTrajectoryState
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:60
anyDirection
Definition: PropagationDirection.h:4
AnalyticalCurvilinearJacobian::jacobian
const AlgebraicMatrix55 & jacobian() const
Definition: AnalyticalCurvilinearJacobian.h:51
AnalyticalCurvilinearJacobian
Definition: AnalyticalCurvilinearJacobian.h:21
FreeTrajectoryState::hasError
bool hasError() const
Definition: FreeTrajectoryState.h:77
GlobalTrajectoryParameters::position
GlobalPoint position() const
Definition: GlobalTrajectoryParameters.h:60
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FreeTrajectoryState::charge
TrackCharge charge() const
Definition: FreeTrajectoryState.h:69
IterativeHelixExtrapolatorToLine
Definition: IterativeHelixExtrapolatorToLine.h:13
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
IterativeHelixExtrapolatorToLine::pathLength
std::pair< bool, double > pathLength(const GlobalPoint &point) const override
Definition: IterativeHelixExtrapolatorToLine.cc:37
ReferenceCountingPointer< Plane >
DDAxes::x
Propagator::magneticField
virtual const MagneticField * magneticField() const =0
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
Basic3DVector::mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: extBasic3DVector.h:116
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
AlgebraicMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
Definition: AlgebraicROOTObjects.h:55
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
FreeTrajectoryState::curvilinearError
const CurvilinearTrajectoryError & curvilinearError() const
Definition: FreeTrajectoryState.h:89
IterativeHelixExtrapolatorToLine::position
PositionType position(double s) const override
Definition: IterativeHelixExtrapolatorToLine.cc:128
AnalyticalTrajectoryExtrapolatorToLine::propagateWithHelix
bool propagateWithHelix(const IterativeHelixExtrapolatorToLine &extrapolator, const Line &line, GlobalPoint &x, GlobalVector &p, double &s) const
the actual propagation to a new point & momentum vector
Definition: AnalyticalTrajectoryExtrapolatorToLine.cc:114
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
Propagator::setPropagationDirection
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
DDAxes::rho
AnalyticalPropagator_cfi.AnalyticalPropagator
AnalyticalPropagator
Definition: AnalyticalPropagator_cfi.py:3
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
Line
Definition: Line.h:10
AnalyticalTrajectoryExtrapolatorToLine::extrapolateFullState
TrajectoryStateOnSurface extrapolateFullState(const TrajectoryStateOnSurface tsos, const Line &line) const
extrapolation of (multi) TSOS
Definition: AnalyticalTrajectoryExtrapolatorToLine.cc:35
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
PlaneBuilder::plane
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:21
TrajectoryStateOnSurface::singleState
bool singleState() const
Definition: TrajectoryStateOnSurface.h:86
AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState
TrajectoryStateOnSurface extrapolateSingleState(const FreeTrajectoryState &fts, const Line &line) const
extrapolation of (single) FTS
Definition: AnalyticalTrajectoryExtrapolatorToLine.cc:50
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
IterativeHelixExtrapolatorToLine::direction
DirectionType direction(double s) const override
Definition: IterativeHelixExtrapolatorToLine.cc:174
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
PlaneBuilder
Definition: PlaneBuilder.h:13
mps_splice.line
line
Definition: mps_splice.py:76
PVValHelper::dx
Definition: PVValidationHelpers.h:48
FreeTrajectoryState::transverseCurvature
double transverseCurvature() const
Definition: FreeTrajectoryState.h:71
Basic3DVector< float >
CurvilinearTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: CurvilinearTrajectoryError.h:61
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
AnalyticalTrajectoryExtrapolatorToLine::thePropagator
DeepCopyPointerByClone< Propagator > thePropagator
Definition: AnalyticalTrajectoryExtrapolatorToLine.h:56
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37