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

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 30 Jul 2010 10:22:18 -0500


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_at_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 Fri Jul 30 2010 - 17:22:44 CEST

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