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 */
10 /** @file AliHLTSimulation.h
11 @author Matthias Richter
13 @brief Binding class for HLT simulation in AliRoot
15 // see below for class documentation
17 // refer to README to build package
19 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
22 * @defgroup alihlt_aliroot_simulation HLT simulation in AliRoot
23 * This section describes the the simulation of the HLT in AliRoot.
25 * @section alihlt_aliroot_simulation_intro General Remarks
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>.
35 * @section alihlt_aliroot_simulation_steering Steering
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
38 * available libraries or a AliHLTConfiguration configuration macro.
40 * The libraries to be loaded can be specified as an option to AliSimulation.
43 * sim.SetRunHLT("libAliHLTSample.so");
45 * @see AliHLTSimulation for further details
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.
54 * @section alihlt_aliroot_simulation_examples Examples
55 * - @ref tut_simulation
57 * @ingroup alihlt_system
63 class AliHLTPluginBase;
68 * @class AliHLTSimulation
69 * Plugin for HLT reconstruction embedded into <tt>AliSimulation</tt>.
71 * The libraries to be loaded can be specified as an option to AliSimulation.
74 * sim.SetRunHLT("libAliHLTSample.so");
76 * will only load <tt>libAliHLTSample.so</tt>
78 * Other available options:
79 * \li loglevel=<i>level</i> <br>
80 * logging level for this processing, default level is 0x79 filtering
81 * out everything below level 'warning'. 0x7c allows info messages as
82 * well, 0x3f is the highest loglevel.
84 * disable redirection of log messages to AliLog class
85 * \li config=<i>macro</i> <br>
86 * configuration macro: normal ROOT macro defining HLT component
87 * configurations by means of AliHLTConfiguration.
88 * \li chains=<i>configuration</i> <br>
89 * comma separated list of configurations to be run during simulation
91 * @ingroup alihlt_aliroot_simulation
93 class AliHLTSimulation : public TObject {
95 /** create an instance of the class */
96 static AliHLTSimulation* CreateInstance();
98 /** delete an instance */
99 static int DeleteInstance(AliHLTSimulation* pSim);
101 /** init simulation */
102 int Init(AliRunLoader* pRunLoader, const char* options);
104 /** run simulation with an instance of the run loader */
105 int Run(AliRunLoader* pRunLoader);
108 /** standard constructor */
110 /** copy constructor prohibited */
111 AliHLTSimulation(const AliHLTSimulation&);
112 /** assignment operator prohibited */
113 AliHLTSimulation& operator=(const AliHLTSimulation&);
114 /** standard destructor */
117 /* current options */
118 TString fOptions; //!transient
120 /** base class for AliRoot HLT plugins */
121 AliHLTPluginBase* fpPluginBase; //!transient
123 /** RAW reader instance for chains which need RAW data as input */
124 AliRawReader* fpRawReader; //!transient
126 ClassDef(AliHLTSimulation, 2)
129 #define ALIHLTSIMULATION_LIBRARY "libHLTsim.so"
130 #define ALIHLTSIMULATION_LIBRARY_VERSION 1
131 #define ALIHLTSIMULATION_CREATE_INSTANCE "AliHLTSimulationCreateInstance"
132 #define ALIHLTSIMULATION_DELETE_INSTANCE "AliHLTSimulationDeleteInstance"
133 #define ALIHLTSIMULATION_SETUP "AliHLTSimulationSetup"
134 #define ALIHLTSIMULATION_INIT "AliHLTSimulationInit"
135 #define ALIHLTSIMULATION_RUN "AliHLTSimulationRun"
136 #define ALIHLTSIMULATION_GET_LIBRARY_VERSION "AliHLTSimulationGetLibraryVersion"
141 typedef AliHLTSimulation* (*AliHLTSimulationCreateInstance_t)();
142 typedef int (*AliHLTSimulationDeleteInstance_t)(AliHLTSimulation* pSim);
143 typedef int (*AliHLTSimulationSetup_t)(AliHLTSimulation* pHLTSim, AliSimulation* pSim, const char* options);
144 typedef int (*AliHLTSimulationInit_t)(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options);
145 typedef int (*AliHLTSimulationRun_t)(AliHLTSimulation* pSim, AliRunLoader* pRunLoader);
146 typedef int (*AliHLTSimulationGetLibraryVersion_t)();
147 typedef int (*AliHLTSimulationInitOCDB_t)(AliHLTSimulation* pSim);
150 * Create an instance of the AliHLTSimulation class
152 AliHLTSimulation* AliHLTSimulationCreateInstance();
154 * Delete an instance of the AliHLTSimulation class
156 int AliHLTSimulationDeleteInstance(AliHLTSimulation* pSim);
158 * Setup the HLT simulation.
159 * Setup is done right after the creation. To be called before
160 * the actual AliSimulation starts when the OCDB is not yet locked.
162 int AliHLTSimulationSetup(AliHLTSimulation* pHLTSim, AliSimulation* pSim, const char* options);
164 * Set options for an instance.
165 * Init is invoked right before running HLT simulation, i.e. after all
166 * the other AliSimulation was done
168 int AliHLTSimulationInit(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options);
170 * Run simulation for an instance and run loader
172 int AliHLTSimulationRun(AliHLTSimulation* pSim, AliRunLoader* pRunLoader);
174 * Get version no of the library/class interface
176 int AliHLTSimulationGetLibraryVersion();