]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderFile.cxx
New class AliFigure (Jochen)
[u/mrichter/AliRoot.git] / RAW / AliRawReaderFile.cxx
index 42f72f06a586af0dbd0319f6a1dc77ba41a3903e..92b5d850f477439f49cae0232734aefd8ea7486d 100644 (file)
@@ -37,6 +37,7 @@
 #include <TArrayC.h>
 
 
+using std::ios;
 ClassImp(AliRawReaderFile)
 
 
@@ -60,7 +61,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 +88,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;
@@ -163,9 +166,14 @@ Bool_t AliRawReaderFile::CreateFileIndex()
   fDDLIndex=new TArrayC(0);
   if (!fDDLIndex) return kFALSE;
   TString entry;
-  while (entry = gSystem->GetDirEntry(fDirectory)) {
+  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);