4 void anachain(
const Char_t *ddname =
"/star/data05/scratch/jwebb/checkin/",
5 const Char_t *pref=
"R5",
6 const Char_t *ffname =
".root",
11 gROOT->LoadMacro(
"macros/loadlibs.C");
14 c =
new TCanvas(
"c",
"A canvas",500,500);
16 mTree =
new TChain(
"mTree",
"A pi0 tree");
18 TSystemDirectory *dir =
new TSystemDirectory(
"pwd",ddname);
19 TList *files = dir->GetListOfFiles();
21 TSystemFile *file = 0;
24 TList *listOfEmpties=
new TList();
26 while ( (file = (TSystemFile *)next() ) ) {
30 TString fname = file -> GetName();
31 if ( !fname.Contains(ffname) )
continue;
32 if ( !fname.Contains(pref) )
continue;
38 TTree *mytree = (TTree *)pfile.Get(
"mTree");
39 if ( mytree ) pi0tree = 1;
44 std::cout <<
"Adding " << fname
45 <<
" npi0tree=" << mTree->GetEntries()
48 mTree -> Add(fname+
"/mTree");
52 if ( nf > nmax )
break;
55 std::cout <<
"-- anachain -----------------------------------" << std::endl;
56 std::cout << std::endl;
57 std::cout <<
"loaded " << nf <<
" files" << std::endl;