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
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
< Propagator
thePropagator
 

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::AnalyticalTrajectoryExtrapolatorToLine ( const MagneticField field)

constructor with default geometrical propagator

Definition at line 15 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

AnalyticalTrajectoryExtrapolatorToLine::AnalyticalTrajectoryExtrapolatorToLine ( const Propagator propagator)

constructor with alternative propagator

Definition at line 19 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

References anyDirection.

19  : thePropagator(propagator.clone())
20 {
22 }
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:144
virtual Propagator * clone() const =0

Member Function Documentation

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

extrapolation from FreeTrajectoryState

Definition at line 25 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

References extrapolateSingleState().

Referenced by SignedDecayLength3D::closestApproachToJet(), SignedImpactParameter3D::closestApproachToJet(), and IPTools::closestApproachToJet().

27 {
28  return extrapolateSingleState(fts,line);
29 }
TrajectoryStateOnSurface extrapolateSingleState(const FreeTrajectoryState &fts, const Line &line) const
extrapolation of (single) FTS
TrajectoryStateOnSurface AnalyticalTrajectoryExtrapolatorToLine::extrapolate ( const TrajectoryStateOnSurface  tsos,
const Line L 
) const

extrapolation from TrajectoryStateOnSurface

Definition at line 32 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

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

34 {
35  if ( tsos.isValid() ) return extrapolateFullState(tsos,line);
36  else return tsos;
37 }
TrajectoryStateOnSurface extrapolateFullState(const TrajectoryStateOnSurface tsos, const Line &line) const
extrapolation of (multi) TSOS
TrajectoryStateOnSurface AnalyticalTrajectoryExtrapolatorToLine::extrapolateFullState ( const TrajectoryStateOnSurface  tsos,
const Line line 
) const
private

extrapolation of (multi) TSOS

Definition at line 40 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

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

Referenced by extrapolate().

42 {
43  //
44  // first determine IP plane using propagation with (single) FTS
45  // could be optimised (will propagate errors even if duplicated below)
46  //
47  TrajectoryStateOnSurface singleState =
49  if ( !singleState.isValid() || tsos.components().size()==1 ) return singleState;
50  //
51  // propagate multiTsos to plane found above
52  //
53  return thePropagator->propagate(tsos,singleState.surface());
54 }
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:119
const SurfaceType & surface() const
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
TrajectoryStateOnSurface extrapolateSingleState(const FreeTrajectoryState &fts, const Line &line) const
extrapolation of (single) FTS
std::vector< TrajectoryStateOnSurface > components() const
TrajectoryStateOnSurface AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState ( const FreeTrajectoryState fts,
const Line line 
) const
private

extrapolation of (single) FTS

Definition at line 57 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

References anyDirection, FreeTrajectoryState::charge(), Line::closerPointToLine(), FreeTrajectoryState::curvilinearError(), alignCSCRings::e, FreeTrajectoryState::hasError(), AnalyticalCurvilinearJacobian::jacobian(), PV3DBase< T, PVType, FrameType >::mag(), Propagator::magneticField(), CurvilinearTrajectoryError::matrix(), FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::parameters(), PlaneBuilder::plane(), GlobalTrajectoryParameters::position(), FreeTrajectoryState::position(), propagateWithHelix(), rho, makeMuonMisalignmentScenario::rot, alignCSCRings::s, thePropagator, FreeTrajectoryState::transverseCurvature(), and x.

Referenced by extrapolate(), and extrapolateFullState().

