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
17 * @defgroup alihlt_aliroot_simulation HLT simulation in AliRoot
18 * This section describes the the simulation of the HLT in AliRoot.
20 * @section alihlt_aliroot_simulation_intro General Remarks
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>.
30 * @section alihlt_aliroot_simulation_steering Steering
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
33 * available libraries or a AliHLTConfiguration configuration macro.
35 * The libraries to be loaded can be specified as an option to AliSimulation.
38 * sim.SetRunHLT("libAliHLTSample.so");
40 * @see AliHLTSimulation for further details
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.
49 * @section alihlt_aliroot_simulation_examples Examples
50 * - @ref tut_simulation
52 * @ingroup alihlt_system
58 class AliHLTPluginBase;
64 * @class AliHLTSimulation
65 * Plugin for HLT reconstruction embedded into <tt>AliSimulation</tt>.
67 * The libraries to be loaded can be specified as an option to AliSimulation.
70 * sim.SetRunHLT("libAliHLTSample.so");
72 * will only load <tt>libAliHLTSample.so</tt>
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.
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
87 * number of events to simulate
89 * @ingroup alihlt_aliroot_simulation
91 class AliHLTSimulation : public TObject {
93 /** create an instance of the class */
94 static AliHLTSimulation* CreateInstance();
96 /** delete an instance */
97 static int DeleteInstance(AliHLTSimulation* pSim);
99 /** init simulation */
100 int Init(AliRunLoader* pRunLoader, const char* options);
102 int ConfigureHLTSystem(AliHLTSystem* pSystem, const char* options, AliRunLoader* pRunLoader, AliRawReader* pRawReader) const;
104 /** run simulation with an instance of the run loader */
105 int Run(AliRunLoader* pRunLoader);
107 /// run reconstruction cycle for AliHLTSystem
108 int RunHLTSystem(AliHLTSystem* pSystem, AliRunLoader* pRunLoader, AliRawReader* pRawReader) const;
111 // indicate that only one chain should be run, behavior before Dec 2010
116 /** standard constructor */
118 /** copy constructor prohibited */
119 AliHLTSimulation(const AliHLTSimulation&);
120 /** assignment operator prohibited */
121 AliHLTSimulation& operator=(const AliHLTSimulation&);
122 /** standard destructor */
125 /* current options */
126 TString fOptions; //!transient
128 /** base class for AliRoot HLT plugins */
129 AliHLTPluginBase* fpPluginBase; //!transient
131 /** RAW reader instance for chains which need RAW data as input */
132 AliRawReader* fpRawReader; //!transient
134 /// number of events to run
135 int fNEvents; //! number of events
137 ClassDef(AliHLTSimulation, 0)
140 #define ALIHLTSIMULATION_LIBRARY "libHLTsim.so"
141 #define ALIHLTSIMULATION_LIBRARY_VERSION 1
142 #define ALIHLTSIMULATION_CREATE_INSTANCE "AliHLTSimulationCreateInstance"
143 #define ALIHLTSIMULATION_DELETE_INSTANCE "AliHLTSimulationDeleteInstance"
144 #define ALIHLTSIMULATION_SETUP "AliHLTSimulationSetup"
145 #define ALIHLTSIMULATION_INIT "AliHLTSimulationInit"
146 #define ALIHLTSIMULATION_RUN "AliHLTSimulationRun"
147 #define ALIHLTSIMULATION_GET_LIBRARY_VERSION "AliHLTSimulationGetLibraryVersion"
152 typedef AliHLTSimulation* (*AliHLTSimulationCreateInstance_t)();
153 typedef int (*AliHLTSimulationDeleteInstance_t)(AliHLTSimulation* pSim);
154 typedef int (*AliHLTSimulationSetup_t)(AliHLTSimulation* pHLTSim, AliSimulation* pSim, const char* options);
155 typedef int (*AliHLTSimulationInit_t)(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options);
156 typedef int (*AliHLTSimulationRun_t)(AliHLTSimulation* pSim, AliRunLoader* pRunLoader);
157 typedef int (*AliHLTSimulationGetLibraryVersion_t)();
158 typedef int (*AliHLTSimulationInitOCDB_t)(AliHLTSimulation* pSim);
161 * Create an instance of the AliHLTSimulation class
163 AliHLTSimulation* AliHLTSimulationCreateInstance();
165 * Delete an instance of the AliHLTSimulation class
167 int AliHLTSimulationDeleteInstance(AliHLTSimulation* pSim);
169 * Setup the HLT simulation.
170 * Setup is done right after the creation. To be called before
171 * the actual AliSimulation starts when the OCDB is not yet locked.
173 int AliHLTSimulationSetup(AliHLTSimulation* pHLTSim, AliSimulation* pSim, const char* options);
175 * Set options for an instance.
176 * Init is invoked right before running HLT simulation, i.e. after all
177 * the other AliSimulation was done
179 int AliHLTSimulationInit(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options);
181 * Run simulation for an instance and run loader
183 int AliHLTSimulationRun(AliHLTSimulation* pSim, AliRunLoader* pRunLoader);
185 * Get version no of the library/class interface
187 int AliHLTSimulationGetLibraryVersion();