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() override {
67  if (owner) {
68  delete thePropagator;
69  delete theUpdator;
70  delete theEstimator;
71  }
72  }
73 
74  Trajectory fitOne(const Trajectory& aTraj, fitType) const override;
75  Trajectory fitOne(const TrajectorySeed& aSeed, const RecHitContainer& hits, fitType) const override;
76 
77  Trajectory fitOne(const TrajectorySeed& aSeed,
78  const RecHitContainer& hits,
79  const TSOS& firstPredTsos,
80  fitType) const override;
81 
82  const Propagator* propagator() const { return thePropagator; }
83  const TrajectoryStateUpdator* updator() const { return theUpdator; }
84  const MeasurementEstimator* estimator() const { return theEstimator; }
85 
86  std::unique_ptr<TrajectoryFitter> clone() const override {
87  return owner ? std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(
89  : std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(
91  }
92 
93  // FIXME a prototype: final inplementaiton may differ
94  void setHitCloner(TkCloner const* hc) override { theHitCloner = hc; }
95 
96 private:
97  KFTrajectoryFitter(KFTrajectoryFitter const&) = delete;
98 
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:83
TkCloner
Definition: TkCloner.h:16
KFTrajectoryFitter::TSOS
TrajectoryStateOnSurface TSOS
Definition: KFTrajectoryFitter.h:24
KFTrajectoryFitter::~KFTrajectoryFitter
~KFTrajectoryFitter() override
Definition: KFTrajectoryFitter.h:66
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:86
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:82
KFTrajectoryFitter::setHitCloner
void setHitCloner(TkCloner const *hc) override
Definition: KFTrajectoryFitter.h:94
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:84
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