Belle II Software development
CombinationOptions Class Reference

Options for the Combination MVA method. More...

#include <Combination.h>

Inheritance diagram for CombinationOptions:
SpecificOptions Options

Public Member Functions

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

Public Attributes

std::vector< std::string > m_weightfiles
 Weightfiles of all methods we want to combine.
 

Detailed Description

Options for the Combination MVA method.

Definition at line 28 of file Combination.h.

Member Function Documentation

◆ getDescription()

po::options_description getDescription ( )
overridevirtual

Returns a program options description for all available options.

Implements Options.

Definition at line 46 of file Combination.cc.

47 {
48 po::options_description description("PDF options");
49 description.add_options()
50 ("weightfiles", po::value<std::vector<std::string>>(&m_weightfiles)->multitoken(),
51 "Weightfiles of other experts we want to combine together");
52 return description;
53 }
std::vector< std::string > m_weightfiles
Weightfiles of all methods we want to combine.
Definition: Combination.h:53

◆ getMethod()

virtual std::string getMethod ( ) const
inlineoverridevirtual

Return method name.

Implements SpecificOptions.

Definition at line 51 of file Combination.h.

51{ return "Combination"; }

◆ load()

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

Load mechanism to load Options from a xml tree.

Parameters
ptxml tree

Implements Options.

Definition at line 21 of file Combination.cc.

22 {
23 int version = pt.get<int>("Combination_version");
24 if (version != 1) {
25 B2ERROR("Unknown weightfile version " << std::to_string(version));
26 throw std::runtime_error("Unknown weightfile version " + std::to_string(version));
27 }
28
29 auto numberOfWeightfiles = pt.get<unsigned int>("Combination_number_of_weightfiles");
30 m_weightfiles.resize(numberOfWeightfiles);
31 for (unsigned int i = 0; i < numberOfWeightfiles; ++i) {
32 m_weightfiles[i] = pt.get<std::string>(std::string("Combination_weightfile") + std::to_string(i));
33 }
34
35 }

◆ save()

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

Save mechanism to store Options in a xml tree.

Parameters
ptxml tree

Implements Options.

Definition at line 37 of file Combination.cc.

38 {
39 pt.put("Combination_version", 1);
40 pt.put("Combination_number_of_weightfiles", m_weightfiles.size());
41 for (unsigned int i = 0; i < m_weightfiles.size(); ++i) {
42 pt.put(std::string("Combination_weightfile") + std::to_string(i), m_weightfiles[i]);
43 }
44 }

Member Data Documentation

◆ m_weightfiles

std::vector<std::string> m_weightfiles

Weightfiles of all methods we want to combine.

Definition at line 53 of file Combination.h.


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