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