]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTRootFileStreamerComponent.h
Update master to aliroot
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTRootFileStreamerComponent.h
1 // -*- Mode: C++ -*-
2 // $Id$
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                               *
8
9 /// @file   AliHLTRootFileStreamerComponent.h
10 /// @author Matthias Richter
11 /// @date   
12 /// @brief  Save objects in a ROOT memory file
13 ///
14
15 #include "AliHLTProcessor.h"
16
17 /**
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.
24  *
25  * <h2>General properties:</h2>
26  *
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>
32  *
33  * <h2>Mandatory arguments:</h2>
34  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
35  *      
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
42  *      prepended by '0x'
43  *
44  * <h2>Configuration:</h2>
45  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
46  * Configuration by component arguments.
47  *
48  * <h2>Default CDB entries:</h2>
49  * The component loads no CDB entries.
50  *
51  * <h2>Performance:</h2>
52  * The component does not process any event data.
53  *
54  * <h2>Memory consumption:</h2>
55  * The component does not process any event data.
56  *
57  * <h2>Output size:</h2>
58  * No data published (AliHLTDataSink).
59  *
60  * @ingroup alihlt_util_components
61  */
62 class AliHLTRootFileStreamerComponent : public AliHLTProcessor
63 {
64  public:
65   /** standard constructor */
66   AliHLTRootFileStreamerComponent();
67   /** destructor */
68   virtual ~AliHLTRootFileStreamerComponent();
69
70   /**
71    * The id of the component.
72    * @return component id (string)
73    */
74   const char* GetComponentID() {return "ROOTFileStreamer";};
75
76   /**
77    * Spawn function.
78    * @return new class instance
79    */
80   AliHLTComponent* Spawn() {return new AliHLTRootFileStreamerComponent;}
81
82   /**
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
86    */
87   void GetInputDataTypes( vector<AliHLTComponentDataType>& );
88
89   /**
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
93    */
94   AliHLTComponentDataType GetOutputDataType();
95
96   /**
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
100    *                                   input data volume  
101    * @param inputMultiplier  <i>return</i>: multiplication ratio
102    * @return values in the reference variables
103    */
104   void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
105
106  protected:
107   /**
108    * Internal initialization.
109    * @see @ref AliHLTComponent::DoInit for description and parameters
110    */
111   virtual int DoInit( int argc, const char** argv );
112
113   /**
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
119    */
120   int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
121   
122   using AliHLTProcessor::DoEvent;
123
124  private:
125   /** copy constructor prohibited */
126   AliHLTRootFileStreamerComponent(const AliHLTRootFileStreamerComponent&);
127   /** assignment operator prohibited */
128   AliHLTRootFileStreamerComponent& operator=(const AliHLTRootFileStreamerComponent&);
129
130   /** data type */
131   AliHLTComponentDataType fDataType;                               // see above
132   /** data specification */
133   AliHLTUInt32_t          fSpecification;                          // see above
134
135   ClassDef(AliHLTRootFileStreamerComponent, 0)
136 };
137 #endif