475 {
476
477 weightfile.getOptions(specific_options);
478
479
480 std::string custom_weightfile = weightfile.generateFileName(std::string("_") + specific_options.m_method + ".weights.xml");
481 weightfile.getFile("TMVA_Weightfile", custom_weightfile);
482
483 TMVAExpert::load(weightfile);
484
485 if (specific_options.m_type == "Plugins") {
486 auto base = std::string("TMVA@@MethodBase");
487 auto regexp1 = std::string(".*_") + specific_options.m_method + std::string(".*");
488 auto regexp2 = std::string(".*") + specific_options.m_method + std::string(".*");
489 auto className = std::string("TMVA::Method") + specific_options.m_method;
490 auto ctor1 = std::string("Method") + specific_options.m_method + std::string("(TMVA::DataSetInfo&,TString)");
491 auto ctor2 = std::string("Method") + specific_options.m_method + std::string("(TString&,TString&,TMVA::DataSetInfo&,TString&)");
492 auto pluginName = std::string("TMVA") + specific_options.m_method;
493
494 gROOT->GetPluginManager()->AddHandler(base.c_str(), regexp1.c_str(), className.c_str(), pluginName.c_str(), ctor1.c_str());
495 gROOT->GetPluginManager()->AddHandler(base.c_str(), regexp2.c_str(), className.c_str(), pluginName.c_str(), ctor2.c_str());
496 B2INFO("Registered new TMVA Plugin named " << pluginName);
497 }
498
499 if (!m_expert->BookMVA(specific_options.m_method, custom_weightfile)) {
500 B2FATAL("Could not set up expert! Please see preceding error message from TMVA!");
501 }
502
503 }