]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/AliHLTRootFilePublisherComponent.h
added collector component and HLTOUT handler for component statistics blocks and
[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 publishing objects
24  * from a root file make a feature request at                          <br>
25  * https://savannah.cern.ch/projects/alicehlt/
26  * and assign it to richterm.                                          <br>
27  * Or even better, start the development, any contributions are welcome.
28  *
29  * Component ID: \b RootFilePublisherComponent <br>
30  * Library: \b libAliHLTUtil.
31  *
32  * Mandatory arguments: <br>
33  *
34  * Optional arguments:<br>
35  *
36  * @see AliHLTFilePublisher for default arguments
37  *
38  * @ingroup alihlt_util_components
39  */
40 class AliHLTRootFilePublisherComponent : public AliHLTFilePublisher  {
41  public:
42   /** standard constructor */
43   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 for all events from the event list @ref fEvents and adds TFile
55    * opjects to the internal 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     not used
69    * @param size          not used
70    * @param outputBlocks  not used
71    * @return
72    */
73   int GetEvent( const AliHLTComponentEventData& evtData,
74                 AliHLTComponentTriggerData& trigData,
75                 AliHLTUInt8_t* outputPtr, 
76                 AliHLTUInt32_t& size,
77                 vector<AliHLTComponentBlockData>& outputBlocks);
78
79   using AliHLTFilePublisher::GetEvent;
80
81   /**
82    * Scan one argument and adjacent parameters.
83    * Can be overloaded by child classes in order to add additional arguments
84    * beyond the standard arguments of the file publisher. The method is called
85    * whenever a non-standard argument is recognized.
86    * @param argc           size of the argument array
87    * @param argv           agument array for component initialization
88    * @return number of processed members of the argv <br>
89    *         -EINVAL unknown argument <br>
90    *         -EPROTO parameter for argument missing <br>
91    */
92   virtual int ScanArgument(int argc, const char** argv);
93
94  private:
95   /** copy constructor prohibited */
96   AliHLTRootFilePublisherComponent(const AliHLTRootFilePublisherComponent&);
97   /** assignment operator prohibited */
98   AliHLTRootFilePublisherComponent& operator=(const AliHLTRootFilePublisherComponent&);
99
100   ClassDef(AliHLTRootFilePublisherComponent, 0)
101 };
102 #endif