CMS 3D CMS Logo

KinematicParticleFitter.cc
Go to the documentation of this file.
4 
8 }
9 
11  parentFitter = fitter.clone();
12  cUpdator = updator.clone();
13 }
14 
16  delete parentFitter;
17  delete cUpdator;
18 }
19 
20 std::vector<RefCountedKinematicTree> KinematicParticleFitter::fit(
21  KinematicConstraint* cs, const std::vector<RefCountedKinematicTree>& trees) const {
22  std::vector<RefCountedKinematicTree> tr = parentFitter->fit(trees, cs);
23  // In case of problem in fit:
24  if (tr.empty())
25  return tr;
26  tr = cUpdator->update(tr);
27  return tr;
28 }
29 
31  std::vector<RefCountedKinematicTree> trees;
32  trees.push_back(tree);
33  std::vector<RefCountedKinematicTree> tr = parentFitter->fit(trees, cs);
34  // In case of problem in fit:
35  if (tr.empty())
37  tr = cUpdator->update(tr);
38  return tr.front();
39 }
virtual RefCountedKinematicTree update(RefCountedKinematicTree tree) const =0
ParentParticleFitter * parentFitter
virtual std::vector< RefCountedKinematicTree > fit(const std::vector< RefCountedKinematicTree > &trees, KinematicConstraint *cs) const =0
virtual ParentParticleFitter * clone() const =0
std::vector< RefCountedKinematicTree > fit(KinematicConstraint *cs, const std::vector< RefCountedKinematicTree > &trees) const
Definition: tree.py:1