CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

TransverseImpactPointExtrapolator Class Reference

#include <TransverseImpactPointExtrapolator.h>

List of all members.

Public Member Functions

TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
 extrapolation with default (=geometrical) propagator
TrajectoryStateOnSurface extrapolate (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
 as above, but from TrajectoryStateOnSurface
TrajectoryStateOnSurface extrapolate (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx) const
 as above, but from TrajectoryStateOnSurface
TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &fts, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation with user-supplied propagator
 TransverseImpactPointExtrapolator (const MagneticField *field)
 constructor with default geometrical propagator
 TransverseImpactPointExtrapolator ()
 constructor with default geometrical propagator
 TransverseImpactPointExtrapolator (const Propagator &u)
 constructor with user-supplied propagator

Private Member Functions

TrajectoryStateOnSurface doExtrapolation (const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation of (multi) TSOS with (internal or user-supplied) propagator
TrajectoryStateOnSurface doExtrapolation (const FreeTrajectoryState &fts, const GlobalPoint &vtx, const Propagator &u) const
 extrapolation of (single) FTS with (internal or user-supplied) propagator
ReferenceCountingPointer< PlanetipSurface (const GlobalPoint &position, const GlobalVector &momentum, const double &signedTransverseRadius, const GlobalPoint &vtx) const
 computation of the TIP surface

Private Attributes

DeepCopyPointerByClone
< Propagator
thePropagator

Detailed Description

Extrapolate to impact point with respect to vtx, i.e. point of closest approach to vtx in 2D. The surface of the returned TrajectoryStateOnSurface is chosen centred on vtx; the axes of the local coordinate system (x_loc, y_loc, z_loc) are z_loc // trajectory direction in transverse plane 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 25 of file TransverseImpactPointExtrapolator.h.


Constructor & Destructor Documentation

TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( )

constructor with default geometrical propagator

Definition at line 15 of file TransverseImpactPointExtrapolator.cc.

                                                                      :
  thePropagator(0) {}
TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( const MagneticField field)

constructor with default geometrical propagator

Definition at line 19 of file TransverseImpactPointExtrapolator.cc.

TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator ( const Propagator u)

constructor with user-supplied propagator

Definition at line 22 of file TransverseImpactPointExtrapolator.cc.

References anyDirection, and thePropagator.

                                                                                         :
  thePropagator(u.clone()) 
{
  thePropagator->setPropagationDirection(anyDirection);
}

Member Function Documentation

TrajectoryStateOnSurface TransverseImpactPointExtrapolator::doExtrapolation ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx,
const Propagator u 
) const [private]

extrapolation of (multi) TSOS with (internal or user-supplied) propagator

Definition at line 69 of file TransverseImpactPointExtrapolator.cc.

References Vector3DBase< T, FrameTag >::cross(), TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), LogDebug, PlaneBuilder::plane(), Propagator::propagate(), idealTransformation::rotation, tipSurface(), FreeTrajectoryState::transverseCurvature(), TrajectoryStateOnSurface::transverseCurvature(), csvLumiCalc::unit, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by extrapolate().

{
  //
  // Compute tip surface
  //
  if (fabs(tsos.freeState()->transverseCurvature())<1.E-6){
    LogDebug("TransverseImpactPointExtrapolator")<< "negligeable curvature: using a trick to extrapolate:\n"<<tsos;

    //0T field probably
    //x is perpendicular to the momentum
    GlobalVector xLocal = GlobalVector(-tsos.globalMomentum().y(),tsos.globalMomentum().x(),0).unit();
    //y along global Z
    GlobalVector yLocal(0.,0.,1.);
    //z accordingly
    GlobalVector zLocal(xLocal.cross(yLocal));

    Surface::PositionType origin(vtx);
    Surface::RotationType rotation(xLocal,yLocal,zLocal);
    ReferenceCountingPointer<Plane> surface =  PlaneBuilder().plane(origin,rotation);
    
    return p.propagate(*tsos.freeState(),*surface);
  }else{
  ReferenceCountingPointer<Plane> surface = 
    tipSurface(tsos.globalPosition(),tsos.globalMomentum(),
               1./tsos.transverseCurvature(),vtx);
  //
  // propagate
  //
  return p.propagate(tsos,*surface);
  }
}
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::doExtrapolation ( const FreeTrajectoryState fts,
const GlobalPoint vtx,
const Propagator u 
) const [private]

extrapolation of (single) FTS with (internal or user-supplied) propagator

Definition at line 104 of file TransverseImpactPointExtrapolator.cc.

References Vector3DBase< T, FrameTag >::cross(), LogDebug, FreeTrajectoryState::momentum(), PlaneBuilder::plane(), FreeTrajectoryState::position(), Propagator::propagate(), idealTransformation::rotation, tipSurface(), FreeTrajectoryState::transverseCurvature(), csvLumiCalc::unit, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

