3 #ifndef ALIHLTRECONSTRUCTOR_H
4 #define ALIHLTRECONSTRUCTOR_H
5 //* This file is property of and copyright by the ALICE HLT Project *
6 //* ALICE Experiment at CERN, All rights reserved. *
7 //* See cxx source for full Copyright notice *
9 /** @file AliHLTReconstructor.h
10 @author Matthias Richter
12 @brief Binding class for HLT simulation in AliRoot
15 #include "AliReconstructor.h"
16 #include "AliHLTPluginBase.h"
22 class AliHLTEsdManager;
24 * @defgroup alihlt_aliroot_reconstruction AliRoot reconstruction.
26 * @section alihlt_aliroot_reconstruction_intro General Remarks
27 * Like all other ALICE detectors, HLT utilizes the AliReconstruction interface
28 * to implement a plugin for the AliRoot reconstruction. The reconstructor can be
30 * -# run HLT analysis chains in the AliRoot reconstruction <br>
31 * This option is mainly intended for the <em>development and debugging cycle</em>.
32 * HLT chains can be defined by means of AliHLTConfiguration and can be run either
33 * stand-alone or embedded into the AliReconstruction cycle.
34 * -# run the default analysis chains <br>
35 * HLT modules can define default analysis chains to be run during AliRoot
37 * -# handle the HLTOUT data<br>
38 * The HLT output stream contains multiple data blocks produced by the various
39 * components of the HLT chain. Each block might need different and even
40 * detector specific processing, like e.g. the processing of ESD objects or the
41 * handling of compressed data.
43 * @section alihlt_aliroot_reconstruction_steering Steering
44 * The AliHLTReconstructor provides the main interface for the reconstruction.
45 * The handling of the HLTOUT data is described in AliRawReaderHLT.
47 * @section alihlt_aliroot_reconstruction_examples Examples
48 * @subsection alihlt_aliroot_reconstruction_examples_reco Run chains
49 * - @ref tut_reconstruction
51 * @subsection alihlt_aliroot_reconstruction_examples_hltout Handle HLTOUT
52 * - @ref tut_alirawreaderhlt
54 * @ingroup alihlt_system
58 * @class AliHLTReconstructor
59 * AliRoot event reconstruction plug-in for the HLT.
60 * The AliHLTReconstructor holds an instance of the @ref AliHLTSystem
61 * steering class. The actual reconstruction depends on the loaded component
62 * libraries. Each library must implement a module agent (@ref AliHLTModuleAgent)
63 * in order to provide information on the supported features and the
64 * configurations to be run.
66 * The AliHLTReconstructor provides both the functionality to run customized
67 * analysis chains and the treatment of the HLTOUT data.
69 * @section sec_alihltreconstructor_options Options
70 * The default component libraries which are loaded through the initialization
71 * are determined by the @ref AliHLTSystem::fgkHLTDefaultLibs array. The library
72 * loading can be overridden by an option to the AliHLTReconstructor through the
73 * <tt>SetOption</tt> method of <tt>AliReconstruction</tt>, e.g.
75 * AliReconstruction rec;
76 * rec.SetOption("HLT", "libAliHLTSample.so");
78 * will only load <tt>libAliHLTSample.so</tt>
80 * Optional arguments:<br>
81 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
82 * \li loglevel=<i>level</i><br>
83 * level can be a hex number encoding the @ref AliHLTComponentLogSeverity
85 * disables the logging of HLT log messages through <tt>AliLog</tt> <br>
87 * For further information on the AliRoot reconstruction refer to the AliRoot
88 * documentation, namely <tt>AliReconstruction</tt>.
90 * @section sec_alihltreconstructor_chains Custom reconstruction chains
91 * In order to run an HLT chain during the AliRoot reconstruction, a chain
92 * configuration must be defined. This can be done by
93 * - specifying a configuration macro defining a configuration macro and
94 * the name of the chain as parameters
96 * rec.SetOption("HLT", "config=[macro.C] chains=[name]")
98 * - providing the configuration and the name by the module agent.
99 * AliHLTModuleAgent and the functions AliHLTModuleAgent::CreateConfigurations
100 * and AliHLTModuleAgent::GetReconstructionChains
102 * @section sec_alihltreconstructor_hltout Treatment of HLTOUT data.
103 * The HLTOUT data is a collation of output blocks produced by the various
104 * components running in an HLT chain. Typically its the output of the last
105 * component(s) in the chain, or components specifically connected to the HLT
108 * The treatment of the HLTOUT data blocks is implemented in handlers of type
109 * AliHLTOUTHandler. The AliHLTModuleAgent of the module creates the appropriate
110 * handler for a data block.
111 * The data type of the individual blocks is set by the producer component and
112 * specifies the nature of the data processing. There are 5 overall groups:
113 * - output is in ESD format:
114 * @ref sec_alihltreconstructor_hltout_esd
115 * - data describes DDL raw format:
116 * @ref sec_alihltreconstructor_hltout_rawreader
117 * - pre-analyzed data to be fed into the normal reconstruction:
118 * @ref sec_alihltreconstructor_hltout_rawstream
119 * - data is fed into an analysis chain:
120 * @ref sec_alihltreconstructor_hltout_chain
121 * - detector specific handler:
122 * @ref sec_alihltreconstructor_hltout_proprietary
124 * @subsection sec_alihltreconstructor_hltout_esd ESD HLTOUT data
125 * The framework implements a standard handling of ESD data
126 * blocks of type ::kAliHLTDataTypeESDTree {ESD_TREE:ANY}. \em ANY can be
127 * any detector origin. Each ESD block contains the data of only one event,
128 * the ESDs are merged by the AliHLTEsdManager and written to files of the
129 * naming scheme AliHLT\em DET ESDs.root. The first ESD block is also copied
130 * to the hltEsd provided by the AliReconstruction. This is a temporary
131 * solution as the handling and merging of HLT ESDs is under discussion.
132 * At the time of writing (May 08) only the TPC HLT components produce ESD
134 * The module agent can provide a handler for multiple ESD data blocks, e.g.
135 * for merging within one event prior to the writing. Instead of the individual
136 * ESDs the one provided by the handler is passed to the AliHLTEsdManager. The
137 * handler is of type \link AliHLTModuleAgent::AliHLTOUTHandlerType kEsd \endlink.
139 * @subsection sec_alihltreconstructor_hltout_rawreader DDL raw HLTOUT data
140 * The HLT can perform selective readout and produces a reduced amount of data
141 * in the original raw ddl format. In order to feed this data from the HLTOUT
142 * DDL links into the normal reconstruction, a handler of type
143 * \link AliHLTModuleAgent::AliHLTOUTHandlerType kRawReader \endlink must be
144 * implemented and provided by the
145 * module agent. The handler has to derive the original equipment id from the
146 * data type and specification of the block. The offline reconstruction does
147 * not need to be changed or adapted at all. See AliRawReaderHLT for details.
149 * @subsection sec_alihltreconstructor_hltout_rawstream Preprocessed Raw HLTOUT data
150 * Handlers of type \link AliHLTModuleAgent::AliHLTOUTHandlerType kRawStream \endlink
151 * are foreseen though at the time of writing (May 08) the
152 * concept is not fixed. Advanced data compression algorithms can produce a
153 * raw data format which is not convertible into the raw DDL data, e.g. lossy
154 * compression techniques storing clusters parametrized regarding to tracks. A
155 * specific RawStream is needed here since the data is detector specific and the
156 * first stage of the offline reconstruction might need some adaptions.
158 * @subsection sec_alihltreconstructor_hltout_chain HLTOUT data fed into a chain
159 * At the time of writing (May 08), handler type
160 * \link AliHLTModuleAgent::AliHLTOUTHandlerType kChain \endlink
161 * is foreseen but not yet implemented. Has to be discussed.
163 * @subsection sec_alihltreconstructor_hltout_proprietary Proprietary HLTOUT data
164 * This is a handler of proprietary detector data. Handlers of type
165 * \link AliHLTModuleAgent::AliHLTOUTHandlerType kProprietary \endlink
166 * do not have any standard output to the framework. Data can be processed and
169 * @section sec_alihltreconstructor_helper Tools and helper functions
170 * Some helper functions of the AliHLTReconstruction can be used in stand-alone
171 * mode. Remember to Init() the reconstructor.
174 * gSystem->Load("libHLTrec.so");
175 * AliHLTReconstructor rec;
180 * @subsection sec_alihltreconstructor_hltout_standalone Stand-alone HLTOUT processing
181 * - HLTOUT processing from a digit file:
183 * void ProcessHLTOUT(const char*, AliESDEvent*) const;
185 * - HLTOUT processing from an AliRawReader
187 * void ProcessHLTOUT(AliRawReader*, AliESDEvent*) const;
190 * @ingroup alihlt_aliroot_reconstruction
191 * @section sec_alihltreconstructor_members Class members
193 class AliHLTReconstructor: public AliReconstructor, public AliHLTPluginBase {
195 /** standard constructor */
196 AliHLTReconstructor();
198 AliHLTReconstructor(const char* options);
200 virtual ~AliHLTReconstructor();
202 /** init the reconstructor */
205 /** init the reconstructor */
206 void Init(const char* options);
209 * This Reconstructor function is not applicable for the AliHLTReconstructor
210 * as it gets a detector specific digits tree. But HLT processes all detectors.
211 * Furthermore it's purely simulated data. <br>
212 * The function forwards to the default bahavior of AliReconstructor but gives
213 * a warning if there were options set, i.e. the user runs customized
216 * @note HLT reconstruction on simulated data is processed at the end of
219 void Reconstruct(TTree* digitsTree, TTree* clustersTree) const;
222 * Reconstruction from RAW data.
223 * The rawReader holds data for all detectors and this version of Reconstruct
224 * is thus applicable for the HLT. The clustersTree is just ignored.
226 void Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const;
229 * This function treats the simulated HLTOUT data.
230 * Opens a handler for simulated HLTOUT data and forwards to ::ProcessHLTOUT.
232 void FillESD(TTree* digitsTree, TTree* clustersTree, AliESDEvent* esd) const;
235 * Process the raw HLTOUT data and fill ESD.
236 * Opens a handler for raw HLTOUT data and forwards to ::ProcessHLTOUT.
238 void FillESD(AliRawReader* rawReader, TTree* clustersTree, AliESDEvent* esd) const;
241 * Process HLTOUT data and fill ESD.
242 * This is the final treatment of the HLTOUT data, either simulated or real.
243 * HLTOUT data is stored in HOMER format, the AliHLTOUT object provides the interface
244 * to the individual data blocks.
246 * During reconstruction (::Reconstruct), module or user defined chains can be
247 * processed and may add additional data to the HLTOUT object. This data is then
248 * treated in the same way.
250 void ProcessHLTOUT(AliHLTOUT* pHLTOUT, AliESDEvent* esd, bool bVerbose=false) const;
253 * Process HLTOUT data.
254 * Open digit file and process the HLTOUT digit data.
255 * This function is mostly intended for debugging purposes and stand-alone
256 * processing of the output from the simulation. Loops over all events.
257 * @param digitFile path of the digit file
258 * @param pEsd optional ESD to be filled
260 void ProcessHLTOUT(const char* digitFile="HLT.Digits.root", AliESDEvent* pEsd=NULL) const;
263 * Process HLTOUT data.
264 * Process the HLTOUT from the raw reader.
265 * This function is mostly intended for debugging purposes and stand-alone
266 * processing of simulated or real raw data.
267 * \em Note: Loops over all events, i.e. the current event of the the raw
268 * reader will change. Not to be called inside the normal AliRoot processsing.
269 * @param pRawReader raw reader instance
270 * @param pEsd optional ESD to be filled
272 void ProcessHLTOUT(AliRawReader* pRawReader, AliESDEvent* pEsd=NULL) const;
275 * Print a short info about the HLTOUT content.
277 void PrintHLTOUTContent(AliHLTOUT* pHLTOUT) const;
280 /** copy constructor prohibited */
281 AliHLTReconstructor(const AliHLTReconstructor& src);
282 /** assignment operator prohibited */
283 AliHLTReconstructor& operator=(const AliHLTReconstructor& src);
285 /** function pointer: processing of HLTOUT data */
286 void (*fFctProcessHLTOUT)(); //!transient
288 /** ESD manger instance for this reconstruction */
289 AliHLTEsdManager* fpEsdManager; //!transient
291 ClassDef(AliHLTReconstructor, 5) // class for the HLT reconstruction
295 typedef AliHLTReconstructor AliL3Reconstructor; // for backward compatibility