Belle II Software  release-05-02-19
ParticleVertexFitterModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric, Luigi Li Gioi, Anze Zupanc *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/Module.h>
14 #include <string>
15 #include <analysis/DecayDescriptor/DecayDescriptor.h>
16 
17 // DataStore
18 #include <framework/database/DBObjPtr.h>
19 
20 // DataObjects
21 #include <mdst/dbobjects/BeamSpot.h>
22 
23 // KFit
24 #include <analysis/VertexFitting/KFit/MassFitKFit.h>
25 #include <analysis/VertexFitting/KFit/FourCFitKFit.h>
26 #include <analysis/VertexFitting/KFit/MassPointingVertexFitKFit.h>
27 #include <analysis/VertexFitting/KFit/MassVertexFitKFit.h>
28 #include <analysis/VertexFitting/KFit/VertexFitKFit.h>
29 #include <analysis/VertexFitting/KFit/MakeMotherKFit.h>
30 
31 // Rave
32 #include <analysis/VertexFitting/RaveInterface/RaveSetup.h>
33 #include <analysis/VertexFitting/RaveInterface/RaveVertexFitter.h>
34 #include <analysis/VertexFitting/RaveInterface/RaveKinematicVertexFitter.h>
35 
36 namespace Belle2 {
42  class Particle;
43 
47  class ParticleVertexFitterModule : public Module {
48 
49  public:
50 
55 
60  virtual void initialize() override;
61 
66  virtual void beginRun() override;
67 
71  virtual void event() override;
72 
73  private:
74 
75  std::string m_listName;
76  double m_confidenceLevel;
77  double m_Bfield;
78  std::string m_vertexFitter;
79  std::string m_fitType;
80  std::string m_withConstraint;
81  std::string m_decayString;
82  bool m_updateDaughters;
84  bool m_hasCovMatrix = false;
85  TVector3 m_BeamSpotCenter;
86  TMatrixDSym m_beamSpotCov;
88  double m_smearing;
96 
102  bool doKVertexFit(Particle* p, bool ipProfileConstraint, bool ipTubeConstraint);
103 
109  bool doKMassVertexFit(Particle* p);
110 
117 
123  bool doKMassFit(Particle* p);
124 
130  bool doKFourCFit(Particle* p);
131 
139 
147 
155 
163 
171 
180  void updateMapOfTrackAndDaughter(unsigned& l, std::vector<std::vector<unsigned>>& pars, std::vector<unsigned>& pard,
181  std::vector<Particle*>& allparticles, const Particle* daughter);
182 
188  bool addChildofParticletoKFit(analysis::FourCFitKFit& kv, const Particle* particle);
189 
194 
199 
204  bool fillFitParticles(const Particle* mother, std::vector<const Particle*>& fitChildren, std::vector<const Particle*>& pi0Children);
205 
209  bool redoPi0MassFit(Particle* pi0Temp, const Particle* pi0Orig, const analysis::VertexFitKFit& kv) ;
210 
216  bool doRaveFit(Particle* mother);
217 
219  bool allSelectedDaughters(const Particle* mother, const std::vector<const Particle*>& tracksVertex);
220 
222  void findConstraintBoost(double cut);
223 
225  void smearBeamSpot(double width);
226  };
227 
229 } // Belle2 namespace
230 
Belle2::ParticleVertexFitterModule::makeKVertexMother
bool makeKVertexMother(analysis::VertexFitKFit &kv, Particle *p)
Update mother particle after unconstrained vertex fit using KFit.
Definition: ParticleVertexFitterModule.cc:644
Belle2::ParticleVertexFitterModule::doKMassVertexFit
bool doKMassVertexFit(Particle *p)
Mass-constrained vertex fit using KFit.
Definition: ParticleVertexFitterModule.cc:460
Belle2::ParticleVertexFitterModule::m_withConstraint
std::string m_withConstraint
additional constraint on vertex
Definition: ParticleVertexFitterModule.h:88
Belle2::ParticleVertexFitterModule::makeKFourCMother
bool makeKFourCMother(analysis::FourCFitKFit &kv, Particle *p)
Update mother particle after FourC fit using KFit.
Definition: ParticleVertexFitterModule.cc:769
Belle2::ParticleVertexFitterModule::m_fitType
std::string m_fitType
type of the kinematic fit
Definition: ParticleVertexFitterModule.h:87
Belle2::ParticleVertexFitterModule::m_confidenceLevel
double m_confidenceLevel
required fit confidence level
Definition: ParticleVertexFitterModule.h:84
Belle2::ParticleVertexFitterModule::m_vertexFitter
std::string m_vertexFitter
Vertex Fitter name.
Definition: ParticleVertexFitterModule.h:86
Belle2::analysis::MassFitKFit
MassFitKFit is a derived class from KFitBase to perform mass-constraint kinematical fit.
Definition: MassFitKFit.h:34
Belle2::ParticleVertexFitterModule::event
virtual void event() override
Event processor.
Definition: ParticleVertexFitterModule.cc:112
Belle2::analysis::FourCFitKFit
FourCFitKFit is a derived class from KFitBase to perform 4 momentum-constraint kinematical fit.
Definition: FourCFitKFit.h:32
Belle2::ParticleVertexFitterModule::smearBeamSpot
void smearBeamSpot(double width)
smear beam spot covariance
Definition: ParticleVertexFitterModule.cc:1118
Belle2::ParticleVertexFitterModule::makeKMassMother
bool makeKMassMother(analysis::MassFitKFit &kv, Particle *p)
Update mother particle after mass fit using KFit.
Definition: ParticleVertexFitterModule.cc:737
Belle2::ParticleVertexFitterModule::doKMassFit
bool doKMassFit(Particle *p)
Mass fit using KFit.
Definition: ParticleVertexFitterModule.cc:584
Belle2::ParticleVertexFitterModule::doKMassPointingVertexFit
bool doKMassPointingVertexFit(Particle *p)
Mass-constrained vertex fit with additional pointing constraint using KFit.
Definition: ParticleVertexFitterModule.cc:539
Belle2::ParticleVertexFitterModule::makeKMassVertexMother
bool makeKMassVertexMother(analysis::MassVertexFitKFit &kv, Particle *p)
Update mother particle after mass-constrained vertex fit using KFit.
Definition: ParticleVertexFitterModule.cc:674
Belle2::ParticleVertexFitterModule::m_smearing
double m_smearing
smearing width applied to IP tube
Definition: ParticleVertexFitterModule.h:96
Belle2::ParticleVertexFitterModule::updateMapOfTrackAndDaughter
void updateMapOfTrackAndDaughter(unsigned &l, std::vector< std::vector< unsigned >> &pars, std::vector< unsigned > &pard, std::vector< Particle * > &allparticles, const Particle *daughter)
update the map of daughter and tracks, find out which tracks belong to each daughter.
Definition: ParticleVertexFitterModule.cc:830
Belle2::ParticleVertexFitterModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: ParticleVertexFitterModule.cc:82
Belle2::ParticleVertexFitterModule::m_listName
std::string m_listName
particle list name
Definition: ParticleVertexFitterModule.h:83
Belle2::ParticleVertexFitterModule::m_beamSpotCov
TMatrixDSym m_beamSpotCov
Beam spot covariance matrix.
Definition: ParticleVertexFitterModule.h:94
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::ParticleVertexFitterModule::addIPTubeToKFit
void addIPTubeToKFit(analysis::VertexFitKFit &kv)
Adds IPTube constraint to the vertex fit using KFit.
Definition: ParticleVertexFitterModule.cc:1061
Belle2::analysis::MassPointingVertexFitKFit
MassPointingVertexFitKFit is a derived class from KFitBase It performs a kinematical fit with three c...
Definition: MassPointingVertexFitKFit.h:36
Belle2::ParticleVertexFitterModule::m_Bfield
double m_Bfield
magnetic field from data base
Definition: ParticleVertexFitterModule.h:85
Belle2::ParticleVertexFitterModule::m_decayString
std::string m_decayString
daughter particles selection
Definition: ParticleVertexFitterModule.h:89
Belle2::ParticleVertexFitterModule::m_hasCovMatrix
bool m_hasCovMatrix
flag for mother covariance matrix (PseudoFitter)
Definition: ParticleVertexFitterModule.h:92
Belle2::ParticleVertexFitterModule::doVertexFit
bool doVertexFit(Particle *p)
Main steering routine.
Definition: ParticleVertexFitterModule.cc:193
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ParticleVertexFitterModule::addChildofParticletoKFit
bool addChildofParticletoKFit(analysis::FourCFitKFit &kv, const Particle *particle)
Adds given particle's child to the FourCFitKFit.
Definition: ParticleVertexFitterModule.cc:1032
Belle2::ParticleVertexFitterModule::fillFitParticles
bool fillFitParticles(const Particle *mother, std::vector< const Particle * > &fitChildren, std::vector< const Particle * > &pi0Children)
Fills valid particle's children (with valid error matrix) in the vector of Particles that will enter ...
Definition: ParticleVertexFitterModule.cc:285
Belle2::ParticleVertexFitterModule::addIPProfileToKFit
void addIPProfileToKFit(analysis::VertexFitKFit &kv)
Adds IPProfile constraint to the vertex fit using KFit.
Definition: ParticleVertexFitterModule.cc:1046
Belle2::ParticleVertexFitterModule::m_beamSpotDB
DBObjPtr< BeamSpot > m_beamSpotDB
Beam spot database object.
Definition: ParticleVertexFitterModule.h:95
Belle2::ParticleVertexFitterModule::doKVertexFit
bool doKVertexFit(Particle *p, bool ipProfileConstraint, bool ipTubeConstraint)
Unconstrained vertex fit using KFit.
Definition: ParticleVertexFitterModule.cc:384
Belle2::ParticleVertexFitterModule::m_updateDaughters
bool m_updateDaughters
flag for daughters update
Definition: ParticleVertexFitterModule.h:90
Belle2::ParticleVertexFitterModule::doRaveFit
bool doRaveFit(Particle *mother)
Fit using Rave.
Definition: ParticleVertexFitterModule.cc:853
Belle2::Particle
Class to store reconstructed particles.
Definition: Particle.h:77
Belle2::ParticleVertexFitterModule::makeKMassPointingVertexMother
bool makeKMassPointingVertexMother(analysis::MassPointingVertexFitKFit &kv, Particle *p)
Update mother particle after mass-constrained vertex fit with additional pointing constraint using KF...
Definition: ParticleVertexFitterModule.cc:704
Belle2::DecayDescriptor
The DecayDescriptor stores information about a decay tree or parts of a decay tree.
Definition: DecayDescriptor.h:43
Belle2::ParticleVertexFitterModule::findConstraintBoost
void findConstraintBoost(double cut)
calculate iptube constraint (quasi cylinder along boost direction) for RAVE fit
Definition: ParticleVertexFitterModule.cc:1081
Belle2::ParticleVertexFitterModule::ParticleVertexFitterModule
ParticleVertexFitterModule()
Constructor.
Definition: ParticleVertexFitterModule.cc:57
Belle2::ParticleVertexFitterModule::allSelectedDaughters
bool allSelectedDaughters(const Particle *mother, const std::vector< const Particle * > &tracksVertex)
check if all the Daughters (o grand-daughters) are selected for the vertex fit
Definition: ParticleVertexFitterModule.cc:1008
Belle2::ParticleVertexFitterModule::doKFourCFit
bool doKFourCFit(Particle *p)
FourC fit using KFit.
Definition: ParticleVertexFitterModule.cc:611
Belle2::analysis::MassVertexFitKFit
MassVertexFitKFit is a derived class from KFitBase to perform mass-vertex-constraint kinematical fit.
Definition: MassVertexFitKFit.h:34
Belle2::ParticleVertexFitterModule::m_BeamSpotCenter
TVector3 m_BeamSpotCenter
Beam spot position.
Definition: ParticleVertexFitterModule.h:93
Belle2::ParticleVertexFitterModule::redoPi0MassFit
bool redoPi0MassFit(Particle *pi0Temp, const Particle *pi0Orig, const analysis::VertexFitKFit &kv)
Performs mass refit of pi0 assuming that pi0 originates from the point given by VertexFit.
Definition: ParticleVertexFitterModule.cc:332
Belle2::ParticleVertexFitterModule::m_decaydescriptor
DecayDescriptor m_decaydescriptor
Decay descriptor of decays to look for.
Definition: ParticleVertexFitterModule.h:91
Belle2::analysis::VertexFitKFit
VertexFitKFit is a derived class from KFitBase to perform vertex-constraint kinematical fit.
Definition: VertexFitKFit.h:33
Belle2::ParticleVertexFitterModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: ParticleVertexFitterModule.cc:105