How to supress TBranch error output?

Hello,

I use the MakeClass funciton to make a class for use with ntuples. The problem I have is sometimes I will make an ntuple with some branches missing (e.g. if I decide I dont need certain types of things in a particular ntuple). When I use the class made with MakeClass I get an error:

Error in TTree::SetBranchStatus: unknown branch ->

for every branch that is missing. I dont want these messages output so Is there a way for me to turn this output off?

I am using root_v4.03.02.Linux.slc3.gcc3.2.3.

Thanks,

Mark

comment the lines in the .h file referencing the branch(es) that you
do not want to use

or call tree.SetBranchStatus(“branchname”,0);
for the non interesting branches, and then call tree.MakeClass again

Rene

[quote=“brun”]
or call tree.SetBranchStatus(“branchname”,0);
for the non interesting branches, and then call tree.MakeClass again
Rene[/quote]

does this really work?!

doing something like:

TFile *_file0 = TFile::Open("Zhad.root");
TTree* fChain =(TTree*)_file0->Get("qcd");
fChain->SetBranchStatus("*",0);
fChain->SetBranchStatus("RunNumber",1);
fChain->MakeClass("analyser");

I always get a *.h with all the branches present in the Tree.
Am I mis-reading your solution?

cheers,
delo

forgot to tell you:

ROOT 5.28/00g (tags/v5-28-00g@40876, Sep 14 2011, 15:32:32 on linux)

Hi,

There was a problem with this use pattern which should be working properly in ROOT v5.30 and later.

Cheers,
Philippe.