CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
KinematicParticleFitter Class Reference

#include <KinematicParticleFitter.h>

Public Member Functions

std::vector< RefCountedKinematicTreefit (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() [1/2]

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() [2/2]

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

Constructor allowing use of any fitter-updator pair implemented

Definition at line 10 of file KinematicParticleFitter.cc.

References ParentParticleFitter::clone(), cUpdator, parentFitter, and HLT_2023v12_cff::updator.

10  {
11  parentFitter = fitter.clone();
12  cUpdator = updator.clone();
13 }
ParentParticleFitter * parentFitter
virtual ParentParticleFitter * clone() const =0

◆ ~KinematicParticleFitter()

KinematicParticleFitter::~KinematicParticleFitter ( )

Definition at line 15 of file KinematicParticleFitter.cc.

References cUpdator, and parentFitter.

15  {
16  delete parentFitter;
17  delete cUpdator;
18 }
ParentParticleFitter * parentFitter

Member Function Documentation

◆ fit() [1/2]

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 20 of file KinematicParticleFitter.cc.

References callgraph::cs, cUpdator, ParentParticleFitter::fit(), parentFitter, dqmdumpme::trees, and ChildUpdator::update().

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

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

◆ fit() [2/2]

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 30 of file KinematicParticleFitter.cc.

References callgraph::cs, cUpdator, ParentParticleFitter::fit(), parentFitter, dqmdumpme::trees, and ChildUpdator::update().

Referenced by trackingPlots.Iteration::modules().

30  {
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
Definition: tree.py:1

Member Data Documentation

◆ cUpdator

ChildUpdator* KinematicParticleFitter::cUpdator
private

◆ parentFitter

ParentParticleFitter* KinematicParticleFitter::parentFitter
private