test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
KinematicParticleFitter.cc
Go to the documentation of this file.
4 
6 {
9 }
10 
12 {
13  parentFitter = fitter.clone();
14  cUpdator = updator.clone();
15 }
16 
18 {
19  delete parentFitter;
20  delete cUpdator;
21 }
22 
23 std::vector<RefCountedKinematicTree> KinematicParticleFitter::fit(KinematicConstraint * cs ,
24  const std::vector<RefCountedKinematicTree> &trees)const
25 {
26  std::vector<RefCountedKinematicTree> tr = parentFitter->fit(trees,cs);
27  // In case of problem in fit:
28  if (tr.empty()) return tr;
29  tr = cUpdator->update(tr);
30  return tr;
31 }
32 
35 {
36  std::vector<RefCountedKinematicTree> trees;
37  trees.push_back(tree);
38  std::vector<RefCountedKinematicTree> tr = parentFitter->fit(trees,cs);
39  // In case of problem in fit:
40  if (tr.empty()) return ReferenceCountingPointer<KinematicTree>(new KinematicTree());
41  tr = cUpdator->update(tr);
42  return tr.front();
43 }
virtual RefCountedKinematicTree update(RefCountedKinematicTree tree) const =0
virtual ChildUpdator * clone() const =0
auto_ptr< ClusterSequence > cs
ParentParticleFitter * parentFitter
std::vector< RefCountedKinematicTree > fit(KinematicConstraint *cs, const std::vector< RefCountedKinematicTree > &trees) const
virtual std::vector< RefCountedKinematicTree > fit(const std::vector< RefCountedKinematicTree > &trees, KinematicConstraint *cs) const =0
virtual ParentParticleFitter * clone() const =0