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 "AliHLTReconstructorBase.h"
22 class AliHLTEsdManager;
25 * @class AliHLTReconstructor
26 * AliHLTReconstructor AliRoot event reconstruction plug-in for the HLT.
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.
33 * The AliHLTReconstructor provides both the functionality to run customized
34 * analysis chains and the treatment of the HLTOUT data.
36 * @section sec_alihltreconstructor_options Options
37 * The default component libraries which are loaded through the initialization
38 * are determined by the @ref AliHLTSystem::fgkHLTDefaultLibs array. The library
39 * loading can be overridden by an option to the AliHLTReconstructor through the
40 * <tt>SetOption</tt> method of <tt>AliReconstruction</tt>, e.g.
42 * AliReconstruction rec;
43 * rec.SetOption("HLT", "libAliHLTSample.so");
45 * will only load <tt>libAliHLTSample.so</tt>
47 * Optional arguments:<br>
48 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
49 * \li loglevel=<i>level</i><br>
50 * level can be a hex number encoding the @ref AliHLTComponentLogSeverity
52 * disables the logging of HLT log messages through <tt>AliLog</tt> <br>
54 * For further information on the AliRoot reconstruction refer to the AliRoot
55 * documentation, namely <tt>AliReconstruction</tt>.
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
63 * rec.SetOption("HLT", "config=[macro.C] chains=[name]")
65 * - providing the configuration and the name by the module agent.
66 * AliHLTModuleAgent and the functions AliHLTModuleAgent::CreateConfigurations
67 * and AliHLTModuleAgent::GetReconstructionChains
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
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
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
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
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.
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.
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.
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.
132 * @ingroup alihlt_aliroot_reconstruction
134 class AliHLTReconstructor: public AliReconstructor, public AliHLTReconstructorBase {
136 /** standard constructor */
137 AliHLTReconstructor();
139 AliHLTReconstructor(const char* options);
141 virtual ~AliHLTReconstructor();
143 /** init the reconstructor */
146 /** init the reconstructor */
147 void Init(const char* options);
150 * This Reconstructor function is not applicable for the AliHLTReconstructor
151 * as it gets a detector specific digits tree. But HLT processes all detectors.
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
157 * @note HLT reconstruction on simulated data is processed at the end of
160 void Reconstruct(TTree* digitsTree, TTree* clustersTree) const;
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.
167 void Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const;
170 * This function treats the simulated HLTOUT data.
171 * Opens a handler for simulated HLTOUT data and forwards to ::ProcessHLTOUT.
173 void FillESD(TTree* digitsTree, TTree* clustersTree, AliESDEvent* esd) const;
176 * Process the raw HLTOUT data and fill ESD.
177 * Opens a handler for raw HLTOUT data and forwards to ::ProcessHLTOUT.
179 void FillESD(AliRawReader* rawReader, TTree* clustersTree, AliESDEvent* esd) const;
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.
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.
191 void ProcessHLTOUT(AliHLTOUT* pHLTOUT, AliESDEvent* esd) const;
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
201 void ProcessHLTOUT(const char* digitFile="HLT.Digits.root", AliESDEvent* pEsd=NULL) const;
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
213 void ProcessHLTOUT(AliRawReader* pRawReader, AliESDEvent* pEsd=NULL) const;
216 * Print a short info about the HLTOUT content.
218 void PrintHLTOUTContent(AliHLTOUT* pHLTOUT) const;
221 /** copy constructor prohibited */
222 AliHLTReconstructor(const AliHLTReconstructor& src);
223 /** assignment operator prohibited */
224 AliHLTReconstructor& operator=(const AliHLTReconstructor& src);
226 /** function pointer: processing of HLTOUT data */
227 void* fFctProcessHLTOUT; //!transient
229 /** ESD manger instance for this reconstruction */
230 AliHLTEsdManager* fpEsdManager; //!transient
232 ClassDef(AliHLTReconstructor, 5) // class for the HLT reconstruction
236 typedef AliHLTReconstructor AliL3Reconstructor; // for backward compatibility