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