Belle II Software development
RaveSetup Class Reference

The RaveSetup class is part of the RaveInterface together with RaveVertexFitter It holds all global options for the RaveVertexFitter and also takes care that stuff like the magnetic field is correctly set up in way Rave can access it. More...

#include <RaveSetup.h>

Public Member Functions

void setBeamSpot (const ROOT::Math::XYZVector &beamSpot, const TMatrixDSym &beamSpotCov)
 The beam spot position and covariance is known you can set it here so that and a vertex in the beam spot should be fitted you can set it here.
 
void unsetBeamSpot ()
 unset beam spot constraint
 
void reset ()
 frees memory allocated by initialize().
 

Static Public Member Functions

static RaveSetupgetInstance ()
 get the pointer to the instance to get/set any of options stored in RaveSetup
 
static void initialize (int verbosity=1, double MagneticField=1.5)
 Set everything up so everything needed for vertex fitting is there.
 
static void Print ()
 Print() writes all RaveSetup member variables to the terminal.
 

Protected Member Functions

 RaveSetup ()
 default constructor
 
 ~RaveSetup ()
 default destructor
 

Static Protected Member Functions

static RaveSetupgetRawInstance ()
 Same as getInstance(), but no check if the instance is initialised.
 

Protected Attributes

bool m_useBeamSpot
 flag determines if beam spot information should be used for vertex fit.
 
ROOT::Math::XYZVector m_beamSpot
 beam spot position.
 
TMatrixDSym m_beamSpotCov
 beam spot position covariance matrix.
 
rave::VertexFactory * m_raveVertexFactory
 The RAVE vertex factory is the principal interface offered by the RAVE vertex fitting library.
 
rave::KinematicTreeFactory * m_raveKinematicTreeFactory
 < The RAVE Kinematic Tree factory is the principal interface offered by the RAVE for kinematic vertex fitting.
 
bool m_initialized
 Has initialize() been called?
 

Friends

class RaveVertexFitter
 
class RaveKinematicVertexFitter
 

Detailed Description

The RaveSetup class is part of the RaveInterface together with RaveVertexFitter It holds all global options for the RaveVertexFitter and also takes care that stuff like the magnetic field is correctly set up in way Rave can access it.

Definition at line 37 of file RaveSetup.h.

Constructor & Destructor Documentation

◆ RaveSetup()

RaveSetup ( )
protected

default constructor

Definition at line 50 of file RaveSetup.cc.

50 : m_useBeamSpot(false), m_raveVertexFactory(nullptr)/*, m_GFRaveVertexFactory(NULL)*/,
52{
53}
rave::KinematicTreeFactory * m_raveKinematicTreeFactory
< The RAVE Kinematic Tree factory is the principal interface offered by the RAVE for kinematic vertex...
Definition RaveSetup.h:81
bool m_useBeamSpot
flag determines if beam spot information should be used for vertex fit.
Definition RaveSetup.h:72
bool m_initialized
Has initialize() been called?
Definition RaveSetup.h:83
rave::VertexFactory * m_raveVertexFactory
The RAVE vertex factory is the principal interface offered by the RAVE vertex fitting library.
Definition RaveSetup.h:77

◆ ~RaveSetup()

~RaveSetup ( )
protected

default destructor

Definition at line 55 of file RaveSetup.cc.

56{
57 reset();
58}
void reset()
frees memory allocated by initialize().
Definition RaveSetup.cc:60

Member Function Documentation

◆ getInstance()

static RaveSetup * getInstance ( )
inlinestatic

get the pointer to the instance to get/set any of options stored in RaveSetup

Definition at line 43 of file RaveSetup.h.

44 {
45 RaveSetup* instance = getRawInstance();
46 if (!instance->m_initialized) {
47 B2FATAL("RaveSetup::initialize was not called. It has to be called before RaveSetup or RaveVertexFitter are used");
48 }
49 return instance;
50 }

◆ getRawInstance()

RaveSetup * getRawInstance ( )
staticprotected

Same as getInstance(), but no check if the instance is initialised.

Definition at line 29 of file RaveSetup.cc.

30{
31 static RaveSetup instance;
32 return &instance;
33}
RaveSetup()
default constructor
Definition RaveSetup.cc:50

◆ initialize()

void initialize ( int verbosity = 1,
double MagneticField = 1.5 )
static

Set everything up so everything needed for vertex fitting is there.

Must be called before RaveVertexFitter can be used

Definition at line 35 of file RaveSetup.cc.

