]>
Commit | Line | Data |
---|---|---|
4cbaf07b | 1 | //-*- Mode: C++ -*- |
5879742f | 2 | // $Id$ |
4cbaf07b | 3 | |
4 | #ifndef ALIHLTSIMULATION_H | |
5 | #define ALIHLTSIMULATION_H | |
6 | /* This file is property of and copyright by the ALICE HLT Project * | |
7 | * ALICE Experiment at CERN, All rights reserved. * | |
8 | * See cxx source for full Copyright notice */ | |
9 | ||
5879742f | 10 | /// @file AliHLTSimulation.h |
11 | /// @author Matthias Richter | |
12 | /// @date | |
13 | /// @brief Binding class for HLT simulation in AliRoot | |
14 | /// | |
15 | ||
4cbaf07b | 16 | /** |
fb345ed7 | 17 | * @defgroup alihlt_aliroot_simulation HLT simulation in AliRoot |
4cbaf07b | 18 | * This section describes the the simulation of the HLT in AliRoot. |
a55f626d | 19 | * |
fb345ed7 | 20 | * @section alihlt_aliroot_simulation_intro General Remarks |
a55f626d | 21 | * HLT has a special role in the normal data flow of simulation and |
22 | * reconstruction. Since the HLT reconstruction and analysis runs on-line | |
23 | * on the HLT farm, the raw data produced by HLT as a detector contains | |
24 | * already reconstructed events. Consequently, the HLT response has to be | |
25 | * simulated as well as the data of all other detectors. Since the detector | |
26 | * data is needed, the HLT simulation is run at the end of AliSimulation. | |
27 | * As a matter of fact, HLT always reconstructs data, <em><b>HLT simulation | |
28 | * </b></em> means <em><b>HLT reconstruction embedded into AliRoot</b></em>. | |
29 | * | |
fb345ed7 | 30 | * @section alihlt_aliroot_simulation_steering Steering |
a55f626d | 31 | * The AliHLTSimulation class is the steering class called from AliSimulation. |
32 | * An instance of AliHLTSystem is used to run the chains defined by the | |
fb345ed7 | 33 | * available libraries or a AliHLTConfiguration configuration macro. |
34 | * | |
35 | * The libraries to be loaded can be specified as an option to AliSimulation. | |
36 | * <pre> | |
37 | * AliSimulation sim; | |
38 | * sim.SetRunHLT("libAliHLTSample.so"); | |
39 | * </pre> | |
40 | * @see AliHLTSimulation for further details | |
41 | * | |
42 | * @section alihlt_aliroot_simulation_running Running | |
43 | * The actual chains to be run depend on the HLT library modules which | |
44 | * are loaded to the system. There is a default collection of libraries | |
45 | * defined in AliHLTSystem::fgkHLTDefaultLibs. The default libraries are | |
46 | * loaded if nothing else is specified. The libraries implement \em agents | |
47 | * (AliHLTModuleAgent childs) describing the properties of a module. | |
48 | * | |
49 | * @section alihlt_aliroot_simulation_examples Examples | |
50 | * - @ref tut_simulation | |
51 | * | |
52 | * @ingroup alihlt_system | |
53 | */ | |
54 | ||
55 | #include "TObject.h" | |
56 | #include "TString.h" | |
57 | class AliRunLoader; | |
7bf6c76d | 58 | class AliHLTPluginBase; |
fb345ed7 | 59 | class AliRawReader; |
5a29e5cb | 60 | class AliSimulation; |
5879742f | 61 | class AliHLTSystem; |
fb345ed7 | 62 | |
63 | /** | |
64 | * @class AliHLTSimulation | |
65 | * Plugin for HLT reconstruction embedded into <tt>AliSimulation</tt>. | |
a55f626d | 66 | * |
67 | * The libraries to be loaded can be specified as an option to AliSimulation. | |
68 | * <pre> | |
69 | * AliSimulation sim; | |
70 | * sim.SetRunHLT("libAliHLTSample.so"); | |
71 | * </pre> | |
72 | * will only load <tt>libAliHLTSample.so</tt> | |
73 | * | |
74 | * Other available options: | |
75 | * \li loglevel=<i>level</i> <br> | |
76 | * logging level for this processing, default level is 0x79 filtering | |
77 | * out everything below level 'warning'. 0x7c allows info messages as | |
78 | * well, 0x3f is the highest loglevel. | |
79 | * \li alilog=off <br> | |
80 | * disable redirection of log messages to AliLog class | |
81 | * \li config=<i>macro</i> <br> | |
82 | * configuration macro: normal ROOT macro defining HLT component | |
83 | * configurations by means of AliHLTConfiguration. | |
84 | * \li chains=<i>configuration</i> <br> | |
85 | * comma separated list of configurations to be run during simulation | |
86 | * | |
fb345ed7 | 87 | * @ingroup alihlt_aliroot_simulation |
4cbaf07b | 88 | */ |
57034f7f | 89 | class AliHLTSimulation : public TObject { |
4cbaf07b | 90 | public: |
91 | /** create an instance of the class */ | |
92 | static AliHLTSimulation* CreateInstance(); | |
93 | ||
94 | /** delete an instance */ | |
95 | static int DeleteInstance(AliHLTSimulation* pSim); | |
96 | ||
97 | /** init simulation */ | |
98 | int Init(AliRunLoader* pRunLoader, const char* options); | |
99 | ||
5879742f | 100 | int ConfigureHLTSystem(AliHLTSystem* pSystem, const char* options, AliRunLoader* pRunLoader, AliRawReader* pRawReader) const; |
101 | ||
4cbaf07b | 102 | /** run simulation with an instance of the run loader */ |
103 | int Run(AliRunLoader* pRunLoader); | |
104 | ||
5879742f | 105 | /// run reconstruction cycle for AliHLTSystem |
106 | int RunHLTSystem(AliHLTSystem* pSystem, AliRunLoader* pRunLoader, AliRawReader* pRawReader) const; | |
107 | ||
108 | enum EOptions { | |
109 | // indicate that only one chain should be run, behavior before Dec 2010 | |
110 | kOneChain = BIT(15) | |
111 | }; | |
112 | ||
4cbaf07b | 113 | private: |
114 | /** standard constructor */ | |
115 | AliHLTSimulation(); | |
116 | /** copy constructor prohibited */ | |
117 | AliHLTSimulation(const AliHLTSimulation&); | |
118 | /** assignment operator prohibited */ | |
119 | AliHLTSimulation& operator=(const AliHLTSimulation&); | |
120 | /** standard destructor */ | |
121 | ~AliHLTSimulation(); | |
122 | ||
123 | /* current options */ | |
124 | TString fOptions; //!transient | |
125 | ||
7bf6c76d | 126 | /** base class for AliRoot HLT plugins */ |
127 | AliHLTPluginBase* fpPluginBase; //!transient | |
57034f7f | 128 | |
7bf6c76d | 129 | /** RAW reader instance for chains which need RAW data as input */ |
130 | AliRawReader* fpRawReader; //!transient | |
7777fa45 | 131 | |
7bf6c76d | 132 | ClassDef(AliHLTSimulation, 2) |
4cbaf07b | 133 | }; |
134 | ||
135 | #define ALIHLTSIMULATION_LIBRARY "libHLTsim.so" | |
cf95f17c | 136 | #define ALIHLTSIMULATION_LIBRARY_VERSION 1 |
4cbaf07b | 137 | #define ALIHLTSIMULATION_CREATE_INSTANCE "AliHLTSimulationCreateInstance" |
138 | #define ALIHLTSIMULATION_DELETE_INSTANCE "AliHLTSimulationDeleteInstance" | |
5a29e5cb | 139 | #define ALIHLTSIMULATION_SETUP "AliHLTSimulationSetup" |
4cbaf07b | 140 | #define ALIHLTSIMULATION_INIT "AliHLTSimulationInit" |
141 | #define ALIHLTSIMULATION_RUN "AliHLTSimulationRun" | |
142 | #define ALIHLTSIMULATION_GET_LIBRARY_VERSION "AliHLTSimulationGetLibraryVersion" | |
143 | ||
144 | #ifdef __cplusplus | |
145 | extern "C" { | |
146 | #endif | |
147 | typedef AliHLTSimulation* (*AliHLTSimulationCreateInstance_t)(); | |
148 | typedef int (*AliHLTSimulationDeleteInstance_t)(AliHLTSimulation* pSim); | |
5a29e5cb | 149 | typedef int (*AliHLTSimulationSetup_t)(AliHLTSimulation* pHLTSim, AliSimulation* pSim, const char* options); |
4cbaf07b | 150 | typedef int (*AliHLTSimulationInit_t)(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options); |
151 | typedef int (*AliHLTSimulationRun_t)(AliHLTSimulation* pSim, AliRunLoader* pRunLoader); | |
152 | typedef int (*AliHLTSimulationGetLibraryVersion_t)(); | |
8dd79235 | 153 | typedef int (*AliHLTSimulationInitOCDB_t)(AliHLTSimulation* pSim); |
4cbaf07b | 154 | |
155 | /** | |
156 | * Create an instance of the AliHLTSimulation class | |
157 | */ | |
158 | AliHLTSimulation* AliHLTSimulationCreateInstance(); | |
159 | /** | |
160 | * Delete an instance of the AliHLTSimulation class | |
161 | */ | |
162 | int AliHLTSimulationDeleteInstance(AliHLTSimulation* pSim); | |
163 | /** | |
5a29e5cb | 164 | * Setup the HLT simulation. |
165 | * Setup is done right after the creation. To be called before | |
166 | * the actual AliSimulation starts when the OCDB is not yet locked. | |
167 | */ | |
168 | int AliHLTSimulationSetup(AliHLTSimulation* pHLTSim, AliSimulation* pSim, const char* options); | |
169 | /** | |
170 | * Set options for an instance. | |
171 | * Init is invoked right before running HLT simulation, i.e. after all | |
172 | * the other AliSimulation was done | |
4cbaf07b | 173 | */ |
174 | int AliHLTSimulationInit(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options); | |
175 | /** | |
176 | * Run simulation for an instance and run loader | |
177 | */ | |
178 | int AliHLTSimulationRun(AliHLTSimulation* pSim, AliRunLoader* pRunLoader); | |
179 | /** | |
180 | * Get version no of the library/class interface | |
181 | */ | |
182 | int AliHLTSimulationGetLibraryVersion(); | |
183 | #ifdef __cplusplus | |
184 | } | |
185 | #endif | |
186 | ||
187 | #endif |