]>
Commit | Line | Data |
---|---|---|
87434909 | 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 ALIHLTPHOSRAWANALYZERCOMPONENTV3_H | |
19 | #define ALIHLTPHOSRAWANALYZERCOMPONENTV3_H | |
20 | ||
21 | ||
22 | /** | |
23 | * Raw data analyzer component base class for PHOS HLT | |
24 | * | |
25 | * @file AliHLTPHOSRawAnalyzerComponentv3.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 | ||
37 | #include "AliHLTPHOSRcuProcessor.h" | |
38 | ||
39 | ||
40 | class AliHLTPHOSRawAnalyzer; | |
41 | class AliHLTPHOSRcuCellEnergyDataStruct; | |
42 | class AliHLTPHOSMapper; | |
43 | class AliHLTPHOSSanityInspector; | |
44 | class AliHLTPHOSDigitMaker; | |
45 | class AliHLTPHOSDigitContainerDataStruct; | |
46 | class AliRawReaderMemory; | |
47 | class AliAltroRawStreamV3; | |
37ff2dd6 | 48 | class AliHLTPHOSChannelDataStruct; |
49 | ||
50 | //class RawDataWriter; | |
51 | ||
87434909 | 52 | |
53 | /** | |
54 | * @class AliHLTPHOSRawAnalyzerComponentv3 | |
55 | * This the new and fast version of the component taking care of the decoding and energy and timing | |
56 | * extraction of the raw data from PHOS. | |
57 | * | |
58 | * <h2>General properties:</h2> | |
59 | * | |
60 | * Component ID: \b PhosRawAnalyzerv3 <br> | |
61 | * Library: \b libAliHLTPHOS.so <br> | |
62 | * Input Data Types: @ref <br> | |
63 | * Output Data Types: @ref AliHLTPHOSDefinitions::fgkChannelDataType<br> | |
64 | * | |
65 | * <h2>Mandatory arguments:</h2> | |
66 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> | |
67 | * \li No mandatory arguments for component <br> | |
68 | * | |
69 | * <h2>Optional arguments:</h2> | |
70 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> | |
71 | * \li -offset <i> value </i> <br> | |
72 | * gives the offset added to the data during zero suppression (default value: 0) | |
73 | * \li -bunchsizecut <i> value </i> <br> | |
74 | * minimum number of samples a bunch must contain to be considered (default value: 0) | |
75 | * \li -minpeakposition <i> value </i> <br> | |
76 | * cut on minimum postion of the peak in the bunch (defaul value: 0) | |
77 | * \li -maxpeakposition <i> value </i> <br> | |
78 | * cut on maximum postion of the peak in the bunch (defaul value: 100) | |
79 | * | |
80 | * <h2>Configuration:</h2> | |
81 | * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting --> | |
82 | * \li No configuration arguments | |
83 | * | |
84 | * <h2>Default CDB entries:</h2> | |
85 | * \li No CDB entry yet, will come. | |
86 | * | |
87 | * <h2>Performance:</h2> | |
88 | * Pretty good (~ 3 kHz), depends on amount of data... | |
89 | * | |
90 | * <h2>Memory consumption:</h2> | |
91 | * Depends on the amount of data, but pretty godd | |
92 | * | |
93 | * <h2>Output size:</h2> | |
94 | * Depends on the amount of data... | |
95 | * | |
96 | * More detailed description. (Soon) | |
97 | * | |
98 | * @ingroup alihlt_phos | |
99 | */ | |
100 | ||
101 | ||
102 | class AliHLTPHOSRawAnalyzerComponentv3 : public AliHLTPHOSRcuProcessor | |
103 | { | |
104 | public: | |
105 | ||
106 | /** Standard constructor */ | |
107 | AliHLTPHOSRawAnalyzerComponentv3(); | |
108 | ||
109 | /** Destructor */ | |
110 | virtual ~AliHLTPHOSRawAnalyzerComponentv3(); | |
111 | ||
112 | /** interface function, see @ref AliHLTComponent for description */ | |
113 | virtual int DoInit(int argc =0, const char** argv = 0); | |
114 | ||
115 | /** interface function, see @ref AliHLTComponent for description */ | |
116 | virtual int Deinit(); | |
117 | ||
118 | /** interface function, see @ref AliHLTComponent for description */ | |
119 | virtual const char* GetComponentID() = 0; | |
120 | ||
121 | /** interface function, see @ref AliHLTComponent for description */ | |
122 | virtual void GetInputDataTypes( vector <AliHLTComponentDataType>& list); | |
123 | ||
124 | /** interface function, see @ref AliHLTComponent for description */ | |
125 | virtual AliHLTComponentDataType GetOutputDataType(); | |
126 | ||
127 | /** interface function, see @ref AliHLTComponent for description */ | |
128 | virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier); | |
129 | ||
130 | /** interface function, see @ref AliHLTComponent for description */ | |
131 | virtual AliHLTComponent* Spawn() = 0; | |
132 | ||
133 | protected: | |
134 | ||
135 | /** interface function, see @ref AliHLTComponent for description */ | |
136 | using AliHLTPHOSRcuProcessor::DoEvent; | |
137 | ||
138 | /** interface function, see @ref AliHLTComponent for description */ | |
139 | virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, | |
140 | AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, | |
141 | AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks ); | |
142 | ||
143 | /** | |
144 | * Do the real processing in the component | |
145 | * @param iter is the pointer to the data blocks | |
146 | * @param outputPtr is the pointer to the output buffer | |
147 | * @param size is the available size for output | |
148 | * @param totSize is the total size used for output | |
149 | * @return the size output size used | |
150 | */ | |
151 | virtual Int_t DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize); | |
152 | ||
153 | ||
154 | /** Pointer to an analyzer object used for raw data anlysis */ | |
155 | AliHLTPHOSRawAnalyzer *fAnalyzerPtr; //COMMENT | |
156 | ||
157 | private: | |
158 | ||
37ff2dd6 | 159 | int WriteRawData( AliHLTPHOSChannelDataStruct *dtaPtr ); |
160 | ||
87434909 | 161 | /** Keep the copy constructor private since it should not be used */ |
162 | AliHLTPHOSRawAnalyzerComponentv3(const AliHLTPHOSRawAnalyzerComponentv3 & ); | |
163 | ||
164 | /** Keep the assignement operator private since it should not be used */ | |
165 | AliHLTPHOSRawAnalyzerComponentv3 & operator = (const AliHLTPHOSRawAnalyzerComponentv3 &); | |
166 | ||
167 | /** Mapping from harware address to geometrical address */ | |
168 | AliHLTPHOSMapper *fMapperPtr; //!transient | |
169 | ||
170 | /** Pointer to object which may check the integrity of the data */ | |
171 | AliHLTPHOSSanityInspector *fSanityInspectorPtr; //!transient | |
172 | ||
173 | /** Pointer to the raw data reader which reads from memory */ | |
174 | AliRawReaderMemory* fRawReaderMemoryPtr; //!transient | |
175 | ||
176 | /** Pointer to the raw stream */ | |
177 | AliAltroRawStreamV3* fAltroRawStreamPtr; //!transient | |
178 | ||
179 | /** Describing which algorithm we are using */ | |
180 | Short_t fAlgorithm; //COMMENT | |
181 | ||
182 | /** The offset applied before ZS */ | |
183 | Int_t fOffset; //COMMENT | |
184 | ||
185 | /** The minimum length a bunch can have to be considered */ | |
186 | Int_t fBunchSizeCut; //COMMENT | |
187 | ||
188 | /** The lowest position a peak can have to be considered */ | |
189 | Int_t fMinPeakPosition; //COMMENT | |
190 | ||
191 | /** The maximum position a peak can have to be considered */ | |
192 | Int_t fMaxPeakPosition; //COMMENT | |
193 | ||
37ff2dd6 | 194 | |
195 | const bool fkDoPushRawData; | |
196 | ||
197 | // const UShort_t* fRawDataBuffer; | |
198 | // RawDataWriter *fRawDataWriter; | |
199 | ||
200 | // class RawDataWriter : public AliHLTLogging | |
201 | ||
202 | class RawDataWriter | |
203 | { | |
204 | public: | |
205 | RawDataWriter(); | |
206 | ~RawDataWriter(); | |
207 | // void WriteChannelId(const UShort_t channeldid ); | |
208 | void NewChannel( ); | |
209 | void WriteBunchData(const UShort_t *bunchdata, const int length, const UInt_t starttimebin ); | |
210 | void ResetBuffer(); | |
211 | void SetChannelId( const UShort_t channeldid ); | |
212 | ||
213 | //void CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused ); | |
214 | int CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused ); | |
215 | ||
216 | void NewEvent(); | |
217 | ||
218 | private: | |
219 | RawDataWriter (const RawDataWriter & ); | |
220 | RawDataWriter & operator = (const RawDataWriter &); | |
221 | ||
222 | void Init(); | |
223 | ||
224 | // bool fIsFirstChannel; | |
225 | UShort_t* fRawDataBuffer; | |
226 | int fCurrentChannelSize; | |
227 | int fBufferIndex; | |
228 | int fBufferSize; | |
229 | UShort_t *fCurrentChannelIdPtr; | |
230 | UShort_t *fCurrentChannelSizePtr; | |
231 | UShort_t *fCurrentChannelDataPtr; | |
232 | int fTotalSize; | |
233 | }; | |
234 | ||
235 | RawDataWriter *fRawDataWriter; | |
236 | ||
87434909 | 237 | }; |
238 | ||
239 | #endif | |
240 |