gErrorIgnoreLevel problem

Hi,

I am having trouble understanding the exact nature of gErrorIgnoreLevel. I would like to suppress recurring error messages when reading in trees of the form:
Warning in TClass::TClass: no dictionary for class AttributeListLayout is available
Warning in TClass::TClass: no dictionary for class pair<string,string> is available
Error in TClass::Load: dictionary of class TTreeIndex not found

By calling

I was under the assumption that this simply prevented error messages from being directed to std out/err, however I have experienced scenarios under which this changes the behavior of my code. I’m compiling binary executables with gcc by linking against ROOT 5.26/00e. While reading in a tree containing a branch which is of type std::vector<std::vector > the size of the nested vector depends on whether the aforementioned gROOT call is made in main or not. If the call not made the size is correct, however if the call is made the size is always zero. The size of the vector of vectors is correct in both cases.

Is this a bug or is this an aspect of how errors are handled in root that I am not aware of. If so where could I find documentation.

Thanks,
Aaron

#include <vector>
#include <iostream>
#include <TFile.h>
#include <TTree.h>
#include <TBranch.h>
#include <TROOT.h>

int main()
{
	gROOT->ProcessLine("gErrorIgnoreLevel = kFatal;"); 	
	TFile* fin=TFile::Open("myfile.root");
	TTree* tree=(TTree*)fin->Get("the_tree");

	std::vector<std::vector<float> >* v;
	TBranch* b;
	tree->SetBranchAddress("the_branch",&v,&b);
	tree->GetEntry(0);
	
	std::cout << v->front().size() << std::endl;
	return 0;
}

Hi,

there is no need to go via gROOT->ProcessLine() (which initialized more than you need at this stage). Just do:

#include <TError.h>
...
...
gErrorIgnoreLevel = kFatal;

This should have no side effects.

Cheers, Fons.

Hi
I used your code:

#include <TError.h>


gErrorIgnoreLevel = kFatal;

and at compile time I’m getting : Error expected constructor, destructor, or type conversion before = sign
for the last line.

I’m linking to Root from a standalone c++ program.
thanks
Ken

[code]#include “TError.h”

// gErrorIgnoreLevel = kFatal; // this IS NOT the right place

int main(int /argc/, char ** /argv/)
{
gErrorIgnoreLevel = kFatal; // this IS the right place
return 0;
}[/code]

I see, it’s an extern in TError.h
many thanks!