Belle II Software light-2406-ragdoll
ReweighterOptions Class Reference

Options for the Reweighter MVA method. More...

#include <Reweighter.h>

Inheritance diagram for ReweighterOptions:
Collaboration diagram for ReweighterOptions:

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::string m_weightfile
 Weightfile of the reweighting expert.
 
std::string m_variable
 Variable which decides if the reweighter is applied or not.
 

Detailed Description

Options for the Reweighter MVA method.

Definition at line 28 of file Reweighter.h.

Member Function Documentation

◆ getDescription()

po::options_description getDescription ( )
overridevirtual

Returns a program options description for all available options.

Implements Options.

Definition at line 40 of file Reweighter.cc.

41 {
42 po::options_description description("Reweighter options");
43 description.add_options()
44 ("reweighter_weightfile", po::value<std::string>(&m_weightfile),
45 "Weightfile of the expert used to reweight")
46 ("reweighter_variable", po::value<std::string>(&m_variable),
47 "Variable which decides if the reweighter is applied or not");
48 return description;
49 }
std::string m_weightfile
Weightfile of the reweighting expert.
Definition: Reweighter.h:53
std::string m_variable
Variable which decides if the reweighter is applied or not.
Definition: Reweighter.h:54

◆ getMethod()

virtual std::string getMethod ( ) const
inlineoverridevirtual

Return method name.

Implements SpecificOptions.

Definition at line 51 of file Reweighter.h.

51{ return "Reweighter"; }

◆ 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 20 of file Reweighter.cc.

21 {
22 int version = pt.get<int>("Reweighter_version");
23 if (version != 1) {
24 B2ERROR("Unknown weightfile version " << std::to_string(version));
25 throw std::runtime_error("Unknown weightfile version " + std::to_string(version));
26 }
27
28 m_weightfile = pt.get<std::string>(std::string("Reweighter_weightfile"));
29 m_variable = pt.get<std::string>(std::string("Reweighter_variable"));
30
31 }

◆ 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 33 of file Reweighter.cc.

34 {
35 pt.put("Reweighter_version", 1);
36 pt.put(std::string("Reweighter_weightfile"), m_weightfile);
37 pt.put(std::string("Reweighter_variable"), m_variable);
38 }

Member Data Documentation

◆ m_variable

std::string m_variable

Variable which decides if the reweighter is applied or not.

Definition at line 54 of file Reweighter.h.

◆ m_weightfile

std::string m_weightfile

Weightfile of the reweighting expert.

Definition at line 53 of file Reweighter.h.


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