+void* AliRawReaderFile::OpenDirectory()
+{
+// open and return the directory
+
+ TString dirName = GetDirName();
+ void* directory = gSystem->OpenDirectory(dirName);
+ if (!directory) {
+ Error("OpenDirectory", "could not open directory %s", dirName.Data());
+ }
+ return directory;
+}
+
+Bool_t AliRawReaderFile::CreateFileIndex()
+{
+// scan the files of the directory and create index of all DDL files
+// returns kFALSE if no DDL files available
+ Bool_t result=kFALSE;
+ fDDLCurrent=-1;
+ if (fDDLIndex) return fDDLIndex->GetSize()>0;
+ if (!fDirectory) return kFALSE;
+ fDDLIndex=new TArrayC(0);
+ if (!fDDLIndex) return kFALSE;
+ TString entry;
+ 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);
+ entry.Remove(entry.Length()-4);
+ Int_t equipmentId = atoi(entry.Data());
+ Int_t ddlIndex = -1;
+ fDetectorPattern |= (1 << AliDAQ::DetectorIDFromDdlID(equipmentId,ddlIndex));
+ if (fDDLIndex->GetSize()<=equipmentId) {
+ fDDLIndex->Set(equipmentId+1);
+ }
+ char* array=(char*)fDDLIndex->GetArray();
+ array[equipmentId]=1;
+ }
+
+ return result;
+}