00001 #ifndef RecoTracker_CkfPattern_BaseCkfTrajectoryBuilder_h
00002 #define RecoTracker_CkfPattern_BaseCkfTrajectoryBuilder_h
00003
00004 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
00005 #include "TrackingTools/PatternTools/interface/TrajectoryBuilder.h"
00006 #include "FWCore/Framework/interface/Event.h"
00007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00008
00009 class CkfDebugger;
00010 class Chi2MeasurementEstimatorBase;
00011 class DetGroup;
00012 class FreeTrajectoryState;
00013 class IntermediateTrajectoryCleaner;
00014 class LayerMeasurements;
00015 class MeasurementTracker;
00016 class MeasurementEstimator;
00017 class NavigationSchool;
00018 class Propagator;
00019 class TrajectoryStateUpdator;
00020 class TrajectoryMeasurement;
00021 class TrajectorySeed;
00022 class TrajectoryContainer;
00023 class TrajectoryStateOnSurface;
00024 class TrajectoryFitter;
00025 class TransientTrackingRecHitBuilder;
00026 class Trajectory;
00027 class TempTrajectory;
00028 class TrajectoryFilter;
00029 class TrackingRegion;
00030 class TrajectoryMeasurementGroup;
00031 class TrajectoryCleaner;
00032
00033
00041 class BaseCkfTrajectoryBuilder : public TrajectoryBuilder {
00042 protected:
00043
00044 typedef FreeTrajectoryState FTS;
00045 typedef TrajectoryStateOnSurface TSOS;
00046 typedef TrajectoryMeasurement TM;
00047 typedef std::pair<TSOS,std::vector<const DetLayer*> > StateAndLayers;
00048
00049 public:
00050
00051 typedef std::vector<Trajectory> TrajectoryContainer;
00052 typedef std::vector<TempTrajectory> TempTrajectoryContainer;
00053 typedef TrajectoryContainer::iterator TrajectoryIterator;
00054
00055 BaseCkfTrajectoryBuilder(const edm::ParameterSet& conf,
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 virtual ~BaseCkfTrajectoryBuilder();
00065
00066 virtual TrajectoryContainer trajectories(const TrajectorySeed&) const = 0;
00067
00068 virtual void setEvent(const edm::Event& event) const = 0;
00069
00070 virtual void setDebugger( CkfDebugger * dbg) const {;}
00071
00073
00074
00076
00077
00078 protected:
00079
00080 virtual bool analyzeMeasurementsDebugger(Trajectory& traj, std::vector<TrajectoryMeasurement> meas,
00081 const MeasurementTracker* theMeasurementTracker,
00082 const Propagator* theForwardPropagator,
00083 const Chi2MeasurementEstimatorBase* theEstimator,
00084 const TransientTrackingRecHitBuilder * theTTRHBuilder) const {return true;}
00085 virtual bool analyzeMeasurementsDebugger(TempTrajectory& traj, std::vector<TrajectoryMeasurement> meas,
00086 const MeasurementTracker* theMeasurementTracker,
00087 const Propagator* theForwardPropagator,
00088 const Chi2MeasurementEstimatorBase* theEstimator,
00089 const TransientTrackingRecHitBuilder * theTTRHBuilder) const {return true;}
00090 virtual void fillSeedHistoDebugger(std::vector<TrajectoryMeasurement>::iterator begin,
00091 std::vector<TrajectoryMeasurement>::iterator end) const {;}
00092
00093 protected:
00094
00095 TempTrajectory createStartingTrajectory( const TrajectorySeed& seed) const;
00096
00097 bool toBeContinued( TempTrajectory& traj) const;
00098
00099 bool qualityFilter( const TempTrajectory& traj) const;
00100
00101 void addToResult( TempTrajectory& traj, TrajectoryContainer& result) const;
00102 void addToResult( TempTrajectory& traj, TempTrajectoryContainer& result) const;
00103
00104 StateAndLayers findStateAndLayers(const TempTrajectory& traj) const;
00105
00106 private:
00107 void seedMeasurements(const TrajectorySeed& seed, std::vector<TrajectoryMeasurement> & result) const;
00108
00109
00110
00111 protected:
00112 const TrajectoryStateUpdator* theUpdator;
00113 const Propagator* thePropagatorAlong;
00114 const Propagator* thePropagatorOpposite;
00115 const Chi2MeasurementEstimatorBase* theEstimator;
00116 const TransientTrackingRecHitBuilder* theTTRHBuilder;
00117 const MeasurementTracker* theMeasurementTracker;
00118 const LayerMeasurements* theLayerMeasurements;
00119
00120
00121 mutable const Propagator* theForwardPropagator;
00122 mutable const Propagator* theBackwardPropagator;
00123
00124
00125 private:
00126
00127
00128
00129
00130
00131
00132
00133
00134 const TrajectoryFilter* theFilter;
00135
00136
00137 };
00138
00139
00140 #endif