Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:59

0001 #ifndef TrajectorySegmentBuilder_H
0002 #define TrajectorySegmentBuilder_H
0003 
0004 //B.M. #include "CommonDet/DetUtilities/interface/DetExceptions.h"
0005 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0006 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0007 //B.M.#include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
0008 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0009 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0010 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
0011 #include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h"
0012 #include "TrackingTools/MeasurementDet/interface/LayerMeasurements.h"
0013 #include <vector>
0014 
0015 #include "FWCore/Utilities/interface/Visibility.h"
0016 
0017 class TrajectoryStateUpdator;
0018 class MeasurementEstimator;
0019 class Trajectory;
0020 class TrajectoryMeasurement;
0021 class TrajectoryMeasurementGroup;
0022 class FreeTrajectoryState;
0023 class TrajectoryStateOnSurface;
0024 class DetGroup;
0025 class DetLayer;
0026 class TempTrajectory;
0027 
0028 /** 
0029  */
0030 
0031 class dso_internal TrajectorySegmentBuilder {
0032 private:
0033   // short names
0034   typedef FreeTrajectoryState FTS;
0035   typedef TrajectoryStateOnSurface TSOS;
0036   typedef TrajectoryMeasurement TM;
0037   typedef TrajectoryMeasurementGroup TMG;
0038   typedef std::vector<Trajectory> TrajectoryContainer;
0039   typedef std::vector<TempTrajectory> TempTrajectoryContainer;
0040   typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer;
0041   typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
0042 
0043 public:
0044   /// constructor from layer and helper objects
0045   TrajectorySegmentBuilder(const LayerMeasurements* theInputLayerMeasurements,
0046                            const DetLayer& layer,
0047                            const Propagator& propagator,
0048                            const TrajectoryStateUpdator& updator,
0049                            const MeasurementEstimator& estimator,
0050                            bool lockHits,
0051                            bool bestHitOnly,
0052                            int maxCand)
0053       : theLayerMeasurements(theInputLayerMeasurements),
0054         theLayer(layer),
0055         theFullPropagator(propagator),
0056         theUpdator(updator),
0057         theEstimator(estimator),
0058         theGeomPropagator(propagator),
0059         //     theGeomPropagator(propagator.propagationDirection()),
0060         theLockHits(lockHits),
0061         theBestHitOnly(bestHitOnly),
0062         theMaxCand(maxCand) {}
0063 
0064   /// destructor
0065   ~TrajectorySegmentBuilder() {}
0066 
0067   /// new segments within layer
0068   //std::vector<Trajectory> segments (const TSOS startingState);
0069   TempTrajectoryContainer segments(const TSOS startingState);
0070 
0071 private:
0072   /// update of a trajectory with a hit
0073   void updateTrajectory(TempTrajectory& traj, TM tm) const;
0074 
0075   /// creation of new candidates from a segment and a collection of hits
0076   void updateCandidates(TempTrajectory const& traj,
0077                         const std::vector<TM>& measurements,
0078                         TempTrajectoryContainer& candidates);
0079 
0080   /// creation of a new candidate from a segment and the best hit out of a collection
0081   void updateCandidatesWithBestHit(TempTrajectory const& traj, TM measurements, TempTrajectoryContainer& candidates);
0082 
0083   /// retrieve compatible hits from a DetGroup
0084   std::vector<TrajectoryMeasurement> redoMeasurements(const TempTrajectory& traj, const DetGroup& detGroup) const;
0085 
0086   /// get list of unused hits
0087   std::vector<TrajectoryMeasurement> unlockedMeasurements(const std::vector<TM>& measurements) const;
0088 
0089   /// mark a hit as used
0090   void lockMeasurement(const TM& measurement);
0091 
0092   /// clean a set of candidates
0093   //B.M to be ported later
0094   void cleanCandidates(std::vector<TempTrajectory>& candidates) const;
0095 
0096   // public:
0097 
0098   std::vector<TempTrajectory> addGroup(TempTrajectory const& traj,
0099                                        std::vector<TrajectoryMeasurementGroup>::const_iterator begin,
0100                                        std::vector<TrajectoryMeasurementGroup>::const_iterator end);
0101 
0102   void updateWithInvalidHit(TempTrajectory& traj,
0103                             const std::vector<TMG>& groups,
0104                             TempTrajectoryContainer& candidates) const;
0105 
0106 private:
0107   const LayerMeasurements* theLayerMeasurements;
0108   const DetLayer& theLayer;
0109   const Propagator& theFullPropagator;
0110   const TrajectoryStateUpdator& theUpdator;
0111   const MeasurementEstimator& theEstimator;
0112   //   AnalyticalPropagator theGeomPropagator;
0113   const Propagator& theGeomPropagator;
0114 
0115   bool theLockHits;
0116   bool theBestHitOnly;
0117   int theMaxCand;
0118   ConstRecHitContainer theLockedHits;
0119 
0120   bool theDbgFlg;
0121 };
0122 
0123 #endif