]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding macro for generation of HLT StreamerInfo from raw data payload
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Dec 2009 07:57:14 +0000 (07:57 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Dec 2009 07:57:14 +0000 (07:57 +0000)
HLT/rec/streamerinfo-from-raw.C [new file with mode: 0644]

diff --git a/HLT/rec/streamerinfo-from-raw.C b/HLT/rec/streamerinfo-from-raw.C
new file mode 100644 (file)
index 0000000..5b454a5
--- /dev/null
@@ -0,0 +1,66 @@
+// $Id$
+/**
+ * @file streamerinfo-from-raw.C
+ * @brief Extract the streamer info for a raw file and AliRoot version
+ *
+ * This macro generates the streamer info for all objects in the HLTOUT
+ * payload of the specified raw file. The AliRoot version of the when
+ * running this macro needs to be the same as the HLTOUT payload was
+ * generatted with.
+ *
+ * The macro has two optional parameters:
+ * - filename:  default 'raw://'
+ * - OCDB URI:  default 'raw.root'
+ *
+ * If either file or URI refers to the GRID, the macro connects to alien.
+ * Make sure that ROOT is compiled with ALIEN support and that the required
+ * alien API libraries can be loaded.
+ *
+ * You can run this macro with defaults using the following shell command:
+ * @code
+ *   > aliroot -b -q $ALICE_ROOT/HLT/rec/streamerinfo-from-raw.C
+ * @endcode
+ * With a raw file from the GRID
+ * @code
+ *   > aliroot -b -q streamerinfo-from-raw.C'("alien:///alice/data/2009/LHC09d/000102925/raw/09000102925035.10.root")'
+ * @endcode
+ *
+ * Streamer info is stored in a TObjArray wrapped into an AliCDBEntry
+ * object, and stored to HLT.StreamerInfo.root. This file can be used
+ * directly as OCDB object, it just needs to be renamed.
+ *
+ * @author Matthias.Richter@ift.uib.no
+ */
+void streamerinfo_from_raw(const char *filename="raw.root", const char* cdbUri="raw://")
+{
+  TString tmpStr1=filename;
+  TString tmpStr2=cdbUri;
+  if ((tmpStr1.Contains("://") && !tmpStr1.BeginsWith("local://")) ||
+      !tmpStr2.BeginsWith("local://")) {
+    // setup the GRID connection if raw file or OCDB are from GRID
+    TGrid::Connect("alien");
+  }
+
+  // Set the CDB storage location
+  AliCDBManager * man = AliCDBManager::Instance();
+  man->SetDefaultStorage(cdbUri);
+
+  // Reconstruction settings
+  AliReconstruction rec;
+  rec.SetRunPlaneEff(kFALSE);
+  rec.SetCleanESD(kFALSE);
+
+  rec.SetInput(filename);
+  rec.SetRunReconstruction("HLT");
+  rec.SetOption("HLT","skip-hltout chains=schemaevo");
+
+  AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
+  AliHLTConfiguration publisher("hltout-publisher", "AliHLTOUTPublisher" , NULL, "");
+  AliHLTConfiguration collector("schemaevo", "ROOTSchemaEvolutionComponent"   , "hltout-publisher", "-file=HLT.StreamerInfo.root");
+
+  // QA options
+  rec.SetRunQA(":") ;
+
+  AliLog::Flush();
+  rec.Run();
+}