I want to use ROOT.Minuit2 for fitting data. However, when I execute
MnMigrad() in PyROOT, Jupyter console displays c++ segmentation fault error. How to fix under my code ?
class MyFCN(Minuit2.FCNBase): def __init__(self): pass def __call__(self, params): return 1. fcn = MyFCN() param = Minuit2.MnUserParameters() param.Add("test1",0.01, 0.01) param.Add("test2",0.01, 0.01) param.Add("test3",0.01, 0.01) migrad = Minuit2.MnMigrad(fcn, param,3) migrad()
Error massage is here.
SegmentationViolation Traceback (most recent call last)
9 param.Add(“test3”,0.01, 0.01)
10 migrad = Minuit2.MnMigrad(fcn, param,3)
—> 11 migrad()
SegmentationViolation: ROOT::Minuit2::FunctionMinimum ROOT::Minuit2::MnApplication::operator()(unsigned int maxfcn = 0, double tolerance = 0.10000000000000001) =>
SegmentationViolation: segfault in C++; program state was reset
ROOT Version: JupyROOT 6.22/08
Platform: macOS Catalina 10.15.7