CMS 3D CMS Logo

KinematicRefittedTrackState.cc

Go to the documentation of this file.
00001 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicRefittedTrackState.h"
00002 #include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
00003 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00004 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicPerigeeConversions.h"
00005 
00006 
00007 KinematicRefittedTrackState::KinematicRefittedTrackState(const KinematicState& st)              
00008 {state = st;}
00009 
00010 AlgebraicVector6 KinematicRefittedTrackState::parameters() const
00011 {
00012   KinematicPerigeeConversions conv;
00013   return conv.extendedPerigeeFromKinematicParameters(state,state.globalPosition()).vector();
00014 }
00015   
00016 AlgebraicSymMatrix66 KinematicRefittedTrackState::covariance() const 
00017 {
00018   throw VertexException("KinematicRefittedTrackState::Fishy covariance called");
00019   return AlgebraicSymMatrix66();
00020 }
00021 
00022 AlgebraicVector7 KinematicRefittedTrackState::kinematicParameters() const
00023 {return state.kinematicParameters().vector();}
00024 
00025 AlgebraicSymMatrix77 KinematicRefittedTrackState::kinematicParametersCovariance() const
00026 {return state.kinematicParametersError().matrix();}
00027 
00028 
00029 FreeTrajectoryState KinematicRefittedTrackState::freeTrajectoryState() const
00030 {
00031  return state.freeTrajectoryState();
00032 }
00033 
00034 GlobalPoint KinematicRefittedTrackState::position() const
00035 {return state.globalPosition();}
00036 
00037 AlgebraicVector4 KinematicRefittedTrackState::kinematicMomentumVector() const
00038 {
00039  GlobalVector mm = state.globalMomentum();
00040  AlgebraicVector4 mr;
00041  mr[0] = mm.x();
00042  mr[1] = mm.y();
00043  mr[2] = mm.z();
00044  mr[3] = state.mass();
00045  return mr;
00046 }
00047 
00048 AlgebraicVector4 KinematicRefittedTrackState::momentumVector() const
00049 {
00050 
00051  KinematicPerigeeConversions conv;
00052  
00053  ExtendedPerigeeTrajectoryParameters pState = 
00054                 conv.extendedPerigeeFromKinematicParameters(state,state.globalPosition());
00055 
00056  AlgebraicVector4 mr;
00057  mr[3] = pState.vector()[5];
00058  mr[0] = pState.vector()[0];
00059  mr[1] = pState.vector()[1];
00060  mr[2] = pState.vector()[2];
00061  return mr;
00062 }
00063 
00064 
00065 TrajectoryStateOnSurface KinematicRefittedTrackState::trajectoryStateOnSurface(const Surface & surface) const
00066 {
00067   AnalyticalPropagator thePropagator(state.magneticField(), anyDirection);
00068  return thePropagator.propagate(freeTrajectoryState(), surface);
00069 }
00070 
00071 TrajectoryStateOnSurface KinematicRefittedTrackState::trajectoryStateOnSurface(const Surface & surface, 
00072                                                    const Propagator & propagator) const
00073 {
00074  std::auto_ptr<Propagator> thePropagator( propagator.clone());
00075  thePropagator->setPropagationDirection(anyDirection);
00076  return thePropagator->propagate(freeTrajectoryState(), surface);
00077 }
00078                                                    
00079  double KinematicRefittedTrackState::weight() const
00080 { return 1.;}
00081 
00082 ReferenceCountingPointer<RefittedTrackState<6> >  KinematicRefittedTrackState::stateWithNewWeight
00083         (const double newWeight) const
00084 {
00085  std::cout<<"WARNING: Change weight for Kinematic state called, weigt will stay to be equal 1."<<std::endl;
00086  return RefCountedRefittedTrackState( 
00087                                 const_cast<KinematicRefittedTrackState*>(this));
00088 }
00089 
00090 std::vector< ReferenceCountingPointer<RefittedTrackState<6> > > KinematicRefittedTrackState::components() const
00091 {
00092  std::vector<RefCountedRefittedTrackState> result; result.reserve(1);
00093  result.push_back(RefCountedRefittedTrackState( 
00094                                 const_cast<KinematicRefittedTrackState*>(this)));
00095  return result;
00096 }                                                  
00097 
00098 
00099 
00100 reco::TransientTrack KinematicRefittedTrackState::transientTrack() const
00101 {
00102   throw VertexException("KinematicRefittedTrackState::Can Not write a TransientTrack");
00103 //  TransientTrackFromFTSFactory factory;
00104 //   return factory.build(freeTrajectoryState());
00105 }

Generated on Tue Jun 9 17:46:11 2009 for CMSSW by  doxygen 1.5.4