3 * @file hltout-collect-esd.C
4 * @brief Example for the AliHLTEsdCollectorComponent
6 * Example macro to run a small chain with the AliHLTOUTPublisherComponent
7 * and the AliHLTEsdCollectorComponent. The AliHLTOUTPublisherComponent
8 * is configured to publish all ESD objects from the HLTOUT data, the
9 * AliHLTEsdCollectorComponent writes the files using the AliHLTEsdManager.
11 * Usage: aliroot -b -q \
12 * hltout-collect-esd.C'("raw.root","local://$ALICE_ROOT/OCDB",0,5)' | tee hltout-collect-esd.log
16 * hltout-collect-esd.C'("alien:///alice/data/2010/LHC10b/000115322/raw/10000115322040.80.root","raw://",0,5)' | tee hltout-collect-esd.log
19 * The macro asumes HLTOUT raw data ddl files in order to open an
20 * AliRawReaderFile, e.g. simulated using the default AliSimulation with
21 * at least SetWriteRawData("HLT") enabled.
23 * \b Note: The example disables a few steps in the AliReconstruction,
24 * mainly because of crashes in various parts of AliRoot. This does not
25 * have any impact to the HLT features to be presented.
27 * @author Matthias.Richter@ift.uib.no
28 * @ingroup alihlt_tutorial
30 void hltout_collect_esd(const char *filename,
36 // connect to the GRID if we use a file or OCDB from the GRID
37 TString struri=cdbURI;
38 TString strfile=filename;
39 if (struri.BeginsWith("raw://") ||
40 strfile.Contains("://") && !strfile.Contains("local://")) {
41 TGrid::Connect("alien");
44 // Set the CDB storage location
45 AliCDBManager * man = AliCDBManager::Instance();
46 man->SetDefaultStorage(cdbURI);
47 if (struri.BeginsWith("local://")) {
48 // set specific storage for GRP entry
49 // search in the working directory and one level above, the latter
50 // follows the standard simulation setup like e.g. in test/ppbench
51 if (!gSystem->AccessPathName("GRP/GRP/Data")) {
52 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD");
53 } else if (!gSystem->AccessPathName("../GRP/GRP/Data")) {
54 man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/..");
57 /////////////////////////////////////////////////////////////////////////
58 /////////////////////////////////////////////////////////////////////////
60 // setup of the HLT system
61 AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
63 cerr << "fatal error: can not get HLT instance" << endl;
66 /////////////////////////////////////////////////////////////////////////
67 /////////////////////////////////////////////////////////////////////////
69 // the configuration chain
72 // the publisher configuration
73 arg.Form("-typeid ALIESDV0");
74 AliHLTConfiguration publisher("hltout-publisher", "AliHLTOUTPublisher" , NULL, arg.Data());
76 // the writer configuration
78 AliHLTConfiguration collector("sink1", "EsdCollector" , "hltout-publisher", arg.Data());
80 /////////////////////////////////////////////////////////////////////////
81 /////////////////////////////////////////////////////////////////////////
83 // setup of the reconstruction
84 AliReconstruction rec;
86 if (minEvent>=0 || maxEvent>minEvent) {
87 if (minEvent<0) minEvent=0;
88 if (maxEvent<minEvent) maxEvent=minEvent;
89 rec.SetEventRange(minEvent,maxEvent);
92 rec.SetInput(filename);
93 rec.SetRunLocalReconstruction("HLT");
94 rec.SetRunTracking("");
97 rec.SetFillTriggerESD(kFALSE);
98 rec.SetRunVertexFinder(kFALSE);
99 rec.SetOption("HLT", "libAliHLTUtil.so loglevel=0x7c chains=sink1");