- // ########################################################
- // get the data dir
- Char_t execDir[256];
- sprintf(execDir,gSystem->pwd());
- TSystemDirectory* baseDir = new TSystemDirectory(".",aDataDir);
- TList* fileList = baseDir->GetListOfFiles();
- Int_t nFiles = fileList->GetEntries();
- // go back to the dir where this script is executed
- gSystem->cd(execDir);
-
- // ########################################################
- // loop over files
- Int_t counter = 0;
- for (Int_t r=0; r<nFiles; r++) {
-
- if (counter>aRuns)
- break;
-
- TSystemFile* presentFile = (TSystemFile*)fileList->At(r);
- if (!presentFile || presentFile->IsDirectory())
- continue;
+ // Open the input stream
+ ifstream in;
+ in.open(aDataDir);
+
+ Int_t count = 0;
+
+ // Read the input list of files and add them to the chain
+ TString line;
+ while(in.good())
+ {
+ in >> line;
+
+ if (line.Length() == 0)
+ continue;