410 {
411
412 weightfile.getOptions(specific_options);
413 if (specific_options.transform2probability) {
414 expert_signalFraction = weightfile.getSignalFraction();
415 }
416
417
418 std::string custom_weightfile = weightfile.generateFileName(std::string("_") + specific_options.m_method + ".weights.xml");
419 weightfile.getFile("TMVA_Weightfile", custom_weightfile);
420
421 TMVAExpert::load(weightfile);
422
423 if (specific_options.m_type == "Plugins") {
424 auto base = std::string("TMVA@@MethodBase");
425 auto regexp1 = std::string(".*_") + specific_options.m_method + std::string(".*");
426 auto regexp2 = std::string(".*") + specific_options.m_method + std::string(".*");
427 auto className = std::string("TMVA::Method") + specific_options.m_method;
428 auto ctor1 = std::string("Method") + specific_options.m_method + std::string("(TMVA::DataSetInfo&,TString)");
429 auto ctor2 = std::string("Method") + specific_options.m_method + std::string("(TString&,TString&,TMVA::DataSetInfo&,TString&)");
430 auto pluginName = std::string("TMVA") + specific_options.m_method;
431
432 gROOT->GetPluginManager()->AddHandler(base.c_str(), regexp1.c_str(), className.c_str(), pluginName.c_str(), ctor1.c_str());
433 gROOT->GetPluginManager()->AddHandler(base.c_str(), regexp2.c_str(), className.c_str(), pluginName.c_str(), ctor2.c_str());
434 B2INFO("Registered new TMVA Plugin named " << pluginName);
435 }
436
437 if (!m_expert->BookMVA(specific_options.m_method, custom_weightfile)) {
438 B2FATAL("Could not set up expert! Please see preceding error message from TMVA!");
439 }
440
441 }