00001 #include "RecoVertex/KinematicFit/interface/KinematicParticleFitter.h" 00002 #include "RecoVertex/KinematicFit/interface/LagrangeParentParticleFitter.h" 00003 #include "RecoVertex/KinematicFit/interface/LagrangeChildUpdator.h" 00004 00005 KinematicParticleFitter::KinematicParticleFitter() 00006 { 00007 parentFitter = new LagrangeParentParticleFitter(); 00008 cUpdator = new LagrangeChildUpdator(); 00009 } 00010 00011 KinematicParticleFitter::KinematicParticleFitter(const ParentParticleFitter& fitter, const ChildUpdator& updator) 00012 { 00013 parentFitter = fitter.clone(); 00014 cUpdator = updator.clone(); 00015 } 00016 00017 KinematicParticleFitter::~KinematicParticleFitter() 00018 { 00019 delete parentFitter; 00020 delete cUpdator; 00021 } 00022 00023 vector<RefCountedKinematicTree> KinematicParticleFitter::fit(KinematicConstraint * cs , 00024 vector<RefCountedKinematicTree> trees)const 00025 { 00026 vector<RefCountedKinematicTree> tr = parentFitter->fit(trees,cs); 00027 tr = cUpdator->update(tr); 00028 return tr; 00029 } 00030 00031 RefCountedKinematicTree KinematicParticleFitter::fit(KinematicConstraint * cs , 00032 RefCountedKinematicTree tree)const 00033 { 00034 vector<RefCountedKinematicTree> trees; 00035 trees.push_back(tree); 00036 vector<RefCountedKinematicTree> tr = parentFitter->fit(trees,cs); 00037 tr = cUpdator->update(tr); 00038 return tr.front(); 00039 }