444 {
445
446 weightfile.getOptions(specific_options);
447
448
449 std::string custom_weightfile = weightfile.generateFileName(std::string("_") + specific_options.m_method + ".weights.xml");
450 weightfile.getFile("TMVA_Weightfile", custom_weightfile);
451
452 TMVAExpert::load(weightfile);
453
454 if (specific_options.m_type == "Plugins") {
455 auto base = std::string("TMVA@@MethodBase");
456 auto regexp1 = std::string(".*_") + specific_options.m_method + std::string(".*");
457 auto regexp2 = std::string(".*") + specific_options.m_method + std::string(".*");
458 auto className = std::string("TMVA::Method") + specific_options.m_method;
459 auto ctor1 = std::string("Method") + specific_options.m_method + std::string("(TMVA::DataSetInfo&,TString)");
460 auto ctor2 = std::string("Method") + specific_options.m_method + std::string("(TString&,TString&,TMVA::DataSetInfo&,TString&)");
461 auto pluginName = std::string("TMVA") + specific_options.m_method;
462
463 gROOT->GetPluginManager()->AddHandler(base.c_str(), regexp1.c_str(), className.c_str(), pluginName.c_str(), ctor1.c_str());
464 gROOT->GetPluginManager()->AddHandler(base.c_str(), regexp2.c_str(), className.c_str(), pluginName.c_str(), ctor2.c_str());
465 B2INFO("Registered new TMVA Plugin named " << pluginName);
466 }
467
468 if (!m_expert->BookMVA(specific_options.m_method, custom_weightfile)) {
469 B2FATAL("Could not set up expert! Please see preceding error message from TMVA!");
470 }
471
472 }