4 * @brief Run HLT reconstruction embedded into AliSimulation
7 * Usage: aliroot -b -q -l \
8 * aliroot -b -q -l simhlt.C'("hltoption", "rawdataoptions", nofEvents, runNo, "cdbUri")'
11 * simhlt.C'("loglevel=0x7c chains=GLOBAL-esd-converter")'
12 * load all default libraries and run the chain 'GLOBAL-esd-converter'
13 * simhlt.C'("loglevel=0x7c !libAliHLTITS.so")'
14 * load all default libraries but the libAliHLTITS.so and run the
15 * default chain, skips the ITS tracking
16 * simhlt.C'("loglevel=0x7c rawfile=")'
17 * run explicitly on digit data
20 * rawdataoptions="" -> skip generation of raw data
21 * nofEvents=-1 -> take event count from simulated sample
22 * runNo=-1 -> take run number from simulated sample
23 * cdbUri="local://$ALICE_ROOT/OCDB"
27 * This macro can be used to run the 'HLT simulation' standalone with an
28 * already simulated data sample. 'HLT simulation' means HLT reconstruction
29 * on simulated data, and is carried out at the end of the AliSimulation
32 * The definition of the HLT reconstruction chain depends on the available
33 * module plugins (component libraries). Each library defines a number of
34 * component configurations identified by a unique string. Here are a couple
35 * of definitions, but the list is by far not complete:
36 * - libAliHLTTPC.so: TPC-clusters, TPC-globalmerger
37 * - libAliHLTITS.so: ITS-tracker, ITS-SPD-vertexer
38 * - libAliHLTGlobal.so: GLOBAL-esd-converter, GLOBAL-vertexhisto
39 * - libAliHLTTrigger.so: GLOBAL-Trigger
41 * This list will certainly develop over time, it is planned to add some
42 * helper functionality to AliHLTSystem for querying of such information.
44 * The definition of the chain depends on the availability of simulated raw
45 * data. If raw data is available, the HLT chain runs on this, otherwise on
46 * the digit data. \b NOTE: propagation of MC information is only possible
47 * for the latter case. Raw data generation must be either switched of, i.e.
48 * rawdataoptions is empty, or explicitly explicitly ignored by the HLT
49 * option 'rawfile=' (note the empty argument to the option).
51 * The output of the simulation are the HLT.Digits.root file and (if enabled)
52 * the HLT raw data files. You must run AliReconstruction in order to extract
53 * the simulated HLT data. A typical test sequence can be like:
56 * cd $ALICE_ROOT/test/ppbench
58 * aliroot -b -q -l simhlt.C'("loglevel=0x7c chains=GLOBAL-esd-converter")' \
60 * aliroot -b -q -l rec.C | tee rec.log
63 * @author Matthias.Richter@ift.uib.no
64 * @ingroup alihlt_tutorial
66 void simhlt(const char *hltOptions,
67 const char *rawDataSelection="",
70 const char *cdbURI="local://$ALICE_ROOT/OCDB"
73 ///////////////////////////////////////////////////////////////////////////////////////////////////
74 ///////////////////////////////////////////////////////////////////////////////////////////////////
75 ///////////////////////////////////////////////////////////////////////////////////////////////////
77 // connect to the GRID if we use a file or OCDB from the GRID
78 TString struri=cdbURI;
79 if (struri.Contains("://") && !struri.Contains("local://")) {
80 TGrid::Connect("alien");
83 // Set the CDB storage location
84 AliCDBManager * man = AliCDBManager::Instance();
85 man->SetDefaultStorage(cdbURI);
87 ///////////////////////////////////////////////////////////////////////////////////////////////////
88 ///////////////////////////////////////////////////////////////////////////////////////////////////
89 ///////////////////////////////////////////////////////////////////////////////////////////////////
91 // Init and run the HLT simulation
92 // All but HLT simulation is switched off
96 // switch of simulation and data generation
97 // comment all that stuff to also simulate the events and data
98 sim.SetRunGeneration(kFALSE);
99 sim.SetMakeDigits("");
100 sim.SetMakeSDigits("");
101 sim.SetMakeDigitsFromHits("");
102 //sim.SetMakeTrigger("");
103 sim.SetRunQA("HLT:ALL");
105 // the normal simulation sets the specific storage for the GRP entry
106 if (gSystem->AccessPathName("GRP/GRP/Data")) {
107 cerr << "*********************************************************" << endl;
108 cerr << "error: no GRP entry found in the currect directory, simulation might be incomplete. Skip setting specific storage for GRP entry" << endl;
109 cerr << "*********************************************************" << endl << endl;
111 sim.SetSpecificStorage("GRP/GRP/Data",
112 Form("local://%s",gSystem->pwd()));
115 // set the options for writing raw data, possible values e.g. ALL; HLT
116 if (rawDataSelection && rawDataSelection[0]!=0) {
117 sim.SetWriteRawData(rawDataSelection, "raw.root", kTRUE);
120 // set the options for the HLT simulation
121 sim.SetRunHLT(hltOptions);
123 if (runNo>=0) sim.SetRunNumber(runNo);
125 if (nofEvents>0) sim.Run(nofEvents);
131 cout << "recraw-local: Run HLT reconstruction embedded into AliSimulation" << endl;
132 cout << " Usage: aliroot -b -q -l \\" << endl;
133 cout << " aliroot -q simhlt.C'(\"hltoption\", \"rawdataoptions\", nofEvents, runNo, \"cdbUri\")'" << endl;
135 cout << " Examples:" << endl;
136 cout << " aliroot -q simhlt.C'(\"loglevel=0x7c chains=GLOBAL-esd-converter\")'" << endl;
137 cout << " aliroot -q simhlt.C'(\"loglevel=0x7c !libAliHLTITS.so\")' " << endl;
138 cout << " aliroot -q simhlt.C'(\"loglevel=0x7c rawfile=\")' " << endl;
140 cout << " Defaults" << endl;
141 cout << " rawdataoptions=\"\" -> skip generation of raw data " << endl;
142 cout << " nofEvents=-1 -> take event count from simulated sample" << endl;
143 cout << " runNo=-1 -> take run number from simulated sample " << endl;
144 cout << " cdbUri=\"local://$ALICE_ROOT/OCDB\" " << endl;
146 cout << " The definition of the chain depends on the availability of simulated raw " << endl;
147 cout << " data. If raw data is available, the HLT chain runs on this, otherwise on " << endl;
148 cout << " the digit data. \b NOTE: propagation of MC information is only possible " << endl;
149 cout << " for the latter case. Raw data generation must be either switched of, i.e." << endl;
150 cout << " rawdataoptions is empty, or explicitly explicitly ignored by the HLT " << endl;
151 cout << " option 'rawfile=' (note the empty argument to the option). " << endl;