2 // $Id: AliHLTESDMCEventPublisherComponent.h 27447 2008-07-19 21:59:56Z richterm $
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 *
10 /** @file AliHLTESDMCEventPublisherComponent.h
11 @author Jochen Thaeder
13 @brief Component for publishing ESD and MC events.
14 @note The class is used in Offline (AliRoot) context
17 #include "AliHLTFilePublisher.h"
22 #include "AliESDEvent.h"
23 #include "AliMCEvent.h"
25 #include "AliHLTMCEvent.h"
28 * @class AliHLTESDMCEventPublisherComponent
29 * An HLT data source component which publishes AliESDEvent and AliMCEvent objects
30 * out of a series of datapaths.<br>
32 * <h2>General properties:</h2>
34 * Component ID: \b ESDMCEventPublisher <br>
35 * Library: \b libAliHLTUtil.so <br>
36 * Input Data Types: none <br>
37 * Output Data Types: according to arguments <br>
38 * - AliESDEvent -> kAliHLTDataTypeESDObject
39 * - HLTESD -> kAliHLTDataOriginHLT
40 * - ESD -> kAliHLTDataOriginOffline
42 * - AliMCEvent -> kAliHLTDataTypeMCObject
43 * -> kAliHLTDataOriginOffline
45 * - AliHLTMCEvent -> kAliHLTDataTypeMCObject
46 * -> kAliHLTDataOriginHLT
49 * <h2>Mandatory arguments:</h2>
50 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
51 * \li -entrytype <i> Type of events to publish </i> <br>
52 * Can be one, all or some of :<br>
55 * - MC (publishes both AliHLTMCEvent and AliMCEvent) <br>
57 * \li -datapath <i> Path to list of data files </i><br>
59 * - Kinematics.root<br>
61 * - TrackRefs.root<br>
63 * <h2>Optional arguments:</h2>
64 * \li -dataspec <i> Specification </i> <br>
65 * Data specification treated as decimal number or hex number if
66 * prepended by '0x'<br>
67 * If not given void spec ist used. Otherwise each Bit corresponds to
68 * the detectorID specified at ALICE-INT-2007-016, Table 1
70 * \li -applyParticleCuts <i> Apply particle cuts before filling in AliHLTMCEvent </i> <br>
73 * <h2>Configuration:</h2>
74 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
75 * Configuration by component arguments.
77 * <h2>Default CDB entries:</h2>
78 * The component loads no CDB entries.
80 * <h2>Performance:</h2>
81 * The component does not process any event data.
83 * <h2>Memory consumption:</h2>
84 * The component does not process any event data.
86 * <h2>Output size:</h2>
87 * According to the available data. The component is an AliHLTDataSource
88 * and inteded to be used in the AliHLTSystem framework only. The component
89 * implements the standard AliHLTSystem adaptive buffer allocation.
91 * The component needs at least one argument \em -datapath.
92 * It can occur multiple times. The \em -entrytype and \em -dataspec
93 * parameters are valid for all data paths
95 * All files are broken up and published in individual events. Then one data
96 * block is pulished for each entrytype.
98 * @ingroup alihlt_util_components
101 class AliHLTESDMCEventPublisherComponent : public AliHLTFilePublisher {
105 * ---------------------------------------------------------------------------------
106 * Constructor / Destructor
107 * ---------------------------------------------------------------------------------
110 /** standard constructor */
111 AliHLTESDMCEventPublisherComponent();
114 virtual ~AliHLTESDMCEventPublisherComponent();
117 * ---------------------------------------------------------------------------------
118 * Public functions to implement AliHLTComponent's interface.
119 * These functions are required for the registration process
120 * ---------------------------------------------------------------------------------
123 /** interface function, see @ref AliHLTComponent for description */
124 const char* GetComponentID();
125 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
127 /** interface function, see @ref AliHLTComponent for description */
128 AliHLTComponent* Spawn();
132 * ---------------------------------------------------------------------------------
133 * Protected functions to implement AliHLTComponent's interface.
134 * These functions provide initialization as well as the actual processing
135 * capabilities of the component.
136 * ---------------------------------------------------------------------------------
141 * Overwrites the AliHLTFilePublisher::DoInit() method.
142 * @param argc size of the argument array
143 * @param argv agument array for component initialization
144 * @return number of processed members of the argv <br>
145 * -EINVAL unknown argument <br>
146 * -EPROTO parameter for argument missing <br>
148 Int_t DoInit( int argc, const char** argv );
152 * Deinit method. Calls also the one of AliHLTFilePublisher.
157 * Data processing method for the component.
158 * The component uses the @ref alihltcomponent-high-level-interface
159 * to put serialized Root object into the output stream. Despite of that it
160 * implements the low-level DumpEvent method in order to allow child classes
161 * to use the low-level method.
162 * @param evtData event data structure
163 * @param trigData trigger data structure
164 * @param outputPtr not used
165 * @param size not used
166 * @param outputBlocks not used
169 Int_t GetEvent( const AliHLTComponentEventData& evtData,
170 AliHLTComponentTriggerData& trigData,
171 AliHLTUInt8_t* outputPtr,
172 AliHLTUInt32_t& size,
173 vector<AliHLTComponentBlockData>& outputBlocks);
175 using AliHLTFilePublisher::GetEvent;
180 * ---------------------------------------------------------------------------------
181 * Private functions to implement AliHLTComponent's interface.
182 * These functions provide initialization as well as the actual processing
183 * capabilities of the component.
184 * ---------------------------------------------------------------------------------
187 /** copy constructor prohibited */
188 AliHLTESDMCEventPublisherComponent(const AliHLTESDMCEventPublisherComponent&);
190 /** assignment operator prohibited */
191 AliHLTESDMCEventPublisherComponent& operator=(const AliHLTESDMCEventPublisherComponent&);
195 * ---------------------------------------------------------------------------------
196 * Helper functions - private
197 * ---------------------------------------------------------------------------------
200 /** Add output datatypes according to the fPublish* flags
201 * - AliESDEvent -> kAliHLTDataTypeESDObject
202 * - HLTESD -> kAliHLTDataOriginHLT
203 * - ESD -> kAliHLTDataOriginOffline
205 * - AliMCEvent -> kAliHLTDataTypeMCObject
206 * -> kAliHLTDataOriginOffline
208 void AddDataTypesToOutputlist();
210 /** Insert datafiles according to the fPublish* flags
212 * @return negative number in error case
216 /** Open all files for current folder. Get ESD tree's and TreeE.
217 * @return negative number in error case
219 Int_t OpenCurrentFileList();
221 /** Close all files for current folder.
222 * @return negative number in error case
224 Int_t CloseCurrentFileList();
227 * ---------------------------------------------------------------------------------
229 * ---------------------------------------------------------------------------------
232 /** The current folder, containing 1 set of files */
233 TObjLink *fpCurrentFolder; //! transient
235 /** List of files in current folder*/
236 TList *fpCurrentFileList; //! transient
238 /** Event in current folder ( inside files ) */
239 UInt_t fCurrentEvent; // see above
241 /** Number of event in current folder ( inside files ) */
242 UInt_t fNEventsInFolder; // see above
244 /** List containing TObjStrings
245 * -> Contain paths to reconstructed data
247 TList fFolderList; //! see above
249 /** Data specification */
250 AliHLTUInt32_t fSpecification; // see above
252 /** Publish class AliESDEvent, containing normal ESD */
253 Bool_t fPublishESD; // see above
255 /** Publish class AliESDEvent, containing normal HLTESD */
256 Bool_t fPublishHLTESD; // see above
258 /** Publish class AliMCEvent */
259 Bool_t fPublishMC; // see above
261 /** Fill AliMCEvent without TrackRefs, out of Fast Simulation */
262 Bool_t fFastMC; // see above
264 /** Pointer to ESD tree in current file */
265 TTree* fpTreeESD; //! transient
267 /** Pointer to HLT ESD tree in current file */
268 TTree* fpTreeHLTESD; //! transient
270 /** Pointer to TreeE tree in current galice file */
271 TTree* fpTreeE; //! transient
273 /** Pointer to TreeK tree in current kinematics file
274 * - changes every event
276 TTree* fpTreeK; //! transient
278 /** Pointer to TreeTR tree in current track refernce file
279 * - changes every event
281 TTree* fpTreeTR; //! transient
283 /* Ptr to current AliESDEvent, to be shipped out*/
284 AliESDEvent* fpESD; //! transient
286 /* Ptr to current HLT - AliESDEvent, to be shipped out*/
287 AliESDEvent* fpHLTESD; //! transient
289 /* Ptr to current AliMCEvent, to be shipped out*/
290 AliMCEvent* fpMC; //! transient
292 /* Ptr to current AliHLTMCEvent, to be shipped out*/
293 AliHLTMCEvent* fpHLTMC; //! transient
295 /* Maximum required output size */
296 UInt_t fOutputSize; //! transient
298 /** Apply particle cuts, before filling in AliHLTMCEvent */
299 Bool_t fApplyParticleCuts; // see above
301 ClassDef(AliHLTESDMCEventPublisherComponent, 0)