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