CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/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) :
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   {}
00064 
00066   ~TrajectorySegmentBuilder() {}
00067 
00069   //std::vector<Trajectory> segments (const TSOS startingState);
00070   TempTrajectoryContainer segments (const TSOS startingState);
00071 
00072 private:
00074   void updateTrajectory (TempTrajectory& traj, const TM& tm) const;
00075  
00077   void updateCandidates (TempTrajectory& traj, const std::vector<TM>& measurements,
00078                          TempTrajectoryContainer& candidates);
00079 
00081   void updateCandidatesWithBestHit (TempTrajectory& traj, const std::vector<TM>& measurements,
00082                                     TempTrajectoryContainer& candidates);
00083 
00085   std::vector<TrajectoryMeasurement> redoMeasurements (const TempTrajectory& traj,
00086                                                   const DetGroup& detGroup) const;
00087 
00089   std::vector<TrajectoryMeasurement> unlockedMeasurements (const std::vector<TM>& measurements) const;
00090 
00092   void lockMeasurement (const TM& measurement);
00093 
00095   //B.M to be ported later
00096   void cleanCandidates (std::vector<TempTrajectory>& candidates) const;
00097 
00098 // public:
00099 
00100   std::vector<TempTrajectory> addGroup( TempTrajectory& traj,
00101                                std::vector<TrajectoryMeasurementGroup>::const_iterator begin,
00102                                std::vector<TrajectoryMeasurementGroup>::const_iterator end);
00103     
00104   void updateWithInvalidHit (TempTrajectory& traj,
00105                              const std::vector<TMG>& groups,
00106                              TempTrajectoryContainer& candidates) const;
00107   
00108 private:
00109   const MeasurementTracker*     theMeasurementTracker;
00110   const LayerMeasurements*      theLayerMeasurements;
00111   const DetLayer&               theLayer;
00112   const Propagator&             theFullPropagator;
00113   const TrajectoryStateUpdator& theUpdator;
00114   const MeasurementEstimator&   theEstimator;
00115 //   AnalyticalPropagator theGeomPropagator;
00116   const Propagator&             theGeomPropagator;
00117 
00118   bool theLockHits;
00119   bool theBestHitOnly;
00120   ConstRecHitContainer theLockedHits;
00121 
00122   bool theDbgFlg;
00123 };
00124 
00125 #endif