]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- added the possibility to access the data from the GRID in order to extract the...
authorkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 Oct 2010 14:35:28 +0000 (14:35 +0000)
committerkkanaki <kkanaki@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 Oct 2010 14:35:28 +0000 (14:35 +0000)
- updated documentation, the macro now takes arguments

HLT/exa/hltout-collect-esd.C

index e5ab06fa6deed0eaba402ec7c33b54171dccd8a3..80d5514f35482947cae2d00884ea6259f69c2242 100644 (file)
@@ -8,8 +8,14 @@
  * is configured to publish all ESD objects from the HLTOUT data, the
  * AliHLTEsdCollectorComponent writes the files using the AliHLTEsdManager.
  *
- * Usage: aliroot -b -q hltout-collect-esd.C | tee hltout-collect-esd.log
- *
+ * Usage: aliroot -b -q \
+ *             hltout-collect-esd.C'("raw.root","local://$ALICE_ROOT/OCDB",0,5)' | tee hltout-collect-esd.log
+ * or 
+ *  
+ *    aliroot -b -l -q \
+ *                hltout-collect-esd.C'("alien:///alice/data/2010/LHC10b/000115322/raw/10000115322040.80.root","raw://",0,5)'  | tee hltout-collect-esd.log
+ * 
+ * 
  * The macro asumes HLTOUT raw data ddl files in order to open an
  * AliRawReaderFile, e.g. simulated using the default AliSimulation with
  * at least SetWriteRawData("HLT") enabled.
  * @author Matthias.Richter@ift.uib.no
  * @ingroup alihlt_tutorial
  */
-void hltout_collect_esd()
+void hltout_collect_esd(const char *filename,
+                        const char *cdbURI,
+                        int minEvent=-1,
+                        int maxEvent=-1)
 {
+  
+  // connect to the GRID if we use a file or OCDB from the GRID
+  TString struri=cdbURI;
+  TString strfile=filename;
+  if (struri.BeginsWith("raw://") ||
+      strfile.Contains("://") && !strfile.Contains("local://")) {
+    TGrid::Connect("alien");
+  }
+
+  // Set the CDB storage location
+  AliCDBManager * man = AliCDBManager::Instance();
+  man->SetDefaultStorage(cdbURI);
+  if (struri.BeginsWith("local://")) {
+    // set specific storage for GRP entry
+    // search in the working directory and one level above, the latter
+    // follows the standard simulation setup like e.g. in test/ppbench
+    if (!gSystem->AccessPathName("GRP/GRP/Data")) {
+      man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
+    } else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
+      man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
+    }
+  }
   /////////////////////////////////////////////////////////////////////////
   /////////////////////////////////////////////////////////////////////////
   //
@@ -50,8 +81,15 @@ void hltout_collect_esd()
   /////////////////////////////////////////////////////////////////////////
   //
   // setup of the reconstruction
-  AliReconstruction rec;
-  rec.SetInput("./");
+  AliReconstruction rec; 
+  
+  if (minEvent>=0 || maxEvent>minEvent) {
+    if (minEvent<0) minEvent=0;
+    if (maxEvent<minEvent) maxEvent=minEvent;
+    rec.SetEventRange(minEvent,maxEvent);
+  }
+
+  rec.SetInput(filename);
   rec.SetRunLocalReconstruction("HLT");
   rec.SetRunTracking("");
   rec.SetFillESD("");