]>
Commit | Line | Data |
---|---|---|
a655eae3 | 1 | //-*- Mode: C++ -*- |
c515df4c | 2 | // $Id$ |
f23a6e1a | 3 | |
4 | #ifndef ALIHLTPROCESSOR_H | |
5 | #define ALIHLTPROCESSOR_H | |
c515df4c | 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 * | |
f23a6e1a | 9 | |
c515df4c | 10 | /// @file AliHLTProcessor.h |
11 | /// @author Matthias Richter, Timm Steinbeck | |
12 | /// @date | |
13 | /// @brief Base class declaration for HLT analysis components. | |
14 | /// | |
30338a30 | 15 | |
f23a6e1a | 16 | #include "AliHLTComponent.h" |
17 | ||
bfccbf68 | 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: | |
b22e91eb | 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 | |
bfccbf68 | 31 | * |
b22e91eb | 32 | * @ingroup alihlt_component |
bfccbf68 | 33 | */ |
f23a6e1a | 34 | class AliHLTProcessor : public AliHLTComponent { |
35 | public: | |
bfccbf68 | 36 | /** standard constructor */ |
f23a6e1a | 37 | AliHLTProcessor(); |
bfccbf68 | 38 | /** standard destructor */ |
f23a6e1a | 39 | virtual ~AliHLTProcessor(); |
40 | ||
bfccbf68 | 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 | */ | |
3cde846d | 47 | int DoProcessing( const AliHLTComponentEventData& evtData, |
8ede8717 | 48 | const AliHLTComponentBlockData* blocks, |
49 | AliHLTComponentTriggerData& trigData, | |
bfccbf68 | 50 | AliHLTUInt8_t* outputPtr, |
51 | AliHLTUInt32_t& size, | |
457ec821 | 52 | AliHLTComponentBlockDataList& outputBlocks, |
8ede8717 | 53 | AliHLTComponentEventDoneData*& edd ); |
f23a6e1a | 54 | |
55 | // Information member functions for registration. | |
bfccbf68 | 56 | |
57 | /** | |
58 | * Return @ref AliHLTComponent::kProcessor type as component type. | |
59 | * @return component type id | |
60 | */ | |
f23a6e1a | 61 | TComponentType GetComponentType() { return AliHLTComponent::kProcessor;} |
62 | ||
e3629e8a | 63 | protected: |
bfccbf68 | 64 | /** |
a655eae3 | 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. | |
9bb806cd | 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 | |
bfccbf68 | 73 | * <i>output</i>:size of produced data |
9bb806cd | 74 | * @param [in] outputBlocks list to receive output block descriptors |
b6800be0 | 75 | * @return neg. error code if failed <br> |
76 | * -ENOSPC output buffer too small | |
bfccbf68 | 77 | */ |
8ede8717 | 78 | virtual int DoEvent( const AliHLTComponentEventData& evtData, |
79 | const AliHLTComponentBlockData* blocks, | |
80 | AliHLTComponentTriggerData& trigData, | |
bfccbf68 | 81 | AliHLTUInt8_t* outputPtr, |
82 | AliHLTUInt32_t& size, | |
457ec821 | 83 | AliHLTComponentBlockDataList& outputBlocks ); |
f23a6e1a | 84 | |
a655eae3 | 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 | ||
df3d6cff | 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 | ClassDef(AliHLTProcessor, 2) | |
f23a6e1a | 113 | }; |
114 | #endif |