]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTDataSink.h
flat friends update
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTDataSink.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 #ifndef ALIHLTDATASINK_H
5 #define ALIHLTDATASINK_H
6 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7  * See cxx source for full Copyright notice                               */
8
9 /// @file   AliHLTDataSink.h
10 /// @author Matthias Richter
11 /// @date   
12 /// @brief  Base class declaration for HLT data sink components.
13 /// @note   The class is used in Offline (AliRoot) context
14 ///
15
16 #include "AliHLTComponent.h"
17
18 /**
19  * @class AliHLTDataSink
20  * Base class of HLT data sink components.
21  * The class provides a common interface for the implementation of HLT data
22  * sink components. The child class must implement the functions:
23  * - @ref DoInit (optional)
24  * - @ref DoDeinit (optional)
25  * - @ref DumpEvent
26  * - @ref GetComponentID
27  * - @ref GetInputDataTypes
28  * - @ref Spawn
29  *
30  * @ingroup alihlt_component
31  */
32 class AliHLTDataSink : public AliHLTComponent {
33  public:
34   /** standard constructor */
35   AliHLTDataSink();
36   /** standard destructor */
37   virtual ~AliHLTDataSink();
38
39   /**
40    * Event processing function.
41    * The method is called by the framework to process one event. After 
42    * preparation of data structures. The call is redirected to DumpEvent.
43    * @return neg. error code if failed
44    */
45   int DoProcessing( const AliHLTComponentEventData& evtData,
46                     const AliHLTComponentBlockData* blocks, 
47                     AliHLTComponentTriggerData& trigData,
48                     AliHLTUInt8_t* outputPtr, 
49                     AliHLTUInt32_t& size,
50                     AliHLTComponentBlockDataList& outputBlocks,
51                     AliHLTComponentEventDoneData*& edd );
52
53   // Information member functions for registration.
54
55   /**
56    * Return @ref AliHLTComponent::kSink type as component type.
57    * @return component type id
58    */
59   TComponentType GetComponentType() { return AliHLTComponent::kSink;}
60
61   /**
62    * Default implementation for all data sinks.
63    * There are no output data types.
64    */
65   AliHLTComponentDataType GetOutputDataType();
66
67   /**
68    * Default implementation for all data sinks.
69    * There is no output data.
70    */
71   void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
72
73  protected:
74
75   /**
76    * The low-level data processing method for the component.
77    * This is the custom processing method and can be overloaded by 
78    * the component.
79    * @param evtData       event data structure
80    * @param blocks        input data block descriptors
81    * @param trigData      trigger data structure
82    */
83   virtual int DumpEvent( const AliHLTComponentEventData& evtData,
84                  const AliHLTComponentBlockData* blocks, 
85                  AliHLTComponentTriggerData& trigData );
86
87   /**
88    * The high-level data processing method.
89    * This is the default processing method; the method is called
90    * if no low level @ref DumpEvent method is overloaded by the component.
91    * @param evtData       event data structure
92    * @param trigData      trigger data structure
93    */
94   virtual int DumpEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
95
96
97   ClassDef(AliHLTDataSink, 1)
98 };
99 #endif