Belle II Software  light-2212-foldex
TreeFitterModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <framework/core/Module.h>
11 #include <framework/database/DBObjPtr.h>
12 #include <framework/datastore/StoreArray.h>
13 #include <framework/datastore/StoreObjPtr.h>
14 #include <framework/dbobjects/BeamParameters.h>
15 
16 #include <analysis/dataobjects/Particle.h>
17 #include <analysis/dataobjects/ParticleList.h>
18 
19 #include <analysis/VertexFitting/TreeFitter/ConstraintConfiguration.h>
20 
21 #include <analysis/DecayDescriptor/DecayDescriptor.h>
22 
23 namespace Belle2 {
28  class Particle;
29 
36  class TreeFitterModule : public Module {
37 
38  public:
41 
43  virtual void initialize() override;
44 
46  virtual void beginRun() override;
47 
49  virtual void event() override;
50 
52  virtual void terminate() override;
53 
54  private:
55 
57  void plotFancyASCII();
58 
61 
63  std::string m_particleList;
64 
73 
79  double m_precision;
80 
82  std::vector<int> m_massConstraintList;
83 
85  std::vector<int> m_geoConstraintListPDG;
86 
89  std::vector<int> m_fixedToMotherVertexListPDG;
90 
92  std::vector<std::string> m_massConstraintListParticlename;
97 
100 
106 
108  bool fitTree(Particle* head);
109 
112 
114  unsigned int m_nCandidatesAfter;
115 
120 
124 
127 
129  std::vector<double> m_customOriginVertex;
130 
132  std::vector<double> m_customOriginCovariance;
133 
137  std::vector<std::string> m_removeConstraintList;
138 
143 
146 
149 
151  Eigen::Matrix<double, 4, 1> m_beamMomE;
152 
154  Eigen::Matrix<double, 4, 4> m_beamCovariance;
155 
157  std::string m_treatAsInvisible;
158 
161 
164 
167  };
169 }
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
Base class for Modules.
Definition: Module.h:72
Class to store reconstructed particles.
Definition: Particle.h:74
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
Module to fit an entire decay tree.
void plotFancyASCII()
plot ascii art and statistics
std::vector< double > m_customOriginVertex
vertex coordinates of the custom origin
DBObjPtr< BeamParameters > m_beamparams
Pointer to the BeamParameters.
virtual void initialize() override
initialize
virtual void event() override
performed for each event
Eigen::Matrix< double, 4, 1 > m_beamMomE
beam four-momentum
bool m_updateDaughters
flag if you want to update all particle momenta in the decay tree.
DecayDescriptor m_pDDescriptorInvisibles
Decay descriptor of the invisible particles.
std::vector< std::string > m_massConstraintListParticlename
vector carrying the names of the particles to be mass constraint
unsigned int m_nCandidatesAfter
after the fit
std::vector< int > m_massConstraintList
vector carrying the PDG codes of the particles to be mass constraint
std::vector< int > m_fixedToMotherVertexListPDG
list of pdg codes of particles where we use the same vertex for production and decay which is the ver...
StoreArray< Particle > m_particles
StoreArray of Particles.
virtual void terminate() override
stuff at the end
bool m_automatic_vertex_constraining
should the vertex be joined with the mother and should it be geometrically constrained?...
virtual void beginRun() override
performed at the start of run
bool m_ipConstraint
Use x-y-z beamspot constraint.
int m_originDimension
dimension to use for beam/origin constraint
int m_inflationFactorCovZ
inflate beamspot covariance of z by this number
std::vector< std::string > m_removeConstraintList
list of constraints not to be applied in tree fit WARNING only use if you know what you are doing
int m_massConstraintType
type of the mass constraint false: use normal one.
std::vector< int > m_geoConstraintListPDG
list of pdg codes of particles to use a geo constraint for
std::vector< double > m_customOriginCovariance
covariance of the custom origin
std::string m_particleList
name of the particle list fed to the fitter
double m_confidenceLevel
minimum confidence level to accept fit calculated as f(chiSquared, NDF) -2: accept all 0: only accept...
bool m_customOrigin
use a custom vertex as the production vertex of the highest hierarchy particle
std::string m_treatAsInvisible
decay string to select one particle that will be treated as invisible
Eigen::Matrix< double, 4, 4 > m_beamCovariance
beam covariance matrix
int m_beamConstraintPDG
PDG code of particle to be constrained to the beam 4-momentum.
bool m_useReferencing
linearise around a previous state of the Kalman Filter
bool fitTree(Particle *head)
this fits all particle candidates contained in the m_particleList
double m_precision
convergence precision for the newton method When the delta chiSquared between 2 iterations divided by...
StoreObjPtr< ParticleList > m_plist
input particle list
unsigned int m_nCandidatesBeforeFit
before the fit
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:23