[ROOT] TChain test for tree name

From: Gene Van Buren (gene@bnl.gov)
Date: Sat Oct 30 2004 - 21:01:45 MEST

I have set of files containing TTrees. All files in each
set either have one name (let's call it "ATree") or all
have a different name ("BTree"). Both TTrees have a
set of branches in common, so one piece of code that
analyzes these common branches could use either
kind of TTree. To access these file sets, I've been
using a TChain.

Anyone have a good way to automatically handle the
two possible tree names?

In the past I have made this work by using the name
"ATree", Add()'ing files, calling LoadTree(0), and
checking if the result was -4, then changing the name
of the TChain and its TChainElements to "BTree" and
trying again. But fEntries is zero after I use Add() to
add files to the TChain, and I can't recover from that.


This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET