]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTRootFilePublisherComponent.h
Preparing the RootSchemaEvolutionComponent to run at 2kHz
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTRootFilePublisherComponent.h
1 // -*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTROOTFILEPUBLISHERCOMPONENT_H
5 #define ALIHLTROOTFILEPUBLISHERCOMPONENT_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                               *
9
10 /** @file   AliHLTRootFilePublisherComponent.h
11     @author Matthias Richter, Jochen Thaeder
12     @date   
13     @brief  component for publishing of Root objects from a root file.
14     @note   The class is used in Offline (AliRoot) context
15 */
16
17 #include "AliHLTFilePublisher.h"
18 #include <TList.h>
19
20 /**
21  * @class AliHLTRootFilePublisherComponent
22  * An HLT data source component which publishes root objects from one 
23  * or a sequence of root files. Be aware, one root file can contain 
24  * several root objects. Either all objects or just one object can be selected.<br>
25  *
26  * <h2>General properties:</h2>
27  *
28  * Component ID: \b ROOTFilePublisher <br>
29  * Library: \b libAliHLTUtil.so     <br>
30  * Input Data Types: none <br>
31  * Output Data Types: according to arguments <br>
32  *
33  * <h2>Mandatory arguments:</h2>
34  * @see AliHLTFilePublisher for mandatory defaultarguments
35  *
36  * <h2>Optional arguments:</h2>
37  * @see AliHLTFilePublisher for optional default arguments
38  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
39  * \li -objectname   <i> objectname    </i>
40  *      Name of the object in the root file to be fetched. This is set for 
41  *      all events/files. If not given, all objects are fetched.
42  *      
43  * <h2>Configuration:</h2>
44  * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
45  * Configuration by component arguments.
46  *
47  * <h2>Default CDB entries:</h2>
48  * The component loads no CDB entries.
49  *
50  * <h2>Performance:</h2>
51  * The component does not process any event data.
52  *
53  * <h2>Memory consumption:</h2>
54  * The component does not process any event data.
55  *
56  * <h2>Output size:</h2>
57  * According to the available data. The component is an AliHLTDataSource
58  * and inteded to be used in the AliHLTSystem framework only. The component
59  * implements the standard AliHLTSystem adaptive buffer allocation. 
60  *
61  * The component needs at least one argument \em -datafile or \em -datafilelist.
62  * Both can occur multiple times. The \em -datatype and \em -dataspec
63  * parameters are valid for all files until the next occurrence of
64  * \em -datatype/spec.
65  * All files are published within one event, unless the \em -nexevent specifies
66  * where to break into multiple events. Be aware, one root file can contain 
67  * several root objects. If \em -objectname is not used to select one, all 
68  * objects are all published with the same datatype and specification.
69  *
70  * @ingroup alihlt_util_components
71  */
72
73 class AliHLTRootFilePublisherComponent : public AliHLTFilePublisher  {
74  public:
75
76   /*
77    * ---------------------------------------------------------------------------------
78    *                            Constructor / Destructor
79    * ---------------------------------------------------------------------------------
80    */
81   
82   /** standard constructor */
83   AliHLTRootFilePublisherComponent();
84
85   /** destructor */
86   virtual ~AliHLTRootFilePublisherComponent();
87   
88   /*
89    * ---------------------------------------------------------------------------------
90    * Public functions to implement AliHLTComponent's interface.
91    * These functions are required for the registration process
92    * ---------------------------------------------------------------------------------
93    */
94
95   /** interface function, see @ref AliHLTComponent for description */
96   const char* GetComponentID();
97
98   /** interface function, see @ref AliHLTComponent for description */
99   AliHLTComponent* Spawn();
100
101  protected:
102   /*
103    * ---------------------------------------------------------------------------------
104    * Protected functions to implement AliHLTComponent's interface.
105    * These functions provide initialization as well as the actual processing
106    * capabilities of the component. 
107    * ---------------------------------------------------------------------------------
108    */
109
110   /**
111    * Data processing method for the component.
112    * The component uses the @ref alihltcomponent-high-level-interface
113    * to put serialized Root object into the output stream. Despite of that it
114    * implements the low-level DumpEvent method in order to allow child classes
115    * to use the low-level method.
116    * @param evtData       event data structure
117    * @param trigData      trigger data structure
118    * @param outputPtr     not used
119    * @param size          not used
120    * @param outputBlocks  not used
121    * @return
122    */
123   Int_t GetEvent( const AliHLTComponentEventData& evtData,
124                 AliHLTComponentTriggerData& trigData,
125                 AliHLTUInt8_t* outputPtr, 
126                 AliHLTUInt32_t& size,
127                 vector<AliHLTComponentBlockData>& outputBlocks);
128
129   using AliHLTFilePublisher::GetEvent;
130
131   /**
132    * Scan one argument and adjacent parameters.
133    * Can be overloaded by child classes in order to add additional arguments
134    * beyond the standard arguments of the file publisher. The method is called
135    * whenever a non-standard argument is recognized.
136    * @param argc           size of the argument array
137    * @param argv           agument array for component initialization
138    * @return number of processed members of the argv <br>
139    *         -EINVAL unknown argument <br>
140    *         -EPROTO parameter for argument missing <br>
141    */
142   virtual Int_t ScanArgument(Int_t argc, const char** argv);
143
144  private:
145
146   /*
147    * ---------------------------------------------------------------------------------
148    * Private functions to implement AliHLTComponent's interface.
149    * These functions provide initialization as well as the actual processing
150    * capabilities of the component. 
151    * ---------------------------------------------------------------------------------
152    */
153
154   /** copy constructor prohibited */
155   AliHLTRootFilePublisherComponent(const AliHLTRootFilePublisherComponent&);
156
157   /** assignment operator prohibited */
158   AliHLTRootFilePublisherComponent& operator=(const AliHLTRootFilePublisherComponent&);
159
160   /*
161    * ---------------------------------------------------------------------------------
162    *                             Members - private
163    * ---------------------------------------------------------------------------------
164    */
165
166   /** The current event */
167   TObjLink *fpCurrentEvent;                  //! transient
168
169   /** Name of the object which should be fetched 
170    *  from the root file.
171    */
172   TString   fObjectName;                     //! objectname
173
174   ClassDef(AliHLTRootFilePublisherComponent, 0)
175 };
176 #endif