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/dataobjects/Particle.h>
12#include <analysis/VertexFitting/TreeFitter/ErrCode.h>
13#include <analysis/VertexFitting/TreeFitter/ConstraintConfiguration.h>
14
15namespace TreeFitter {
16 class DecayChain;
17 class FitParams;
18 class ParticleBase;
19 class ConstraintConfiguration;
20
22 class FitManager {
23 public:
24
26 enum VertexStatus { Success = 0, NonConverged, BadInput, Failed, UnFitted };
27
30 m_chiSquare(-1), m_prec(0.01), m_updateDaugthers(false), m_ndf(0),
32 {}
33
36 const ConstraintConfiguration& config,
37 double prec = 0.01,
38 bool updateDaughters = false,
39 const bool useReferencing = false
40 );
41
43 FitManager(const FitManager& other) = delete;
44
46 FitManager& operator=(const FitManager& other) = delete;
47
50
52 bool fit();
53
55 bool updateCand(Belle2::Particle& particle, const bool isTreeHead) const;
56
58 void updateCand(const ParticleBase& pb, Belle2::Particle& cand, const bool isTreeHead) const;
59
61 void updateTree(Belle2::Particle& particle, const bool isTreeHead) const;
62
64 void getCovFromPB(const ParticleBase* pb, TMatrixFSym& returncov) const;
65
67 std::tuple<double, double> getLifeTime(Belle2::Particle& cand) const;
68
70 std::tuple<double, double> getDecayLength(const ParticleBase* pb) const;
71
73 std::tuple<double, double> getDecayLength(const ParticleBase* pb, const FitParams& fitparams) const;
74
76 std::tuple<double, double> getDecayLength(Belle2::Particle& cand) const;
77
80
81 private:
84
87
90
93
95 double m_prec;
96
99
102
104 int m_ndf;
105
108
111
114 };
115}
Class to store reconstructed particles.
Definition: Particle.h:75
constraint configuration class
this class does a lot of stuff: Build decaytree structure allowing to index particles and handle the ...
Definition: DecayChain.h:23
abstract errorocode be aware that the default is success
Definition: ErrCode.h:14
const ConstraintConfiguration m_config
config container
Definition: FitManager.h:113
DecayChain * m_decaychain
the decay tree
Definition: FitManager.h:86
FitManager()
constructor
Definition: FitManager.h:29
FitManager & operator=(const FitManager &other)=delete
use default assignment op
Belle2::Particle * particle()
getter for the head of the tree
Definition: FitManager.h:79
ErrCode m_errCode
errorcode
Definition: FitManager.h:98
void getCovFromPB(const ParticleBase *pb, TMatrixFSym &returncov) const
extract cov from particle base
Definition: FitManager.cc:127
void updateTree(Belle2::Particle &particle, const bool isTreeHead) const
update the Belle2::Particles with the fit results
Definition: FitManager.cc:262
FitParams * m_fitparams
parameters to be fitted
Definition: FitManager.h:107
const bool m_updateDaugthers
if this is set all daughters will be updated otherwise only the head of the tree
Definition: FitManager.h:101
~FitManager()
destructor does stuff
Definition: FitManager.cc:45
int m_ndf
number of degrees of freedom for this topology
Definition: FitManager.h:104
double m_prec
precision that is needed for status:converged (delta chi2)
Definition: FitManager.h:95
bool fit()
main fit function that uses the kalman filter
Definition: FitManager.cc:51
int m_status
status of the current iteration
Definition: FitManager.h:89
FitManager(const FitManager &other)=delete
use default copy constructor
Belle2::Particle * m_particle
head of the tree
Definition: FitManager.h:83
double m_chiSquare
chi2 of the current iteration
Definition: FitManager.h:92
bool m_useReferencing
use referencing
Definition: FitManager.h:110
VertexStatus
status flag of the fit-itereation (the step in the newton method)
Definition: FitManager.h:26
std::tuple< double, double > getLifeTime(Belle2::Particle &cand) const
get lifetime
Definition: FitManager.cc:276
std::tuple< double, double > getDecayLength(const ParticleBase *pb) const
get decay length
Definition: FitManager.cc:319
bool updateCand(Belle2::Particle &particle, const bool isTreeHead) const
update particles parameters with the fit results
Definition: FitManager.cc:191
Class to store and manage fitparams (statevector)
Definition: FitParams.h:20
base class for all particles
Definition: ParticleBase.h:25