9 IO::
IO(const
char* dir, const
char* ext)
10 : mNFile(0), mDir(dir), mExt(ext) {}
15 IO::chain(TChain* chain)
17 void *pDir = gSystem->OpenDirectory(mDir.Data());
19 cerr <<
"##Cannot open directory " << mDir.Data() << endl;
20 cerr <<
"##Goodbye" << endl;
24 cout <<
"\tUsing directory : " << mDir.Data() << endl;
25 cout <<
"\tMatch extension : " << mExt.Data() << endl;
26 if(mNFile) cout <<
"\tMaximum # files : " << mNFile << endl;
31 const char* fileName(0);
34 while((fileName = gSystem->GetDirEntry(pDir))){
35 if(strcmp(fileName,
".")==0 || strcmp(fileName,
"..")==0)
continue;
37 if(strstr(fileName,mExt.Data())){
38 char* fullFile = gSystem->ConcatFileName(mDir.Data(),fileName);
41 cout <<
"\tAdding " << fullFile <<
" to the chain" << endl;
43 chain->Add(fullFile); count++;
45 if(mNFile && count > mNFile)
break;
48 cout <<
"Added " << count <<
" files to the chain" << endl;