CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectoryFitter.h
Go to the documentation of this file.
1 #ifndef _TrajectoryFitter_H_
2 #define _TrajectoryFitter_H_
3 
6 
8 
9 #include <memory>
10 
11 class TrajectorySeed;
13 class TkCloner;
14 
20 
22 public:
23  enum fitType {standard=0, looper=1};
24 
27 
28  virtual ~TrajectoryFitter() {}
29  virtual std::unique_ptr<TrajectoryFitter> clone() const = 0;
30 
31  // FIXME a prototype: final inplementaiton may differ
32  virtual void setHitCloner(TkCloner const *)=0;
33 
34  // new interface return one trajectory: if fit fails trajectory is invalid...
35  virtual Trajectory fitOne(const Trajectory& traj, fitType type=standard) const=0;
36  virtual Trajectory fitOne(const TrajectorySeed& seed,
37  const RecHitContainer& hits, fitType typee=standard) const =0;
38  virtual Trajectory fitOne(const TrajectorySeed& seed,
39  const RecHitContainer& hits,
40  const TrajectoryStateOnSurface& tsos, fitType type=standard) const=0;
41 
42 
43  // backward compatible interface...
44  std::vector<Trajectory> fit(const Trajectory& traj, fitType type=standard) const {return makeVect(fitOne(traj,type));}
45 
46  std::vector<Trajectory> fit(const TrajectorySeed& seed,
47  const RecHitContainer& hits, fitType type=standard) const {return makeVect(fitOne(seed,hits,type));}
48  std::vector<Trajectory> fit(const TrajectorySeed& seed,
49  const RecHitContainer& hits,
50  const TrajectoryStateOnSurface& tsos,
51  fitType type=standard) const {return makeVect(fitOne(seed,hits,tsos,type));}
52 
53 private:
54 
55  static std::vector<Trajectory> makeVect(Trajectory && outTraj) {
56  if (outTraj.isValid()) return std::vector<Trajectory>(1,std::move(outTraj));
57  return std::vector<Trajectory>();
58  }
59 
60 };
61 
62 #endif
type
Definition: HCALResponse.h:21
std::vector< Trajectory > fit(const TrajectorySeed &seed, const RecHitContainer &hits, const TrajectoryStateOnSurface &tsos, fitType type=standard) const
std::vector< Trajectory > fit(const TrajectorySeed &seed, const RecHitContainer &hits, fitType type=standard) const
virtual void setHitCloner(TkCloner const *)=0
def move
Definition: eostools.py:508
virtual ~TrajectoryFitter()
virtual Trajectory fitOne(const Trajectory &traj, fitType type=standard) const =0
static std::vector< Trajectory > makeVect(Trajectory &&outTraj)
ConstRecHitContainer RecHitContainer
Definition: Trajectory.h:48
TrajectoryFitterRecord Record
std::vector< Trajectory > fit(const Trajectory &traj, fitType type=standard) const
Trajectory::RecHitContainer RecHitContainer
virtual std::unique_ptr< TrajectoryFitter > clone() const =0