]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTRootFilePublisherComponent.h
HLT sample applications
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTRootFilePublisherComponent.h
1 // -*- Mode: C++ -*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTROOTFILEPUBLISHERCOMPONENT_H
5 #define ALIHLTROOTFILEPUBLISHERCOMPONENT_H
6 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7  * See cxx source for full Copyright notice                               */
8
9 /** @file   AliHLTRootFilePublisherComponent.h
10     @author Matthias Richter
11     @date   
12     @brief  component for publishing of Root objects from a root file.
13     @note   The class is used in Offline (AliRoot) context
14 */
15
16 #include "AliHLTFilePublisher.h"
17 #include <TList.h>
18
19 /**
20  * @class AliHLTRootFilePublisherComponent
21  * An HLT data source component which publishes data from one or a sequence
22  * of files.<br>
23  *
24  * Component ID: \b RootFilePublisherComponent <br>
25  * Library: \b libHLTBase (in order to use the component from the external
26  * interface, it might be necessary to specify a dummy library with the
27  * \em -componentlibrary argument).
28  *
29  * Mandatory arguments: <br>
30  *
31  * Optional arguments:<br>
32  *
33  * @see AliHLTFilePublisher for default arguments
34  * @ingroup alihlt_component
35  */
36 class AliHLTRootFilePublisherComponent : public AliHLTFilePublisher  {
37  public:
38   /** standard constructor */
39   AliHLTRootFilePublisherComponent();
40   /** not a valid copy constructor, defined according to effective C++ style */
41   AliHLTRootFilePublisherComponent(const AliHLTRootFilePublisherComponent&);
42   /** not a valid assignment op, but defined according to effective C++ style */
43   AliHLTRootFilePublisherComponent& operator=(const AliHLTRootFilePublisherComponent&);
44   /** destructor */
45   virtual ~AliHLTRootFilePublisherComponent();
46
47   const char* GetComponentID();
48   AliHLTComponentDataType GetOutputDataType();
49   void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
50   AliHLTComponent* Spawn();
51
52   /**
53    * Open all files.
54    * Opens all files from the file name list @ref fFileNames and adds TFile
55    * opjects to the TFiles list.
56    */
57   int OpenFiles();
58
59  protected:
60   /**
61    * Data processing method for the component.
62    * The component uses the @ref alihltcomponent-high-level-interface
63    * to put serialized Root object into the output stream. Despite of that it
64    * implements the lox-level DumpEvent method in order to allow child classes
65    * to use the low-level method.
66    * @param evtData       event data structure
67    * @param trigData      trigger data structure
68    * @param outputPtr     pointer to target buffer
69    * @param size          <i>input</i>: size of target buffer
70    *                      <i>output</i>:size of produced data
71    * @param outputBlocks  list to receive output block descriptors
72    * @return
73    */
74   int GetEvent( const AliHLTComponentEventData& evtData,
75                 AliHLTComponentTriggerData& trigData,
76                 AliHLTUInt8_t* outputPtr, 
77                 AliHLTUInt32_t& size,
78                 vector<AliHLTComponentBlockData>& outputBlocks );
79
80   /**
81    * Scan one argument and adjacent parameters.
82    * Can be overloaded by child classes in order to add additional arguments
83    * beyond the standard arguments of the file publisher. The method is called
84    * whenever a non-standard argument is recognized.
85    * @param argc           size of the argument array
86    * @param argv           agument array for component initialization
87    * @return number of processed members of the argv <br>
88    *         -EINVAL unknown argument <br>
89    *         -EPROTO parameter for argument missing <br>
90    */
91   virtual int ScanArgument(int argc, const char** argv);
92
93  private:
94
95   ClassDef(AliHLTRootFilePublisherComponent, 0)
96 };
97 #endif