26#ifndef ROOT_TMVA_ClassifierFactory
27#define ROOT_TMVA_ClassifierFactory
78 const TString& weightfile =
"" );
80 const std::vector<std::string>
List()
const;
98 typedef std::map<std::string, Creator>
CallMap;
124#define REGISTER_METHOD(CLASS) \
127 struct RegisterTMVAMethod { \
128 static TMVA::IMethod* CreateMethod##CLASS(const TString& job, const TString& title, TMVA::DataSetInfo& dsi, const TString& option) \
130 if(job=="" && title=="") { \
131 return (TMVA::IMethod*) new TMVA::Method##CLASS(dsi, option); \
133 return (TMVA::IMethod*) new TMVA::Method##CLASS(job, title, dsi, option); \
136 RegisterTMVAMethod() { \
137 TMVA::ClassifierFactory::Instance(). Register(#CLASS, CreateMethod##CLASS); \
138 TMVA::Types::Instance().AddTypeMapping(TMVA::Types::k##CLASS, #CLASS); \
141 static RegisterTMVAMethod RegisterTMVAMethod_instance; \
IMethod * Create(const std::string &name, const TString &job, const TString &title, DataSetInfo &dsi, const TString &option)
creates the method if needed based on the method name using the creator function the factory has stor...
static ClassifierFactory * fgInstance
Initialize static singleton pointer.
static ClassifierFactory & Instance()
access to the ClassifierFactory singleton creates the instance if needed
std::map< std::string, Creator > CallMap
static void DestroyInstance()
destroy the singleton instance
IMethod *(* Creator)(const TString &job, const TString &title, DataSetInfo &dsi, const TString &option)
ClassifierFactory(const ClassifierFactory &)
Bool_t Unregister(const std::string &name)
unregisters a classifier type name
const ClassifierFactory & operator=(const ClassifierFactory &)
void Print() const
prints the registered method type names
const std::vector< std::string > List() const
returns a vector of the method type names of registered methods
Bool_t Register(const std::string &name, Creator creator)
registers a classifier creator function under the method type name
Class that contains all the data information.
Interface for all concrete MVA method implementations.
Abstract ClassifierFactory template that handles arbitrary types.