Belle II Software  release-08-01-10
DecayChain.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/ParticleBase.h>
12 #include <analysis/VertexFitting/TreeFitter/MergedConstraint.h>
13 #include <analysis/VertexFitting/TreeFitter/ConstraintConfiguration.h>
14 
15 namespace TreeFitter {
16 
17  class FitParams ;
18  class ParticleBase ;
19  class ConstraintConfiguration;
23  class DecayChain {
24 
25  public:
26 
28  DecayChain() : m_dim(0), m_headOfChain(0), m_cand(0), m_isOwner(true) {} //Default constructor (actually never used)
29 
32  const ConstraintConfiguration& config,
33  bool forceFitAll = false
34  );
35 
37  ~DecayChain();
38 
41 
43  ErrCode filter(FitParams& par);
44 
47 
49  int dim() const { return m_dim;}
50 
52  void initConstraintList();
53 
56 
58  double chiSquare(const FitParams& par) const;
59 
62 
64  const ParticleBase* cand() { return m_cand ; }
65 
67  const ParticleBase* mother() const { return m_headOfChain ; }
68 
70  const ParticleBase* locate(Belle2::Particle* bc) const ;
71 
73  int index(Belle2::Particle* bc) const ;
74 
76  int posIndex(Belle2::Particle* bc) const ;
77 
79  int momIndex(Belle2::Particle* bc) const ;
80 
82  int tauIndex(Belle2::Particle* bc) const ;
83 
85  int momIndex() const ;
86 
87  private:
88 
89  mutable int m_dim ;
93  const ParticleBase* m_cand ;
97 
99  typedef std::map<Belle2::Particle*, const ParticleBase*> ParticleMap ;
100 
103 
105  const bool m_isOwner ;
106 
109 
110  };
111 
112 }
Class to store reconstructed particles.
Definition: Particle.h:75
this class does a lot of stuff: Build decaytree structure allowing to index particles and handle the ...
Definition: DecayChain.h:23
double chiSquare(const FitParams &par) const
get the chi2 for the head of the chain
Definition: DecayChain.cc:106
const ConstraintConfiguration m_config
config container
Definition: DecayChain.h:108
ErrCode initialize(FitParams &par)
initialize the chain
Definition: DecayChain.cc:70
const ParticleBase * cand()
get candidate
Definition: DecayChain.h:64
int m_dim
the dimension of constraint
Definition: DecayChain.h:89
ParticleBase::constraintlist m_constraintlist
list of constraints
Definition: DecayChain.h:96
void removeConstraintFromList()
remove constraints from list
Definition: DecayChain.cc:61
std::map< Belle2::Particle *, const ParticleBase * > ParticleMap
typedef for a map of a particle to a TreeFitter::ParticleBase
Definition: DecayChain.h:99
void initConstraintList()
init contraintlist
Definition: DecayChain.cc:53
ParticleBase * m_headOfChain
head of decay tree
Definition: DecayChain.h:91
const ParticleBase * locate(Belle2::Particle *bc) const
convert Belle2::particle into particle base(fitter base particle)
Definition: DecayChain.cc:111
int dim() const
get dimension
Definition: DecayChain.h:49
ErrCode filterWithReference(FitParams &par, const FitParams &ref)
filter with respect to a previous iteration for better stability
Definition: DecayChain.cc:93
const bool m_isOwner
internal class member to check if we own the chain
Definition: DecayChain.h:105
const ParticleBase * m_cand
fit candidate (not same to mother in case of bs/be constraint)
Definition: DecayChain.h:93
ParticleBase * mother()
get mother
Definition: DecayChain.h:61
int index(Belle2::Particle *bc) const
get the particle index
Definition: DecayChain.cc:130
DecayChain()
empty constructor
Definition: DecayChain.h:28
int tauIndex(Belle2::Particle *bc) const
get tau (i.e.
Definition: DecayChain.cc:157
int momIndex() const
!NOT IMPLEMENTED
~DecayChain()
destructor
Definition: DecayChain.cc:46
ErrCode filter(FitParams &par)
filter down the chain
Definition: DecayChain.cc:81
const ParticleBase * mother() const
get mother
Definition: DecayChain.h:67
int posIndex(Belle2::Particle *bc) const
get the vertex index of the particle in state vector
Definition: DecayChain.cc:139
ParticleMap m_particleMap
the map from Belle2::Particles to TreeFitter::ParticleBase
Definition: DecayChain.h:102
abstract errorocode be aware that the default is success
Definition: ErrCode.h:14
Class to store and manage fitparams (statevector)
Definition: FitParams.h:20
base class for all particles
Definition: ParticleBase.h:25
std::vector< Constraint > constraintlist
alias
Definition: ParticleBase.h:52