CMS 3D CMS Logo

AnalyticalTrajectoryExtrapolatorToLine Class Reference

Extrapolate to the closest approach w.r.t. More...

#include <TrackingTools/GeomPropagators/interface/AnalyticalTrajectoryExtrapolatorToLine.h>

List of all members.

Public Member Functions

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

Private Member Functions

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

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

00015                                                                                                           :
00016   thePropagator(new AnalyticalPropagator(field, anyDirection)) {}

AnalyticalTrajectoryExtrapolatorToLine::AnalyticalTrajectoryExtrapolatorToLine ( const Propagator propagator  ) 

constructor with alternative propagator

Definition at line 19 of file AnalyticalTrajectoryExtrapolatorToLine.cc.

References anyDirection, and thePropagator.

00019                                : thePropagator(propagator.clone()) 
00020 {
00021   thePropagator->setPropagationDirection(anyDirection);
00022 }


Member Function Documentation

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

00034 {
00035   if ( tsos.isValid() )  return extrapolateFullState(tsos,line);
00036   else  return tsos;
00037 }

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 IPTools::closestApproachToJet(), SignedDecayLength3D::closestApproachToJet(), and SignedImpactParameter3D::closestApproachToJet().

00027 {
00028   return extrapolateSingleState(fts,line);
00029 }

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(), TrajectoryStateOnSurface::surface(), and thePropagator.

Referenced by extrapolate().

00042 {
00043   //
00044   // first determine IP plane using propagation with (single) FTS
00045   // could be optimised (will propagate errors even if duplicated below)
00046   //
00047   TrajectoryStateOnSurface singleState = 
00048     extrapolateSingleState(*tsos.freeTrajectoryState(),line);
00049   if ( !singleState.isValid() || tsos.components().size()==1 )  return singleState;
00050   //
00051   // propagate multiTsos to plane found above
00052   //
00053   return thePropagator->propagate(tsos,singleState.surface());
00054 }

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(), e, FreeTrajectoryState::hasError(), PV3DBase< T, PVType, FrameType >::mag(), CurvilinearTrajectoryError::matrix(), FreeTrajectoryState::momentum(), origin, p, FreeTrajectoryState::parameters(), GlobalTrajectoryParameters::position(), FreeTrajectoryState::position(), propagateWithHelix(), rho, rot, s, thePropagator, FreeTrajectoryState::transverseCurvature(), and x.

Referenced by extrapolate(), and extrapolateFullState().

00059 {
00060 //   static TimingReport::Item& timer = detailedDetTimer("AnalyticalTrajectoryExtrapolatorToLine");
00061 //   TimeMe t(timer,false);
00062   //
00063   // initialisation of position, momentum and transverse curvature
00064   //
00065   GlobalPoint x(fts.position());
00066   GlobalVector p(fts.momentum());
00067   double rho = fts.transverseCurvature();
00068   //
00069   // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um 
00070   // difference in transversal position at 10m.
00071   //
00072   double s(0);
00073   if( fabs(rho)<1.e-10 ) {
00074     Line tangent(x,p);
00075     GlobalPoint xold(x);
00076     x = tangent.closerPointToLine(line);
00077     GlobalVector dx(x-xold);
00078     float sign = p.dot(x-xold);
00079     s = sign>0 ? dx.mag() : -dx.mag();
00080   }
00081   //
00082   // Helix case 
00083   //
00084   else {
00085     HelixLineExtrapolation::PositionType helixPos(x);
00086     HelixLineExtrapolation::DirectionType helixDir(p);
00087     IterativeHelixExtrapolatorToLine extrapolator(helixPos,helixDir,rho,anyDirection);
00088     if ( !propagateWithHelix(extrapolator,line,x,p,s) )  return TrajectoryStateOnSurface();
00089   }
00090   //
00091   // Define target surface: origin on line, x_local from line 
00092   //   to helix at closest approach, z_local along the helix
00093   //   and y_local to complete right-handed system
00094   //
00095   GlobalPoint origin(line.closerPointToLine(Line(x,p)));
00096   GlobalVector zLocal(p.unit());
00097   GlobalVector yLocal(zLocal.cross(x-origin).unit());
00098   GlobalVector xLocal(yLocal.cross(zLocal));
00099   Surface::RotationType rot(xLocal,yLocal,zLocal);
00100   PlaneBuilder::ReturnType surface = PlaneBuilder().plane(origin,rot);
00101   //
00102   // Compute propagated state
00103   //
00104   GlobalTrajectoryParameters gtp(x,p,fts.charge(), thePropagator->magneticField());
00105   if (fts.hasError()) {
00106     //
00107     // compute jacobian
00108     //
00109     AnalyticalCurvilinearJacobian analyticalJacobian(fts.parameters(), gtp.position(), gtp.momentum(), s);
00110     const AlgebraicMatrix55 &jacobian = analyticalJacobian.jacobian();
00111     CurvilinearTrajectoryError cte( ROOT::Math::Similarity (jacobian, fts.curvilinearError().matrix()) );
00112     return TrajectoryStateOnSurface(gtp,cte,*surface);
00113   }
00114   else {
00115     //
00116     // return state without errors
00117     //
00118     return TrajectoryStateOnSurface(gtp,*surface);
00119   }
00120 }

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

00125                                                                                                               {
00126   //
00127   // save absolute value of momentum
00128   //
00129   double pmag(p.mag());
00130   //
00131   // get path length to solution
00132   //
00133   std::pair<bool,double> propResult = extrapolator.pathLength(line);
00134   if ( !propResult.first )  return false;
00135   s = propResult.second;
00136   // 
00137   // get point and (normalised) direction from path length
00138   //
00139   HelixLineExtrapolation::PositionType xGen = extrapolator.position(s);
00140   HelixLineExtrapolation::DirectionType pGen = extrapolator.direction(s);
00141   //
00142   // Fix normalisation and convert back to GlobalPoint / GlobalVector
00143   //
00144   x = GlobalPoint(xGen);
00145   pGen *= pmag/pGen.mag();
00146   p = GlobalVector(pGen);
00147   //
00148   return true;
00149 }


Member Data Documentation

DeepCopyPointerByClone<Propagator> AnalyticalTrajectoryExtrapolatorToLine::thePropagator [private]

Definition at line 56 of file AnalyticalTrajectoryExtrapolatorToLine.h.

Referenced by AnalyticalTrajectoryExtrapolatorToLine(), extrapolateFullState(), and extrapolateSingleState().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:40 2009 for CMSSW by  doxygen 1.5.4