CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
KFTrajectoryFitter.h
Go to the documentation of this file.
1 #ifndef CD_KFTrajectoryFitter_H_
2 #define CD_KFTrajectoryFitter_H_
3 
19 
20 #include <memory>
21 
22 class KFTrajectoryFitter final : public TrajectoryFitter {
23 private:
27 
28 public:
29  // backward compatible (too many places it uses as such...)
30  KFTrajectoryFitter(const Propagator& aPropagator,
31  const TrajectoryStateUpdator& aUpdator,
32  const MeasurementEstimator& aEstimator,
33  int minHits = 3,
34  const DetLayerGeometry* detLayerGeometry = nullptr,
35  TkCloner const* hc = nullptr)
36  : thePropagator(aPropagator.clone()),
37  theUpdator(aUpdator.clone()),
38  theEstimator(aEstimator.clone()),
39  theHitCloner(hc),
40  theGeometry(detLayerGeometry),
42  owner(true) {
43  if (!theGeometry)
45  // FIXME. Why this first constructor is needed? who is using it? Can it be removed?
46  // it is uses in many many places
47  }
48 
49  KFTrajectoryFitter(const Propagator* aPropagator,
50  const TrajectoryStateUpdator* aUpdator,
51  const MeasurementEstimator* aEstimator,
52  int minHits = 3,
53  const DetLayerGeometry* detLayerGeometry = nullptr,
54  TkCloner const* hc = nullptr)
55  : thePropagator(aPropagator),
56  theUpdator(aUpdator),
57  theEstimator(aEstimator),
58  theHitCloner(hc),
59  theGeometry(detLayerGeometry),
61  owner(false) {
62  if (!theGeometry)
64  }
65 
66  KFTrajectoryFitter(KFTrajectoryFitter const&) = delete;
67 
68  ~KFTrajectoryFitter() override {
69  if (owner) {
70  delete thePropagator;
71  delete theUpdator;
72  delete theEstimator;
73  }
74  }
75 
76  Trajectory fitOne(const Trajectory& aTraj, fitType) const override;
77  Trajectory fitOne(const TrajectorySeed& aSeed, const RecHitContainer& hits, fitType) const override;
78 
79  Trajectory fitOne(const TrajectorySeed& aSeed,
80  const RecHitContainer& hits,
81  const TSOS& firstPredTsos,
82  fitType) const override;
83 
84  const Propagator* propagator() const { return thePropagator; }
85  const TrajectoryStateUpdator* updator() const { return theUpdator; }
86  const MeasurementEstimator* estimator() const { return theEstimator; }
87 
88  std::unique_ptr<TrajectoryFitter> clone() const override {
89  return owner ? std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(
91  : std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(
93  }
94 
95  // FIXME a prototype: final inplementaiton may differ
96  void setHitCloner(TkCloner const* hc) override { theHitCloner = hc; }
97 
98 private:
103  TkCloner const* theHitCloner = nullptr;
105  int minHits_;
106  bool owner;
107 };
108 
109 #endif //CD_KFTrajectoryFitter_H_
FreeTrajectoryState FTS
const TrajectoryStateUpdator * updator() const
const MeasurementEstimator * estimator() const
KFTrajectoryFitter(const Propagator *aPropagator, const TrajectoryStateUpdator *aUpdator, const MeasurementEstimator *aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=nullptr, TkCloner const *hc=nullptr)
KFTrajectoryFitter(const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=nullptr, TkCloner const *hc=nullptr)
const MeasurementEstimator * theEstimator
TrajectoryMeasurement TM
std::unique_ptr< TrajectoryFitter > clone() const override
const TrajectoryStateUpdator * theUpdator
static const DetLayerGeometry dummyGeometry
~KFTrajectoryFitter() override
TrajectoryStateOnSurface TSOS
void setHitCloner(TkCloner const *hc) override
const DetLayerGeometry * theGeometry
const Propagator * propagator() const
const Propagator * thePropagator
Trajectory::RecHitContainer RecHitContainer
Trajectory fitOne(const Trajectory &aTraj, fitType) const override
TkCloner const * theHitCloner