]>
Commit | Line | Data |
---|---|---|
178dd351 | 1 | |
2 | /************************************************************************** | |
3 | * This file is property of and copyright by the ALICE HLT Project * | |
4 | * All rights reserved. * | |
5 | * * | |
6 | * Primary Authors: Per Thomas Hille, Oystein Djuvsland * | |
7 | * * | |
8 | * Permission to use, copy, modify and distribute this software and its * | |
9 | * documentation strictly for non-commercial purposes is hereby granted * | |
10 | * without fee, provided that the above copyright notice appears in all * | |
11 | * copies and that both the copyright notice and this permission notice * | |
12 | * appear in the supporting documentation. The authors make no claims * | |
13 | * about the suitability of this software for any purpose. It is * | |
14 | * provided "as is" without express or implied warranty. * | |
15 | **************************************************************************/ | |
16 | ||
17 | ||
18 | #ifndef ALIHLTCALORAWANALYZERCOMPONENTV3_H | |
19 | #define ALIHLTCALORAWANALYZERCOMPONENTV3_H | |
20 | ||
21 | ||
22 | /** | |
23 | * Raw data analyzer component base class for PHOS HLT | |
24 | * | |
25 | * @file AliHLTCaloRawAnalyzerComponentv3.h | |
26 | * @author Oystein Djuvsland | |
27 | * @date | |
28 | * @brief A clusterizer component for PHOS HLT | |
29 | */ | |
30 | ||
31 | // see below for class documentation | |
32 | // or | |
33 | // refer to README to build package | |
34 | // or | |
35 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
36 | ||
3800a654 | 37 | //#include "AliHLTCaloRcuProcessor.h" |
178dd351 | 38 | |
39 | ||
72a884c8 | 40 | class AliCaloRawAnalyzer; |
178dd351 | 41 | class AliHLTCaloRcuCellEnergyDataStruct; |
42 | class AliHLTCaloMapper; | |
43 | class AliHLTCaloSanityInspector; | |
44 | class AliHLTCaloDigitMaker; | |
45 | class AliHLTCaloDigitContainerDataStruct; | |
46 | class AliRawReaderMemory; | |
47 | class AliAltroRawStreamV3; | |
48 | ||
72a884c8 | 49 | |
178dd351 | 50 | /** |
51 | * @class AliHLTCaloRawAnalyzerComponentv3 | |
52 | * This the new and fast version of the component taking care of the decoding and energy and timing | |
53 | * extraction of the raw data from PHOS. | |
54 | * | |
55 | * <h2>General properties:</h2> | |
56 | * | |
57 | * Component ID: \b PhosRawAnalyzerv3 <br> | |
58 | * Library: \b libAliHLTCalo.so <br> | |
59 | * Input Data Types: @ref <br> | |
60 | * Output Data Types: @ref AliHLTCaloDefinitions::fgkChannelDataType<br> | |
61 | * | |
62 | * <h2>Mandatory arguments:</h2> | |
63 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> | |
64 | * \li No mandatory arguments for component <br> | |
65 | * | |
66 | * <h2>Optional arguments:</h2> | |
67 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> | |
68 | * \li -offset <i> value </i> <br> | |
69 | * gives the offset added to the data during zero suppression (default value: 0) | |
70 | * \li -bunchsizecut <i> value </i> <br> | |
71 | * minimum number of samples a bunch must contain to be considered (default value: 0) | |
72 | * \li -minpeakposition <i> value </i> <br> | |
73 | * cut on minimum postion of the peak in the bunch (defaul value: 0) | |
74 | * \li -maxpeakposition <i> value </i> <br> | |
75 | * cut on maximum postion of the peak in the bunch (defaul value: 100) | |
76 | * | |
77 | * <h2>Configuration:</h2> | |
78 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> | |
79 | * \li No configuration arguments | |
80 | * | |
81 | * <h2>Default CDB entries:</h2> | |
82 | * \li No CDB entry yet, will come. | |
83 | * | |
84 | * <h2>Performance:</h2> | |
85 | * Pretty good (~ 3 kHz), depends on amount of data... | |
86 | * | |
87 | * <h2>Memory consumption:</h2> | |
88 | * Depends on the amount of data, but pretty godd | |
89 | * | |
90 | * <h2>Output size:</h2> | |
91 | * Depends on the amount of data... | |
92 | * | |
93 | * More detailed description. (Soon) | |
94 | * | |
95 | * @ingroup alihlt_phos | |
96 | */ | |
97 | ||
3800a654 | 98 | |
097e19a7 | 99 | |
3800a654 | 100 | #include "AliHLTProcessor.h" |
101 | #include "AliHLTCaloDefinitions.h" | |
4f4b7ba4 | 102 | #include "AliHLTCaloConstantsHandler.h" |
c375e15d | 103 | #include "AliHLTCaloRcuProcessor.h" |
3800a654 | 104 | |
097e19a7 | 105 | //#include "TObject.h" |
106 | ||
178dd351 | 107 | class AliHLTCaloMapper; |
108 | ||
109 | ||
097e19a7 | 110 | class AliHLTCaloRawAnalyzerComponentv3 : public AliHLTCaloConstantsHandler, public AliHLTCaloRcuProcessor |
178dd351 | 111 | { |
112 | public: | |
113 | ||
77f350f7 | 114 | /** Constructor must be initialized to specific calorimeter */ |
115 | AliHLTCaloRawAnalyzerComponentv3(TString det); | |
116 | ||
178dd351 | 117 | /** Destructor */ |
118 | virtual ~AliHLTCaloRawAnalyzerComponentv3(); | |
119 | ||
120 | // virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype) = 0; | |
121 | ||
122 | /** interface function, see @ref AliHLTComponent for description */ | |
123 | virtual int DoInit(int argc =0, const char** argv = 0); | |
124 | ||
125 | /** interface function, see @ref AliHLTComponent for description */ | |
c375e15d | 126 | virtual int DoDeinit(); |
178dd351 | 127 | |
128 | /** interface function, see @ref AliHLTComponent for description */ | |
129 | virtual const char* GetComponentID() = 0; | |
130 | ||
131 | /** interface function, see @ref AliHLTComponent for description */ | |
72a884c8 | 132 | // virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list); |
133 | virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list) = 0; | |
134 | ||
178dd351 | 135 | |
097e19a7 | 136 | |
137 | ||
138 | ||
139 | ||
140 | ||
141 | ||
142 | ||
143 | ||
178dd351 | 144 | /** interface function, see @ref AliHLTComponent for description */ |
72a884c8 | 145 | // virtual AliHLTComponentDataType GetOutputDataType(); |
146 | virtual AliHLTComponentDataType GetOutputDataType() = 0; | |
178dd351 | 147 | |
148 | /** interface function, see @ref AliHLTComponent for description */ | |
72a884c8 | 149 | // virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier); |
150 | virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier) = 0 ; | |
178dd351 | 151 | |
152 | /** interface function, see @ref AliHLTComponent for description */ | |
153 | virtual AliHLTComponent* Spawn() = 0; | |
154 | ||
155 | protected: | |
c375e15d | 156 | |
157 | //virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype) = 0; | |
178dd351 | 158 | /** interface function, see @ref AliHLTComponent for description */ |
3800a654 | 159 | |
c375e15d | 160 | using AliHLTCaloRcuProcessor::DoEvent; |
178dd351 | 161 | |
162 | /** interface function, see @ref AliHLTComponent for description */ | |
163 | virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, | |
164 | AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, | |
c375e15d | 165 | AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks ) = 0; |
178dd351 | 166 | |
167 | /** | |
168 | * Do the real processing in the component | |
169 | * @param iter is the pointer to the data blocks | |
170 | * @param outputPtr is the pointer to the output buffer | |
171 | * @param size is the available size for output | |
172 | * @param totSize is the total size used for output | |
173 | * @return the size output size used | |
174 | */ | |
175 | virtual Int_t DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize); | |
176 | ||
097e19a7 | 177 | |
5fc8dce6 | 178 | // unsigned long fCaloEventCount; |
178dd351 | 179 | |
180 | /** Pointer to an analyzer object used for raw data anlysis */ | |
72a884c8 | 181 | AliCaloRawAnalyzer *fAnalyzerPtr; //COMMENT |
c375e15d | 182 | |
4f4b7ba4 | 183 | //** Pointer to a mapper opbject */ |
184 | AliHLTCaloMapper *fMapperPtr; //COMMENT | |
c375e15d | 185 | |
44175a17 | 186 | virtual void InitMapping(const int specification ) = 0; |
187 | ||
178dd351 | 188 | private: |
189 | ||
77f350f7 | 190 | /** Keep default constructor private since it should not be used */ |
191 | AliHLTCaloRawAnalyzerComponentv3(); | |
192 | ||
178dd351 | 193 | /** Keep the copy constructor private since it should not be used */ |
194 | AliHLTCaloRawAnalyzerComponentv3(const AliHLTCaloRawAnalyzerComponentv3 & ); | |
195 | ||
196 | /** Keep the assignement operator private since it should not be used */ | |
197 | AliHLTCaloRawAnalyzerComponentv3 & operator = (const AliHLTCaloRawAnalyzerComponentv3 &); | |
198 | ||
44175a17 | 199 | //virtual void InitMapping(const int specification ) = 0; |
c375e15d | 200 | |
178dd351 | 201 | /** Mapping from harware address to geometrical address */ |
202 | // AliHLTCaloMapper *fMapperPtr; //!transient | |
203 | ||
c375e15d | 204 | |
3800a654 | 205 | |
178dd351 | 206 | /** Pointer to object which may check the integrity of the data */ |
207 | AliHLTCaloSanityInspector *fSanityInspectorPtr; //!transient | |
208 | ||
209 | /** Pointer to the raw data reader which reads from memory */ | |
210 | AliRawReaderMemory* fRawReaderMemoryPtr; //!transient | |
211 | ||
212 | /** Pointer to the raw stream */ | |
213 | AliAltroRawStreamV3* fAltroRawStreamPtr; //!transient | |
214 | ||
215 | /** Describing which algorithm we are using */ | |
216 | Short_t fAlgorithm; //COMMENT | |
217 | ||
218 | /** The offset applied before ZS */ | |
219 | Int_t fOffset; //COMMENT | |
220 | ||
221 | /** The minimum length a bunch can have to be considered */ | |
222 | Int_t fBunchSizeCut; //COMMENT | |
223 | ||
224 | /** The lowest position a peak can have to be considered */ | |
225 | Int_t fMinPeakPosition; //COMMENT | |
226 | ||
227 | /** The maximum position a peak can have to be considered */ | |
228 | Int_t fMaxPeakPosition; //COMMENT | |
229 | ||
230 | // AliHLTCaloMapper *fMapperPtr; | |
231 | ||
c6d582d5 | 232 | /** Should we push the raw data when the channel is crazy? */ |
233 | Bool_t fDoPushBadRawData; //COMMENT | |
234 | ||
235 | /** Should we push all raw data (using the raw data writer) */ | |
236 | Bool_t fDoPushRawData; //COMMENT | |
237 | ||
178dd351 | 238 | class RawDataWriter |
239 | { | |
240 | public: | |
77f350f7 | 241 | RawDataWriter(AliHLTCaloConstants* cConst); |
178dd351 | 242 | ~RawDataWriter(); |
243 | // void WriteChannelId(const UShort_t channeldid ); | |
244 | void NewChannel( ); | |
245 | void WriteBunchData(const UShort_t *bunchdata, const int length, const UInt_t starttimebin ); | |
246 | void ResetBuffer(); | |
247 | void SetChannelId( const UShort_t channeldid ); | |
248 | //void CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused ); | |
249 | int CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused ); | |
250 | void NewEvent(); | |
251 | ||
252 | private: | |
77f350f7 | 253 | |
254 | //Default constructor, should not be used. | |
255 | RawDataWriter(); | |
178dd351 | 256 | RawDataWriter (const RawDataWriter & ); |
257 | RawDataWriter & operator = (const RawDataWriter &); | |
258 | void Init(); | |
259 | // bool fIsFirstChannel; | |
260 | UShort_t* fRawDataBuffer; | |
261 | int fCurrentChannelSize; | |
262 | int fBufferIndex; | |
263 | int fBufferSize; | |
264 | UShort_t *fCurrentChannelIdPtr; | |
265 | UShort_t *fCurrentChannelSizePtr; | |
266 | UShort_t *fCurrentChannelDataPtr; | |
267 | int fTotalSize; | |
268 | }; | |
269 | ||
270 | RawDataWriter *fRawDataWriter; | |
271 | ||
097e19a7 | 272 | // ClassDef(AliHLTCaloRawAnalyzerComponentv3, 1) |
4f4b7ba4 | 273 | |
178dd351 | 274 | }; |
275 | ||
276 | #endif | |
277 |