Belle II Software  release-05-02-19
RaveKinematicVertexFitter Class Reference

The RaveKinematicVertexFitter class is part of the RaveInterface together with RaveSetup. More...

#include <RaveKinematicVertexFitter.h>

Collaboration diagram for RaveKinematicVertexFitter:

Public Member Functions

 RaveKinematicVertexFitter ()
 The default constructor checks if RaveSetup was initialized and will set the attributes of RaveKinematicVertexFitter.
 
 ~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
 
void addMother (const Particle *aMotherParticlePtr)
 All daughters of the argument of this function will be used as input for the vertex fit. More...
 
void setMother (const Particle *aMotherParticlePtr)
 Set Mother particle for Vertex/momentum update. More...
 
int fit ()
 do the kinematic vertex fit with all tracks previously added with the addTrack or addMother function. More...
 
TVector3 getPos ()
 get the position of the fitted vertex. More...
 
double getPValue ()
 get the p value of the fitted vertex. More...
 
double getNdf ()
 get the number of degrees of freedom (NDF) of the fitted vertex. More...
 
double getChi2 ()
 get the χ² of the fitted vertex.
 
TMatrixDSym getCov ()
 get the covariance matrix (7x7). More...
 
TMatrixDSym getVertexErrorMatrix ()
 get the covariance matrix (3x3) of the of the fitted vertex position. More...
 
void useBeamSpot (bool beamSpot=true)
 Overwrite the global option in ReveSetup that tells the fitter if beam spot info should be used or not. More...
 
ParticlegetMother ()
 returns a pointer to the mother particle
 
void updateMother ()
 update the mother particle
 
void updateDaughters ()
 update the Daughters particles
 
void clearTracks ()
 Delete all information of previously added tracks and fitted results.
 
void setMassConstFit (bool isConstFit=true)
 Set mass constrained fit

 
void setVertFit (bool isVertFit=true)
 Set vertex fit: set false in case of mass fit only.
 
void Print () const
 Print all attributes of this object to terminal.
 

Protected Attributes

bool m_useBeamSpot
 flag determines if the beam spot will be used or not. More...
 
Particlem_motherParticlePtr
 pointer to the mother particle who's daughters will be used in the fit. More...
 
std::string m_raveAlgorithm
 Algorithm used by rave (kalman, avr, ...)
 
rave::KinematicTree m_fittedResult
 the output of the kinematic fit
 
std::vector< rave::Track > m_raveTracks
 holds the tracks that were added to a RaveVertexFitter object in the format used by Rave
 
std::vector< rave::Vertex > m_raveVertices
 holds the fitted vertices after fit() was called in the format used by Rave
 
std::vector< rave::KinematicParticle > m_inputParticles
 input particles for vertex fit in rave format
 
rave::KinematicParticle m_fittedParticle
 Particle fit output.
 
std::vector< Particle * > m_belleDaughters
 Belle Particle pointers input.
 
bool m_massConstFit
 flag determines if the mass fit is performed
 
bool m_vertFit
 flag determines if the vertex fit is performed
 
double m_fittedNdf
 Ndf of the vertex fit.
 
double m_fittedPValue
 Pvalue of the fit result.
 
double m_fittedChi2
 chi^2 of the vertex fit
 
TVector3 m_fittedPos
 Fitted vertex position.
 
TLorentzVector m_fitted4Vector
 4 momentum of the mother particle after the fit
 
TMatrixFSym m_fitted7Cov
 7x7 errror matrix of the mother particle after the fit
 

Private Member Functions

TMatrixDSym ErrorMatrixMassToEnergy (const TLorentzVector &p4, const TMatrixDSym &MassErr)
 Convert the error matrix from P-M to P-E. More...
 
TMatrixDSym ErrorMatrixEnergyToMass (const TLorentzVector &p4, const TMatrixDSym &EnergyErr)
 Convert the error matrix from P-E to P-M. More...
 
IOIntercept::InterceptorScopeGuard< IOIntercept::OutputToLogMessagescaptureOutput ()
 Start capturing the output of rave and divert it to log messages. More...
 

Detailed Description

The RaveKinematicVertexFitter class is part of the RaveInterface together with RaveSetup.

To fit a vertex the user adds tracks (different formats are supported). Then calls the fit() function where the name of the fitting method and parameters can be passed as a string. RaveKinematicVertexFitter provides the getters to extract the results produced by Rave.

Definition at line 52 of file RaveKinematicVertexFitter.h.

Member Function Documentation

◆ addMother()

void addMother ( const Particle aMotherParticlePtr)

All daughters of the argument of this function will be used as input for the vertex fit.

Writes back the result directly to the mother particle

Definition at line 107 of file RaveKinematicVertexFitter.cc.

