CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoHI/HiMuonAlgos/interface/HICTrajectoryBuilder.h

Go to the documentation of this file.
00001 #ifndef HICTrajectoryBuilder_H
00002 #define HICTrajectoryBuilder_H
00003 
00004 #include <vector>
00005 
00006 class Propagator;
00007 class TrajectoryStateUpdator;
00008 class MeasurementEstimator;
00009 class TrajectorySeed;
00010 class TrajectoryStateOnSurface;
00011 class TrajectoryFilter;
00012 
00013 #include "FWCore/Framework/interface/ESHandle.h"
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 #include "FWCore/Framework/interface/EventSetup.h"
00016 #include "FWCore/Framework/interface/Event.h"
00017 
00018 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
00019 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00020 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
00021 
00022 #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h"
00023 
00024 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00025 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
00026 #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h"
00027 //#include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
00028 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00029 #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h"
00030 #include "RecoHI/HiMuonAlgos/interface/HICMeasurementEstimator.h"
00031 #include "TrackingTools/PatternTools/interface/TempTrajectory.h"
00032 #include "RecoHI/HiMuonAlgos/interface/HICConst.h"
00033 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
00034 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
00035 #include "TrackingTools/TrackFitters/interface/TrajectoryFitter.h"
00036 #include "TrackingTools/PatternTools/interface/TrajectorySmoother.h"
00037 class TransientTrackingRecHitBuilder;
00038 class TrajectoryFilter;
00039 
00040 class HICTrajectoryBuilder :public BaseCkfTrajectoryBuilder {
00041 protected:
00042 // short names
00043   typedef TrajectoryStateOnSurface TSOS;
00044   typedef TrajectoryMeasurement TM;
00045 
00046 public:
00047 
00048   typedef std::vector<Trajectory>         TrajectoryContainer;
00049   typedef std::vector<TempTrajectory>     TempTrajectoryContainer;
00050 
00051   //HICTrajectoryBuilder( const edm::ParameterSet& conf,
00052   //                    const edm::EventSetup& es,
00053   //            const MeasurementTracker* theInputMeasurementTracker);
00054   HICTrajectoryBuilder(const edm::ParameterSet&              conf,
00055                        const edm::EventSetup&                es, 
00056                        const TrajectoryStateUpdator*         updator,
00057                        const Propagator*                     propagatorAlong,
00058                        const Propagator*                     propagatorOpposite,
00059                        const Chi2MeasurementEstimatorBase*           estimator,
00060                        const TransientTrackingRecHitBuilder* RecHitBuilder,
00061                        const MeasurementTracker*             measurementTracker,
00062                        const TrajectoryFilter*               filter);
00063 
00064   ~HICTrajectoryBuilder();
00065   
00067   virtual TrajectoryContainer trajectories(const TrajectorySeed& seed) const;
00068 
00070   virtual void setEvent(const edm::Event& event) const;
00071 
00072   virtual void settracker(const MeasurementTracker* measurementTracker){theMeasurementTracker = measurementTracker;}
00073 
00074  private:
00075   const TrajectoryStateUpdator*         theUpdator;
00076   const Propagator*                     thePropagatorAlong;
00077   const Propagator*                     thePropagatorOpposite;
00078   const Chi2MeasurementEstimatorBase*   theEstimator;
00079 //  const HICMeasurementEstimator*        theEstimator;
00080   mutable cms::HICConst*                theHICConst; 
00081     
00082   edm::ESHandle<GlobalTrackingGeometry> globTkGeomHandle;
00083   edm::ESHandle<TrajectoryFitter>       theFitterTrack;
00084   edm::ESHandle<TrajectorySmoother>     theSmootherTrack;
00085   edm::ESHandle<Propagator>             thePropagatorTrack;
00086   
00087   const TransientTrackingRecHitBuilder* theTTRHBuilder;
00088   const MeasurementTracker*             theMeasurementTracker;
00089   const LayerMeasurements*              theLayerMeasurements;
00090 
00091   // these may change from seed to seed
00092   mutable const Propagator*             theForwardPropagator;
00093   mutable const Propagator*             theBackwardPropagator;
00094   
00095   TrajectoryFilter*                     theMinPtCondition;
00096   TrajectoryFilter*                     theMaxHitsCondition;
00097 
00098   int theMaxCand;               
00100   int theMaxLostHit;            
00101   int theMaxConsecLostHit;      
00103   float theLostHitPenalty;      
00104   bool theIntermediateCleaning; 
00106   int theMinimumNumberOfHits;   
00107   bool theAlwaysUseInvalidHits;
00108 
00109 
00110   TempTrajectory createStartingTrajectory( const TrajectorySeed& seed) const;
00111 
00112   std::vector<TrajectoryMeasurement> seedMeasurements(const TrajectorySeed& seed) const;
00113 
00114   void limitedCandidates( TempTrajectory& startingTraj, TrajectoryContainer& result) const;
00115 
00116   std::vector<TrajectoryMeasurement> findCompatibleMeasurements( const TempTrajectory& traj) const;
00117 
00118   bool qualityFilter( const TempTrajectory& traj) const;
00119 
00120   void addToResult( TempTrajectory& traj, TrajectoryContainer& result) const; 
00121   
00122   bool updateTrajectory( TempTrajectory& traj, const TM& tm) const;
00123 
00124   bool toBeContinued( const TempTrajectory& traj) const;
00125 
00126 };
00127 
00128 #endif