Belle II Software development
AnalysisConfigurationModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <string>
10#include <set>
11#include <analysis/modules/AnalysisConfiguration/AnalysisConfigurationModule.h>
12#include <analysis/utility/AnalysisConfiguration.h>
13
14using namespace std;
15using namespace Belle2;
16
17
18
20
22{
23 setDescription("This is a supplementary module designed to configure other modules");
24 addParam("tupleStyle", m_tupleStyle, R"DOC(This parameter defines style of variables written by all other ntuples tools.
25Possible styles on example of PX variable of pi0 from D in decay B -> (D -> pi0 pi) pi0:
26
27- "default": B_D_pi0_PX
28- "semilaconic": D_pi0_PX
29- "laconic": pi01_PX
30 )DOC", std::string("default"));
31
32 addParam("mcMatchingVersion", m_mcMatchingVersion, "Specifies what version of mc matching algorithm is going to be used. \n"
33 "Possibilities are: BelleII (default) and Belle. The latter should be used when analysing Belle MC.\n"
34 "The difference between the algorithms is only in the treatment (identification) of FSR photons. In Belle II MC \n"
35 "it is possible to identify FSR photons via special flag set by the generator, while in case of Belle MC such\n"
36 "information is not available.", std::string("BelleII"));
37}
38
40{
41 if (m_styles.find(m_tupleStyle) == m_styles.end()) {
42 B2WARNING("Chosen tuple style '" << m_tupleStyle << "' is not defined. Using default tuple style.");
43 }
45
46 if (m_mcMatchingVersion == "BelleII")
48 else if (m_mcMatchingVersion == "Belle")
50 else
51 B2ERROR("Invalid mcMatchingVersion specified to AnalysisConfiguration: " << m_mcMatchingVersion << "\n"
52 "Please choose between BelleII or Belle depending whether you are analysing Belle II or Belle MC.");
53}
virtual void initialize() override
Initialize the module.
std::set< std::string > m_styles
List of possible styles of variables in nTuple Possible styles on example of PX variable of pi0 from ...
std::string m_mcMatchingVersion
specifies the version of MC matching algorithm to be used
std::string m_tupleStyle
Style of naming of variables in nTuple configured by user.
Singleton class keeping configurables of analysis components.
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).
static AnalysisConfiguration * instance()
Returns a pointer to the singleton instance.
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.
STL namespace.