 |
Belle II Software
release-05-01-25
|
14 #include <framework/logging/Logger.h>
16 #include <analysis/VertexFitting/TreeFitter/FitParams.h>
17 #include <analysis/VertexFitting/TreeFitter/ParticleBase.h>
18 #include <analysis/VertexFitting/TreeFitter/DecayChain.h>
21 namespace TreeFitter {
24 const ConstraintConfiguration& config,
28 m_headOfChain(nullptr),
33 if (config.m_ipConstraint && config.m_customOrigin) {
34 B2FATAL(
"Setup error. Cant have both custom origin and ip constraint.");
36 config.m_headOfTreePDG = std::abs(particle->getPDGCode());
37 if (config.m_ipConstraint || config.m_customOrigin) {
42 }
else if ((!config.m_customOrigin) && (!config.m_ipConstraint)) {
47 m_headOfChain->updateIndex(
m_dim);
49 m_cand = locate(particle);
71 [&](
const Constraint & constraint) { return constraint.name() == removeConstraint ;}),
79 par.resetStateVector();
81 par.resetCovariance();
90 par.resetCovariance();
94 status |= constraint.filter(par);
102 par.resetCovariance();
104 par.resetChiSquare();
106 status |= constraint.filterWithReference(par, ref);
119 const ParticleBase* rc(
nullptr);
126 if (rc && rc->particle()) {
138 const ParticleBase* base =
locate(particle);
140 return base->index();
149 return base->posIndex();
158 return base->momIndex();
167 return base->tauIndex();
ParticleBase::constraintlist m_constraintlist
list of constraints
unsigned int m_dim
dimension of constraint
ErrCode initialize(FitParams &par)
initalize the chain
static ParticleBase * createParticle(Belle2::Particle *particle, const ParticleBase *mother, const ConstraintConfiguration &config, bool forceFitAll=false)
create the according treeFitter particle obj for a basf2 particle type
ParticleMap m_particleMap
the map from Belle2::Particles to TreeFitter::ParticleBase
const bool m_isOwner
internal class member to check if we own the chain
ErrCode filter(FitParams &par)
filter down the chain
const ParticleBase * locate(Belle2::Particle *particle) const
get particle base from basf2 particle
DecayChain()
empty constructor
abstract errorocode be aware that the default is succes
int tauIndex(Belle2::Particle *bc) const
get tau (i.e.
base class for all particles
virtual double chiSquare(const FitParams &) const
get chi2
Class to store and manage fitparams (statevector)
const ParticleBase * locate(Belle2::Particle *bc) const
convert Belle2::particle into particle base(fitter base particle)
int posIndex(Belle2::Particle *bc) const
get the vertex index of the particle in state vector
ErrCode filterWithReference(FitParams &par, const FitParams &ref)
filter with respect to a previous iteration for better stability
virtual void addToConstraintList(constraintlist &alist, int depth) const =0
add to constraint list
static ParticleBase * createOrigin(Belle2::Particle *daughter, const ConstraintConfiguration &config, bool forceFitAll)
create a custom origin particle or a beamspot
this class does a lot of stuff: Build decaytree structure allowing to index particles and handle the ...
class to manage the order of contraints and their filtering
const ConstraintConfiguration m_config
config container
double chiSquare(const FitParams &par) const
get the chi2 for the head of the chain
virtual ErrCode initCovariance(FitParams &) const
init covariance matrix
Class to store reconstructed particles.
void removeConstraintFromList()
remove constraints from list
void initConstraintList()
init contraintlist
virtual ErrCode initMotherlessParticle(FitParams &)=0
init particle that does not need a mother vertex
ParticleBase * m_headOfChain
head of decay tree
int index(Belle2::Particle *bc) const
get the particle index
int momIndex() const
!NOT IMPLEMENTED
const std::vector< std::string > m_removeConstraintList
list of constraints not to apply in tree fit