{
  //
  // Compute tip surface
  //
  if (fabs(fts.transverseCurvature())<1.E-6){
    LogDebug("TransverseImpactPointExtrapolator")<< "negligeable curvature: using a trick to extrapolate:\n"<<fts;

    //0T field probably
    //x is perpendicular to the momentum
    GlobalVector xLocal = GlobalVector(-fts.momentum().y(),fts.momentum().x(),0).unit();
    //y along global Z
    GlobalVector yLocal(0.,0.,1.);
    //z accordingly
    GlobalVector zLocal(xLocal.cross(yLocal));

    Surface::PositionType origin(vtx);
    Surface::RotationType rotation(xLocal,yLocal,zLocal);
    ReferenceCountingPointer<Plane> surface =  PlaneBuilder().plane(origin,rotation);
    
    return p.propagate(fts,*surface);
  }else{
  ReferenceCountingPointer<Plane> surface = 
    tipSurface(fts.position(),fts.momentum(),
               1./fts.transverseCurvature(),vtx);
  //
  // propagate
  //
  return p.propagate(fts,*surface);
  }
}
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const FreeTrajectoryState fts,
const GlobalPoint vtx 
) const
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx 
) const

as above, but from TrajectoryStateOnSurface

Definition at line 36 of file TransverseImpactPointExtrapolator.cc.

References doExtrapolation(), TrajectoryStateOnSurface::isValid(), and thePropagator.

{
  if ( !tsos.isValid() )  return tsos;
  return doExtrapolation(tsos, vtx, *thePropagator);
}
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const TrajectoryStateOnSurface  tsos,
const GlobalPoint vtx,
const Propagator u 
) const

as above, but from TrajectoryStateOnSurface

Definition at line 56 of file TransverseImpactPointExtrapolator.cc.

References anyDirection, doExtrapolation(), and TrajectoryStateOnSurface::isValid().

{
  if ( !tsos.isValid() )  return tsos;
  //
  // set propagator for bidirectional propagation
  //
  SetPropagationDirection setter(p,anyDirection);
  return doExtrapolation(tsos,vtx,p);
} 
TrajectoryStateOnSurface TransverseImpactPointExtrapolator::extrapolate ( const FreeTrajectoryState fts,
const GlobalPoint vtx,
const Propagator u 
) const

extrapolation with user-supplied propagator

Definition at line 44 of file TransverseImpactPointExtrapolator.cc.

References anyDirection, and doExtrapolation().

{
  //
  // set propagator for bidirectional propagation
  //
  SetPropagationDirection setter(p,anyDirection);
  return doExtrapolation(fts,vtx,p);
} 
ReferenceCountingPointer< Plane > TransverseImpactPointExtrapolator::tipSurface ( const GlobalPoint position,
const GlobalVector momentum,
const double &  signedTransverseRadius,
const GlobalPoint vtx 
) const [private]

computation of the TIP surface

Definition at line 139 of file TransverseImpactPointExtrapolator.cc.

References Vector3DBase< T, FrameTag >::cross(), LogDebug, PV2DBase< T, PVType, FrameType >::mag(), PlaneBuilder::plane(), idealTransformation::rotation, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by doExtrapolation().

{

  LogDebug("TransverseImpactPointExtrapolator")<< position<<"\n"
                                                    <<momentum<<"\n"
                                                    <<"signedTransverseRadius : "<<signedTransverseRadius<<"\n"
                                                    <<vertex;

  typedef Point2DBase<double,GlobalTag> PositionType2D;
  typedef Vector2DBase<double,GlobalTag> DirectionType2D;
  
  PositionType2D x0(position.x(),position.y());
  DirectionType2D t0(-momentum.y(),momentum.x());
  t0 = t0/t0.mag();

  PositionType2D xc(x0+signedTransverseRadius*t0);

  DirectionType2D vtxDirection(xc.x()-vertex.x(),xc.y()-vertex.y());
  double vtxDistance = vtxDirection.mag();

  Surface::PositionType origin(vertex);
  GlobalVector xLocal(vtxDirection.x()/vtxDistance,
                      vtxDirection.y()/vtxDistance,
                      0.);
  if ( vtxDistance<fabs(signedTransverseRadius) ) {
    LogDebug("TransverseImpactPointExtrapolator")<<"Inverting the x axis.";
    xLocal = -xLocal;
  }
  GlobalVector yLocal(0.,0.,1.);
  GlobalVector zLocal(xLocal.cross(yLocal));
  if ( zLocal.dot(momentum)<0. ) {
    LogDebug("TransverseImpactPointExtrapolator")<<"Inverting the y,z frame.";
    yLocal = -yLocal;
    zLocal = -zLocal;
  }
  Surface::RotationType rotation(xLocal,yLocal,zLocal);
  
  LogDebug("TransverseImpactPointExtrapolator")<<"plane center: "<<origin<<"\n"
                                               <<"plane rotation axis:\n"
                                               <<xLocal<<"\n"
                                               <<yLocal<<"\n"
                                               <<zLocal<<"\n"
                                               <<"x0: "<<x0<<"\n"
                                               <<"t0: "<<t0<<"\n"
                                               <<"xc: "<<xc<<"\n"
                                               <<"vtxDirection: "<<vtxDirection;

  return PlaneBuilder().plane(origin,rotation);
}

Member Data Documentation