CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions

TrackKinematicStatePropagator Class Reference

#include <TrackKinematicStatePropagator.h>

Inheritance diagram for TrackKinematicStatePropagator:
KinematicStatePropagator

List of all members.

Public Member Functions

virtual KinematicStatePropagatorclone () const
virtual std::pair
< HelixBarrelPlaneCrossingByCircle,
BoundPlane::BoundPlanePointer
planeCrossing (const FreeTrajectoryState &par, const GlobalPoint &point) const
virtual KinematicState propagateToTheTransversePCA (const KinematicState &state, const GlobalPoint &referencePoint) const
 TrackKinematicStatePropagator ()
virtual ~TrackKinematicStatePropagator ()

Private Types

typedef Point3DBase< double,
GlobalTag
GlobalPointDouble
typedef Vector3DBase< double,
GlobalTag
GlobalVectorDouble

Private Member Functions

virtual KinematicState propagateToTheTransversePCACharged (const KinematicState &state, const GlobalPoint &referencePoint) const
virtual KinematicState propagateToTheTransversePCANeutral (const KinematicState &state, const GlobalPoint &referencePoint) const

Detailed Description

Propagator for TransientTrack based KinematicStates. Does not include the material.

Definition at line 18 of file TrackKinematicStatePropagator.h.


Member Typedef Documentation

Definition at line 53 of file TrackKinematicStatePropagator.h.

Definition at line 54 of file TrackKinematicStatePropagator.h.


Constructor & Destructor Documentation

TrackKinematicStatePropagator::TrackKinematicStatePropagator ( ) [inline]

Definition at line 22 of file TrackKinematicStatePropagator.h.

Referenced by clone().

{}
virtual TrackKinematicStatePropagator::~TrackKinematicStatePropagator ( ) [inline, virtual]

Definition at line 24 of file TrackKinematicStatePropagator.h.

{}

Member Function Documentation

virtual KinematicStatePropagator* TrackKinematicStatePropagator::clone ( void  ) const [inline, virtual]

Clone method reimplemented from abstract class

Implements KinematicStatePropagator.

Definition at line 40 of file TrackKinematicStatePropagator.h.

References TrackKinematicStatePropagator().

 {return new TrackKinematicStatePropagator(*this);}
pair< HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer > TrackKinematicStatePropagator::planeCrossing ( const FreeTrajectoryState par,
const GlobalPoint point 
) const [virtual]

Definition at line 23 of file TrackKinematicStatePropagator.cc.

References anyDirection, newFWLiteAna::build, FreeTrajectoryState::charge(), MagneticField::inInverseGeV(), GlobalTrajectoryParameters::magneticField(), FreeTrajectoryState::momentum(), FreeTrajectoryState::parameters(), pos, FreeTrajectoryState::position(), makeMuonMisalignmentScenario::rot, FreeTrajectoryState::transverseCurvature(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), X, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

{
 GlobalPoint inPos = state.position();
 GlobalVector inMom = state.momentum();
 double kappa = state.transverseCurvature();
 double fac = 1./state.charge()/state.parameters().magneticField().inInverseGeV(point).z();
 
 GlobalVectorDouble xOrig2Centre = GlobalVectorDouble(fac * inMom.y(), -fac * inMom.x(), 0.);
 GlobalVectorDouble xOrigProj = GlobalVectorDouble(inPos.x(), inPos.y(), 0.);
 GlobalVectorDouble xRefProj = GlobalVectorDouble(point.x(), point.y(), 0.);
 GlobalVectorDouble deltax = xRefProj-xOrigProj-xOrig2Centre;
 GlobalVectorDouble ndeltax = deltax.unit();
  
 PropagationDirection direction = anyDirection;
 Surface::PositionType pos(point);
  
// Need to define plane with orientation as the ImpactPointSurface
 GlobalVector X(ndeltax.x(), ndeltax.y(), ndeltax.z());
 GlobalVector Y(0.,0.,1.);
 Surface::RotationType rot(X,Y);
 BoundPlane::BoundPlanePointer plane = BoundPlane::build(pos,rot,OpenBounds());
 HelixBarrelPlaneCrossingByCircle 
   planeCrossing(HelixPlaneCrossing::PositionType(inPos.x(), inPos.y(), inPos.z()),
                 HelixPlaneCrossing::DirectionType(inMom.x(), inMom.y(), inMom.z()), 
                 kappa, direction);
 return std::pair<HelixBarrelPlaneCrossingByCircle,BoundPlane::BoundPlanePointer>(planeCrossing,plane);
}
KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCA ( const KinematicState state,
const GlobalPoint referencePoint 
) const [virtual]

