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.

10  {
11  parentFitter = fitter.clone();
12  cUpdator = updator.clone();
13 }

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

◆ ~KinematicParticleFitter()

KinematicParticleFitter::~KinematicParticleFitter ( )

Definition at line 15 of file KinematicParticleFitter.cc.

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

References cUpdator, and 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.

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 }

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

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

◆ 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.

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 }

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

Referenced by trackingPlots.Iteration::modules().

Member Data Documentation

◆ cUpdator

ChildUpdator* KinematicParticleFitter::cUpdator
private

◆ parentFitter

ParentParticleFitter* KinematicParticleFitter::parentFitter
private
LagrangeParentParticleFitter
Definition: LagrangeParentParticleFitter.h:18
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:45
KinematicParticleFitter::parentFitter
ParentParticleFitter * parentFitter
Definition: KinematicParticleFitter.h:62
KinematicParticleFitter::cUpdator
ChildUpdator * cUpdator
Definition: KinematicParticleFitter.h:63
tree
Definition: tree.py:1
KinematicTree
Definition: KinematicTree.h:36
LagrangeChildUpdator
Definition: LagrangeChildUpdator.h:13
ReferenceCountingPointer< KinematicTree >
HLT_2018_cff.updator
updator
Definition: HLT_2018_cff.py:123
dqmdumpme.trees
trees
Definition: dqmdumpme.py:37
ChildUpdator::update
virtual RefCountedKinematicTree update(RefCountedKinematicTree tree) const =0
ParentParticleFitter::clone
virtual ParentParticleFitter * clone() const =0
ParentParticleFitter::fit
virtual std::vector< RefCountedKinematicTree > fit(const std::vector< RefCountedKinematicTree > &trees, KinematicConstraint *cs) const =0