Hello, I am calling ROOT from Python , but I can’t disable ROOT errors. I use it for fitting some data, and it works great, but from time to time we get invalid data (which we discard, of course), and ROOT complains with this message:
Error in : matrix not positive definite
Error in <TVectorT::operator=(const TVectorT &)>: vectors not compatible
I have tried to disable it by including this in my scripts:
ROOT.gErrorIgnoreLevel = 1
but it didn’t have any effect! Any ideas about this?
with some older versions, there is a problem when setting a global variable, if that variable hasn’t been retrieved before. Please use:
gROOT.ProcessLine( "gErrorIgnoreLevel = 1;" )
to work around this, until you can move to a more recent version.
Hi Wim, thanks a lot for your answer. As far as the versions are concerned, I have to say that I’m up-to-date both with root (just reinstalled from source on my dual opteron - FC5) and python, so I am afraid that that’s not the problem.
about the line you suggest:
I have tried to enter this command as well but probably I did something wrong, since Python complains that there are no gROOT modules.
any other idea?
ok, had my coffee now … two things: 1) I didn’t notice you wanted to suppress errors (rather than infos), in which case gErrorIgnoreLevel has to be larger than kError in TError.h (i.e. larger than 2000, using 1 will work for infos, as kInfo is 0). And 2) gROOT is part of ROOT, I didn’t see that you did “import ROOT” (always better than “from ROOT import *” ), and so it’d be:
ROOT.gROOT.ProcessLine( "gErrorIgnoreLevel = 1;" )
Thanks a lot Wim, problem solved!