Propagation to the point of closest approach in transverse plane to the given point

Implements KinematicStatePropagator.

Definition at line 13 of file TrackKinematicStatePropagator.cc.

References KinematicState::particleCharge().

{
 if( state.particleCharge() == 0. ) {
    return propagateToTheTransversePCANeutral(state, referencePoint);
  } else {
    return propagateToTheTransversePCACharged(state, referencePoint);
  }
}
KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCACharged ( const KinematicState state,
const GlobalPoint referencePoint 
) const [private, virtual]

Internal private methods, distinguishing between the propagation of neutrals and propagation of cahrged tracks.

Definition at line 55 of file TrackKinematicStatePropagator.cc.

References HelixBarrelPlaneCrossingByCircle::direction(), KinematicState::freeTrajectoryState(), KinematicState::globalMomentum(), KinematicState::globalPosition(), JacobianCurvilinearToCartesian::jacobian(), KinematicState::kinematicParametersError(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), KinematicState::magneticField(), KinematicState::mass(), KinematicParametersError::matrix(), KinematicState::particleCharge(), HelixBarrelPlaneCrossingByCircle::pathLength(), HelixBarrelPlaneCrossingByCircle::position(), alignCSCRings::s, PV3DBase< T, PVType, FrameType >::x(), Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

{
//first use the existing FTS propagator to obtain parameters at PCA
//in transverse plane to the given point

//final parameters and covariance
  AlgebraicVector7 par;
  AlgebraicSymMatrix77 cov;
    
//initial parameters as class and vectors:  
  GlobalTrajectoryParameters inPar(state.globalPosition(),state.globalMomentum(), 
                state.particleCharge(), state.magneticField());
  ParticleMass mass = state.mass();                                                       
  GlobalVector inMom = state.globalMomentum();                                                    
  
//making a free trajectory state and looking 
//for helix barrel plane crossing  
  FreeTrajectoryState fState = state.freeTrajectoryState();             
  GlobalPoint iP = referencePoint;                                        
  std::pair<HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer> cros = planeCrossing(fState,iP);      
  
  HelixBarrelPlaneCrossingByCircle planeCrossing = cros.first; 
  BoundPlane::BoundPlanePointer plane = cros.second;
  std::pair<bool,double> propResult = planeCrossing.pathLength(*plane);
  if ( !propResult.first ) {
    LogDebug("RecoVertex/TrackKinematicStatePropagator") 
         << "Propagation failed! State is invalid\n";
    return  KinematicState();
  }
  double s = propResult.second;
  
  HelixPlaneCrossing::PositionType xGen = planeCrossing.position(s);
  GlobalPoint nPosition(xGen.x(),xGen.y(),xGen.z());
  HelixPlaneCrossing::DirectionType pGen = planeCrossing.direction(s);
  pGen *= inMom.mag()/pGen.mag();
  GlobalVector nMomentum(pGen.x(),pGen.y(),pGen.z()); 
  par(0) = nPosition.x();
  par(1) = nPosition.y();
  par(2) = nPosition.z();
  par(3) = nMomentum.x();
  par(4) = nMomentum.y();
  par(5) = nMomentum.z();
  par(6) = mass;
  
//covariance matrix business  
//elements of 7x7 covariance matrix responcible for the mass and
//mass - momentum projections corellations do change under such a transformation:
//special Jacobian needed  
  GlobalTrajectoryParameters fPar(nPosition, nMomentum, state.particleCharge(),
                                state.magneticField());
                                                                                                  
  JacobianCartesianToCurvilinear cart2curv(inPar);
  JacobianCurvilinearToCartesian curv2cart(fPar);
  
  AlgebraicMatrix67 ca2cu;
  AlgebraicMatrix76 cu2ca;
  ca2cu.Place_at(cart2curv.jacobian(),0,0);
  cu2ca.Place_at(curv2cart.jacobian(),0,0);
  ca2cu(5,6) = 1;  
  cu2ca(6,5) = 1;

//now both transformation jacobians: cartesian to curvilinear and back are done
//We transform matrix to curv frame, then propagate it and translate it back to
//cartesian frame.  
  AlgebraicSymMatrix66 cov1 = ROOT::Math::Similarity(ca2cu, state.kinematicParametersError().matrix());

//propagation jacobian
  AnalyticalCurvilinearJacobian prop(inPar,nPosition,nMomentum,s);
  AlgebraicMatrix66 pr;
  pr(5,5) = 1;
  pr.Place_at(prop.jacobian(),0,0);

//transportation
  AlgebraicSymMatrix66 cov2 = ROOT::Math::Similarity(pr, cov1);
  
//now geting back to 7-parametrization from curvilinear
  cov = ROOT::Math::Similarity(cu2ca, cov2);
  
//return parameters as a kiematic state  
  KinematicParameters resPar(par);
  KinematicParametersError resEr(cov);
  return  KinematicState(resPar,resEr,state.particleCharge(), state.magneticField()); 
 }
KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCANeutral ( const KinematicState state,
const GlobalPoint referencePoint 
) const [private, virtual]

Definition at line 140 of file TrackKinematicStatePropagator.cc.

References funct::cos(), KinematicState::freeTrajectoryState(), KinematicState::globalMomentum(), KinematicState::globalPosition(), JacobianCurvilinearToCartesian::jacobian(), KinematicState::kinematicParametersError(), KinematicState::magneticField(), KinematicState::mass(), KinematicParametersError::matrix(), KinematicState::particleCharge(), phi, alignCSCRings::s, funct::sin(), funct::tan(), theta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

{
//new parameters vector and covariance:
 AlgebraicVector7 par;
 AlgebraicSymMatrix77 cov;
 
 //AlgebraicVector7 inStatePar = state.kinematicParameters().vector();
 GlobalTrajectoryParameters inPar(state.globalPosition(),state.globalMomentum(), 
                state.particleCharge(), state.magneticField());
 
//first making a free trajectory state and propagating it according
//to the algorithm provided by Thomas Speer and Wolfgang Adam 
 FreeTrajectoryState fState = state.freeTrajectoryState();
  
 GlobalPoint xvecOrig = fState.position();
 double phi = fState.momentum().phi();
 double theta = fState.momentum().theta();
 double xOrig = xvecOrig.x();
 double yOrig = xvecOrig.y();
 double zOrig = xvecOrig.z();
 double xR = referencePoint.x();
 double yR = referencePoint.y();

 double s2D = (xR - xOrig)  * cos(phi) + (yR - yOrig)  * sin(phi);
 double s = s2D / sin(theta);
 double xGen = xOrig + s2D*cos(phi);
 double yGen = yOrig + s2D*sin(phi);
 double zGen = zOrig + s2D/tan(theta);
 GlobalPoint xPerigee = GlobalPoint(xGen, yGen, zGen);

//new parameters
 GlobalVector pPerigee = fState.momentum();
 par(0) = xPerigee.x();
 par(1) = xPerigee.y(); 
 par(2) = xPerigee.z(); 
 par(3) = pPerigee.x(); 
 par(4) = pPerigee.y(); 
 par(5) = pPerigee.z(); 
 // par(6) = inStatePar(7);
 par(6) = state.mass();

//covariance matrix business:
//everything lake it was before: jacobains are smart enouhg to 
//distinguish between neutral and charged states themselves

 GlobalTrajectoryParameters fPar(xPerigee, pPerigee, state.particleCharge(),
                                state.magneticField());

 JacobianCartesianToCurvilinear cart2curv(inPar);
 JacobianCurvilinearToCartesian curv2cart(fPar);
  
  AlgebraicMatrix67 ca2cu;
  AlgebraicMatrix76 cu2ca;
  ca2cu.Place_at(cart2curv.jacobian(),0,0);
  cu2ca.Place_at(curv2cart.jacobian(),0,0);
  ca2cu(5,6) = 1;  
  cu2ca(6,5) = 1;

//now both transformation jacobians: cartesian to curvilinear and back are done
//We transform matrix to curv frame, then propagate it and translate it back to
//cartesian frame.  
  AlgebraicSymMatrix66 cov1 = ROOT::Math::Similarity(ca2cu, state.kinematicParametersError().matrix());

//propagation jacobian
  AnalyticalCurvilinearJacobian prop(inPar,xPerigee,pPerigee,s);
  AlgebraicMatrix66 pr;
  pr(5,5) = 1;
  pr.Place_at(prop.jacobian(),0,0);
  
//transportation
  AlgebraicSymMatrix66 cov2 = ROOT::Math::Similarity(pr, cov1);
  
//now geting back to 7-parametrization from curvilinear
  cov = ROOT::Math::Similarity(cu2ca, cov2);
 
//return parameters as a kiematic state  
 KinematicParameters resPar(par);
 KinematicParametersError resEr(cov);
 return  KinematicState(resPar,resEr,state.particleCharge(), state.magneticField());    
}