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