CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
KinematicParticleFitter Class Reference

#include <KinematicParticleFitter.h>

Public Member Functions

std::vector
< RefCountedKinematicTree
fit (KinematicConstraint *cs, const std::vector< RefCountedKinematicTree > &trees) const
 
RefCountedKinematicTree fit (KinematicConstraint *cs, RefCountedKinematicTree tree) const
 
 KinematicParticleFitter ()
 
 KinematicParticleFitter (const ParentParticleFitter &fitter, const ChildUpdator &updator)
 
 ~KinematicParticleFitter ()
 

Private Attributes

ChildUpdatorcUpdator
 
ParentParticleFitterparentFitter
 

Detailed Description

Class making kinematic fit of the particle inside the KinematicTree. The daughter states of the tree get automathically refitted according to the changes done to mother state. Mechanism is split in 2 parts: ParentParticleFitter to fit the mother particle and ChildUpdator to update the states of daughter particles. Child updator is currently not implemented. Fitter is designed to use any user provided algorithm for state refit.

Definition at line 23 of file KinematicParticleFitter.h.

Constructor & Destructor Documentation

KinematicParticleFitter::KinematicParticleFitter ( )

Default constructor using LMS with Lagrange multipliers for particle refit.

Definition at line 5 of file KinematicParticleFitter.cc.

References cUpdator, and parentFitter.

KinematicParticleFitter::KinematicParticleFitter ( const ParentParticleFitter fitter,
const ChildUpdator updator 
)

Constructor allowing use of any fitter-updator pair implemented

Definition at line 11 of file KinematicParticleFitter.cc.

References ParentParticleFitter::clone(), ChildUpdator::clone(), cUpdator, and parentFitter.

12 {
13  parentFitter = fitter.clone();
14  cUpdator = updator.clone();
15 }
virtual ChildUpdator * clone() const =0
ParentParticleFitter * parentFitter
virtual ParentParticleFitter * clone() const =0
KinematicParticleFitter::~KinematicParticleFitter ( )

Definition at line 17 of file KinematicParticleFitter.cc.

References cUpdator, and parentFitter.

18 {
19  delete parentFitter;
20  delete cUpdator;
21 }
ParentParticleFitter * parentFitter

Member Function Documentation

std::vector< RefCountedKinematicTree > KinematicParticleFitter::fit ( KinematicConstraint cs,
const std::vector< RefCountedKinematicTree > &  trees 
) const

Method applying the constraint to the TOP particle inside the Kinematic Tree. Tree containing the refitted state is returned. The initial state of the particle and constraint applyed are stored in particle's corresponding data memebers In case of failure, an empty vector is returned.

Definition at line 23 of file KinematicParticleFitter.cc.

References cUpdator, ParentParticleFitter::fit(), parentFitter, and ChildUpdator::update().

Referenced by KineExample::analyze(), and CandKinematicVertexFitter::fill().

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 }
virtual RefCountedKinematicTree update(RefCountedKinematicTree tree) const =0
ParentParticleFitter * parentFitter
virtual std::vector< RefCountedKinematicTree > fit(const std::vector< RefCountedKinematicTree > &trees, KinematicConstraint *cs) const =0
RefCountedKinematicTree KinematicParticleFitter::fit ( KinematicConstraint cs,
RefCountedKinematicTree  tree 
) const

Method refitting a top particle of the single tree. for backup compatibility and constraints not allowing multiple track refits. In case of failure, an invalid tree is returned.

Definition at line 33 of file KinematicParticleFitter.cc.

References cUpdator, ParentParticleFitter::fit(), parentFitter, and ChildUpdator::update().

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
ParentParticleFitter * parentFitter
virtual std::vector< RefCountedKinematicTree > fit(const std::vector< RefCountedKinematicTree > &trees, KinematicConstraint *cs) const =0

Member Data Documentation

ChildUpdator* KinematicParticleFitter::cUpdator
private
ParentParticleFitter* KinematicParticleFitter::parentFitter
private