Belle II Software development
AbstractInterface Class Referenceabstract

Abstract Interface to third-party MVA libraries. More...

#include <Interface.h>

Inheritance diagram for AbstractInterface:
Interface< TemplateOptions, TemplateTeacher, TemplateExpert >

Public Member Functions

 AbstractInterface (const std::string &name)
 Creates a new Interface to a third-party library.
 
virtual ~AbstractInterface ()
 Virtual destructor.
 
std::string getName () const
 Returns the name of the third-party MVA library.
 
virtual std::unique_ptr< SpecificOptionsgetOptions () const =0
 Get Options of this MVA library.
 
virtual std::unique_ptr< TeachergetTeacher (const GeneralOptions &general_options, const SpecificOptions &specific_options) const =0
 Get Teacher of this MVA library.
 
virtual std::unique_ptr< MVA::ExpertgetExpert () const =0
 Get Exoert of this MVA library.
 

Static Public Member Functions

static std::map< std::string, AbstractInterface * > getSupportedInterfaces ()
 Returns interfaces supported by the MVA Interface.
 
static void initSupportedInterfaces ()
 Static function which initliazes all supported interfaces, has to be called once before getSupportedInterfaces can be used.
 

Private Attributes

std::string m_name
 Name of the third-party library.
 

Static Private Attributes

static std::map< std::string, AbstractInterface * > s_supported_interfaces
 Map of supported interfaces.
 

Detailed Description

Abstract Interface to third-party MVA libraries.

Definition at line 30 of file Interface.h.

Constructor & Destructor Documentation

◆ AbstractInterface()

AbstractInterface ( const std::string &  name)
explicit

Creates a new Interface to a third-party library.

Parameters
nameof the third-party MVA library

Definition at line 27 of file Interface.cc.

27 : m_name(name)
28 {
30 B2WARNING("An interface with the name " << m_name << " already exists!");
31 } else {
32 s_supported_interfaces.insert(std::make_pair(name, this));
33 }
34 }
static std::map< std::string, AbstractInterface * > s_supported_interfaces
Map of supported interfaces.
Definition: Interface.h:89
std::string m_name
Name of the third-party library.
Definition: Interface.h:84

◆ ~AbstractInterface()

~AbstractInterface ( )
virtual

Virtual destructor.

Definition at line 36 of file Interface.cc.

37 {
39 }

Member Function Documentation

◆ getExpert()

virtual std::unique_ptr< MVA::Expert > getExpert ( ) const
pure virtual

Get Exoert of this MVA library.

Implemented in Interface< TemplateOptions, TemplateTeacher, TemplateExpert >.

◆ getName()

std::string getName ( ) const

Returns the name of the third-party MVA library.

Returns
name of the third-party MVA library

Definition at line 41 of file Interface.cc.

41{ return m_name; }

◆ getOptions()

virtual std::unique_ptr< SpecificOptions > getOptions ( ) const
pure virtual

◆ getSupportedInterfaces()

static std::map< std::string, AbstractInterface * > getSupportedInterfaces ( )
inlinestatic

Returns interfaces supported by the MVA Interface.

Returns
supported interfaces

Definition at line 53 of file Interface.h.

53{ return s_supported_interfaces; }

◆ getTeacher()

virtual std::unique_ptr< Teacher > getTeacher ( const GeneralOptions general_options,
const SpecificOptions specific_options 
) const
pure virtual

Get Teacher of this MVA library.

Parameters
general_optionsshared options of all libraries
specific_optionsspecific options for this library

Implemented in Interface< TemplateOptions, TemplateTeacher, TemplateExpert >.

◆ initSupportedInterfaces()

void initSupportedInterfaces ( )
static

Static function which initliazes all supported interfaces, has to be called once before getSupportedInterfaces can be used.

It is save to call it multiple times

Definition at line 45 of file Interface.cc.

46 {
47 static Interface<FastBDTOptions, FastBDTTeacher, FastBDTExpert> interface_FastBDT;
48 static Interface<RegressionFastBDTOptions, RegressionFastBDTTeacher, RegressionFastBDTExpert> interface_RegressionFastBDT;
49 static Interface<FANNOptions, FANNTeacher, FANNExpert> interface_FANN;
50 static Interface<TMVAOptionsClassification, TMVATeacherClassification, TMVAExpertClassification>
51 interface_TMVAClassification;
52 static Interface<TMVAOptionsRegression, TMVATeacherRegression, TMVAExpertRegression> interface_TMVARegression;
53 static Interface<TMVAOptionsMulticlass, TMVATeacherMulticlass, TMVAExpertMulticlass> interface_TMVAMulticlass;
54 static Interface<PythonOptions, PythonTeacher, PythonExpert> interface_Python;
55 static Interface<PDFOptions, PDFTeacher, PDFExpert> interface_PDF;
56 static Interface<CombinationOptions, CombinationTeacher, CombinationExpert> interface_Combination;
57 static Interface<ReweighterOptions, ReweighterTeacher, ReweighterExpert> interface_Reweighter;
58 static Interface<TrivialOptions, TrivialTeacher, TrivialExpert> interface_Trivial;
59 }

Member Data Documentation

◆ m_name

std::string m_name
private

Name of the third-party library.

Definition at line 84 of file Interface.h.

◆ s_supported_interfaces

std::map< std::string, AbstractInterface * > s_supported_interfaces
staticprivate

Map of supported interfaces.

Definition at line 89 of file Interface.h.


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