#include <TArrayC.h>
+using std::ios;
ClassImp(AliRawReaderFile)
// in the current directory
fDirectory = OpenDirectory();
- OpenNextFile();
+ if (!fDirectory) fIsValid = kFALSE;
+ if (!OpenNextFile()) fIsValid = kFALSE;
fHeader = new AliRawDataHeader;
fId[0] = fId[1] = 0;
// 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;
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);