Re: Error in <TTree::SetBranchStatus>: unknown branch

From: Harinder Singh Bawa <hbawa_at_csufresno.edu>
Date: Mon, 2 Aug 2010 04:13:45 -0700


Dear Axel, Philips,

Thanks for the reply but I figured out that the branches are not in my input rootfiles because these input files are older and my code is according to newer one. So now my question is
I need to analyse the rootfiles(all some with more variables and some with less variables). What needs to be done so that I dont get erorr like variables not found.

I did MakeClass with newer one and so I am having more variables defined in my .h file. Now If I run to older file, it is complaiing that these variables are unknown branches. I want to run on both older and newer files.

Kindly suggest

Harinder

From: "Philippe Canal" <pcanal_at_fnal.gov> To: "Harinder Singh Bawa" <hbawa_at_csufresno.edu> Cc: "roottalk" <roottalk_at_cern.ch>
Sent: Friday, July 30, 2010 5:22:18 PM
Subject: Re: [ROOT] Error in <TTree::SetBranchStatus>: unknown branch

Hi,

It is plausible that you do not have any branch with exactly those names. You may want to try:

fChain-> SetBranchStatus (" L2_xe12* ",1);

or double check the names (via mytree->Print()).

Cheers,
Philippe.

On 7/30/10 7:55 AM, Harinder Singh Bawa wrote:

Dear Root Experts,

  1. I need to understand 2 things. First I opened a rootfile and made .C and .h using MakeClass . I am expecting that MakeClass incorporated all the branch addresses and variables. But when I run , I am getting the following error.
Error in < TTree :: SetBranchStatus >: unknown branch -> trig_EF_ph 
Error in < TTree :: SetBranchStatus >: unknown branch -> L2_xe12 
Error in < TTree :: SetBranchStatus >: unknown branch -> xxxxxxxxx(blah blah) 
Error in <TTree::SetBranchStatus>: unknown branch -> xxxxxxxxx 
Error in <TTree::SetBranchStatus>: unknown branch -> xxxxxxxxx 
Error in <TTree::SetBranchStatus>: unknown branch -> xxxxxxxxx 
Error in <TTree::SetBranchStatus>: unknown branch -> xxxxxxxxx 

What needs to be done ? The code is running but I want to get rid of it

2. I did something in my .C file as
fChain-> SetBranchStatus ("*",0);

if ( stream_analyzed==TYPE_DATA) {
fChain-> SetBranchStatus (" RunNumber ",1); fChain-> SetBranchStatus (" lbn ",1);
}

fChain-> SetBranchStatus ("L1_EM10",1); 
fChain-> SetBranchStatus (" vxp _ nTracks ",1); 
fChain-> SetBranchStatus ("MET_Goodness_N90Cells_Jet",1); 
fChain-> SetBranchStatus ("MET_Goodness_ PtEM _Jet",1); 
fChain-> SetBranchStatus ("MET_Goodness_N90Cells_Jet",1); 
fChain-> SetBranchStatus ("MET_Goodness_ HECf _Jet",1); 
fChain-> SetBranchStatus ("MET_Goodness_ QualityFrac _Jet",1); 
fChain-> SetBranchStatus ("MET_Goodness_ EMFraction _Jet",1); 
fChain-> SetBranchStatus ("MET_Goodness_Timing_Jet",1); 
fChain-> SetBranchStatus (" el _n",1); 
fChain-> SetBranchStatus (" el _cl_eta",1); 
fChain-> SetBranchStatus (" el _cl_phi",1); 
fChain-> SetBranchStatus (" el _cl_pt",1); 
fChain-> SetBranchStatus (" el _author",1); 
fChain-> SetBranchStatus (" el _loose",1); 
fChain-> SetBranchStatus (" el _medium",1); 
fChain-> SetBranchStatus (" el _ tightIso ",1); 
fChain-> SetBranchStatus (" el _ isEM ",1); 
fChain-> SetBranchStatus (" el _ expectHitInBLayer ",1); 
fChain-> SetBranchStatus ("MET_ LocHadTopo _ et ",1); 
fChain-> SetBranchStatus ("MET_ LocHadTopo _phi",1); 

In order to read only those variables which are of my interest. I thought , it will read only the above variables and branches and I should not get the errors as pointed out in 1, because it is not reading now all the branches. But I think It is reading but taking only those which are defined above. Am I right?

If yes,
Then My question is same for both points. How to get rid of the errors.

thanks

Harinder Singh Bawa
California State University Fresno
Alternative email:- bawa@ cern .ch

Office:-
CERN B591-R-024 CSU Fresno:- Science II Room326 Phone:- +41-22-767-78187 Telephone:- +1-559-278-5802 CERN Mobile:- 0764878721
Res:- 0033-457055309 Received on Mon Aug 02 2010 - 13:13:55 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 02 2010 - 17:50:01 CEST