ROOT logo
// $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 needs to be the
 * same as the one the HLTOUT payload was generated 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();
}
 streamerinfo-from-raw.C:1
 streamerinfo-from-raw.C:2
 streamerinfo-from-raw.C:3
 streamerinfo-from-raw.C:4
 streamerinfo-from-raw.C:5
 streamerinfo-from-raw.C:6
 streamerinfo-from-raw.C:7
 streamerinfo-from-raw.C:8
 streamerinfo-from-raw.C:9
 streamerinfo-from-raw.C:10
 streamerinfo-from-raw.C:11
 streamerinfo-from-raw.C:12
 streamerinfo-from-raw.C:13
 streamerinfo-from-raw.C:14
 streamerinfo-from-raw.C:15
 streamerinfo-from-raw.C:16
 streamerinfo-from-raw.C:17
 streamerinfo-from-raw.C:18
 streamerinfo-from-raw.C:19
 streamerinfo-from-raw.C:20
 streamerinfo-from-raw.C:21
 streamerinfo-from-raw.C:22
 streamerinfo-from-raw.C:23
 streamerinfo-from-raw.C:24
 streamerinfo-from-raw.C:25
 streamerinfo-from-raw.C:26
 streamerinfo-from-raw.C:27
 streamerinfo-from-raw.C:28
 streamerinfo-from-raw.C:29
 streamerinfo-from-raw.C:30
 streamerinfo-from-raw.C:31
 streamerinfo-from-raw.C:32
 streamerinfo-from-raw.C:33
 streamerinfo-from-raw.C:34
 streamerinfo-from-raw.C:35
 streamerinfo-from-raw.C:36
 streamerinfo-from-raw.C:37
 streamerinfo-from-raw.C:38
 streamerinfo-from-raw.C:39
 streamerinfo-from-raw.C:40
 streamerinfo-from-raw.C:41
 streamerinfo-from-raw.C:42
 streamerinfo-from-raw.C:43
 streamerinfo-from-raw.C:44
 streamerinfo-from-raw.C:45
 streamerinfo-from-raw.C:46
 streamerinfo-from-raw.C:47
 streamerinfo-from-raw.C:48
 streamerinfo-from-raw.C:49
 streamerinfo-from-raw.C:50
 streamerinfo-from-raw.C:51
 streamerinfo-from-raw.C:52
 streamerinfo-from-raw.C:53
 streamerinfo-from-raw.C:54
 streamerinfo-from-raw.C:55
 streamerinfo-from-raw.C:56
 streamerinfo-from-raw.C:57
 streamerinfo-from-raw.C:58
 streamerinfo-from-raw.C:59
 streamerinfo-from-raw.C:60
 streamerinfo-from-raw.C:61
 streamerinfo-from-raw.C:62
 streamerinfo-from-raw.C:63
 streamerinfo-from-raw.C:64
 streamerinfo-from-raw.C:65
 streamerinfo-from-raw.C:66