Skip to content
Snippets Groups Projects
Commit ac36324f authored by Lorenzo Moneta's avatar Lorenzo Moneta
Browse files

Add a protection for creating the Minimizer and DistSampler with the plugin...

Add a protection for creating the Minimizer and DistSampler  with the plugin manager in multithreads
(thanks for Andreas, see ROOT-5335)
parent 19e2c79a
No related branches found
No related tags found
No related merge requests found
......@@ -21,10 +21,17 @@
#include "Math/DistSampler.h"
#include "Math/DistSamplerOptions.h"
// uncomment these if you dont want to use the plugin manager
// but you need to link also the needed minimization libraries (e.g Minuit and/or Minuit2)
// #define MATH_NO_PLUGIN_MANAGER
// #define HAS_MINUIT
// #define HAS_MINUIT2
#ifndef MATH_NO_PLUGIN_MANAGER
// use ROOT Plug-in manager
#include "TPluginManager.h"
#include "TROOT.h"
#include "TVirtualMutex.h"
#else
// all the minimizer implementation classes
//#define HAS_MINUIT2
......@@ -76,6 +83,8 @@ ROOT::Math::Minimizer * ROOT::Math::Factory::CreateMinimizer(const std::string &
if (minimizerType.empty() ) minim = ROOT::Math::MinimizerOptions::DefaultMinimizerType().c_str();
R__LOCKGUARD2(gROOTMutex);
// create Minimizer using the PM
TPluginHandler *h;
//gDebug = 3;
......@@ -128,7 +137,7 @@ ROOT::Math::Minimizer * ROOT::Math::Factory::CreateMinimizer(const std::string &
#ifdef HAS_MINUIT
// use TMinuit
if (minimizerType == "Minuit" || minimizerType == "TMinuit")
min = new ROOT::Fit::TMinuitMinimizer(algoType.c_str());
min = new TMinuitMinimizer(algoType.c_str());
#endif
#ifdef R__HAS_MATHMORE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment