TMinuit with OpenMP

Hello all,

For my analysis I need to fit two signals (one high gain (HG), and one low gain (LG)), I fit with TMinuit class with Migrad algorithm.
My problem is Minuit uses global variables for minimization, so how to call Minuit twice with different values in different thread ? When I try I have a “nice” segmentation violation

My code is like this :

Minimization with TMinuit is in fit function and is like every Minuit minimization I think and is like this :

Maybe there is a best tool to fit my signal in different threads, but I don’t find it. If someone thinks is easier to use another minimization algorithm I agree with him (or her).

I see Minuit2Minimizer, and it doesn’t use global variables, so it is easier to do working with OpenMP.

I try it.