Belle II Software light-2406-ragdoll
MetaOptions Class Reference

Meta Options which modify the underlying training by doing sPlot, Multiclass and HyperparameterSearch. More...

#include <Options.h>

Inheritance diagram for MetaOptions:
Collaboration diagram for MetaOptions:

Public Member Functions

virtual void load (const boost::property_tree::ptree &pt) override
 Load mechanism (used by Weightfile) to load Options from a xml tree.
 
virtual void save (boost::property_tree::ptree &pt) const override
 Save mechanism (used by Weightfile) to store Options in a xml tree.
 
virtual po::options_description getDescription () override
 Returns a program options description for all available options.
 

Public Attributes

bool m_use_splot = false
 Use splot training.
 
std::string m_splot_variable = "M"
 Discriminating variable.
 
std::vector< std::string > m_splot_mc_files
 Monte carlo files used for the distribution of the discriminating variable.
 
bool m_splot_combined = false
 Combine sPlot training with PDF classifier for discriminating variable.
 
bool m_splot_boosted = false
 Use boosted sPlot training (aPlot)
 
bool m_use_sideband_subtraction = false
 Use sideband subtraction.
 
std::vector< std::string > m_sideband_mc_files
 used to estimate the number of events in the different regions
 
std::string m_sideband_variable
 Variable defining the signal region (1) background region (2) negative signal region (3) or unused (otherwise) for the sideband subtraction.
 
bool m_use_reweighting = false
 Use a pretraining of data against mc and weight the mc afterwards.
 
std::string m_reweighting_identifier = ""
 Identifier used to save the reweighting expert.
 
std::string m_reweighting_variable
 Variable defining for which events the reweighting should be used (1) or not used (0).
 
std::vector< std::string > m_reweighting_data_files
 Data files for the pretraining.
 
std::vector< std::string > m_reweighting_mc_files
 MC files for the pretraining.
 

Detailed Description

Meta Options which modify the underlying training by doing sPlot, Multiclass and HyperparameterSearch.

Definition at line 111 of file Options.h.

Member Function Documentation

◆ getDescription()

po::options_description getDescription ( )
overridevirtual

Returns a program options description for all available options.

Implements Options.

Definition at line 101 of file Options.cc.

