00001 #ifndef Alignment_KalmanAlignmentAlgorithm_KalmanAlignmentTrackRefitter_h 00002 #define Alignment_KalmanAlignmentAlgorithm_KalmanAlignmentTrackRefitter_h 00003 00004 #include "RecoTracker/TrackProducer/interface/TrackProducerBase.h" 00005 #include "RecoTracker/TrackProducer/interface/TrackProducerAlgorithm.h" 00006 00007 #include "Alignment/CommonAlignment/interface/AlignableNavigator.h" 00008 00009 #include "Alignment/KalmanAlignmentAlgorithm/interface/KalmanAlignmentTracklet.h" 00010 #include "Alignment/KalmanAlignmentAlgorithm/interface/KalmanAlignmentSetup.h" 00011 00012 #include "TrackingTools/TransientTrack/interface/TransientTrack.h" 00013 00014 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" 00015 00016 class TrajectoryFitter; 00017 00027 00028 00029 class KalmanAlignmentTrackRefitter : public TrackProducerBase<reco::Track> 00030 { 00031 00032 public: 00033 00034 typedef std::vector< KalmanAlignmentSetup* > AlignmentSetupCollection; 00035 typedef KalmanAlignmentSetup::SortingDirection SortingDirection; 00036 00037 typedef edm::OwnVector< TrackingRecHit > RecHitContainer; 00038 00039 typedef KalmanAlignmentTracklet::TrajTrackPairCollection TrajTrackPairCollection; 00040 typedef KalmanAlignmentTracklet::TrackletPtr TrackletPtr; 00041 typedef std::vector< TrackletPtr > TrackletCollection; 00042 00043 typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair; 00044 typedef AlignmentAlgorithmBase::ConstTrajTrackPairCollection ConstTrajTrackPairCollection; 00045 00047 KalmanAlignmentTrackRefitter( const edm::ParameterSet& config, AlignableNavigator* navigator ); 00048 00050 ~KalmanAlignmentTrackRefitter( void ); 00051 00052 TrackletCollection refitTracks( const edm::EventSetup& eventSetup, 00053 const AlignmentSetupCollection& algoSetups, 00054 const ConstTrajTrackPairCollection& tracks ); 00055 00057 virtual void produce( edm::Event&, const edm::EventSetup& ) {} 00058 00059 private: 00060 00061 TrajTrackPairCollection refitSingleTracklet( const TrackingGeometry* geometry, 00062 const MagneticField* magneticField, 00063 const TrajectoryFitter* fitter, 00064 const Propagator* propagator, 00065 const TransientTrackingRecHitBuilder* recHitBuilder, 00066 const reco::TransientTrack& originalTrack, 00067 RecHitContainer& recHits, 00068 const SortingDirection& sortingDir, 00069 bool useExternalEstimate, 00070 bool reuseMomentumEstimate ); 00071 00072 void sortRecHits( RecHitContainer& hits, 00073 const TransientTrackingRecHitBuilder* builder, 00074 const SortingDirection& sortingDir ) const; 00075 00076 void debugTrackData( const std::string identifier, const Trajectory* traj, const reco::Track* track ); 00077 00078 TrackProducerAlgorithm<reco::Track> theRefitterAlgo; 00079 AlignableNavigator* theNavigator; 00080 bool theDebugFlag; 00081 }; 00082 00083 00084 #endif