Randomly a segmentation fault for uninitialized TTree

Check:

root-config --features | grep -i minuit2
root-config --has-minuit2
`

Yes, thanks you. It looks like one MUST leave the default, that is one must not specify any minimizer on lxplus.
Given that, now everything works fine.

You can try GSL based minimizers, if you have:

root-config --features | grep -i mathmore
root-config --has-mathmore

I had already tried giving “minuit2” (not “Minuit2” as I found in Lorenzo Moneta’s
ROOT: tutorials/fit/NumericalMinimization.C Source File) argument for the name, but I got segmentation fault despite the fact that “minuit2” is found by root-config --features.

By now I am satisfied having my program working both on my mac and on lxplus.
Bye,
Ignazio

The “minimizer’s name” is case sensitive (i.e., you must use “Minuit2”).

@Axel If “root-config --has-minuit2” returns “yes” but “Minuit2” is not working, then I think it is a bug (specific to the default ROOT installation on lxplus?).

BTW. The default minimizer (when the “minimizer’s name” is empty) is the old “Minuit”.

Not “minuit2” nor “Minuit2” does work on lxplus, but “” (empty string) does.
“Minuit2” works on my mac.

I have just done one check more: I confirm that not “minuit2” nor “Minuit2” does work on lxplus, but “” (empty string) does.
“Minuit2” works on my mac.

Just to make sure … in your application, do you create a “TApplication” first (in your “main”)?

Yes, it does: it’s the first call in main.
My username is “lazi”. If you like, you find the whole code in my home, ANALISI subdirectory.

Post the full “stack trace” from lxplus and the output of “root-config --version --prefix --exec-prefix” (maybe that’s something people know about).

gdb.printing.register_pretty_printer(gdb.current_objfile(),
gdb.printing.register_pretty_printer(gdb.current_objfile(),
# #0 0x00007faf2bb6446c in waitpid () from /lib64/libc.so.6
#1 0x00007faf2bae1f62 in do_system () from /lib64/libc.so.6
#2 0x00007faf304ff58c in TUnixSystem::StackTrace() () from /usr/lib64/root/libCore.so.6.22
#3 0x00007faf3050201a in TUnixSystem::DispatchSignals(ESignals) () from /usr/lib64/root/libCore.so.6.22
#4
#5 0x0000000000463862 in ROOT::Math::MinimizerOptions::SetMaxFunctionCalls(unsigned int) ()
#6 0x00000000004638ec in ROOT::Math::Minimizer::SetMaxFunctionCalls(unsigned int) ()
#7 0x0000000000462bb4 in FitHist2Hist::_fit(double*, double*, char const*, char const*, int) ()
#8 0x0000000000462ffa in FitHist2Hist::go(double) ()
#9 0x0000000000447e14 in Analisi::look_for_gamma(std::map<std::string, TH1F*, std::lessstd::string, std::allocator<std::pair<std::string const, TH1F*> > >&) ()
#10 0x000000000044687c in Analisi::fillHistograms(std::vector<std::string, std::allocatorstd::string >) ()
#11 0x000000000043857a in main ()

Anyway the point is what I already said:
in

    ROOT::Math::Minimizer* minimum =
       ROOT::Math::Factory::CreateMinimizer(minName, algoName);

ROOT::Math::Factory::CreateMinimizer(minName, algoName) 

returns zero, whence the segmentation fault when doing like

minimum->SetMaxFunctionCalls(1000000);

I gave

minName = std::string("Minuit2"); algoName = std::string("");

What happens if you try: minName = std::string("Minuit");

With std::string(“Minuit2”) it doesn’t work as well.

I just wrote to Lorenzo Moneta who is the expert in the subject.

We need @moneta here!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.