108 {
109  vector<Particle*> daughters = aMotherParticlePtr->getDaughters();
110 
111  int nDaughters = daughters.size();
112  for (int i = 0; i not_eq nDaughters; ++i) {
113  addTrack(daughters[i]);
114  }
115 
116  //store input pointer so fit results can be written to the mother particle after the fit
117  auto* tmp = const_cast<Particle*>(aMotherParticlePtr);
118  m_motherParticlePtr = tmp;
119 
120 }

◆ captureOutput()

Start capturing the output of rave and divert it to log messages.

Capturing will finish as soon as the returned object goes out of scope

Definition at line 48 of file RaveKinematicVertexFitter.cc.

◆ ErrorMatrixEnergyToMass()

TMatrixDSym ErrorMatrixEnergyToMass ( const TLorentzVector &  p4,
const TMatrixDSym &  EnergyErr 
)
private

Convert the error matrix from P-E to P-M.

It Requires an input error matrit in the form X,P,E

Definition at line 485 of file RaveKinematicVertexFitter.cc.

◆ ErrorMatrixMassToEnergy()

TMatrixDSym ErrorMatrixMassToEnergy ( const TLorentzVector &  p4,
const TMatrixDSym &  MassErr 
)
private

Convert the error matrix from P-M to P-E.

It Requires an input error matrit in the form X,P,M

Definition at line 455 of file RaveKinematicVertexFitter.cc.

◆ fit()

int fit ( )

do the kinematic vertex fit with all tracks previously added with the addTrack or addMother function.

The return value is 1 if a vertex is successfully found. Return value 0 means the fit was not successful. -1 means not enough tracks were added

Definition at line 131 of file RaveKinematicVertexFitter.cc.

◆ getCov()

TMatrixDSym getCov ( )

get the covariance matrix (7x7).


Definition at line 433 of file RaveKinematicVertexFitter.cc.

◆ getNdf()

double getNdf ( )

get the number of degrees of freedom (NDF) of the fitted vertex.


Definition at line 423 of file RaveKinematicVertexFitter.cc.

◆ getPos()

TVector3 getPos ( )

get the position of the fitted vertex.


Definition at line 413 of file RaveKinematicVertexFitter.cc.

◆ getPValue()

double getPValue ( )

get the p value of the fitted vertex.


Definition at line 418 of file RaveKinematicVertexFitter.cc.

◆ getVertexErrorMatrix()

TMatrixDSym getVertexErrorMatrix ( )

get the covariance matrix (3x3) of the of the fitted vertex position.


Definition at line 438 of file RaveKinematicVertexFitter.cc.

◆ setMother()

void setMother ( const Particle aMotherParticlePtr)

Set Mother particle for Vertex/momentum update.

Not to be used with addMother

Definition at line 123 of file RaveKinematicVertexFitter.cc.

◆ useBeamSpot()

void useBeamSpot ( bool  beamSpot = true)
inline

Overwrite the global option in ReveSetup that tells the fitter if beam spot info should be used or not.

The beam spot pos and cov must still be set in the RaveSetup class if you what to use it

Definition at line 93 of file RaveKinematicVertexFitter.h.

93  {
94  m_useBeamSpot = false;
95  }
96  }
97 
99  Particle* getMother();
100 
102  void updateMother();
103 

Member Data Documentation

◆ m_motherParticlePtr

Particle* m_motherParticlePtr
protected

pointer to the mother particle who's daughters will be used in the fit.

the fit result will be written back to the mother particle

Definition at line 144 of file RaveKinematicVertexFitter.h.

◆ m_useBeamSpot

bool m_useBeamSpot
protected

flag determines if the beam spot will be used or not.

Overwrites the global flag in RaveSetup

Definition at line 141 of file RaveKinematicVertexFitter.h.


The documentation for this class was generated from the following files:
Belle2::analysis::RaveKinematicVertexFitter::getMother
Particle * getMother()
returns a pointer to the mother particle
Definition: RaveKinematicVertexFitter.cc:408
Belle2::analysis::RaveKinematicVertexFitter::updateMother
void updateMother()
update the mother particle
Definition: RaveKinematicVertexFitter.cc:326
Belle2::analysis::RaveKinematicVertexFitter::addTrack
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
Definition: RaveKinematicVertexFitter.cc:70
Belle2::Particle::getDaughters
std::vector< Belle2::Particle * > getDaughters() const
Returns a vector of pointers to daughter particles.
Definition: Particle.cc:601
Belle2::analysis::RaveKinematicVertexFitter::m_motherParticlePtr
Particle * m_motherParticlePtr
pointer to the mother particle who's daughters will be used in the fit.
Definition: RaveKinematicVertexFitter.h:144
Belle2::Particle
Class to store reconstructed particles.
Definition: Particle.h:77
Belle2::analysis::RaveKinematicVertexFitter::m_useBeamSpot
bool m_useBeamSpot
flag determines if the beam spot will be used or not.
Definition: RaveKinematicVertexFitter.h:141