Belle II Software  release-05-01-25
DecayChain.h
1 /**************************************************************************
2  *
3  * BASF2 (Belle Analysis Framework 2) *
4  * Copyright(C) 2013 - Belle II Collaboration *
5  * *
6  * Author: The Belle II Collaboration *
7  * Contributor: Wouter Hulsbergen, Francesco Tenchini, Jo-Frederik Krohn *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 #pragma once
12 
13 #include <analysis/VertexFitting/TreeFitter/ParticleBase.h>
14 #include <analysis/VertexFitting/TreeFitter/MergedConstraint.h>
15 #include <analysis/VertexFitting/TreeFitter/ConstraintConfiguration.h>
16 
17 namespace TreeFitter {
18 
19  class FitParams ;
20  class ParticleBase ;
21  class ConstraintConfiguration;
25  class DecayChain {
26 
27  public:
28 
30  DecayChain() : m_dim(0), m_headOfChain(0), m_cand(0), m_isOwner(true) {} //Default constructor (actually never used)
31 
34  const ConstraintConfiguration& config,
35  bool forceFitAll = false
36  );
37 
40 
43 
45  ErrCode filter(FitParams& par);
46 
49 
51  int dim() const { return m_dim;}
52 
54  void initConstraintList();
55 
58 
60  double chiSquare(const FitParams& par) const;
61 
63  ParticleBase* mother() { return m_headOfChain ; }
64 
66  const ParticleBase* cand() { return m_cand ; }
67 
69  const ParticleBase* mother() const { return m_headOfChain ; }
70 
72  const ParticleBase* locate(Belle2::Particle* bc) const ;
73 
75  int index(Belle2::Particle* bc) const ;
76 
78  int posIndex(Belle2::Particle* bc) const ;
79 
81  int momIndex(Belle2::Particle* bc) const ;
82 
84  int tauIndex(Belle2::Particle* bc) const ;
85 
87  int momIndex() const ;
88 
89  private:
90 
91  mutable int m_dim ;
93  mutable ParticleBase* m_headOfChain ;
95  const ParticleBase* m_cand ;
99 
101  typedef std::map<Belle2::Particle*, const ParticleBase*> ParticleMap ;
102 
105 
107  const bool m_isOwner ;
108 
111 
112  };
113 
114 }
TreeFitter::DecayChain::m_constraintlist
ParticleBase::constraintlist m_constraintlist
list of constraints
Definition: DecayChain.h:107
TreeFitter::DecayChain::initialize
ErrCode initialize(FitParams &par)
initalize the chain
Definition: DecayChain.cc:85
TreeFitter::DecayChain::m_particleMap
ParticleMap m_particleMap
the map from Belle2::Particles to TreeFitter::ParticleBase
Definition: DecayChain.h:113
TreeFitter::DecayChain::m_isOwner
const bool m_isOwner
internal class member to check if we own the chain
Definition: DecayChain.h:116
TreeFitter::DecayChain::filter
ErrCode filter(FitParams &par)
filter down the chain
Definition: DecayChain.cc:96
TreeFitter::ConstraintConfiguration
constainer
Definition: ConstraintConfiguration.h:25
TreeFitter::DecayChain::cand
const ParticleBase * cand()
get candidate
Definition: DecayChain.h:75
TreeFitter::DecayChain::DecayChain
DecayChain()
empty constructor
Definition: DecayChain.h:39
TreeFitter::ErrCode
abstract errorocode be aware that the default is succes
Definition: ErrCode.h:23
TreeFitter::DecayChain::tauIndex
int tauIndex(Belle2::Particle *bc) const
get tau (i.e.
Definition: DecayChain.cc:172
TreeFitter::ParticleBase
base class for all particles
Definition: ParticleBase.h:36
TreeFitter::FitParams
Class to store and manage fitparams (statevector)
Definition: FitParams.h:29
TreeFitter::DecayChain::locate
const ParticleBase * locate(Belle2::Particle *bc) const
convert Belle2::particle into particle base(fitter base particle)
Definition: DecayChain.cc:126
TreeFitter::DecayChain::posIndex
int posIndex(Belle2::Particle *bc) const
get the vertex index of the particle in state vector
Definition: DecayChain.cc:154
TreeFitter::DecayChain::ParticleMap
std::map< Belle2::Particle *, const ParticleBase * > ParticleMap
typedef for a map of a particle to a TreeFitter::ParticleBase
Definition: DecayChain.h:110
TreeFitter::DecayChain::filterWithReference
ErrCode filterWithReference(FitParams &par, const FitParams &ref)
filter with respect to a previous iteration for better stability
Definition: DecayChain.cc:108
TreeFitter::DecayChain::m_config
const ConstraintConfiguration m_config
config container
Definition: DecayChain.h:119
TreeFitter::DecayChain::mother
ParticleBase * mother()
get mother
Definition: DecayChain.h:72
TreeFitter::DecayChain::chiSquare
double chiSquare(const FitParams &par) const
get the chi2 for the head of the chain
Definition: DecayChain.cc:121
TreeFitter::ParticleBase::constraintlist
std::vector< Constraint > constraintlist
alias
Definition: ParticleBase.h:69
TreeFitter::DecayChain::m_cand
const ParticleBase * m_cand
fit candidate (not same to mother in case of bs/be constraint)
Definition: DecayChain.h:104
Belle2::Particle
Class to store reconstructed particles.
Definition: Particle.h:77
TreeFitter::DecayChain::~DecayChain
~DecayChain()
destructor
Definition: DecayChain.cc:61
TreeFitter::DecayChain::removeConstraintFromList
void removeConstraintFromList()
remove constraints from list
Definition: DecayChain.cc:76
TreeFitter::DecayChain::initConstraintList
void initConstraintList()
init contraintlist
Definition: DecayChain.cc:68
TreeFitter::DecayChain::m_headOfChain
ParticleBase * m_headOfChain
head of decay tree
Definition: DecayChain.h:102
TreeFitter::DecayChain::m_dim
int m_dim
the dimension of constraint
Definition: DecayChain.h:100
TreeFitter::DecayChain::index
int index(Belle2::Particle *bc) const
get the particle index
Definition: DecayChain.cc:145
TreeFitter::DecayChain::momIndex
int momIndex() const
!NOT IMPLEMENTED
TreeFitter::DecayChain::dim
int dim() const
get dimension
Definition: DecayChain.h:60