Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:37

0001 #ifndef GsfTrajectoryFitter_H_
0002 #define GsfTrajectoryFitter_H_
0003 
0004 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0006 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
0007 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0008 #include "TrackingTools/TrackFitters/interface/TrajectoryFitter.h"
0009 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0010 #include "TrackingTools/DetLayers/interface/MeasurementEstimator.h"
0011 #include "TrackingTools/DetLayers/interface/DetLayerGeometry.h"
0012 
0013 #include <vector>
0014 
0015 class MultiTrajectoryStateMerger;
0016 
0017 /** A GSF fitter, similar to KFTrajectoryFitter.
0018  */
0019 
0020 class GsfTrajectoryFitter final : public TrajectoryFitter {
0021 private:
0022   typedef TrajectoryStateOnSurface TSOS;
0023   typedef TrajectoryMeasurement TM;
0024 
0025 public:
0026   /** Constructor with explicit components for propagation, update,
0027    *  chi2 calculation, merging and flag for merging before / after
0028    *  the update (i.e. fully configured) */
0029   GsfTrajectoryFitter(const Propagator& aPropagator,
0030                       const TrajectoryStateUpdator& aUpdator,
0031                       const MeasurementEstimator& aEstimator,
0032                       const MultiTrajectoryStateMerger& aMerger,
0033                       const DetLayerGeometry* detLayerGeometry = nullptr);
0034 
0035   ~GsfTrajectoryFitter() override;
0036 
0037   Trajectory fitOne(const Trajectory& t, fitType type) const override;
0038   Trajectory fitOne(const TrajectorySeed& aSeed,
0039                     const RecHitContainer& hits,
0040                     const TrajectoryStateOnSurface& firstPredTsos,
0041                     fitType type) const override;
0042   Trajectory fitOne(const TrajectorySeed& aSeed, const RecHitContainer& hits, fitType type) const override;
0043 
0044   const Propagator* propagator() const { return thePropagator; }
0045   const TrajectoryStateUpdator* updator() const { return theUpdator; }
0046   const MeasurementEstimator* estimator() const { return theEstimator; }
0047   const MultiTrajectoryStateMerger* merger() const { return theMerger; }
0048 
0049   std::unique_ptr<TrajectoryFitter> clone() const override {
0050     return std::unique_ptr<TrajectoryFitter>(
0051         new GsfTrajectoryFitter(*thePropagator, *theUpdator, *theEstimator, *theMerger, theGeometry));
0052   }
0053 
0054   void setHitCloner(TkCloner const* hc) override { theHitCloner = hc; }
0055 
0056 private:
0057   const Propagator* thePropagator;
0058   const TrajectoryStateUpdator* theUpdator;
0059   const MeasurementEstimator* theEstimator;
0060   const MultiTrajectoryStateMerger* theMerger;
0061   TkCloner const* theHitCloner = nullptr;
0062   const DetLayerGeometry dummyGeometry;
0063   const DetLayerGeometry* theGeometry;
0064 
0065   bool theTiming;
0066 };
0067 
0068 #endif  //TR_GsfTrajectoryFitter_H_