36{
39 //now setup everything for the use of GFRave
40// getRawInstance()->m_GFRaveVertexFactory = new GFRaveVertexFactory(verbosity, true);
41
42
43 getRawInstance()->m_raveVertexFactory = new rave::VertexFactory(rave::ConstantMagneticField(0, 0, magneticField),
44 rave::VacuumPropagator(), "kalman", verbosity);
45 getRawInstance()->m_raveKinematicTreeFactory = new rave::KinematicTreeFactory(rave::ConstantMagneticField(0, 0, magneticField),
46 rave::VacuumPropagator(), verbosity);
48}
static RaveSetup * getRawInstance()
Same as getInstance(), but no check if the instance is initialised.
Definition RaveSetup.cc:29

◆ Print()

void Print ( )
static

Print() writes all RaveSetup member variables to the terminal.

Definition at line 89 of file RaveSetup.cc.

90{
91 if (getRawInstance() not_eq nullptr) {
92 if (getRawInstance()->m_useBeamSpot == false) {
93 B2INFO("use beam spot is false");
94 } else {
95 B2INFO("use beam spot is true and beam spot position and covariance matrix are:");
98 }
99 B2INFO("the pointer to rave::VertexFactory is " << getRawInstance()->m_raveVertexFactory);
100 } else {
101 B2INFO("RaveSetup::initialize was not called. There is nothing to Print.");
102 }
103}
std::string PrintString(unsigned precision=4) const
create a string containing vector in cartesian and spherical coordinates
Definition B2Vector3.h:481
TMatrixDSym m_beamSpotCov
beam spot position covariance matrix.
Definition RaveSetup.h:74
ROOT::Math::XYZVector m_beamSpot
beam spot position.
Definition RaveSetup.h:73
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition B2Vector3.h:516

◆ reset()

void reset ( )

frees memory allocated by initialize().

Beam spot is not modified.

Definition at line 60 of file RaveSetup.cc.

61{
62 //delete everything that could have potentially created with new in this class
63
64 delete m_raveVertexFactory; // workaround to avoid crashes with V0 finder
65 m_raveVertexFactory = nullptr;
68 // delete m_GFRaveVertexFactory;
69
70 m_initialized = false;
71}

◆ setBeamSpot()

void setBeamSpot ( const ROOT::Math::XYZVector & beamSpot,
const TMatrixDSym & beamSpotCov )

The beam spot position and covariance is known you can set it here so that and a vertex in the beam spot should be fitted you can set it here.

Definition at line 74 of file RaveSetup.cc.

75{
76 m_beamSpot = beamSpot;
77 m_beamSpotCov.ResizeTo(beamSpotCov);
78 m_beamSpotCov = beamSpotCov;
79 m_useBeamSpot = true;
80}

◆ unsetBeamSpot()

void unsetBeamSpot ( )

unset beam spot constraint

Definition at line 82 of file RaveSetup.cc.

83{
84 m_useBeamSpot = false;
85}

Friends And Related Symbol Documentation

◆ RaveKinematicVertexFitter

friend class RaveKinematicVertexFitter
friend

Definition at line 41 of file RaveSetup.h.

◆ RaveVertexFitter

friend class RaveVertexFitter
friend

Definition at line 40 of file RaveSetup.h.

Member Data Documentation

◆ m_beamSpot

ROOT::Math::XYZVector m_beamSpot
protected

beam spot position.

Can be used as additional information by RaveVertexFitter

Definition at line 73 of file RaveSetup.h.

◆ m_beamSpotCov

TMatrixDSym m_beamSpotCov
protected

beam spot position covariance matrix.

Can be used as additional information by RaveVertexFitter

Definition at line 74 of file RaveSetup.h.

◆ m_initialized

bool m_initialized
protected

Has initialize() been called?

unusable otherwise.

Definition at line 83 of file RaveSetup.h.

◆ m_raveKinematicTreeFactory

rave::KinematicTreeFactory* m_raveKinematicTreeFactory
protected

< The RAVE Kinematic Tree factory is the principal interface offered by the RAVE for kinematic vertex fitting.

Definition at line 81 of file RaveSetup.h.

◆ m_raveVertexFactory

rave::VertexFactory* m_raveVertexFactory
protected

The RAVE vertex factory is the principal interface offered by the RAVE vertex fitting library.

Definition at line 77 of file RaveSetup.h.

◆ m_useBeamSpot

bool m_useBeamSpot
protected

flag determines if beam spot information should be used for vertex fit.

Can be overruled by individual fits in RaveVertexFitter

Definition at line 72 of file RaveSetup.h.


The documentation for this class was generated from the following files: