Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:25

0001 #include "RecoVertex/VertexTools/interface/PerigeeRefittedTrackState.h"
0002 #include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
0003 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0004 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0006 #include "TrackingTools/TransientTrack/interface/TransientTrackFromFTSFactory.h"
0007 
0008 AlgebraicVector3 PerigeeRefittedTrackState::momentumVector() const { return momentumAtVertex; }
0009 
0010 std::vector<PerigeeRefittedTrackState::RefCountedRefittedTrackState> PerigeeRefittedTrackState::components() const {
0011   std::vector<RefCountedRefittedTrackState> result;
0012   result.reserve(1);
0013   result.push_back(RefCountedRefittedTrackState(const_cast<PerigeeRefittedTrackState*>(this)));
0014   return result;
0015 }
0016 
0017 PerigeeRefittedTrackState::RefCountedRefittedTrackState PerigeeRefittedTrackState::stateWithNewWeight(
0018     const double newWeight) const {
0019   return RefCountedRefittedTrackState(new PerigeeRefittedTrackState(theState, momentumAtVertex, newWeight));
0020 }
0021 
0022 TrajectoryStateOnSurface PerigeeRefittedTrackState::trajectoryStateOnSurface(const Surface& surface) const {
0023   AnalyticalPropagator thePropagator(&(theState.theState().parameters().magneticField()), anyDirection);
0024   TrajectoryStateOnSurface tsos = thePropagator.propagate(freeTrajectoryState(), surface);
0025   return TrajectoryStateOnSurface(weight(), tsos.globalParameters(), tsos.curvilinearError(), surface);
0026 }
0027 
0028 TrajectoryStateOnSurface PerigeeRefittedTrackState::trajectoryStateOnSurface(const Surface& surface,
0029                                                                              const Propagator& propagator) const {
0030   std::unique_ptr<Propagator> thePropagator(propagator.clone());
0031   thePropagator->setPropagationDirection(anyDirection);
0032 
0033   TrajectoryStateOnSurface tsos = thePropagator->propagate(freeTrajectoryState(), surface);
0034   return TrajectoryStateOnSurface(weight(), tsos.globalParameters(), tsos.curvilinearError(), surface);
0035 }
0036 
0037 reco::TransientTrack PerigeeRefittedTrackState::transientTrack() const {
0038   TransientTrackFromFTSFactory factory;
0039   return factory.build(freeTrajectoryState());
0040 }