]>
Commit | Line | Data |
---|---|---|
6666bfe5 | 1 | //-*- Mode: C++ -*- |
2 | // @(#) $Id$ | |
3 | ||
4 | #ifndef ALIHLTRAWREADERPUBLISHERCOMPONENT_H | |
5 | #define ALIHLTRAWREADERPUBLISHERCOMPONENT_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 AliHLTRawReaderPublisherComponent.h | |
11 | @author Matthias Richter | |
12 | @date | |
13 | @brief A general data publisher component for the AliRawReader. | |
14 | */ | |
15 | ||
16 | // see header file for class documentation | |
17 | // or | |
18 | // refer to README to build package | |
19 | // or | |
20 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
21 | ||
22 | #include "AliHLTOfflineDataSource.h" | |
23 | ||
24 | /** | |
25 | * @class AliHLTRawReaderPublisherComponent | |
26 | * A general data publisher component for the AliRawReader. | |
27 | * The component publishs the data of a given detector and equipment ID. | |
10ca703e | 28 | * |
0a51d3cf | 29 | * If no data specification is given, the equipment id is used as default. |
30 | * A child class can implement @ref GetSpecificationFromEquipmentId to | |
31 | * provide a different rule. | |
bee77626 | 32 | * |
33 | * The component publishes one data block for each equipment id in the | |
34 | * give range. If the RawReader does not provide any data, an empty data | |
35 | * block consisting of the Common Data Header is produced. | |
6666bfe5 | 36 | * |
37 | * Component ID: \b AliRawReaderPublisher <br> | |
38 | * Library: \b libAliHLTUtil. | |
39 | * | |
40 | * Mandatory arguments: <br> | |
1ac82ce6 | 41 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> |
6666bfe5 | 42 | * \li -detector <i> detector name </i> |
43 | * e.g. <tt> -detector TPC </tt> | |
44 | * \li -equipmentid <i> id </i> | |
10ca703e | 45 | * the equipmentid within the detector, e.g. TPC 0 is 768 |
6666bfe5 | 46 | * \li -minid <i> id </i> |
e39ae6fb | 47 | * the minimum equipmentid including detector offset, e.g. 768 is TPC 0<br> |
48 | * if the -detector option is used, the id is without detector offset | |
6666bfe5 | 49 | * \li -maxid <i> id </i> |
e39ae6fb | 50 | * the maximum equipmentid including detector offset (default = minid)<br> |
51 | * if the -detector option is used, the id is without detector offset | |
6666bfe5 | 52 | * \li -verbose<br> |
53 | * print out some more info messages, mainly for the sake of tutorials | |
4eb069ae | 54 | * \li -skipempty |
55 | * skip all empty ddls in the specified range; by default, the component | |
56 | * generates and inserts empty data blocks | |
6666bfe5 | 57 | * \li -datatype <i> datatype dataorigin </i> <br> |
58 | * data type ID and origin, e.g. <tt>-datatype DIGITS TPC </tt> | |
59 | * \li -dataspec <i> specification </i> <br> | |
60 | * data specification treated as decimal number or hex number if | |
61 | * prepended by '0x' | |
62 | * | |
63 | * Optional arguments:<br> | |
64 | * | |
65 | * | |
66 | * @ingroup alihlt_system | |
67 | */ | |
68 | class AliHLTRawReaderPublisherComponent : public AliHLTOfflineDataSource { | |
69 | public: | |
70 | /** standard constructor */ | |
71 | AliHLTRawReaderPublisherComponent(); | |
72 | /** destructor */ | |
73 | virtual ~AliHLTRawReaderPublisherComponent(); | |
74 | ||
75 | /** | |
76 | * Get the id of the component. | |
77 | * Each component is identified by a unique id. | |
78 | * The function is pure virtual and must be implemented by the child class. | |
79 | * @return component id (string) | |
80 | */ | |
81 | const char* GetComponentID(); | |
82 | ||
83 | /** | |
84 | * Get the output data type of the component. | |
85 | * The function is pure virtual and must be implemented by the child class. | |
86 | * @return output data type | |
87 | */ | |
88 | AliHLTComponentDataType GetOutputDataType(); | |
89 | ||
90 | /** | |
91 | * Get a ratio by how much the data volume is shrinked or enhanced. | |
92 | * The function is pure virtual and must be implemented by the child class. | |
93 | * @param constBase <i>return</i>: additive part, independent of the | |
94 | * input data volume | |
95 | * @param inputMultiplier <i>return</i>: multiplication ratio | |
96 | * @return values in the reference variables | |
97 | */ | |
98 | void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ); | |
99 | ||
100 | /** | |
101 | * Spawn function. | |
102 | * Each component must implement a spawn function to create a new instance of | |
103 | * the class. Basically the function must return <i>new <b>my_class_name</b></i>. | |
104 | * @return new class instance | |
105 | */ | |
106 | virtual AliHLTComponent* Spawn(); | |
107 | ||
108 | protected: | |
109 | /** | |
110 | * Init method. | |
111 | */ | |
112 | int DoInit( int argc, const char** argv ); | |
113 | ||
114 | /** | |
115 | * Deinit method. | |
116 | */ | |
117 | int DoDeinit(); | |
118 | ||
119 | /** | |
120 | * Data source method. | |
121 | * @param evtData event data structure | |
122 | * @param trigData trigger data structure | |
123 | * @param outputPtr pointer to target buffer | |
124 | * @param size <i>input</i>: size of target buffer | |
125 | * <i>output</i>:size of produced data | |
126 | * @param outputBlocks list to receive output block descriptors | |
127 | * @return neg. error code if failed | |
128 | */ | |
129 | int GetEvent( const AliHLTComponentEventData& evtData, | |
130 | AliHLTComponentTriggerData& trigData, | |
131 | AliHLTUInt8_t* outputPtr, | |
132 | AliHLTUInt32_t& size, | |
133 | vector<AliHLTComponentBlockData>& outputBlocks ); | |
134 | ||
a8abc5d5 | 135 | using AliHLTOfflineDataSource::GetEvent; |
136 | ||
6666bfe5 | 137 | protected: |
138 | virtual int GetSpecificationFromEquipmentId(int id, AliHLTUInt32_t &specification) const; | |
139 | ||
140 | private: | |
141 | /** copy constructor prohibited */ | |
142 | AliHLTRawReaderPublisherComponent(const AliHLTRawReaderPublisherComponent&); | |
143 | /** assignment operator prohibited */ | |
144 | AliHLTRawReaderPublisherComponent& operator=(const AliHLTRawReaderPublisherComponent&); | |
145 | ||
146 | /** max output block size, estimated during DoInit */ | |
147 | Int_t fMaxSize; //!transient | |
148 | ||
149 | /** detector string */ | |
150 | TString fDetector; //!transient | |
151 | ||
152 | /** min equipment id */ | |
153 | int fMinEquId; //!transient | |
154 | ||
155 | /** max equipment id */ | |
156 | int fMaxEquId; //!transient | |
157 | ||
158 | /** be verbose: info printouts */ | |
159 | Bool_t fVerbose; //!transient | |
160 | ||
161 | /** data type */ | |
162 | AliHLTComponentDataType fDataType; //!transient | |
163 | ||
164 | /** data specification */ | |
165 | AliHLTUInt32_t fSpecification; //!transient | |
166 | ||
4eb069ae | 167 | /** skip the generation of empty data blocks */ |
168 | Bool_t fSkipEmpty; //!transient | |
169 | ||
170 | ClassDef(AliHLTRawReaderPublisherComponent, 1); | |
6666bfe5 | 171 | }; |
172 | ||
173 | #endif |