CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/RecoVertex/VertexTools/src/PerigeeRefittedTrackState.cc

Go to the documentation of this file.
00001 #include "RecoVertex/VertexTools/interface/PerigeeRefittedTrackState.h"
00002 #include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
00003 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00004 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00006 #include "TrackingTools/TransientTrack/interface/TransientTrackFromFTSFactory.h"
00007 
00008 AlgebraicVector3 PerigeeRefittedTrackState::momentumVector() const
00009 {
00010   return momentumAtVertex;
00011 }
00012 
00013 std::vector< PerigeeRefittedTrackState::RefCountedRefittedTrackState > 
00014 PerigeeRefittedTrackState::components() const
00015 {
00016   std::vector<RefCountedRefittedTrackState> result; result.reserve(1);
00017   result.push_back(RefCountedRefittedTrackState( 
00018                                 const_cast<PerigeeRefittedTrackState*>(this)));
00019   return result;
00020 }
00021 
00022 PerigeeRefittedTrackState::RefCountedRefittedTrackState
00023 PerigeeRefittedTrackState::stateWithNewWeight (const double newWeight) const
00024 {
00025   return RefCountedRefittedTrackState(
00026                 new PerigeeRefittedTrackState(theState, momentumAtVertex, newWeight) );
00027 }
00028 
00029 TrajectoryStateOnSurface
00030 PerigeeRefittedTrackState::trajectoryStateOnSurface(const Surface & surface) const
00031 {
00032   AnalyticalPropagator thePropagator(&(theState.theState().parameters().magneticField()), anyDirection);
00033   TrajectoryStateOnSurface tsos = thePropagator.propagate(freeTrajectoryState(), surface);
00034   return TrajectoryStateOnSurface (tsos.globalParameters(),
00035         tsos.curvilinearError(), surface ,weight()) ;
00036 } 
00037 
00038 TrajectoryStateOnSurface
00039 PerigeeRefittedTrackState::trajectoryStateOnSurface(const Surface & surface,
00040                                 const Propagator & propagator) const
00041 {
00042   std::auto_ptr<Propagator> thePropagator( propagator.clone());
00043   thePropagator->setPropagationDirection(anyDirection);
00044 
00045   TrajectoryStateOnSurface tsos = thePropagator->propagate(freeTrajectoryState(), surface);
00046   return TrajectoryStateOnSurface (tsos.globalParameters(),
00047         tsos.curvilinearError(), surface ,weight()) ;
00048 }
00049 
00050 reco::TransientTrack PerigeeRefittedTrackState::transientTrack() const
00051 {
00052   TransientTrackFromFTSFactory factory;
00053   return factory.build(freeTrajectoryState());
00054 }