Switch off the QA
[u/mrichter/AliRoot.git] / HLT / rec / AliHLTReconstructor.h
CommitLineData
3e820254 1// @(#) $Id$
2
3#ifndef ALIHLTRECONSTRUCTOR_H
4#define ALIHLTRECONSTRUCTOR_H
c5123824 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 *
3e820254 8
3a7c0444 9/** @file AliHLTReconstructor.h
c534985b 10 @author Matthias Richter
11 @date
12 @brief Binding class for HLT simulation in AliRoot
c5123824 13*/
c534985b 14
3e820254 15#include "AliReconstructor.h"
a3ef3c1d 16#include "AliHLTReconstructorBase.h"
3e820254 17
18class AliHLTSystem;
19class AliRawReader;
20class AliESDEvent;
c5123824 21class AliHLTOUT;
22class AliHLTEsdManager;
3e820254 23
24/**
25 * @class AliHLTReconstructor
d1d1bbd7 26 * AliHLTReconstructor AliRoot event reconstruction plug-in for the HLT.
3e820254 27 * The AliHLTReconstructor holds an instance of the @ref AliHLTSystem
28 * steering class. The actual reconstruction depends on the loaded component
29 * libraries. Each library must implement a module agent (@ref AliHLTModuleAgent)
30 * in order to provide information on the supported features and the
31 * configurations to be run.
32 *
d1d1bbd7 33 * The AliHLTReconstructor provides both the functionality to run customized
34 * analysis chains and the treatment of the HLTOUT data.
35 *
36 * @section sec_alihltreconstructor_options Options
3e820254 37 * The default component libraries which are loaded through the initialization
60dd5042 38 * are determined by the @ref AliHLTSystem::fgkHLTDefaultLibs array. The library
39 * loading can be overridden by an option to the AliHLTReconstructor through the
3e820254 40 * <tt>SetOption</tt> method of <tt>AliReconstruction</tt>, e.g.
41 * <pre>
42 * AliReconstruction rec;
43 * rec.SetOption("HLT", "libAliHLTSample.so");
44 * </pre>
45 * will only load <tt>libAliHLTSample.so</tt>
46 *
47 * Optional arguments:<br>
1ac82ce6 48 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
3e820254 49 * \li loglevel=<i>level</i><br>
50 * level can be a hex number encoding the @ref AliHLTComponentLogSeverity
51 * \li alilog=off <br>
52 * disables the logging of HLT log messages through <tt>AliLog</tt> <br>
53 *
54 * For further information on the AliRoot reconstruction refer to the AliRoot
55 * documentation, namely <tt>AliReconstruction</tt>.
d1d1bbd7 56 *
57 * @section sec_alihltreconstructor_chains Custom reconstruction chains
58 * In order to run an HLT chain during the AliRoot reconstruction, a chain
59 * configuration must be defined. This can be done by
60 * - specifying a configuration macro defining a configuration macro and
61 * the name of the chain as parameters
62 * <pre>
63 * rec.SetOption("HLT", "config=[macro.C] chains=[name]")
64 * </pre>
65 * - providing the configuration and the name by the module agent.
66 * AliHLTModuleAgent and the functions AliHLTModuleAgent::CreateConfigurations
67 * and AliHLTModuleAgent::GetReconstructionChains
68 *
69 * @section sec_alihltreconstructor_hltout Treatment of HLTOUT data.
70 * The HLTOUT data is a collation of output blocks produced by the various
71 * components running in an HLT chain. Typically its the output of the last
72 * component(s) in the chain, or components specifically connected to the HLT
73 * output.
74 *
75 * The treatment of the HLTOUT data blocks is implemented in handlers of type
76 * AliHLTOUTHandler. The AliHLTModuleAgent of the module creates the appropriate
77 * handler for a data block.
78 * The data type of the individual blocks is set by the producer component and
79 * specifies the nature of the data processing. There are 5 overall groups:
80 * - output is in ESD format:
81 * @ref sec_alihltreconstructor_hltout_esd
82 * - data describes DDL raw format:
83 * @ref sec_alihltreconstructor_hltout_rawreader
84 * - pre-analyzed data to be fed into the normal reconstruction:
85 * @ref sec_alihltreconstructor_hltout_rawstream
86 * - data is fed into an analysis chain:
87 * @ref sec_alihltreconstructor_hltout_chain
88 * - detector specific handler:
89 * @ref sec_alihltreconstructor_hltout_proprietary
90 *
91 * @subsection sec_alihltreconstructor_hltout_esd ESD HLTOUT data
92 * The frame work implements a standard handling of
93 * ESD data blocks of type ::kAliHLTDataTypeESDTree {ESD_TREE:ANY}. ANY can be
94 * any detector origin. Each ESD block contains the data of only one event,
95 * the ESDs are merged by the AliHLTEsdManager and written to files of the
96 * naming scheme AliHLT<DET>ESDs.root. The first ESD block is also copied
97 * to the hltEsd provided by the AliReconstruction. This is a temporary
98 * solution as the handling and merging of HLT ESDs is under discussion.
99 * At the time of writing (May 08) only the TPC HLT components produce ESD
100 * blocks.
101 * The module agent can provide a handler for multiple ESD data blocks, e.g.
102 * for merging within one event prior to the writing. Instead of the individual
103 * ESDs the one provided by the handler is passed to the AliHLTEsdManager. The
104 * handler is of type AliHLTModuleAgent::AliHLTOUTHandlerType::kEsd
105 *
106 * @subsection sec_alihltreconstructor_hltout_rawreader DDL raw HLTOUT data
107 * The HLT can perform selective readout and produces a reduced amount of data
108 * in the original raw ddl format. In order to feed this data from the HLTOUT
109 * DDL links into the normal reconstruction, a handler of type
110 * @ref AliHLTModuleAgent::AliHLTOUTHandlerType::kRawReader must be implemented and provided by the
111 * module agent. The handler has to derive the original equipment id from the
112 * data type and specification of the block. The offline reconstruction does
113 * not need to be changed or adapted at all.
114 *
115 * @subsection sec_alihltreconstructor_hltout_rawstream Preprocessed Raw HLTOUT data
116 * Handlers type @ref AliHLTModuleAgent::AliHLTOUTHandlerType::kRawStream are foreseen though at the time of writing (May 08) the
117 * concept is not fixed. Advanced data compression algorithms can produce a
118 * raw data format which is not convertible into the raw DDL data, e.g. lossy
119 * compression techniques storing clusters parametrized regarding to tracks. A
120 * specific RawStream is needed here since the data is detector specific and the
121 * first stage of the offline reconstruction might need some adaptions.
122 *
123 * @subsection sec_alihltreconstructor_hltout_chain HLTOUT data fed into a chain
124 * At the time of writing (May 08), handler type @ref AliHLTModuleAgent::AliHLTOUTHandlerType::kChain
125 * is foreseen but not yet implemented. Has to be discussed.
126 *
127 * @subsection sec_alihltreconstructor_hltout_proprietary Proprietary HLTOUT data
128 * This is a handler of proprietary detector data, @ref AliHLTModuleAgent::AliHLTOUTHandlerType::kProprietary.
129 * Handlers of this type do not have any standard output to the framework. Data
130 * can be processed and stored to files.
131 *
132 * @ingroup alihlt_aliroot_reconstruction
3e820254 133 */
a3ef3c1d 134class AliHLTReconstructor: public AliReconstructor, public AliHLTReconstructorBase {
3e820254 135public:
032c5e5e 136 /** standard constructor */
3e820254 137 AliHLTReconstructor();
032c5e5e 138 /** constructor */
139 AliHLTReconstructor(const char* options);
3e820254 140 /** destructor */
141 virtual ~AliHLTReconstructor();
142
143 /** init the reconstructor */
144 void Init();
145
032c5e5e 146 /** init the reconstructor */
147 void Init(const char* options);
148
3e820254 149 /**
150 * This Reconstructor function is not applicable for the AliHLTReconstructor
151 * as it gets a detector specific digits tree. But HLT processes all detectors.
7f9ab840 152 * Furthermore it's purely simulated data. <br>
153 * The function forwards to the default bahavior of AliReconstructor but gives
154 * a warning if there were options set, i.e. the user runs customized
155 * reconstruction.
c5123824 156 *
157 * @note HLT reconstruction on simulated data is processed at the end of
158 * simulation. <br>
3e820254 159 */
7f9ab840 160 void Reconstruct(TTree* digitsTree, TTree* clustersTree) const;
3e820254 161
162 /**
163 * Reconstruction from RAW data.
164 * The rawReader holds data for all detectors and this version of Reconstruct
165 * is thus applicable for the HLT. The clustersTree is just ignored.
166 */
167 void Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const;
168
169 /**
c5123824 170 * This function treats the simulated HLTOUT data.
171 * Opens a handler for simulated HLTOUT data and forwards to ::ProcessHLTOUT.
3e820254 172 */
7f9ab840 173 void FillESD(TTree* digitsTree, TTree* clustersTree, AliESDEvent* esd) const;
3e820254 174
175 /**
c5123824 176 * Process the raw HLTOUT data and fill ESD.
177 * Opens a handler for raw HLTOUT data and forwards to ::ProcessHLTOUT.
3e820254 178 */
179 void FillESD(AliRawReader* rawReader, TTree* clustersTree, AliESDEvent* esd) const;
180
c5123824 181 /**
182 * Process HLTOUT data and fill ESD.
183 * This is the final treatment of the HLTOUT data, either simulated or real.
184 * HLTOUT data is stored in HOMER format, the AliHLTOUT object provides the interface
185 * to the individual data blocks.
186 *
187 * During reconstruction (::Reconstruct), module or user defined chains can be
188 * processed and may add additional data to the HLTOUT object. This data is then
189 * treated in the same way.
190 */
191 void ProcessHLTOUT(AliHLTOUT* pHLTOUT, AliESDEvent* esd) const;
192
032c5e5e 193 /**
194 * Process HLTOUT data.
195 * Open digit file and process the HLTOUT digit data.
196 * This function is mostly intended for debugging purposes and stand-alone
197 * processing of the output from the simulation. Loops over all events.
198 * @param digitFile path of the digit file
199 * @param pEsd optional ESD to be filled
200 */
201 void ProcessHLTOUT(const char* digitFile="HLT.Digits.root", AliESDEvent* pEsd=NULL) const;
202
203 /**
204 * Process HLTOUT data.
205 * Process the HLTOUT from the raw reader.
206 * This function is mostly intended for debugging purposes and stand-alone
207 * processing of simulated or real raw data.
208 * \em Note: Loops over all events, i.e. the current event of the the raw
209 * reader will change. Not to be called inside the normal AliRoot processsing.
210 * @param pRawReader raw reader instance
211 * @param pEsd optional ESD to be filled
212 */
213 void ProcessHLTOUT(AliRawReader* pRawReader, AliESDEvent* pEsd=NULL) const;
214
215 /**
216 * Print a short info about the HLTOUT content.
217 */
218 void PrintHLTOUTContent(AliHLTOUT* pHLTOUT) const;
219
3e820254 220private:
221 /** copy constructor prohibited */
222 AliHLTReconstructor(const AliHLTReconstructor& src);
223 /** assignment operator prohibited */
224 AliHLTReconstructor& operator=(const AliHLTReconstructor& src);
225
c5123824 226 /** function pointer: processing of HLTOUT data */
227 void* fFctProcessHLTOUT; //!transient
228
229 /** ESD manger instance for this reconstruction */
230 AliHLTEsdManager* fpEsdManager; //!transient
231
232 ClassDef(AliHLTReconstructor, 5) // class for the HLT reconstruction
233
3e820254 234};
235
236typedef AliHLTReconstructor AliL3Reconstructor; // for backward compatibility
237
238#endif