]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTProcessor.h
Cosmetics. Fixed bug preventing creation of async block list
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTProcessor.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTPROCESSOR_H
5 #define ALIHLTPROCESSOR_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   AliHLTProcessor.h
11     @author Matthias Richter, Timm Steinbeck
12     @date   
13     @brief  Base class declaration for HLT analysis components. */
14
15 // see below for class documentation
16 // or
17 // refer to README to build package
18 // or
19 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt   
20
21 #include "AliHLTComponent.h"
22
23 /**
24  * @class AliHLTProcessor
25  * Base class of HLT data analysis components.
26  * The class provides a common interface for the implementation of HLT data
27  * analysis components. The child class must implement the functions:
28  * - @ref DoInit (optional)
29  * - @ref DoDeinit (optional)
30  * - @ref DoEvent
31  * - @ref GetComponentID
32  * - @ref GetInputDataTypes
33  * - @ref GetOutputDataType
34  * - @ref GetOutputDataSize
35  * - @ref Spawn
36  *
37  * @ingroup alihlt_component
38  */
39 class AliHLTProcessor : public AliHLTComponent {
40  public:
41   /** standard constructor */
42   AliHLTProcessor();
43   /** standard destructor */
44   virtual ~AliHLTProcessor();
45
46   /**
47    * Event processing function.
48    * The method is called by the framework to process one event. After 
49    * preparation of data structures. The call is redirected to DoEvent.
50    * @return neg. error code if failed 
51    */
52   int DoProcessing( const AliHLTComponentEventData& evtData,
53                     const AliHLTComponentBlockData* blocks, 
54                     AliHLTComponentTriggerData& trigData,
55                     AliHLTUInt8_t* outputPtr, 
56                     AliHLTUInt32_t& size,
57                     AliHLTComponentBlockDataList& outputBlocks,
58                     AliHLTComponentEventDoneData*& edd );
59
60   // Information member functions for registration.
61
62   /**
63    * Return @ref AliHLTComponent::kProcessor type as component type.
64    * @return component type id
65    */
66   TComponentType GetComponentType() { return AliHLTComponent::kProcessor;}
67
68  protected:
69   /**
70    * The low-level data processing method for the component.
71    * This is the custom processing method and can be overloaded by 
72    * the component.
73    * @param evtData       event data structure
74    * @param blocks        input data block descriptors
75    * @param trigData      trigger data structure
76    * @param outputPtr     pointer to target buffer
77    * @param size          <i>input</i>: size of target buffer
78    *                      <i>output</i>:size of produced data
79    * @param outputBlocks  list to receive output block descriptors
80    * @return neg. error code if failed                                <br>
81    *         -ENOSPC      output buffer too small
82    */
83   virtual int DoEvent( const AliHLTComponentEventData& evtData,
84                        const AliHLTComponentBlockData* blocks, 
85                        AliHLTComponentTriggerData& trigData,
86                        AliHLTUInt8_t* outputPtr, 
87                        AliHLTUInt32_t& size,
88                        AliHLTComponentBlockDataList& outputBlocks );
89
90   /**
91    * The high-level data processing method.
92    * This is the default processing method; the method is called
93    * if no low level @ref DoEvent method is overloaded by the component.
94    * @param evtData       event data structure
95    * @param trigData      trigger data structure
96    * @return neg. error code if failed
97    */
98   virtual int DoEvent( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData);
99
100   // collection of debug counters
101   struct AliHLTProcessorCounters {
102     AliHLTProcessorCounters() : fReadoutFilter(0), fMonitoringFilter(0), fMonitoringEvent(0), fMismatch(0) {}
103     int fReadoutFilter;    // counter for the EDD readout filter
104     int fMonitoringFilter; // counter for the EDD monitoring filter
105     int fMonitoringEvent;  // counter for the EDD monitoring event
106     int fMismatch;         // counter for EDD format mismatch
107   };
108
109 private:
110   /// copy contructor prohibited
111   AliHLTProcessor(const AliHLTProcessor&);
112   /// assignment operator prohibited
113   AliHLTProcessor& operator=(const AliHLTProcessor&);
114
115   AliHLTProcessorCounters* fpDebugCounters; // optional debugging counters
116
117   ClassDef(AliHLTProcessor, 2)
118 };
119 #endif