]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderFile.cxx
Changes for report #76227: ZDC TDC info in ESD and physics selection (for release...
[u/mrichter/AliRoot.git] / RAW / AliRawReaderFile.cxx
index 42f72f06a586af0dbd0319f6a1dc77ba41a3903e..e126d1010e4488e59e5373605d67202f957e4d94 100644 (file)
@@ -60,7 +60,8 @@ AliRawReaderFile::AliRawReaderFile(Int_t eventNumber) :
 // in the current directory
 
   fDirectory = OpenDirectory();
-  OpenNextFile();
+  if (!fDirectory) fIsValid = kFALSE;
+  if (!OpenNextFile()) fIsValid = kFALSE;
   fHeader = new AliRawDataHeader;
 
   fId[0] = fId[1] = 0;
@@ -86,7 +87,8 @@ AliRawReaderFile::AliRawReaderFile(const char* dirName, Int_t eventNumber) :
 // create an object to read digits from the given directory
 
   fDirectory = OpenDirectory();
-  OpenNextFile();
+  if (!fDirectory) fIsValid = kFALSE;
+  if (fEventIndex >= 0 && (!OpenNextFile())) fIsValid = kFALSE;
   fHeader = new AliRawDataHeader;
 
   fId[0] = fId[1] = 0;
@@ -166,6 +168,11 @@ Bool_t AliRawReaderFile::CreateFileIndex()
   while (entry = gSystem->GetDirEntry(fDirectory)) {
     const char* filename=entry.Data();
     if (!filename || entry.IsNull()) break;
+    if (entry.BeginsWith("run")) {
+      entry.ReplaceAll("run","");
+      fRunNb = entry.Atoi();
+      continue;
+    }
     if (!entry.EndsWith(".ddl")) continue;
     result=kTRUE;
     entry.Remove(0, entry.Last('_')+1);