11#include <analysis/dataobjects/Particle.h>
12#include <analysis/VertexFitting/RaveInterface/RaveSetup.h>
14#include <mdst/dataobjects/TrackFitResult.h>
19#include <TMatrixFSym.h>
20#include <Math/Vector3D.h>
21#include <Math/Vector4D.h>
23#include <rave/Vertex.h>
24#include <rave/Track.h>
25#include <rave/KinematicTree.h>
28#include <framework/utilities/IOIntercept.h>
67 ROOT::Math::XYZVector
getPos() ;
87 if (beamSpot ==
true) {
89 B2FATAL(
"Beam spot information cannot be used because the beam spot position and covariance was not set in RaveSetup");
Simple RAII guard for output interceptor.
Class to store reconstructed particles.
The RaveKinematicVertexFitter class is part of the RaveInterface together with RaveSetup.
std::vector< Particle * > m_belleDaughters
Belle Particle pointers input.
void useBeamSpot(bool beamSpot=true)
Overwrite the global option in ReveSetup that tells the fitter if beam spot info should be used or no...
std::string m_raveAlgorithm
Algorithm used by rave (kalman, avr, ...)
TMatrixDSym ErrorMatrixEnergyToMass(const ROOT::Math::PxPyPzEVector &p4, const TMatrixDSym &EnergyErr)
Convert the error matrix from P-E to P-M.
void updateMother()
update the mother particle
IOIntercept::InterceptorScopeGuard< IOIntercept::OutputToLogMessages > captureOutput()
Start capturing the output of rave and divert it to log messages.
ROOT::Math::PxPyPzEVector m_fitted4Vector
4 momentum of the mother particle after the fit
TMatrixFSym m_fitted7Cov
7x7 error matrix of the mother particle after the fit
TMatrixDSym getCov()
get the covariance matrix (7x7).
rave::KinematicParticle m_fittedParticle
Particle fit output.
bool m_useBeamSpot
flag determines if the beam spot will be used or not.
void addMother(const Particle *aMotherParticlePtr)
All daughters of the argument of this function will be used as input for the vertex fit.
ROOT::Math::XYZVector getPos()
get the position of the fitted vertex.
~RaveKinematicVertexFitter()
Destructor.
void addTrack(const Particle *aParticlePtr)
add a track (in the format of a Belle2::Particle) to set of tracks that should be fitted to a vertex
bool m_massConstFit
flag determines if the mass fit is performed
TMatrixDSym ErrorMatrixMassToEnergy(const ROOT::Math::PxPyPzEVector &p4, const TMatrixDSym &MassErr)
Convert the error matrix from P-M to P-E.
void setMother(const Particle *aMotherParticlePtr)
Set Mother particle for Vertex/momentum update.
RaveKinematicVertexFitter()
The default constructor checks if RaveSetup was initialized and will set the attributes of RaveKinema...
rave::KinematicTree m_fittedResult
the output of the kinematic fit
int fit()
do the kinematic vertex fit with all tracks previously added with the addTrack or addMother function.
double m_fittedPValue
Pvalue of the fit result.
Particle * m_motherParticlePtr
pointer to the mother particle who's daughters will be used in the fit.
void setVertFit(bool isVertFit=true)
Set vertex fit: set false in case of mass fit only.
std::vector< rave::Vertex > m_raveVertices
holds the fitted vertices after fit() was called in the format used by Rave
void setMassConstFit(bool isConstFit=true)
Set mass constrained fit
Particle * getMother()
returns a pointer to the mother particle
void clearTracks()
Delete all information of previously added tracks and fitted results.
double m_fittedChi2
chi^2 of the vertex fit
double getPValue()
get the p value of the fitted vertex.
TMatrixDSym getVertexErrorMatrix()
get the covariance matrix (3x3) of the of the fitted vertex position.
double m_fittedNdf
Ndf of the vertex fit.
double getChi2()
get the χ² of the fitted vertex.
std::vector< rave::KinematicParticle > m_inputParticles
input particles for vertex fit in rave format
double getNdf()
get the number of degrees of freedom (NDF) of the fitted vertex.
bool m_vertFit
flag determines if the vertex fit is performed
void updateDaughters()
update the Daughters particles
void Print() const
Print all attributes of this object to terminal.
std::vector< rave::Track > m_raveTracks
holds the tracks that were added to a RaveVertexFitter object in the format used by Rave
ROOT::Math::XYZVector m_fittedPos
Fitted vertex position.
static RaveSetup * getRawInstance()
Same as getInstance(), but no check if the instance is initialised.
Abstract base class for different kinds of events.