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;
}