CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

AnalyticalImpactPointExtrapolator Class Reference

#include <AnalyticalImpactPointExtrapolator.h>

List of all members.

Public Member Functions

 AnalyticalImpactPointExtrapolator (const MagneticField *field)
 constructor with default geometrical propagator
 AnalyticalImpactPointExtrapolator (const Propagator &, const MagneticField *)
 constructor with alternative propagator
TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
 extrapolation from FreeTrajectoryState
TrajectoryStateOnSurface extrapolate (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx) const
 as above, but from TrajectoryStateOnSurface

Private Member Functions

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

Private Attributes

const MagneticFieldtheField
DeepCopyPointerByClone
< Propagator
thePropagator

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

constructor with default geometrical propagator

Definition at line 12 of file AnalyticalImpactPointExtrapolator.cc.

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

constructor with alternative propagator

Definition at line 17 of file AnalyticalImpactPointExtrapolator.cc.

References anyDirection, and thePropagator.

                                                                                                  :
  thePropagator(propagator.clone()),
  theField(field)
{
  thePropagator->setPropagationDirection(anyDirection);
}

Member Function Documentation

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

extrapolation from FreeTrajectoryState

Definition at line 26 of file AnalyticalImpactPointExtrapolator.cc.

References extrapolateSingleState().

{
//   static TimingReport::Item& timer = detailedDetTimer("AnalyticalImpactPointExtrapolator");
//   TimeMe t(timer,false);

  return extrapolateSingleState(fts, vtx);
}
TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolate ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx 
) const

as above, but from TrajectoryStateOnSurface

Definition at line 36 of file AnalyticalImpactPointExtrapolator.cc.

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

{
  if ( tsos.isValid() )  return extrapolateFullState(tsos,vtx);
  else  return tsos;
}
TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolateFullState ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vertex 
) const [private]

extrapolation of (multi) TSOS

Definition at line 44 of file AnalyticalImpactPointExtrapolator.cc.

References TrajectoryStateOnSurface::components(), extrapolateSingleState(), TrajectoryStateOnSurface::freeTrajectoryState(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::surface(), and thePropagator.

Referenced by extrapolate().

{
  //
  // first determine IP plane using propagation with (single) FTS
  // could be optimised (will propagate errors even if duplicated below)
  //
  TrajectoryStateOnSurface singleState = 
    extrapolateSingleState(*tsos.freeTrajectoryState(),vertex);
  if ( !singleState.isValid() || tsos.components().size()==1 )  return singleState;
  //
  // propagate multiTsos to plane found above
  //
  return thePropagator->propagate(tsos,singleState.surface());
}
TrajectoryStateOnSurface AnalyticalImpactPointExtrapolator::extrapolateSingleState ( const FreeTrajectoryState fts,
const GlobalPoint vertex 
) const [private]

extrapolation of (single) FTS

Definition at line 61 of file AnalyticalImpactPointExtrapolator.cc.

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

Referenced by extrapolate(), and extrapolateFullState().

{
  //
  // initialisation of position, momentum and transverse curvature
  //
  GlobalPoint x(fts.position());
  GlobalVector p(fts.momentum());
  double rho = fts.transverseCurvature();
  //
  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um 
  // difference in transversal position at 10m.
  //
  double s(0);
  if( fabs(rho)<1.e-10 ) {
    GlobalVector dx(p.dot(vertex-x)/p.mag2()*p);
    x += dx;
    float sign = p.dot(dx);
    s = sign>0 ? dx.mag() : -dx.mag();
  }
  //
  // Helix case 
  //
  else {
    HelixLineExtrapolation::PositionType helixPos(x);
    HelixLineExtrapolation::DirectionType helixDir(p);
    IterativeHelixExtrapolatorToLine extrapolator(helixPos,helixDir,rho,anyDirection);
    if ( !propagateWithHelix(extrapolator,vertex,x,p,s) )  return TrajectoryStateOnSurface();
  }
  //
  // Define target surface: origin on line, x_local from line 
  //   to helix at closest approach, z_local along the helix
  //   and y_local to complete right-handed system
  //
  GlobalVector zLocal(p.unit());
  GlobalVector yLocal(zLocal.cross(x-vertex).unit());
  GlobalVector xLocal(yLocal.cross(zLocal));
  Surface::RotationType rot(xLocal,yLocal,zLocal);
  PlaneBuilder::ReturnType surface = PlaneBuilder().plane(vertex,rot);
  //
  // Compute propagated state
  //
  GlobalTrajectoryParameters gtp(x,p,fts.charge(), theField);
  if (fts.hasError()) {
    //
    // compute jacobian
    //
    AnalyticalCurvilinearJacobian analyticalJacobian(fts.parameters(), gtp.position(), gtp.momentum(), s);
    CurvilinearTrajectoryError cte( ROOT::Math::Similarity( analyticalJacobian.jacobian(), 
                                                            fts.curvilinearError().matrix()) );
    return TrajectoryStateOnSurface(gtp,cte,*surface);
  }
  else {
    //
    // return state without errors
    //
    return TrajectoryStateOnSurface(gtp,*surface);
  }
}
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 122 of file AnalyticalImpactPointExtrapolator.cc.

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

Referenced by extrapolateSingleState().

                                                                                                         {
  //
  // save absolute value of momentum
  //
  double pmag(p.mag());
  //
  // get path length to solution
  //
  std::pair<bool,double> propResult = extrapolator.pathLength(vertex);
  if ( !propResult.first )  return false;
  s = propResult.second;
  // 
  // get point and (normalised) direction from path length
  //
  HelixLineExtrapolation::PositionType xGen = extrapolator.position(s);
  HelixLineExtrapolation::DirectionType pGen = extrapolator.direction(s);
  //
  // Fix normalisation and convert back to GlobalPoint / GlobalVector
  //
  x = GlobalPoint(xGen);
  pGen *= pmag/pGen.mag();
  p = GlobalVector(pGen);
  //
  return true;
}

Member Data Documentation

Definition at line 57 of file AnalyticalImpactPointExtrapolator.h.

Referenced by extrapolateSingleState().