4 #ifndef ALIHLTFILEPUBLISHER_H
5 #define ALIHLTFILEPUBLISHER_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 AliHLTFilePublisher.h
11 @author Matthias Richter
13 @brief An HLT file publishing (data source) component.
14 @note The class is used in Offline (AliRoot) context
17 #include "AliHLTDataSource.h"
21 * @class AliHLTFilePublisher
22 * An HLT data source component which publishes data from one or a sequence
25 * Component ID: \b FilePublisher <br>
26 * Library: \b libAliHLTUtil.
28 * Mandatory arguments: <br>
29 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formating -->
30 * \li -datafile <i> filename </i>
31 * \li -datafilelist <i> file pattern </i> <br>
33 * \li -datatype <i> datatype dataorigin </i> <br>
34 * data type ID and origin, e.g. <tt>-datatype CLUSTERS TPC </tt>
35 * \li -dataspec <i> specification </i> <br>
36 * data specification treated as decimal number or hex number if
39 * Optional arguments:<br>
41 * The component needs at least one argument \em -datafile or \em -datafilelist.
42 * Both can occur multiple times. The \em -datatype and \em -dataspec
43 * parameters are valid for all files until the next occurrence of
45 * @ingroup alihlt_component
47 class AliHLTFilePublisher : public AliHLTDataSource {
49 /** standard constructor */
50 AliHLTFilePublisher();
51 /** not a valid copy constructor, defined according to effective C++ style */
52 AliHLTFilePublisher(const AliHLTFilePublisher&);
53 /** not a valid assignment op, but defined according to effective C++ style */
54 AliHLTFilePublisher& operator=(const AliHLTFilePublisher&);
56 virtual ~AliHLTFilePublisher();
58 const char* GetComponentID();
59 AliHLTComponentDataType GetOutputDataType();
60 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
61 AliHLTComponent* Spawn();
65 * Opens all files from the file name list @ref fFileNames and adds TFile
66 * opjects to the TFiles list.
74 int DoInit( int argc, const char** argv );
82 * Data processing method for the component.
83 * @param evtData event data structure
84 * @param trigData trigger data structure
85 * @param outputPtr pointer to target buffer
86 * @param size <i>input</i>: size of target buffer
87 * <i>output</i>:size of produced data
88 * @param outputBlocks list to receive output block descriptors
91 int GetEvent( const AliHLTComponentEventData& evtData,
92 AliHLTComponentTriggerData& trigData,
93 AliHLTUInt8_t* outputPtr,
95 vector<AliHLTComponentBlockData>& outputBlocks );
98 * Scan one argument and adjacent parameters.
99 * Can be overloaded by child classes in order to add additional arguments
100 * beyond the standard arguments of the file publisher. The method is called
101 * whenever a non-standard argument is recognized.
102 * @param argc size of the argument array
103 * @param argv agument array for component initialization
104 * @return number of processed members of the argv <br>
105 * -EINVAL unknown argument <br>
106 * -EPROTO parameter for argument missing <br>
108 virtual int ScanArgument(int argc, const char** argv);
112 * Get the data type which is set for the current file
114 AliHLTComponentDataType GetCurrentDataType() const;
117 * Get the data specification which is set for the current file
119 AliHLTUInt32_t GetCurrentSpecification() const;
122 /** list of file names */
123 TList fFileNames; // see above
124 /** list of opened files */
125 TList fFiles; // see above
126 /** current positions in the file list */
127 TObjLink* fpCurrent; //! transient
129 AliHLTComponentDataType fDataType; // see above
130 /** data specification */
131 AliHLTUInt32_t fSpecification; // see above
132 /** the maximum buffer size i.e. size of the biggest file */
133 Int_t fMaxSize; // see above
135 ClassDef(AliHLTFilePublisher, 0)