]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTRootFilePublisherComponent.h
minor changes
[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
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  * \Note: This component is not what it pretends to be. So far it was just
23  * used for debugging purpose. If you need a component like this make a
24  * feature request at                                                  <br>
25  * https://savannah.cern.ch/projects/alicehlt/
26  * and assign it to richterm.                                          <br>
27  * Any contributions are of course welcome.
28  *
29  * Component ID: \b RootFilePublisherComponent <br>
30  * Library: \b libHLTBase (in order to use the component from the external
31  * interface, it might be necessary to specify a dummy library with the
32  * \em -componentlibrary argument).
33  *
34  * Mandatory arguments: <br>
35  *
36  * Optional arguments:<br>
37  *
38  * @see AliHLTFilePublisher for default arguments
39  * @ingroup alihlt_component
40  */
41 class AliHLTRootFilePublisherComponent : public AliHLTFilePublisher  {
42  public:
43   /** standard constructor */
44   AliHLTRootFilePublisherComponent();
45   /** not a valid copy constructor, defined according to effective C++ style */
46   AliHLTRootFilePublisherComponent(const AliHLTRootFilePublisherComponent&);
47   /** not a valid assignment op, but defined according to effective C++ style */
48   AliHLTRootFilePublisherComponent& operator=(const AliHLTRootFilePublisherComponent&);
49   /** destructor */
50   virtual ~AliHLTRootFilePublisherComponent();
51
52   const char* GetComponentID();
53   AliHLTComponentDataType GetOutputDataType();
54   void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
55   AliHLTComponent* Spawn();
56
57   /**
58    * Open all files.
59    * Opens all files for all events from the event list @ref fEvents and adds TFile
60    * opjects to the internal list.
61    */
62   int OpenFiles();
63
64  protected:
65   /**
66    * Data processing method for the component.
67    * The component uses the @ref alihltcomponent-high-level-interface
68    * to put serialized Root object into the output stream. Despite of that it
69    * implements the lox-level DumpEvent method in order to allow child classes
70    * to use the low-level method.
71    * @param evtData       event data structure
72    * @param trigData      trigger data structure
73    * @param outputPtr     pointer to target buffer
74    * @param size          <i>input</i>: size of target buffer
75    *                      <i>output</i>:size of produced data
76    * @param outputBlocks  list to receive output block descriptors
77    * @return
78    */
79   int GetEvent( const AliHLTComponentEventData& evtData,
80                 AliHLTComponentTriggerData& trigData,
81                 AliHLTUInt8_t* outputPtr, 
82                 AliHLTUInt32_t& size,
83                 vector<AliHLTComponentBlockData>& outputBlocks );
84
85   /**
86    * Scan one argument and adjacent parameters.
87    * Can be overloaded by child classes in order to add additional arguments
88    * beyond the standard arguments of the file publisher. The method is called
89    * whenever a non-standard argument is recognized.
90    * @param argc           size of the argument array
91    * @param argv           agument array for component initialization
92    * @return number of processed members of the argv <br>
93    *         -EINVAL unknown argument <br>
94    *         -EPROTO parameter for argument missing <br>
95    */
96   virtual int ScanArgument(int argc, const char** argv);
97
98  private:
99
100   ClassDef(AliHLTRootFilePublisherComponent, 0)
101 };
102 #endif