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 * <h2>Configuration:</h2>
71 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
72 * Configuration by component arguments.
74 * <h2>Default CDB entries:</h2>
75 * The component loads no CDB entries.
77 * <h2>Performance:</h2>
78 * The component does not process any event data.
80 * <h2>Memory consumption:</h2>
81 * The component does not process any event data.
83 * <h2>Output size:</h2>
84 * According to the available data. The component is an AliHLTDataSource
85 * and inteded to be used in the AliHLTSystem framework only. The component
86 * implements the standard AliHLTSystem adaptive buffer allocation.
88 * The component needs at least one argument \em -datapath.
89 * It can occur multiple times. The \em -entrytype and \em -dataspec
90 * parameters are valid for all data paths
92 * All files are broken up and published in individual events. Then one data
93 * block is pulished for each entrytype.
95 * @ingroup alihlt_util_components
98 class AliHLTESDMCEventPublisherComponent : public AliHLTFilePublisher {
102 * ---------------------------------------------------------------------------------
103 * Constructor / Destructor
104 * ---------------------------------------------------------------------------------
107 /** standard constructor */
108 AliHLTESDMCEventPublisherComponent();
111 virtual ~AliHLTESDMCEventPublisherComponent();
114 * ---------------------------------------------------------------------------------
115 * Public functions to implement AliHLTComponent's interface.
116 * These functions are required for the registration process
117 * ---------------------------------------------------------------------------------
120 /** interface function, see @ref AliHLTComponent for description */
121 const char* GetComponentID();
123 /** interface function, see @ref AliHLTComponent for description */
124 AliHLTComponent* Spawn();
128 * ---------------------------------------------------------------------------------
129 * Protected functions to implement AliHLTComponent's interface.
130 * These functions provide initialization as well as the actual processing
131 * capabilities of the component.
132 * ---------------------------------------------------------------------------------
137 * Overwrites the AliHLTFilePublisher::DoInit() method.
138 * @param argc size of the argument array
139 * @param argv agument array for component initialization
140 * @return number of processed members of the argv <br>
141 * -EINVAL unknown argument <br>
142 * -EPROTO parameter for argument missing <br>
144 Int_t DoInit( int argc, const char** argv );
148 * Deinit method. Calls also the one of AliHLTFilePublisher.
153 * Data processing method for the component.
154 * The component uses the @ref alihltcomponent-high-level-interface
155 * to put serialized Root object into the output stream. Despite of that it
156 * implements the low-level DumpEvent method in order to allow child classes
157 * to use the low-level method.
158 * @param evtData event data structure
159 * @param trigData trigger data structure
160 * @param outputPtr not used
161 * @param size not used
162 * @param outputBlocks not used
165 Int_t GetEvent( const AliHLTComponentEventData& evtData,
166 AliHLTComponentTriggerData& trigData,
167 AliHLTUInt8_t* outputPtr,
168 AliHLTUInt32_t& size,
169 vector<AliHLTComponentBlockData>& outputBlocks);
171 using AliHLTFilePublisher::GetEvent;
176 * ---------------------------------------------------------------------------------
177 * Private functions to implement AliHLTComponent's interface.
178 * These functions provide initialization as well as the actual processing
179 * capabilities of the component.
180 * ---------------------------------------------------------------------------------
183 /** copy constructor prohibited */
184 AliHLTESDMCEventPublisherComponent(const AliHLTESDMCEventPublisherComponent&);
186 /** assignment operator prohibited */
187 AliHLTESDMCEventPublisherComponent& operator=(const AliHLTESDMCEventPublisherComponent&);
191 * ---------------------------------------------------------------------------------
192 * Helper functions - private
193 * ---------------------------------------------------------------------------------
196 /** Add output datatypes according to the fPublish* flags
197 * - AliESDEvent -> kAliHLTDataTypeESDObject
198 * - HLTESD -> kAliHLTDataOriginHLT
199 * - ESD -> kAliHLTDataOriginOffline
201 * - AliMCEvent -> kAliHLTDataTypeMCObject
202 * -> kAliHLTDataOriginOffline
204 void AddDataTypesToOutputlist();
206 /** Insert datafiles according to the fPublish* flags
208 * @return negative number in error case
212 /** Open all files for current folder. Get ESD tree's and TreeE.
213 * @return negative number in error case
215 Int_t OpenCurrentFileList();
217 /** Close all files for current folder.
218 * @return negative number in error case
220 Int_t CloseCurrentFileList();
223 * ---------------------------------------------------------------------------------
225 * ---------------------------------------------------------------------------------
228 /** The current folder, containing 1 set of files */
229 TObjLink *fpCurrentFolder; //! transient
231 /** List of files in current folder*/
232 TList *fpCurrentFileList; //! transient
234 /** Event in current folder ( inside files ) */
235 UInt_t fCurrentEvent; // see above
237 /** Number of event in current folder ( inside files ) */
238 UInt_t fNEventsInFolder; // see above
240 /** List containing TObjStrings
241 * -> Contain paths to reconstructed data
243 TList fFolderList; //! see above
245 /** Data specification */
246 AliHLTUInt32_t fSpecification; // see above
248 /** Publish class AliESDEvent, containing normal ESD */
249 Bool_t fPublishESD; // see above
251 /** Publish class AliESDEvent, containing normal HLTESD */
252 Bool_t fPublishHLTESD; // see above
254 /** Publish class AliMCEvent */
255 Bool_t fPublishMC; // see above
257 /** Fill AliMCEvent without TrackRefs, out of Fast Simulation */
258 Bool_t fFastMC; // see above
260 /** Pointer to ESD tree in current file */
261 TTree* fpTreeESD; //! transient
263 /** Pointer to HLT ESD tree in current file */
264 TTree* fpTreeHLTESD; //! transient
266 /** Pointer to TreeE tree in current galice file */
267 TTree* fpTreeE; //! transient
269 /** Pointer to TreeK tree in current kinematics file
270 * - changes every event
272 TTree* fpTreeK; //! transient
274 /** Pointer to TreeTR tree in current track refernce file
275 * - changes every event
277 TTree* fpTreeTR; //! transient
279 /* Ptr to current AliESDEvent, to be shipped out*/
280 AliESDEvent* fpESD; //! transient
282 /* Ptr to current HLT - AliESDEvent, to be shipped out*/
283 AliESDEvent* fpHLTESD; //! transient
285 /* Ptr to current AliMCEvent, to be shipped out*/
286 AliMCEvent* fpMC; //! transient
288 /* Ptr to current AliHLTMCEvent, to be shipped out*/
289 AliHLTMCEvent* fpHLTMC; //! transient
291 ClassDef(AliHLTESDMCEventPublisherComponent, 0)