59 {
60 // static TimingReport::Item& timer = detailedDetTimer("AnalyticalTrajectoryExtrapolatorToLine");
61 // TimeMe t(timer,false);
62  //
63  // initialisation of position, momentum and transverse curvature
64  //
65  GlobalPoint x(fts.position());
66  GlobalVector p(fts.momentum());
67  double rho = fts.transverseCurvature();
68  //
69  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um
70  // difference in transversal position at 10m.
71  //
72  double s(0);
73  if( fabs(rho)<1.e-10 ) {
74  Line tangent(x,p);
75  GlobalPoint xold(x);
76  x = tangent.closerPointToLine(line);
77  GlobalVector dx(x-xold);
78  float sign = p.dot(x-xold);
79  s = sign>0 ? dx.mag() : -dx.mag();
80  }
81  //
82  // Helix case
83  //
84  else {
87  IterativeHelixExtrapolatorToLine extrapolator(helixPos,helixDir,rho,anyDirection);
88  if ( !propagateWithHelix(extrapolator,line,x,p,s) ) return TrajectoryStateOnSurface();
89  }
90  //
91  // Define target surface: origin on line, x_local from line
92  // to helix at closest approach, z_local along the helix
93  // and y_local to complete right-handed system
94  //
95  GlobalPoint origin(line.closerPointToLine(Line(x,p)));
96  GlobalVector zLocal(p.unit());
97  GlobalVector yLocal(zLocal.cross(x-origin).unit());
98  GlobalVector xLocal(yLocal.cross(zLocal));
99  Surface::RotationType rot(xLocal,yLocal,zLocal);
100  PlaneBuilder::ReturnType surface = PlaneBuilder().plane(origin,rot);
101  //
102  // Compute propagated state
103  //
105  if (fts.hasError()) {
106  //
107  // compute jacobian
108  //
109  AnalyticalCurvilinearJacobian analyticalJacobian(fts.parameters(), gtp.position(), gtp.momentum(), s);
110  const AlgebraicMatrix55 &jacobian = analyticalJacobian.jacobian();
111  CurvilinearTrajectoryError cte( ROOT::Math::Similarity (jacobian, fts.curvilinearError().matrix()) );
112  return TrajectoryStateOnSurface(gtp,cte,*surface);
113  }
114  else {
115  //
116  // return state without errors
117  //
118  return TrajectoryStateOnSurface(gtp,*surface);
119  }
120 }
const GlobalTrajectoryParameters & parameters() const
Definition: Line.h:10
const AlgebraicMatrix55 & jacobian() const
Definition: DDAxes.h:10
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:22
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
GlobalVector momentum() const
GlobalPoint position() const
GlobalPoint closerPointToLine(const Line &aLine) const
Definition: Line.h:29
double transverseCurvature() const
virtual const MagneticField * magneticField() const =0
const AlgebraicSymMatrix55 & matrix() const
Definition: DDAxes.h:10
bool propagateWithHelix(const IterativeHelixExtrapolatorToLine &extrapolator, const Line &line, GlobalPoint &x, GlobalVector &p, double &s) const
the actual propagation to a new point &amp; momentum vector
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
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 123 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

References IterativeHelixExtrapolatorToLine::direction(), PV3DBase< T, PVType, FrameType >::mag(), Basic3DVector< T >::mag(), IterativeHelixExtrapolatorToLine::pathLength(), and IterativeHelixExtrapolatorToLine::position().

Referenced by extrapolateSingleState().

125  {
126  //
127  // save absolute value of momentum
128  //
129  double pmag(p.mag());
130  //
131  // get path length to solution
132  //
133  std::pair<bool,double> propResult = extrapolator.pathLength(line);
134  if ( !propResult.first ) return false;
135  s = propResult.second;
136  //
137  // get point and (normalised) direction from path length
138  //
139  HelixLineExtrapolation::PositionType xGen = extrapolator.position(s);
141  //
142  // Fix normalisation and convert back to GlobalPoint / GlobalVector
143  //
144  x = GlobalPoint(xGen);
145  pGen *= pmag/pGen.mag();
146  p = GlobalVector(pGen);
147  //
148  return true;
149 }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual PositionType position(double s) const
virtual DirectionType direction(double s) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual std::pair< bool, double > pathLength(const GlobalPoint &point) const
T mag() const
Definition: PV3DBase.h:67
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

DeepCopyPointerByClone<Propagator> AnalyticalTrajectoryExtrapolatorToLine::thePropagator
private