Belle II Software light-2406-ragdoll
AnalysisConfiguration Class Reference

Singleton class keeping configurables of analysis components. More...

#include <AnalysisConfiguration.h>

Collaboration diagram for AnalysisConfiguration:

Public Member Functions

const std::string getTupleStyle ()
 Configurable-specific function to obtain value.
 
void setTupleStyle (const std::string &v)
 Configurable-specific function to set value.
 
void useLegacyMCMatching (const bool flag)
 Determines whether to use the legacy MCMatching algorithm (true) or not (false).
 
bool useLegacyMCMatching () const
 Specifies whether to use the legacy MCMatching algorithm (true) or not (false).
 

Static Public Member Functions

static AnalysisConfigurationinstance ()
 Returns a pointer to the singleton instance.
 

Private Member Functions

 AnalysisConfiguration ()
 Constructor.
 

Private Attributes

std::string m_tupleStyle
 branch naming style
 
bool m_legacyMCMatching
 specifies the version of MC matching algorithm to be used
 

Static Private Attributes

static AnalysisConfigurations_instance = nullptr
 Singleton instance.
 

Detailed Description

Singleton class keeping configurables of analysis components.

Object of this class is created on the first call and remains in memory such, that once parameters are configured they remain the same for every call. For example: AnalysisConfigurationModule creates AnalysisConfiguration object and set configurable value by line:

AnalysisConfiguration::instance()->setTupleStyle(m_tupleStyle);

Than, NTupleTools use functions inherited from DecayDescriptor and in these get parameter value from AnalysisConfiguration object:

AnalysisConfiguration::instance()->getTupleStyle()

If object was not created before by AnalysisConfiguration module, it is created on first call with default values by NTupleTool.

By now, this class configures only style of variables in tuples and thus has two specific functions:

const string getTupleStyle() which returns chosen style void setTupleStyle(string v) which sets style

Also, it has static AnalysisConfiguration *instance() which returns pointer to previously created AnalysisClass object or, if it is the first call, create object and return pointer to it. Constructor of class is private, so the only way to create object is through instance() function.

Definition at line 18 of file AnalysisConfiguration.h.

Constructor & Destructor Documentation

◆ AnalysisConfiguration()

AnalysisConfiguration ( )
inlineprivate

Constructor.

Definition at line 57 of file AnalysisConfiguration.h.

57 : m_tupleStyle("Default"), m_legacyMCMatching(false)
58 { }
bool m_legacyMCMatching
specifies the version of MC matching algorithm to be used
std::string m_tupleStyle
branch naming style

Member Function Documentation

◆ getTupleStyle()

const std::string getTupleStyle ( )
inline

Configurable-specific function to obtain value.

Definition at line 62 of file AnalysisConfiguration.h.

63 {
64 //B2INFO("Returning style '"<<m_tupleStyle<<"'");
65 return m_tupleStyle;
66 }

◆ instance()

static AnalysisConfiguration * instance ( )
inlinestatic

Returns a pointer to the singleton instance.

Definition at line 94 of file AnalysisConfiguration.h.

95 {
96 if (!s_instance)
98 return s_instance;
99 }
static AnalysisConfiguration * s_instance
Singleton instance.

◆ setTupleStyle()

void setTupleStyle ( const std::string &  v)
inline

Configurable-specific function to set value.

Definition at line 69 of file AnalysisConfiguration.h.

70 {
71 //B2INFO("Setting style '"<<v<<"'");
72 m_tupleStyle = v;
73 }

◆ useLegacyMCMatching() [1/2]

bool useLegacyMCMatching ( ) const
inline

Specifies whether to use the legacy MCMatching algorithm (true) or not (false).

Definition at line 86 of file AnalysisConfiguration.h.

87 {
88 return m_legacyMCMatching;
89 }

◆ useLegacyMCMatching() [2/2]

void useLegacyMCMatching ( const bool  flag)
inline

Determines whether to use the legacy MCMatching algorithm (true) or not (false).

Definition at line 78 of file AnalysisConfiguration.h.

79 {
80 m_legacyMCMatching = flag;
81 }

Member Data Documentation

◆ m_legacyMCMatching

bool m_legacyMCMatching
private

specifies the version of MC matching algorithm to be used

Definition at line 53 of file AnalysisConfiguration.h.

◆ m_tupleStyle

std::string m_tupleStyle
private

branch naming style

Definition at line 52 of file AnalysisConfiguration.h.

◆ s_instance

AnalysisConfiguration * s_instance = nullptr
staticprivate

Singleton instance.

Definition at line 54 of file AnalysisConfiguration.h.


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