Belle II Software development
FitManager.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * External Contributor: Wouter Hulsbergen *
5 * *
6 * See git log for contributors and copyright holders. *
7 * This file is licensed under LGPL-3.0, see LICENSE.md. *
8 **************************************************************************/
9#pragma once
10
11#include <analysis/VertexFitting/TreeFitter/ErrCode.h>
12#include <analysis/VertexFitting/TreeFitter/ConstraintConfiguration.h>
13
14namespace Belle2 {
19 class Particle;
21}
22
23namespace TreeFitter {
24 class DecayChain;
25 class FitParams;
26 class ParticleBase;
27
29 class FitManager {
30 public:
31
33 enum VertexStatus { Success = 0, NonConverged, BadInput, Failed, UnFitted };
34
37 m_chiSquare(-1), m_prec(0.01), m_updateDaugthers(false), m_ndf(0),
39 {}
40
43 const ConstraintConfiguration& config,
44 double prec = 0.01,
45 bool updateDaughters = false
46 );
47
49 FitManager(const FitManager& other) = delete;
50
52 FitManager& operator=(const FitManager& other) = delete;
53
56
58 bool fit();
59
61 bool updateCand(Belle2::Particle& particle, const bool isTreeHead) const;
62
64 void updateCand(const ParticleBase& pb, Belle2::Particle& cand, const bool isTreeHead) const;
65
67 void updateTree(Belle2::Particle& particle, const bool isTreeHead) const;
68
70 void getCovFromPB(const ParticleBase* pb, TMatrixFSym& returncov) const;
71
73 std::tuple<double, double> getLifeTime(Belle2::Particle& cand) const;
74
76 std::tuple<double, double> getDecayLength(const ParticleBase* pb) const;
77
79 std::tuple<double, double> getDecayLength(const ParticleBase* pb, const FitParams& fitparams) const;
80
82 std::tuple<double, double> getDecayLength(Belle2::Particle& cand) const;
83
86
87 private:
90
93
96
99
101 double m_prec;
102
105
108
110 int m_ndf;
111
114
117 };
118}
Class to store reconstructed particles.
Definition Particle.h:76
this class does a lot of stuff: Build decaytree structure allowing to index particles and handle the ...
Definition DecayChain.h:21
abstract errorocode be aware that the default is success
Definition ErrCode.h:14
const ConstraintConfiguration m_config
config container
Definition FitManager.h:116
DecayChain * m_decaychain
the decay tree
Definition FitManager.h:92
FitManager()
constructor
Definition FitManager.h:36
FitManager & operator=(const FitManager &other)=delete
use default assignment op
Belle2::Particle * particle()
getter for the head of the tree
Definition FitManager.h:85
ErrCode m_errCode
errorcode
Definition FitManager.h:104
void getCovFromPB(const ParticleBase *pb, TMatrixFSym &returncov) const
extract cov from particle base
void updateTree(Belle2::Particle &particle, const bool isTreeHead) const
update the Belle2::Particles with the fit results
FitParams * m_fitparams
parameters to be fitted
Definition FitManager.h:113
const bool m_updateDaugthers
if this is set all daughters will be updated otherwise only the head of the tree
Definition FitManager.h:107
~FitManager()
destructor does stuff
Definition FitManager.cc:43
int m_ndf
number of degrees of freedom for this topology
Definition FitManager.h:110
double m_prec
precision that is needed for status:converged (delta chi2)
Definition FitManager.h:101
bool fit()
main fit function that uses the kalman filter
Definition FitManager.cc:49
int m_status
status of the current iteration
Definition FitManager.h:95
FitManager(const FitManager &other)=delete
use default copy constructor
Belle2::Particle * m_particle
head of the tree
Definition FitManager.h:89
double m_chiSquare
chi2 of the current iteration
Definition FitManager.h:98
VertexStatus
status flag of the fit-itereation (the step in the newton method)
Definition FitManager.h:33
std::tuple< double, double > getLifeTime(Belle2::Particle &cand) const
get lifetime
std::tuple< double, double > getDecayLength(const ParticleBase *pb) const
get decay length
bool updateCand(Belle2::Particle &particle, const bool isTreeHead) const
update particles parameters with the fit results
Class to store and manage fitparams (statevector)
Definition FitParams.h:20
base class for all particles
Abstract base class for different kinds of events.