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