CMS 3D CMS Logo

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_
Propagator.h
MeasurementEstimator
Definition: MeasurementEstimator.h:19
TrajectoryStateOnSurface.h
FreeTrajectoryState.h
funct::false
false
Definition: Factorize.h:29
KFTrajectoryFitter::KFTrajectoryFitter
KFTrajectoryFitter(const Propagator *aPropagator, const TrajectoryStateUpdator *aUpdator, const MeasurementEstimator *aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=nullptr, TkCloner const *hc=nullptr)
Definition: KFTrajectoryFitter.h:49
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
KFTrajectoryFitter::theGeometry
const DetLayerGeometry * theGeometry
Definition: KFTrajectoryFitter.h:104
KFTrajectoryFitter
Definition: KFTrajectoryFitter.h:22
TrajectoryMeasurement.h
TrajectoryStateUpdator.h
KFTrajectoryFitter::dummyGeometry
static const DetLayerGeometry dummyGeometry
Definition: KFTrajectoryFitter.h:99
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
KFTrajectoryFitter::updator
const TrajectoryStateUpdator * updator() const
Definition: KFTrajectoryFitter.h:85
TkCloner
Definition: TkCloner.h:16
KFTrajectoryFitter::TSOS
TrajectoryStateOnSurface TSOS
Definition: KFTrajectoryFitter.h:24
KFTrajectoryFitter::~KFTrajectoryFitter
~KFTrajectoryFitter() override
Definition: KFTrajectoryFitter.h:68
MeasurementEstimator.h
KFTrajectoryFitter::TM
TrajectoryMeasurement TM
Definition: KFTrajectoryFitter.h:26
TrajectoryFitter.h
KFTrajectoryFitter::KFTrajectoryFitter
KFTrajectoryFitter(const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=nullptr, TkCloner const *hc=nullptr)
Definition: KFTrajectoryFitter.h:30
KFTrajectoryFitter::owner
bool owner
Definition: KFTrajectoryFitter.h:106
KFTrajectoryFitter::clone
std::unique_ptr< TrajectoryFitter > clone() const override
Definition: KFTrajectoryFitter.h:88
funct::true
true
Definition: Factorize.h:173
KFTrajectoryFitter::fitOne
Trajectory fitOne(const Trajectory &aTraj, fitType) const override
Definition: KFTrajectoryFitter.cc:14
DetLayerGeometry.h
KFTrajectoryFitter::propagator
const Propagator * propagator() const
Definition: KFTrajectoryFitter.h:84
KFTrajectoryFitter::setHitCloner
void setHitCloner(TkCloner const *hc) override
Definition: KFTrajectoryFitter.h:96
DetLayerGeometry
Definition: DetLayerGeometry.h:18
KFTrajectoryFitter::FTS
FreeTrajectoryState FTS
Definition: KFTrajectoryFitter.h:25
KFTrajectoryFitter::thePropagator
const Propagator * thePropagator
Definition: KFTrajectoryFitter.h:100
KFTrajectoryFitter::minHits_
int minHits_
Definition: KFTrajectoryFitter.h:105
Trajectory.h
TrajectoryFitter
Definition: TrajectoryFitter.h:19
KFTrajectoryFitter::theUpdator
const TrajectoryStateUpdator * theUpdator
Definition: KFTrajectoryFitter.h:101
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
Trajectory
Definition: Trajectory.h:38
TrajectorySeed
Definition: TrajectorySeed.h:18
KFTrajectoryFitter::theEstimator
const MeasurementEstimator * theEstimator
Definition: KFTrajectoryFitter.h:102
KFTrajectoryFitter::estimator
const MeasurementEstimator * estimator() const
Definition: KFTrajectoryFitter.h:86
TrajectoryStateUpdator
Definition: TrajectoryStateUpdator.h:14
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
TrajectoryFitter::RecHitContainer
Trajectory::RecHitContainer RecHitContainer
Definition: TrajectoryFitter.h:24
KFTrajectoryFitter::theHitCloner
TkCloner const * theHitCloner
Definition: KFTrajectoryFitter.h:103
reco_skim_cfg_mod.minHits
minHits
Definition: reco_skim_cfg_mod.py:177
TrajectoryFitter::fitType
fitType
Definition: TrajectoryFitter.h:21