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"
27 * @class AliHLTESDMCEventPublisherComponent
28 * An HLT data source component which publishes AliESDEvent and AliMCEvent objects
29 * out of a series of datapaths.<br>
31 * <h2>General properties:</h2>
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
41 * - AliMCEvent -> kAliHLTDataTypeMCObject
42 * -> kAliHLTDataOriginOffline
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>
52 * \li -datapath <i> Path to list of data files </i><br>
54 * - Kinematics.root<br>
56 * - TrackRefs.root<br>
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
65 * <h2>Configuration:</h2>
66 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
67 * Configuration by component arguments.
69 * <h2>Default CDB entries:</h2>
70 * The component loads no CDB entries.
72 * <h2>Performance:</h2>
73 * The component does not process any event data.
75 * <h2>Memory consumption:</h2>
76 * The component does not process any event data.
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.
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
87 * All files are broken up and published in individual events. Then one data
88 * block is pulished for each entrytype.
90 * @ingroup alihlt_util_components
93 class AliHLTESDMCEventPublisherComponent : public AliHLTFilePublisher {
97 * ---------------------------------------------------------------------------------
98 * Constructor / Destructor
99 * ---------------------------------------------------------------------------------
102 /** standard constructor */
103 AliHLTESDMCEventPublisherComponent();
106 virtual ~AliHLTESDMCEventPublisherComponent();
109 * ---------------------------------------------------------------------------------
110 * Public functions to implement AliHLTComponent's interface.
111 * These functions are required for the registration process
112 * ---------------------------------------------------------------------------------
115 /** interface function, see @ref AliHLTComponent for description */
116 const char* GetComponentID();
118 /** interface function, see @ref AliHLTComponent for description */
119 AliHLTComponent* Spawn();
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 * ---------------------------------------------------------------------------------
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>
139 Int_t DoInit( int argc, const char** argv );
143 * Deinit method. Calls also the one of AliHLTFilePublisher.
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
160 Int_t GetEvent( const AliHLTComponentEventData& evtData,
161 AliHLTComponentTriggerData& trigData,
162 AliHLTUInt8_t* outputPtr,
163 AliHLTUInt32_t& size,
164 vector<AliHLTComponentBlockData>& outputBlocks);
166 using AliHLTFilePublisher::GetEvent;
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 * ---------------------------------------------------------------------------------
178 /** copy constructor prohibited */
179 AliHLTESDMCEventPublisherComponent(const AliHLTESDMCEventPublisherComponent&);
181 /** assignment operator prohibited */
182 AliHLTESDMCEventPublisherComponent& operator=(const AliHLTESDMCEventPublisherComponent&);
186 * ---------------------------------------------------------------------------------
187 * Helper functions - private
188 * ---------------------------------------------------------------------------------
191 /** Add output datatypes according to the fPublish* flags
192 * - AliESDEvent -> kAliHLTDataTypeESDObject
193 * - HLTESD -> kAliHLTDataOriginHLT
194 * - ESD -> kAliHLTDataOriginOffline
196 * - AliMCEvent -> kAliHLTDataTypeMCObject
197 * -> kAliHLTDataOriginOffline
199 void AddDataTypesToOutputlist();
201 /** Insert datafiles according to the fPublish* flags
203 * @return negative number in error case
207 /** Open all files for current folder. Get ESD tree's and TreeE.
208 * @return negative number in error case
210 Int_t OpenCurrentFileList();
212 /** Close all files for current folder.
213 * @return negative number in error case
215 Int_t CloseCurrentFileList();
218 * ---------------------------------------------------------------------------------
220 * ---------------------------------------------------------------------------------
223 /** The current folder, containing 1 set of files */
224 TObjLink *fpCurrentFolder; //! transient
226 /** List of files in current folder*/
227 TList *fpCurrentFileList; //! transient
229 /** Event in current folder ( inside files ) */
230 UInt_t fCurrentEvent; //! see above
232 /** Number of event in current folder ( inside files ) */
233 UInt_t fNEventsInFolder; //! see above
235 /** List containing TObjStrings
236 * -> Contain paths to reconstructed data
238 TList fFolderList; //! see above
240 /** Data specification */
241 AliHLTUInt32_t fSpecification; //! transient
243 /** Publish class AliESDEvent, containing normal ESD */
244 Bool_t fPublishESD; //! see above
246 /** Publish class AliESDEvent, containing normal HLTESD */
247 Bool_t fPublishHLTESD; //! see above
249 /** Publish class AliMCEvent */
250 Bool_t fPublishMC; //! see above
252 /** Pointer to ESD tree in current file */
253 TTree* fpTreeESD; //! transient
255 /** Pointer to HLT ESD tree in current file */
256 TTree* fpTreeHLTESD; //! transient
258 /** Pointer to TreeE tree in current galice file */
259 TTree* fpTreeE; //! transient
261 /** Pointer to TreeK tree in current kinematics file
262 * - changes every event
264 TTree* fpTreeK; //! transient
266 /** Pointer to TreeTR tree in current track refernce file
267 * - changes every event
269 TTree* fpTreeTR; //! transient
271 /* Ptr to current AliESDEvent, to be shipped out*/
272 AliESDEvent* fpESD; //! transient
274 /* Ptr to current HLT - AliESDEvent, to be shipped out*/
275 AliESDEvent* fpHLTESD; //! transient
277 /* Ptr to current AliMCEvent, to be shipped out*/
278 AliMCEvent* fpMC; //! transient
280 ClassDef(AliHLTESDMCEventPublisherComponent, 0)