Belle II Software  release-06-00-14
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 
14 using namespace std;
15 using 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"DOCSTRING(This parameter defines style of variables written by all other ntuples tools. \n
25  Possible styles on example of PX variable of pi0 from D in decay B->(D->pi0 pi) pi0:\n
26  'default': B_D_pi0_PX\n
27  'semilaconic': D_pi0_PX\n
28  'laconic': pi01_PX\n)DOCSTRING", std::string("default"));
29 
30  addParam("mcMatchingVersion", m_mcMatchingVersion, "Specifies what version of mc matching algorithm is going to be used. \n"
31  "Possibilities are: BelleII (default) and Belle. The latter should be used when analysing Belle MC.\n"
32  "The difference between the algorithms is only in the treatment (identification) of FSR photons. In Belle II MC \n"
33  "it is possible to identify FSR photons via special flag set by the generator, while in case of Belle MC such\n"
34  "information is not available.", std::string("BelleII"));
35 }
36 
37 void AnalysisConfigurationModule::initialize()
38 {
39  if (m_styles.find(m_tupleStyle) == m_styles.end()) {
40  B2WARNING("Chosen tuple style '" << m_tupleStyle << "' is not defined. Using default tuple style.");
41  }
42  AnalysisConfiguration::instance()->setTupleStyle(m_tupleStyle);
43 
44  if (m_mcMatchingVersion == "BelleII")
45  AnalysisConfiguration::instance()->useLegacyMCMatching(false);
46  else if (m_mcMatchingVersion == "Belle" or m_mcMatchingVersion == "MC5")
47  AnalysisConfiguration::instance()->useLegacyMCMatching(true);
48  else
49  B2ERROR("Invalid mcMatchingVersion specified to AnalysisConfiguration: " << m_mcMatchingVersion << "\n"
50  "Please choose between BelleII or Belle depending whether you are analysing Belle II or Belle MC.");
51 }
Class to hold general basf2 configuration Used to intiate and configure CreateAnalysis object.
Singleton class keeping configurables of analysis components.
Base class for Modules.
Definition: Module.h:72
#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.