CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/Alignment/KalmanAlignmentAlgorithm/interface/KalmanAlignmentTrackRefitter.h

Go to the documentation of this file.
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 
00018 namespace reco { class BeamSpot; }
00019 
00029 
00030 
00031 class KalmanAlignmentTrackRefitter : public TrackProducerBase<reco::Track>
00032 //class KalmanAlignmentTrackRefitter : public TrackProducerBase
00033 {
00034 
00035 public:
00036 
00037   typedef std::vector< KalmanAlignmentSetup* > AlignmentSetupCollection;
00038   typedef KalmanAlignmentSetup::SortingDirection SortingDirection;
00039 
00040   typedef edm::OwnVector< TrackingRecHit > RecHitContainer;
00041 
00042   typedef KalmanAlignmentTracklet::TrajTrackPairCollection TrajTrackPairCollection;
00043   typedef KalmanAlignmentTracklet::TrackletPtr TrackletPtr;
00044   typedef std::vector< TrackletPtr > TrackletCollection;
00045 
00046   typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair;
00047   typedef AlignmentAlgorithmBase::ConstTrajTrackPairCollection ConstTrajTrackPairCollection;
00048 
00050   KalmanAlignmentTrackRefitter( const edm::ParameterSet& config, AlignableNavigator* navigator );
00051 
00053   ~KalmanAlignmentTrackRefitter( void );
00054 
00055   TrackletCollection refitTracks( const edm::EventSetup& eventSetup,
00056                                   const AlignmentSetupCollection& algoSetups,
00057                                   const ConstTrajTrackPairCollection& tracks,
00058                                   const reco::BeamSpot* beamSpot );
00059 
00061   virtual void produce( edm::Event&, const edm::EventSetup& ) {}
00062 
00063 private:
00064 
00065   TrajTrackPairCollection refitSingleTracklet( const TrackingGeometry* geometry,
00066                                                const MagneticField* magneticField,
00067                                                const TrajectoryFitter* fitter,
00068                                                const Propagator* propagator,
00069                                                const TransientTrackingRecHitBuilder* recHitBuilder,
00070                                                const reco::TransientTrack& originalTrack,
00071                                                RecHitContainer& recHits,
00072                                                const reco::BeamSpot* beamSpot,
00073                                                const SortingDirection& sortingDir,
00074                                                bool useExternalEstimate,
00075                                                bool reuseMomentumEstimate,
00076                                                const std::string identifier = std::string("RefitSingle_") );
00077 
00078   void sortRecHits( RecHitContainer& hits,
00079                     const TransientTrackingRecHitBuilder* builder,
00080                     const SortingDirection& sortingDir ) const;
00081 
00082 
00083   bool rejectTrack( const reco::Track* track ) const;
00084 
00085 
00086   void debugTrackData( const std::string identifier,
00087                        const Trajectory* traj,
00088                        const reco::Track* track,
00089                        const reco::BeamSpot* bs );
00090 
00091   TrackProducerAlgorithm<reco::Track> theRefitterAlgo;
00092   //TrackProducerAlgorithm theRefitterAlgo;
00093   AlignableNavigator* theNavigator;
00094   bool theDebugFlag;
00095 };
00096 
00097 
00098 #endif