CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
23 
24 private:
25 
29 
30 public:
31 
32 
33  // backward compatible (too many places it uses as such...)
34  KFTrajectoryFitter(const Propagator& aPropagator,
35  const TrajectoryStateUpdator& aUpdator,
36  const MeasurementEstimator& aEstimator,
37  int minHits = 3,
38  const DetLayerGeometry* detLayerGeometry=0,
39  TkCloner const * hc=nullptr) :
40  thePropagator(aPropagator.clone()),
41  theUpdator(aUpdator.clone()),
42  theEstimator(aEstimator.clone()),
44  theGeometry(detLayerGeometry),
46  owner(true){
48  // FIXME. Why this first constructor is needed? who is using it? Can it be removed?
49  // it is uses in many many places
50  }
51 
52 
53  KFTrajectoryFitter(const Propagator* aPropagator,
54  const TrajectoryStateUpdator* aUpdator,
55  const MeasurementEstimator* aEstimator,
56  int minHits = 3,
57  const DetLayerGeometry* detLayerGeometry=0,
58  TkCloner const * hc=nullptr) :
59  thePropagator(aPropagator),
60  theUpdator(aUpdator),
61  theEstimator(aEstimator),
63  theGeometry(detLayerGeometry),
65  owner(false){
67  }
68 
70  if (owner) {
71  delete thePropagator;
72  delete theUpdator;
73  delete theEstimator;
74  }
75  }
76 
77  Trajectory fitOne(const Trajectory& aTraj,fitType) const;
78  Trajectory fitOne(const TrajectorySeed& aSeed,
79  const RecHitContainer& hits,fitType) const;
80 
81  Trajectory fitOne(const TrajectorySeed& aSeed,
82  const RecHitContainer& hits,
83  const TSOS& firstPredTsos,fitType) const;
84 
85  const Propagator* propagator() const {return thePropagator;}
86  const TrajectoryStateUpdator* updator() const {return theUpdator;}
87  const MeasurementEstimator* estimator() const {return theEstimator;}
88 
89  virtual std::unique_ptr<TrajectoryFitter> clone() const override
90  {
91  return owner ?
92  std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(*thePropagator,
93  *theUpdator,
94  *theEstimator,
96  std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(thePropagator,
97  theUpdator,
99  minHits_,
101  }
102 
103  // FIXME a prototype: final inplementaiton may differ
104  virtual void setHitCloner(TkCloner const * hc) { theHitCloner = hc;}
105 
106 
107 private:
109 
110 
115  TkCloner const * theHitCloner=nullptr;
117  int minHits_;
118  bool owner;
119 };
120 
121 #endif //CD_KFTrajectoryFitter_H_
FreeTrajectoryState FTS
#define GCC11_FINAL
const TrajectoryStateUpdator * updator() const
const MeasurementEstimator * estimator() const
const MeasurementEstimator * theEstimator
TrajectoryMeasurement TM
virtual void setHitCloner(TkCloner const *hc)
virtual std::unique_ptr< TrajectoryFitter > clone() const override
const TrajectoryStateUpdator * theUpdator
static const DetLayerGeometry dummyGeometry
TrajectoryStateOnSurface TSOS
const DetLayerGeometry * theGeometry
KFTrajectoryFitter(const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0, TkCloner const *hc=0)
KFTrajectoryFitter(const Propagator *aPropagator, const TrajectoryStateUpdator *aUpdator, const MeasurementEstimator *aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0, TkCloner const *hc=0)
const Propagator * propagator() const
Trajectory fitOne(const Trajectory &aTraj, fitType) const
const Propagator * thePropagator
susybsm::HSCParticleCollection hc
Definition: classes.h:25
volatile std::atomic< bool > shutdown_flag false
Trajectory::RecHitContainer RecHitContainer
TkCloner const * theHitCloner