Fix for #88591 Request to commit/port fix in AliRawReaderChain (setter instead of...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Nov 2011 17:32:53 +0000 (17:32 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 Nov 2011 17:32:53 +0000 (17:32 +0000)
RAW/AliRawReaderChain.cxx
RAW/AliRawReaderChain.h

index 48379ed..430d5c6 100644 (file)
 
 #include "AliRawReaderChain.h"
 #include "AliRawVEvent.h"
+#include "AliLog.h"
 
 ClassImp(AliRawReaderChain)
 
+TString AliRawReaderChain::fgSearchPath = "/alice/data";
+
 AliRawReaderChain::AliRawReaderChain() :
   AliRawReaderRoot(),
   fChain(NULL)
@@ -230,7 +233,8 @@ AliRawReaderChain::AliRawReaderChain(Int_t runNumber) :
     return;
   }
 
-  TGridResult *res = gGrid->Query("/alice/data",Form("%09d/raw/*%09d*.root",runNumber,runNumber));
+  if (fgSearchPath.IsNull()) fgSearchPath = "/alice/data";
+  TGridResult *res = gGrid->Query(fgSearchPath.Data(),Form("%09d/raw/*%09d*.root",runNumber,runNumber));
   Int_t nFiles = res->GetEntries();
   if (!nFiles) {
     Error("AliRawReaderChain","No raw-data files found for run %d",runNumber);
@@ -344,3 +348,10 @@ Int_t AliRawReaderChain::GetNumberOfEvents() const
 
   return fChain->GetEntries();
 }
+
+void AliRawReaderChain::SetSearchPath(const char* path)
+{
+  // set alien query search path
+  AliInfoGeneral("SetSearchPath",Form("Setting search path to \"%s\" (was \"%s\")",path,fgSearchPath.Data()));
+  fgSearchPath = path;
+}
index 8ef50e3..80e5aa8 100644 (file)
@@ -10,6 +10,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 #include "AliRawReaderRoot.h"
+#include <TString.h>
 
 class TChain;
 class TFileCollection;
@@ -33,10 +34,12 @@ class AliRawReaderChain: public AliRawReaderRoot {
     virtual Int_t    GetNumberOfEvents() const;
 
     virtual TChain*  GetChain() const { return fChain; }
-
+    //
+    static const char* GetSearchPath()                               {return fgSearchPath;}
+    static       void  SetSearchPath(const char* path="/alice/data");
   protected :
     TChain*          fChain;        // root chain with raw events
-
+    static TString   fgSearchPath;   // search path for "find"
     ClassDef(AliRawReaderChain, 0) // class for reading raw digits from a root file
 };