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 B2Vector3D &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.
 
B2Vector3D 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? unusable otherwise.
 

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 48 of file RaveSetup.cc.

48 : m_useBeamSpot(false), m_raveVertexFactory(nullptr)/*, m_GFRaveVertexFactory(NULL)*/,
50{
51}
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? unusable otherwise.
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 53 of file RaveSetup.cc.

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

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 }
RaveSetup()
default constructor
Definition: RaveSetup.cc:48
static RaveSetup * getRawInstance()
Same as getInstance(), but no check if the instance is initialised.
Definition: RaveSetup.cc:27

◆ getRawInstance()

RaveSetup * getRawInstance ( )
staticprotected

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

Definition at line 27 of file RaveSetup.cc.

28{
29 static RaveSetup instance;
30 return &instance;
31}
The RaveSetup class is part of the RaveInterface together with RaveVertexFitter It holds all global o...
Definition: RaveSetup.h:37

◆ 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 33 of file RaveSetup.cc.

34{
37 //now setup everything for the use of GFRave
38// getRawInstance()->m_GFRaveVertexFactory = new GFRaveVertexFactory(verbosity, true);
39
40
41 getRawInstance()->m_raveVertexFactory = new rave::VertexFactory(rave::ConstantMagneticField(0, 0, magneticField),
42 rave::VacuumPropagator(), "kalman", verbosity);
43 getRawInstance()->m_raveKinematicTreeFactory = new rave::KinematicTreeFactory(rave::ConstantMagneticField(0, 0, magneticField),
44 rave::VacuumPropagator(), verbosity);
46}

◆ Print()

void Print ( )
static

Print() writes all RaveSetup member variables to the terminal

Definition at line 87 of file RaveSetup.cc.

88{
89 if (getRawInstance() not_eq nullptr) {
90 if (getRawInstance()->m_useBeamSpot == false) {
91 B2INFO("use beam spot is false");
92 } else {
93 B2INFO("use beam spot is true and beam spot position and covariance matrix are:");
96 }
97 B2INFO("the pointer to rave::VertexFactory is " << getRawInstance()->m_raveVertexFactory);
98 } else {
99 B2INFO("RaveSetup::initialize was not called. There is nothing to Print.");
100 }
101}
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
B2Vector3D m_beamSpot
beam spot position.
Definition: RaveSetup.h:73

◆ reset()

void reset ( )

frees memory allocated by initialize().

Beam spot is not modified.

Definition at line 58 of file RaveSetup.cc.

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

◆ setBeamSpot()

void setBeamSpot ( const B2Vector3D 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 72 of file RaveSetup.cc.

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

◆ unsetBeamSpot()

void unsetBeamSpot ( )

unset beam spot constraint

Definition at line 80 of file RaveSetup.cc.

81{
82 m_useBeamSpot = false;
83}

Friends And Related Function 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

B2Vector3D 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: