6 TChain *Chain(
const Char_t *TreeName =
"T") {
8 TCollection *files = gROOT->GetListOfFiles();
9 if (! files)
return chain;
12 chain =
new TChain(TreeName);
14 ULong64_t nEvents = 0;
16 while ( (f = (TFile *) next()) ) {
17 TTree *tree = (TTree *) f->Get(TreeName);
20 nEvents = tree->GetEntries();
21 cout <<
"#\t" << NFiles <<
"\t" << f->GetName() <<
"\t" << nEvents << endl;
23 chain->Add(f->GetName());
27 cout <<
"chained " << NFiles <<
" files \t"
28 <<
"with total " << nEvTot <<
" events \t"
29 <<
"chain returned pointer: " << chain << endl;