]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/util/AliHLTESDMCEventPublisherComponent.h
correcting compilation warning and making change of AliShuttleInterface (rev 29388)
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTESDMCEventPublisherComponent.h
CommitLineData
fa5e8413 1// -*- Mode: C++ -*-
2// $Id: AliHLTESDMCEventPublisherComponent.h 27447 2008-07-19 21:59:56Z richterm $
3
4#ifndef ALIHLTESDMCEVENTPUBLISHERCOMPONENT_H
5#define ALIHLTESDMCEVENTPUBLISHERCOMPONENT_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 *
9
10/** @file AliHLTESDMCEventPublisherComponent.h
11 @author Jochen Thaeder
12 @date
13 @brief Component for publishing ESD and MC events.
14 @note The class is used in Offline (AliRoot) context
15*/
16
17#include "AliHLTFilePublisher.h"
18
19#include "TList.h"
20#include "TTree.h"
21
22#include "AliESDEvent.h"
23#include "AliMCEvent.h"
24
25
26/**
27 * @class AliHLTESDMCEventPublisherComponent
28 * An HLT data source component which publishes AliESDEvent and AliMCEvent objects
29 * out of a series of datapaths.<br>
30 *
31 * <h2>General properties:</h2>
32 *
33 * Component ID: \b ESDMCEventPublisher <br>
34 * Library: \b libAliHLTUtil.so <br>
35 * Input Data Types: none <br>
36 * Output Data Types: according to arguments <br>
37 * - AliESDEvent -> kAliHLTDataTypeESDObject
38 * - HLTESD -> kAliHLTDataOriginHLT
39 * - ESD -> kAliHLTDataOriginOffline
40 *
41 * - AliMCEvent -> kAliHLTDataTypeMCObject
42 * -> kAliHLTDataOriginOffline
43 *
44 * <h2>Mandatory arguments:</h2>
45 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
46 * \li -entrytype <i> Type of events to publish </i> <br>
47 * Can be one, all or some of :<br>
48 * - ESD<br>
49 * - HLTESD<br>
50 * - MC<br>
51 *
52 * \li -datapath <i> Path to list of data files </i><br>
53 * - AliESDs.root<br>
54 * - Kinematics.root<br>
55 * - galice.root<br>
56 * - TrackRefs.root<br>
57 *
58 * <h2>Optional arguments:</h2>
59 * \li -dataspec <i> Specification </i> <br>
60 * Data specification treated as decimal number or hex number if
61 * prepended by '0x'<br>
62 * If not given void spec ist used. Otherwise each Bit corresponds to
63 * the detectorID specified at ALICE-INT-2007-016, Table 1
64 *
65 * <h2>Configuration:</h2>
66 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
67 * Configuration by component arguments.
68 *
69 * <h2>Default CDB entries:</h2>
70 * The component loads no CDB entries.
71 *
72 * <h2>Performance:</h2>
73 * The component does not process any event data.
74 *
75 * <h2>Memory consumption:</h2>
76 * The component does not process any event data.
77 *
78 * <h2>Output size:</h2>
79 * According to the available data. The component is an AliHLTDataSource
80 * and inteded to be used in the AliHLTSystem framework only. The component
81 * implements the standard AliHLTSystem adaptive buffer allocation.
82 *
83 * The component needs at least one argument \em -datapath.
84 * It can occur multiple times. The \em -entrytype and \em -dataspec
85 * parameters are valid for all data paths
86 *
87 * All files are broken up and published in individual events. Then one data
88 * block is pulished for each entrytype.
89 *
90 * @ingroup alihlt_util_components
91 */
92
93class AliHLTESDMCEventPublisherComponent : public AliHLTFilePublisher {
94 public:
95
96 /*
97 * ---------------------------------------------------------------------------------
98 * Constructor / Destructor
99 * ---------------------------------------------------------------------------------
100 */
101
102 /** standard constructor */
103 AliHLTESDMCEventPublisherComponent();
104
105 /** destructor */
106 virtual ~AliHLTESDMCEventPublisherComponent();
107
108 /*
109 * ---------------------------------------------------------------------------------
110 * Public functions to implement AliHLTComponent's interface.
111 * These functions are required for the registration process
112 * ---------------------------------------------------------------------------------
113 */
114
115 /** interface function, see @ref AliHLTComponent for description */
116 const char* GetComponentID();
117
118 /** interface function, see @ref AliHLTComponent for description */
119 AliHLTComponent* Spawn();
120
121 protected:
122 /*
123 * ---------------------------------------------------------------------------------
124 * Protected functions to implement AliHLTComponent's interface.
125 * These functions provide initialization as well as the actual processing
126 * capabilities of the component.
127 * ---------------------------------------------------------------------------------
128 */
129
130 /**
131 * Init method.
132 * Overwrites the AliHLTFilePublisher::DoInit() method.
133 * @param argc size of the argument array
134 * @param argv agument array for component initialization
135 * @return number of processed members of the argv <br>
136 * -EINVAL unknown argument <br>
137 * -EPROTO parameter for argument missing <br>
138 */
4646c6e3 139 Int_t DoInit( int argc, const char** argv );
fa5e8413 140
141
142 /**
143 * Deinit method. Calls also the one of AliHLTFilePublisher.
144 */
145 Int_t DoDeinit();
146
147 /**
148 * Data processing method for the component.
149 * The component uses the @ref alihltcomponent-high-level-interface
150 * to put serialized Root object into the output stream. Despite of that it
151 * implements the low-level DumpEvent method in order to allow child classes
152 * to use the low-level method.
153 * @param evtData event data structure
154 * @param trigData trigger data structure
155 * @param outputPtr not used
156 * @param size not used
157 * @param outputBlocks not used
158 * @return
159 */
160 Int_t GetEvent( const AliHLTComponentEventData& evtData,
161 AliHLTComponentTriggerData& trigData,
162 AliHLTUInt8_t* outputPtr,
163 AliHLTUInt32_t& size,
164 vector<AliHLTComponentBlockData>& outputBlocks);
165
166 using AliHLTFilePublisher::GetEvent;
167
168 private:
169
170 /*
171 * ---------------------------------------------------------------------------------
172 * Private functions to implement AliHLTComponent's interface.
173 * These functions provide initialization as well as the actual processing
174 * capabilities of the component.
175 * ---------------------------------------------------------------------------------
176 */
177
178 /** copy constructor prohibited */
179 AliHLTESDMCEventPublisherComponent(const AliHLTESDMCEventPublisherComponent&);
180
181 /** assignment operator prohibited */
182 AliHLTESDMCEventPublisherComponent& operator=(const AliHLTESDMCEventPublisherComponent&);
183
184
185 /*
186 * ---------------------------------------------------------------------------------
187 * Helper functions - private
188 * ---------------------------------------------------------------------------------
189 */
190
191 /** Add output datatypes according to the fPublish* flags
192 * - AliESDEvent -> kAliHLTDataTypeESDObject
193 * - HLTESD -> kAliHLTDataOriginHLT
194 * - ESD -> kAliHLTDataOriginOffline
195 *
196 * - AliMCEvent -> kAliHLTDataTypeMCObject
197 * -> kAliHLTDataOriginOffline
198 */
199 void AddDataTypesToOutputlist();
200
201 /** Insert datafiles according to the fPublish* flags
202 * into folders.
203 * @return negative number in error case
204 */
205 Int_t InsertFiles();
206
207 /** Open all files for current folder. Get ESD tree's and TreeE.
208 * @return negative number in error case
209 */
210 Int_t OpenCurrentFileList();
211
212 /** Close all files for current folder.
213 * @return negative number in error case
214 */
215 Int_t CloseCurrentFileList();
216
217 /*
218 * ---------------------------------------------------------------------------------
219 * Members - private
220 * ---------------------------------------------------------------------------------
221 */
222
223 /** The current folder, containing 1 set of files */
224 TObjLink *fpCurrentFolder; //! transient
225
226 /** List of files in current folder*/
227 TList *fpCurrentFileList; //! transient
228
229 /** Event in current folder ( inside files ) */
230 UInt_t fCurrentEvent; //! see above
231
232 /** Number of event in current folder ( inside files ) */
233 UInt_t fNEventsInFolder; //! see above
234
235 /** List containing TObjStrings
236 * -> Contain paths to reconstructed data
237 */
238 TList fFolderList; //! see above
239
240 /** Data specification */
241 AliHLTUInt32_t fSpecification; //! transient
242
243 /** Publish class AliESDEvent, containing normal ESD */
244 Bool_t fPublishESD; //! see above
245
246 /** Publish class AliESDEvent, containing normal HLTESD */
247 Bool_t fPublishHLTESD; //! see above
248
249 /** Publish class AliMCEvent */
250 Bool_t fPublishMC; //! see above
251
252 /** Pointer to ESD tree in current file */
253 TTree* fpTreeESD; //! transient
254
255 /** Pointer to HLT ESD tree in current file */
256 TTree* fpTreeHLTESD; //! transient
257
258 /** Pointer to TreeE tree in current galice file */
259 TTree* fpTreeE; //! transient
260
261 /** Pointer to TreeK tree in current kinematics file
262 * - changes every event
263 */
264 TTree* fpTreeK; //! transient
265
266 /** Pointer to TreeTR tree in current track refernce file
267 * - changes every event
268 */
269 TTree* fpTreeTR; //! transient
270
271 /* Ptr to current AliESDEvent, to be shipped out*/
272 AliESDEvent* fpESD; //! transient
273
274 /* Ptr to current HLT - AliESDEvent, to be shipped out*/
275 AliESDEvent* fpHLTESD; //! transient
276
277 /* Ptr to current AliMCEvent, to be shipped out*/
278 AliMCEvent* fpMC; //! transient
279
280 ClassDef(AliHLTESDMCEventPublisherComponent, 0)
281};
282#endif