6 #include "AliCDBManager.h"
7 #include "AliSimulation.h"
14 * @brief Run HLT reconstruction embedded into AliSimulation
17 * Usage: aliroot -b -q -l \
18 * aliroot -b -q -l simhlt.C'("hltoption", "rawdataoptions", nofEvents, runNo, "cdbUri")'
21 * simhlt.C'("loglevel=0x7c chains=GLOBAL-esd-converter")'
22 * load all default libraries and run the chain 'GLOBAL-esd-converter'
23 * simhlt.C'("loglevel=0x7c !libAliHLTITS.so")'
24 * load all default libraries but the libAliHLTITS.so and run the
25 * default chain, skips the ITS tracking
26 * simhlt.C'("loglevel=0x7c rawfile=")'
27 * run explicitly on digit data
30 * rawdataoptions="" -> skip generation of raw data
31 * nofEvents=-1 -> take event count from simulated sample
32 * runNo=-1 -> take run number from simulated sample
33 * cdbUri="local://$ALICE_ROOT/OCDB"
35 * Running with precompiled macro:
36 * gSystem->AddIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include");
37 * gROOT->LoadMacro("$ALICE_ROOT/HLT/exa/simhlt.C++");
38 * simhlt("loglevel=0x7c");
42 * This macro can be used to run the 'HLT simulation' standalone with an
43 * already simulated data sample. 'HLT simulation' means HLT reconstruction
44 * on simulated data, and is carried out at the end of the AliSimulation
47 * The definition of the HLT reconstruction chain depends on the available
48 * module plugins (component libraries). Each library defines a number of
49 * component configurations identified by a unique string. Here are a couple
50 * of definitions, but the list is by far not complete:
51 * - libAliHLTTPC.so: TPC-clusters, TPC-globalmerger
52 * - libAliHLTITS.so: ITS-tracker, ITS-SPD-vertexer
53 * - libAliHLTGlobal.so: GLOBAL-esd-converter, GLOBAL-vertexhisto
54 * - libAliHLTTrigger.so: GLOBAL-Trigger
56 * This list will certainly develop over time, it is planned to add some
57 * helper functionality to AliHLTSystem for querying of such information.
59 * The definition of the chain depends on the availability of simulated raw
60 * data. If raw data is available, the HLT chain runs on this, otherwise on
61 * the digit data. \b NOTE: propagation of MC information is only possible
62 * for the latter case. Raw data generation must be either switched of, i.e.
63 * rawdataoptions is empty, or explicitly explicitly ignored by the HLT
64 * option 'rawfile=' (note the empty argument to the option).
66 * The output of the simulation are the HLT.Digits.root file and (if enabled)
67 * the HLT raw data files. You must run AliReconstruction in order to extract
68 * the simulated HLT data. A typical test sequence can be like:
71 * cd $ALICE_ROOT/test/ppbench
73 * aliroot -b -q -l simhlt.C'("loglevel=0x7c chains=GLOBAL-esd-converter")' \
75 * aliroot -b -q -l rec.C | tee rec.log
78 * @author Matthias.Richter@ift.uib.no
79 * @ingroup alihlt_tutorial
81 void simhlt(const char *hltOptions,
82 const char *rawDataSelection="",
85 const char *cdbURI="local://$ALICE_ROOT/OCDB"
88 ///////////////////////////////////////////////////////////////////////////////////////////////////
89 ///////////////////////////////////////////////////////////////////////////////////////////////////
90 ///////////////////////////////////////////////////////////////////////////////////////////////////
92 // connect to the GRID if we use a file or OCDB from the GRID
93 TString struri=cdbURI;
94 if (struri.Contains("://") && !struri.Contains("local://")) {
95 TGrid::Connect("alien");
98 // Set the CDB storage location
99 AliCDBManager * man = AliCDBManager::Instance();
100 man->SetDefaultStorage(cdbURI);
102 ///////////////////////////////////////////////////////////////////////////////////////////////////
103 ///////////////////////////////////////////////////////////////////////////////////////////////////
104 ///////////////////////////////////////////////////////////////////////////////////////////////////
106 // Init and run the HLT simulation
107 // All but HLT simulation is switched off
111 // switch of simulation and data generation
112 // comment all that stuff to also simulate the events and data
113 sim.SetRunGeneration(kFALSE);
114 sim.SetMakeDigits("");
115 sim.SetMakeSDigits("");
116 sim.SetMakeDigitsFromHits("");
117 //sim.SetMakeTrigger("");
118 sim.SetRunQA("HLT:ALL");
120 // the normal simulation sets the specific storage for the GRP entry
121 if (gSystem->AccessPathName("GRP/GRP/Data")) {
122 cerr << "*********************************************************" << endl;
123 cerr << "error: no GRP entry found in the currect directory, simulation might be incomplete. Skip setting specific storage for GRP entry" << endl;
124 cerr << "*********************************************************" << endl << endl;
126 sim.SetSpecificStorage("GRP/GRP/Data",
127 Form("local://%s",gSystem->pwd()));
130 // set the options for writing raw data, possible values e.g. ALL; HLT
131 if (rawDataSelection && rawDataSelection[0]!=0) {
132 sim.SetWriteRawData(rawDataSelection, "raw.root", kTRUE);
135 // set the options for the HLT simulation
136 sim.SetRunHLT(hltOptions);
138 if (runNo>=0) sim.SetRunNumber(runNo);
140 if (nofEvents>0) sim.Run(nofEvents);
146 cout << "recraw-local: Run HLT reconstruction embedded into AliSimulation" << endl;
147 cout << " Usage: aliroot -b -q -l \\" << endl;
148 cout << " aliroot -q simhlt.C'(\"hltoption\", \"rawdataoptions\", nofEvents, runNo, \"cdbUri\")'" << endl;
150 cout << " Examples:" << endl;
151 cout << " aliroot -q simhlt.C'(\"loglevel=0x7c chains=GLOBAL-esd-converter\")'" << endl;
152 cout << " aliroot -q simhlt.C'(\"loglevel=0x7c !libAliHLTITS.so\")' " << endl;
153 cout << " aliroot -q simhlt.C'(\"loglevel=0x7c rawfile=\")' " << endl;
155 cout << " Defaults" << endl;
156 cout << " rawdataoptions=\"\" -> skip generation of raw data " << endl;
157 cout << " nofEvents=-1 -> take event count from simulated sample" << endl;
158 cout << " runNo=-1 -> take run number from simulated sample " << endl;
159 cout << " cdbUri=\"local://$ALICE_ROOT/OCDB\" " << endl;
161 cout << " The definition of the chain depends on the availability of simulated raw " << endl;
162 cout << " data. If raw data is available, the HLT chain runs on this, otherwise on " << endl;
163 cout << " the digit data. \b NOTE: propagation of MC information is only possible " << endl;
164 cout << " for the latter case. Raw data generation must be either switched of, i.e." << endl;
165 cout << " rawdataoptions is empty, or explicitly explicitly ignored by the HLT " << endl;
166 cout << " option 'rawfile=' (note the empty argument to the option). " << endl;