3 #ifndef ALIHLTROOTFILESTREAMERCOMPONENT_H
4 #define ALIHLTROOTFILESTREAMERCOMPONENT_H
5 //* This file is property of and copyright by the *
6 //* ALICE Experiment at CERN, All rights reserved. *
7 //* See cxx source for full Copyright notice *
9 /// @file AliHLTRootFileStreamerComponent.h
10 /// @author Matthias Richter
12 /// @brief Save objects in a ROOT memory file
15 #include "AliHLTProcessor.h"
18 * @class AliHLTRootFileStreamerComponent
19 * The RootFileStreamer provides a stand alone component to write incoming
20 * TObject like structures into a ROOT memory file. A ROOT memory file is
21 * a ROOT file stored in memory instead on disk (AliHLTMemoryFile) The file
22 * is published via the output stream. On the receiver side the file can
23 * be directly written to disk and appears like a normal root file.
25 * <h2>General properties:</h2>
27 * Component ID: \b ROOTFileStreamer <br>
28 * Library: \b libAliHLTUtil.so <br>
29 * Input Data Types: ::kAliHLTAnyDataType <br>
30 * Output Data Types: according to component arguments,
31 * ::kAliHLTVoidDataType by default <br>
33 * <h2>Mandatory arguments:</h2>
34 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
36 * <h2>Optional arguments:</h2>
37 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
38 * \li -datatype <i> datatype dataorigin </i> <br>
39 * data type ID and origin, e.g. <tt>-datatype CLUSTERS TPC </tt>
40 * \li -dataspec <i> specification </i> <br>
41 * data specification treated as decimal number or hex number if
44 * <h2>Configuration:</h2>
45 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
46 * Configuration by component arguments.
48 * <h2>Default CDB entries:</h2>
49 * The component loads no CDB entries.
51 * <h2>Performance:</h2>
52 * The component does not process any event data.
54 * <h2>Memory consumption:</h2>
55 * The component does not process any event data.
57 * <h2>Output size:</h2>
58 * No data published (AliHLTDataSink).
60 * @ingroup alihlt_util_components
62 class AliHLTRootFileStreamerComponent : public AliHLTProcessor
65 /** standard constructor */
66 AliHLTRootFileStreamerComponent();
68 virtual ~AliHLTRootFileStreamerComponent();
71 * The id of the component.
72 * @return component id (string)
74 const char* GetComponentID() {return "ROOTFileStreamer";};
78 * @return new class instance
80 AliHLTComponent* Spawn() {return new AliHLTRootFileStreamerComponent;}
83 * Get the input data types of the component.
84 * The function is pure virtual and must be implemented by the child class.
85 * @return list of data types in the vector reference
87 void GetInputDataTypes( vector<AliHLTComponentDataType>& );
90 * Get the output data type of the component.
91 * The function is pure virtual and must be implemented by the child class.
92 * @return output data type
94 AliHLTComponentDataType GetOutputDataType();
97 * Get a ratio by how much the data volume is shrinked or enhanced.
98 * The function is pure virtual and must be implemented by the child class.
99 * @param constBase <i>return</i>: additive part, independent of the
101 * @param inputMultiplier <i>return</i>: multiplication ratio
102 * @return values in the reference variables
104 void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
108 * Internal initialization.
109 * @see @ref AliHLTComponent::DoInit for description and parameters
111 virtual int DoInit( int argc, const char** argv );
114 * The high-level data processing method.
115 * All incoming objects are saved into a ROOT file in memory.
116 * @param evtData event data structure
117 * @param trigData trigger data structure
118 * @return neg. error code if failed
120 int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
122 using AliHLTProcessor::DoEvent;
125 /** copy constructor prohibited */
126 AliHLTRootFileStreamerComponent(const AliHLTRootFileStreamerComponent&);
127 /** assignment operator prohibited */
128 AliHLTRootFileStreamerComponent& operator=(const AliHLTRootFileStreamerComponent&);
131 AliHLTComponentDataType fDataType; // see above
132 /** data specification */
133 AliHLTUInt32_t fSpecification; // see above
135 ClassDef(AliHLTRootFileStreamerComponent, 0)