102 {
103 po::options_description description("Meta options");
104 description.add_options()
105 ("use_splot", po::value<bool>(&m_use_splot), "whether to do an splot training")
106 ("splot_variable", po::value<std::string>(&m_splot_variable), "Variable used as discriminating variable in sPlot training")
107 ("splot_mc_files", po::value<std::vector<std::string>>(&m_splot_mc_files)->multitoken(),
108 "Monte carlo files containing the discriminant variable with the mc truth")
109 ("splot_combined", po::value<bool>(&m_splot_combined), "Combine sPlot training with PDF classifier for discriminating variable")
110 ("splot_boosted", po::value<bool>(&m_splot_boosted), "Use boosted sPlot training (aPlot)")
111 ("use_sideband_subtraction", po::value<bool>(&m_use_sideband_subtraction), "whether to do a sideband subtraction training")
112 ("sideband_mc_files", po::value<std::vector<std::string>>(&m_sideband_mc_files)->multitoken(),
113 "Monte carlo files used to estimate the number of events in the different regions. (Must contain the same signal / background distribution as is expected in data)")
114 ("sideband_variable", po::value<std::string>(&m_sideband_variable),
115 "Variable defining the signal region (1) background region (2) negative signal region (3) or unused (otherwise) for the sideband subtraction")
116 ("use_reweighting", po::value<bool>(&m_use_reweighting), "whether to do a reweighting pre training")
117 ("reweighting_variable", po::value<std::string>(&m_reweighting_variable),
118 "Variable defining for which events the reweighting should be used (1) or not used (0). If empty the reweighting is applied to all events")
119 ("reweighting_identifier", po::value<std::string>(&m_reweighting_identifier),
120 "Identifier used to save the reweighting expert.")
121 ("reweighting_mc_files", po::value<std::vector<std::string>>(&m_reweighting_mc_files)->multitoken(),
122 "Monte carlo files for the reweighting pretraining (Must contain the same luminosity as the given data files)")
123 ("reweighting_data_files", po::value<std::vector<std::string>>(&m_reweighting_data_files)->multitoken(),
124 "Data files for the reweighting pretraining (Must contain the same luminosity as the given MC files)");
125 return description;
126 }
std::string m_reweighting_variable
Variable defining for which events the reweighting should be used (1) or not used (0).
Definition: Options.h:144
bool m_use_reweighting
Use a pretraining of data against mc and weight the mc afterwards.
Definition: Options.h:142
bool m_use_splot
Use splot training.
Definition: Options.h:131
std::string m_splot_variable
Discriminating variable.
Definition: Options.h:132
std::vector< std::string > m_reweighting_mc_files
MC files for the pretraining.
Definition: Options.h:147
std::vector< std::string > m_reweighting_data_files
Data files for the pretraining.
Definition: Options.h:146
bool m_splot_combined
Combine sPlot training with PDF classifier for discriminating variable.
Definition: Options.h:134
std::string m_reweighting_identifier
Identifier used to save the reweighting expert.
Definition: Options.h:143
bool m_splot_boosted
Use boosted sPlot training (aPlot)
Definition: Options.h:135
std::vector< std::string > m_splot_mc_files
Monte carlo files used for the distribution of the discriminating variable.
Definition: Options.h:133
std::string m_sideband_variable
Variable defining the signal region (1) background region (2) negative signal region (3) or unused (o...
Definition: Options.h:139
std::vector< std::string > m_sideband_mc_files
used to estimate the number of events in the different regions
Definition: Options.h:138
bool m_use_sideband_subtraction
Use sideband subtraction.
Definition: Options.h:137

◆ load()

void load ( const boost::property_tree::ptree &  pt)
overridevirtual

Load mechanism (used by Weightfile) to load Options from a xml tree.

Parameters
ptxml tree

Implements Options.

Definition at line 128 of file Options.cc.

129 {
130 m_use_splot = pt.get<bool>("use_splot", false);
131 m_splot_combined = pt.get<bool>("splot_combined", false);
132 m_splot_boosted = pt.get<bool>("splot_boosted", false);
133 m_splot_variable = pt.get<std::string>("splot_variable", "");
134
135 unsigned int splot_number_of_mc_files = pt.get<unsigned int>("splot_number_of_mc_files", 0);
136 m_splot_mc_files.resize(splot_number_of_mc_files);
137 for (unsigned int i = 0; i < splot_number_of_mc_files; ++i) {
138 m_splot_mc_files[i] = pt.get<std::string>(std::string("splot_mc_file") + std::to_string(i));
139 }
140
141 m_use_sideband_subtraction = pt.get<bool>("use_sideband_subtraction");
142 m_sideband_variable = pt.get<std::string>("sideband_variable");
143
144 unsigned int sideband_number_of_mc_files = pt.get<unsigned int>("sideband_number_of_mc_files", 0);
145 m_sideband_mc_files.resize(sideband_number_of_mc_files);
146 for (unsigned int i = 0; i < sideband_number_of_mc_files; ++i) {
147 m_sideband_mc_files[i] = pt.get<std::string>(std::string("sideband_mc_file") + std::to_string(i));
148 }
149
150 m_use_reweighting = pt.get<bool>("use_reweighting", false);
151 m_reweighting_variable = pt.get<std::string>("reweighting_variable");
152 m_reweighting_identifier = pt.get<std::string>("reweighting_identifier");
153
154 unsigned int reweighting_number_of_mc_files = pt.get<unsigned int>("reweighting_number_of_mc_files", 0);
155 m_reweighting_mc_files.resize(reweighting_number_of_mc_files);
156 for (unsigned int i = 0; i < reweighting_number_of_mc_files; ++i) {
157 m_reweighting_mc_files[i] = pt.get<std::string>(std::string("reweighting_mc_file") + std::to_string(i));
158 }
159
160 unsigned int reweighting_number_of_data_files = pt.get<unsigned int>("reweighting_number_of_data_files", 0);
161 m_reweighting_data_files.resize(reweighting_number_of_data_files);
162 for (unsigned int i = 0; i < reweighting_number_of_data_files; ++i) {
163 m_reweighting_data_files[i] = pt.get<std::string>(std::string("reweighting_data_file") + std::to_string(i));
164 }
165
166 }

◆ save()

void save ( boost::property_tree::ptree &  pt) const
overridevirtual

Save mechanism (used by Weightfile) to store Options in a xml tree.

Parameters
ptxml tree

Implements Options.

Definition at line 168 of file Options.cc.

169 {
170 pt.put("use_splot", m_use_splot);
171 pt.put("splot_variable", m_splot_variable);
172 pt.put("splot_combined", m_splot_combined);
173 pt.put("splot_boosted", m_splot_boosted);
174
175 pt.put("splot_number_of_mc_files", m_splot_mc_files.size());
176 for (unsigned int i = 0; i < m_splot_mc_files.size(); ++i) {
177 pt.put(std::string("splot_mc_file") + std::to_string(i), m_splot_mc_files[i]);
178 }
179
180 pt.put("use_sideband_subtraction", m_use_sideband_subtraction);
181 pt.put("sideband_variable", m_sideband_variable);
182
183 pt.put("sideband_number_of_mc_files", m_sideband_mc_files.size());
184 for (unsigned int i = 0; i < m_sideband_mc_files.size(); ++i) {
185 pt.put(std::string("sideband_mc_file") + std::to_string(i), m_sideband_mc_files[i]);
186 }
187
188 pt.put("use_reweighting", m_use_reweighting);
189 pt.put("reweighting_variable", m_reweighting_variable);
190 pt.put("reweighting_identifier", m_reweighting_identifier);
191
192 pt.put("reweighting_number_of_mc_files", m_reweighting_mc_files.size());
193 for (unsigned int i = 0; i < m_reweighting_mc_files.size(); ++i) {
194 pt.put(std::string("reweighting_mc_file") + std::to_string(i), m_reweighting_mc_files[i]);
195 }
196
197 pt.put("reweighting_number_of_data_files", m_reweighting_data_files.size());
198 for (unsigned int i = 0; i < m_reweighting_data_files.size(); ++i) {
199 pt.put(std::string("reweighting_data_file") + std::to_string(i), m_reweighting_data_files[i]);
200 }
201
202 }

Member Data Documentation

◆ m_reweighting_data_files

std::vector<std::string> m_reweighting_data_files

Data files for the pretraining.

Definition at line 146 of file Options.h.

◆ m_reweighting_identifier

std::string m_reweighting_identifier = ""

Identifier used to save the reweighting expert.

Definition at line 143 of file Options.h.

◆ m_reweighting_mc_files

std::vector<std::string> m_reweighting_mc_files

MC files for the pretraining.

Definition at line 147 of file Options.h.

◆ m_reweighting_variable

std::string m_reweighting_variable
Initial value:
=
""

Variable defining for which events the reweighting should be used (1) or not used (0).

If empty the reweighting is applied to all events

Definition at line 144 of file Options.h.

◆ m_sideband_mc_files

std::vector<std::string> m_sideband_mc_files

used to estimate the number of events in the different regions

Definition at line 138 of file Options.h.

◆ m_sideband_variable

std::string m_sideband_variable
Initial value:
=
""

Variable defining the signal region (1) background region (2) negative signal region (3) or unused (otherwise) for the sideband subtraction.

Definition at line 139 of file Options.h.

◆ m_splot_boosted

bool m_splot_boosted = false

Use boosted sPlot training (aPlot)

Definition at line 135 of file Options.h.

◆ m_splot_combined

bool m_splot_combined = false

Combine sPlot training with PDF classifier for discriminating variable.

Definition at line 134 of file Options.h.

◆ m_splot_mc_files

std::vector<std::string> m_splot_mc_files

Monte carlo files used for the distribution of the discriminating variable.

Definition at line 133 of file Options.h.

◆ m_splot_variable

std::string m_splot_variable = "M"

Discriminating variable.

Definition at line 132 of file Options.h.

◆ m_use_reweighting

bool m_use_reweighting = false

Use a pretraining of data against mc and weight the mc afterwards.

Definition at line 142 of file Options.h.

◆ m_use_sideband_subtraction

bool m_use_sideband_subtraction = false

Use sideband subtraction.

Definition at line 137 of file Options.h.

◆ m_use_splot

bool m_use_splot = false

Use splot training.

Definition at line 131 of file Options.h.


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