CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/RecoTracker/CkfPattern/src/TrajectorySegmentBuilder.h

Go to the documentation of this file.
00001 #ifndef TrajectorySegmentBuilder_H
00002 #define TrajectorySegmentBuilder_H
00003 
00004 //B.M. #include "CommonDet/DetUtilities/interface/DetExceptions.h"
00005 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00006 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00007 //B.M.#include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
00008 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00009 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00010 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00011 #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h"
00012 #include <vector>                                        
00013 
00014 #include "FWCore/Utilities/interface/Visibility.h"
00015 
00016 
00017 class TrajectoryStateUpdator;
00018 class MeasurementEstimator;
00019 class Trajectory;
00020 class TrajectoryMeasurement;
00021 class TrajectoryMeasurementGroup;
00022 class FreeTrajectoryState;
00023 class TrajectoryStateOnSurface;
00024 class DetGroup;
00025 class DetLayer;
00026 class TempTrajectory;
00027 
00031 class  dso_internal TrajectorySegmentBuilder {
00032 
00033 private:
00034   // short names
00035   typedef FreeTrajectoryState FTS;
00036   typedef TrajectoryStateOnSurface TSOS;
00037   typedef TrajectoryMeasurement TM;
00038   typedef TrajectoryMeasurementGroup TMG;
00039   typedef std::vector<Trajectory> TrajectoryContainer;
00040   typedef std::vector<TempTrajectory> TempTrajectoryContainer;
00041   typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer;
00042   typedef TransientTrackingRecHit::ConstRecHitPointer   ConstRecHitPointer;
00043   
00044 public:
00045   
00047   TrajectorySegmentBuilder (const MeasurementTracker* theInputMeasurementTracker,
00048                             const LayerMeasurements*  theInputLayerMeasurements,
00049                             const DetLayer& layer,
00050                             const Propagator& propagator,
00051                             const TrajectoryStateUpdator& updator,
00052                             const MeasurementEstimator& estimator,
00053                             bool lockHits, bool bestHitOnly, int maxSegments ) :
00054     theMeasurementTracker(theInputMeasurementTracker),
00055     theLayerMeasurements(theInputLayerMeasurements),
00056     theLayer(layer),
00057     theFullPropagator(propagator),
00058     theUpdator(updator),
00059     theEstimator(estimator),
00060     theGeomPropagator(propagator),
00061 //     theGeomPropagator(propagator.propagationDirection()),
00062     theLockHits(lockHits),theBestHitOnly(bestHitOnly),
00063     theMaxSegments(maxSegments)
00064   {}
00065 
00067   ~TrajectorySegmentBuilder() {}
00068 
00070   //std::vector<Trajectory> segments (const TSOS startingState);
00071   TempTrajectoryContainer segments (const TSOS startingState);
00072 
00073 private:
00075   void updateTrajectory (TempTrajectory& traj, const TM& tm) const;
00076  
00078   void updateCandidates (TempTrajectory& traj, const std::vector<TM>& measurements,
00079                          TempTrajectoryContainer& candidates);
00080 
00082   void updateCandidatesWithBestHit (TempTrajectory& traj, const std::vector<TM>& measurements,
00083                                     TempTrajectoryContainer& candidates);
00084 
00086   std::vector<TrajectoryMeasurement> redoMeasurements (const TempTrajectory& traj,
00087                                                   const DetGroup& detGroup) const;
00088 
00090   std::vector<TrajectoryMeasurement> unlockedMeasurements (const std::vector<TM>& measurements) const;
00091 
00093   void lockMeasurement (const TM& measurement);
00094 
00096   //B.M to be ported later
00097   void cleanCandidates (std::vector<TempTrajectory>& candidates) const;
00098 
00099 // public:
00100 
00101   std::vector<TempTrajectory> addGroup( TempTrajectory& traj,
00102                                std::vector<TrajectoryMeasurementGroup>::const_iterator begin,
00103                                std::vector<TrajectoryMeasurementGroup>::const_iterator end);
00104     
00105   void updateWithInvalidHit (TempTrajectory& traj,
00106                              const std::vector<TMG>& groups,
00107                              TempTrajectoryContainer& candidates) const;
00108   
00109 private:
00110   const MeasurementTracker*     theMeasurementTracker;
00111   const LayerMeasurements*      theLayerMeasurements;
00112   const DetLayer&               theLayer;
00113   const Propagator&             theFullPropagator;
00114   const TrajectoryStateUpdator& theUpdator;
00115   const MeasurementEstimator&   theEstimator;
00116 //   AnalyticalPropagator theGeomPropagator;
00117   const Propagator&             theGeomPropagator;
00118 
00119   bool theLockHits;
00120   bool theBestHitOnly;
00121   ConstRecHitContainer theLockedHits;
00122 
00123   int theMaxSegments;
00124 
00125   bool theDbgFlg;
00126 };
00127 
00128 #endif