]>
Commit | Line | Data |
---|---|---|
571dda3d | 1 | #ifndef ALITOFRAWSTREAM_H |
2 | #define ALITOFRAWSTREAM_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
0e46b9ae | 8 | /////////////////////////////////////////////////////////////// |
9 | // // | |
10 | // This class provides the key-reading for TOF raw data. // | |
11 | // // | |
12 | /////////////////////////////////////////////////////////////// | |
571dda3d | 13 | |
0e46b9ae | 14 | #include "TObject.h" |
5c7c93fa | 15 | |
16 | //#include "AliTOFHitData.h" | |
7813bb1a | 17 | #include "AliTOFHitDataBuffer.h" |
18 | #include "AliTOFDecoder.h" | |
04bacbd9 | 19 | //#include "AliTOFCableLengthMap.h" |
571dda3d | 20 | |
5c7c93fa | 21 | class AliTOFHitData; |
15ec34b9 | 22 | |
7813bb1a | 23 | /********************************** |
24 | * OLD DEFINITIONS | |
25 | **********************************/ | |
26 | ||
27 | /****************************************** | |
28 | GENERAL DATA FORMAT | |
29 | ******************************************/ | |
30 | ||
31 | //filler | |
8af88ade | 32 | //#ifndef FILLER |
7813bb1a | 33 | #define FILLER 0x70000000 |
8af88ade | 34 | //#endif |
7813bb1a | 35 | |
36 | //word type mask/position | |
7813bb1a | 37 | #define WORD_TYPE_MASK 0xf0000000 |
7813bb1a | 38 | #define WORD_TYPE_POSITION 28 |
39 | ||
40 | //global header word required bit pattern | |
7813bb1a | 41 | #define GLOBAL_HEADER 0x40000000 |
7813bb1a | 42 | |
43 | //global trailer word required bit pattern | |
7813bb1a | 44 | #define GLOBAL_TRAILER 0x50000000 |
7813bb1a | 45 | |
46 | //error word required bit pattern | |
8af88ade | 47 | // already defined in AliTOFDecoder |
48 | //#define ERROR 0x30000000 | |
7813bb1a | 49 | |
50 | //header slot ID mask/position | |
51 | #define HEADER_SLOT_ID_MASK 0x0000000f | |
52 | #define HEADER_SLOT_ID_POSITION 0 | |
53 | ||
54 | //word types | |
55 | #define GLOBAL_HEADER_TYPE 4 | |
56 | #define GLOBAL_TRAILER_TYPE 5 | |
57 | #define ERROR_TYPE 6 | |
58 | #define FILLER_TYPE 7 | |
59 | #define TRM_CHAIN0_HEADER_TYPE 0 | |
60 | #define TRM_CHAIN0_TRAILER_TYPE 1 | |
61 | #define TRM_CHAIN1_HEADER_TYPE 2 | |
62 | #define TRM_CHAIN1_TRAILER_TYPE 3 | |
63 | ||
64 | //slot types | |
65 | #define DRM_ID_NUMBER 1 | |
66 | #define LTM_ID_NUMBER 2 | |
67 | ||
68 | ||
69 | /****************************************** | |
70 | DRM DATA FORMAT | |
71 | ******************************************/ | |
72 | ||
73 | //DRM global header word required bit pattern | |
74 | #define DRM_GLOBAL_HEADER 0x40000001 | |
75 | ||
76 | //DRM event words mask/position | |
77 | #define DRM_EVENT_WORDS_MASK 0x001ffff0 | |
78 | #define DRM_EVENT_WORDS_POSITION 4 | |
79 | ||
80 | //DRM DRM ID mask/position | |
81 | #define DRM_DRM_ID_MASK 0x0fe00000 | |
82 | #define DRM_DRM_ID_POSITION 21 | |
83 | ||
84 | //DRM status header 1 word required bit pattern | |
85 | #define DRM_STATUS_HEADER_1 0x40000001 | |
86 | ||
87 | //DRM slot ID mask/position | |
88 | #define DRM_SLOT_ID_MASK 0x00007ff0 | |
89 | #define DRM_SLOT_ID_POSITION 4 | |
90 | ||
91 | //DRM C-bit mask/position | |
92 | #define DRM_C_BIT_MASK 0x00008000 | |
93 | #define DRM_C_BIT_POSITION 15 | |
94 | ||
73620dbf | 95 | //DRM Vers-ID mask/position |
96 | #define DRM_VERS_ID_MASK 0x001f0000 | |
97 | #define DRM_VERS_ID_POSITION 16 | |
98 | ||
99 | //DRM DRM Header size mask/position | |
100 | #define DRM_HEADER_SIZE_MASK 0x01e00000 | |
101 | #define DRM_HEADER_SIZE_POSITION 21 | |
102 | ||
7813bb1a | 103 | //DRM status header 2 word required bit pattern |
104 | #define DRM_STATUS_HEADER_2 0x40000001 | |
105 | ||
106 | //DRM enable ID mask/position | |
107 | #define DRM_ENABLE_ID_MASK 0x00007ff0 | |
108 | #define DRM_ENABLE_ID_POSITION 4 | |
109 | ||
73620dbf | 110 | //DRM zero in word2 mask/position |
111 | #define DRM_ZERO_WORD2_MASK 0x00008000 | |
112 | #define DRM_ZERO_WORD2_POSITION 15 | |
113 | ||
7813bb1a | 114 | //DRM fault ID mask/position |
115 | #define DRM_FAULT_ID_MASK 0x07ff0000 | |
116 | #define DRM_FAULT_ID_POSITION 16 | |
117 | ||
73620dbf | 118 | //DRM RTO bit mask/position |
119 | #define DRM_RTO_BIT_MASK 0x08000000 | |
120 | #define DRM_RTO_BIT_POSITION 27 | |
121 | ||
7813bb1a | 122 | //DRM status header 3 word required bit pattern |
123 | #define DRM_STATUS_HEADER_3 0x40000001 | |
124 | ||
73620dbf | 125 | //DRM L0 BCID mask/position |
126 | #define DRM_L0_BCID_MASK 0x0000fff0 | |
127 | #define DRM_L0_BCID_POSITION 4 | |
128 | ||
129 | //DRM Run Time Info mask/position | |
130 | #define DRM_RUNTIME_INFO_MASK 0x0fff0000 | |
131 | #define DRM_RUNTIME_INFO_POSITION 16 | |
132 | ||
133 | //DRM status header 4 word required bit pattern | |
134 | #define DRM_STATUS_HEADER_4 0x40000001 | |
135 | ||
136 | //DRM Temperature mask/position | |
137 | #define DRM_TEMPERATURE_MASK 0x00003ff0 | |
138 | #define DRM_TEMPERATURE_POSITION 4 | |
139 | ||
140 | //DRM 1st zero in word4 mask/position | |
141 | #define DRM_ZERO_1_WORD4_MASK 0x00004000 | |
142 | #define DRM_ZERO_1_WORD4_POSITION 14 | |
143 | ||
144 | //DRM ACK mask/position | |
145 | #define DRM_ACK_MASK 0x00008000 | |
146 | #define DRM_ACK_POSITION 15 | |
147 | ||
148 | //DRM Sens AD mask/position | |
149 | #define DRM_SENS_AD_MASK 0x00070000 | |
150 | #define DRM_SENS_AD_POSITION 16 | |
151 | ||
152 | //DRM 2nd zero in word4 mask/position | |
153 | #define DRM_ZERO_2_WORD4_MASK 0x00080000 | |
154 | #define DRM_ZERO_2_WORD4_POSITION 19 | |
7813bb1a | 155 | |
156 | //DRM event CRC mask/position | |
7813bb1a | 157 | #define DRM_EVENT_CRC_MASK 0x000ffff0 |
158 | #define DRM_EVENT_CRC_POSITION 4 | |
159 | ||
160 | //DRM global trailer word required bit pattern | |
161 | #define DRM_GLOBAL_TRAILER 0x50000001 | |
162 | ||
163 | //DRM local event counter mask/position | |
164 | #define DRM_LOCAL_EVENT_COUNTER_MASK 0x0000fff0 | |
165 | #define DRM_LOCAL_EVENT_COUNTER_POSITION 4 | |
166 | ||
167 | ||
168 | /****************************************** | |
169 | TRM DATA FORMAT | |
170 | ******************************************/ | |
171 | ||
172 | //TRM global header word required bit pattern | |
173 | #define TRM_GLOBAL_HEADER 0x40000000 | |
174 | ||
175 | //TRM slot ID mask/position | |
176 | #define TRM_SLOT_ID_MASK 0x0000000f | |
177 | #define TRM_SLOT_ID_POSITION 0 | |
178 | ||
179 | //TRM event words mask/position | |
180 | #define TRM_EVENT_WORDS_MASK 0x0001fff0 | |
181 | #define TRM_EVENT_WORDS_POSITION 4 | |
182 | ||
183 | //TRM ACQ-bits mask/position | |
184 | #define TRM_ACQ_BITS_MASK 0x00060000 | |
185 | #define TRM_ACQ_BITS_POSITION 17 | |
186 | ||
187 | //TRM L-bit mask/position | |
188 | #define TRM_L_BIT_MASK 0x00080000 | |
189 | #define TRM_L_BIT_POSITION 19 | |
190 | ||
191 | //TRM chain-0 header word required bit pattern | |
192 | #define TRM_CHAIN_0_HEADER 0x00000000 | |
193 | ||
194 | //TRM chain-1 header word required bit pattern | |
195 | #define TRM_CHAIN_1_HEADER 0x20000000 | |
196 | ||
197 | //TRM bunch ID mask/position | |
198 | #define TRM_BUNCH_ID_MASK 0x0000fff0 | |
199 | #define TRM_BUNCH_ID_POSITION 4 | |
200 | ||
201 | //TRM PB24 temp mask/position | |
202 | #define TRM_PB24_TEMP_MASK 0x00ff0000 | |
203 | #define TRM_PB24_TEMP_POSITION 16 | |
204 | ||
205 | //TRM PB24 ID mask/position | |
206 | #define TRM_PB24_ID_MASK 0x07000000 | |
207 | #define TRM_PB24_ID_POSITION 24 | |
208 | ||
209 | //TRM TS-bit mask/position | |
210 | #define TRM_TS_BIT_MASK 0x08000000 | |
211 | #define TRM_TS_BIT_POSITION 27 | |
212 | ||
213 | //TRM chain-0 trailer word required bit pattern | |
214 | #define TRM_CHAIN_0_TRAILER 0x10000000 | |
215 | ||
216 | //TRM chain-1 trailer word required bit pattern | |
217 | #define TRM_CHAIN_1_TRAILER 0x30000000 | |
218 | ||
219 | //TRM status mask/position | |
220 | #define TRM_STATUS_MASK 0x0000000f | |
221 | #define TRM_STATUS_POSITION 0 | |
222 | ||
223 | ||
224 | //TDC digit | |
225 | ||
226 | //TRM TDC digit word required bit pattern | |
227 | #define TRM_TDC_DIGIT 0x8000000 | |
228 | ||
229 | //TRM digit time mask/position | |
230 | #define TRM_DIGIT_TIME_MASK 0x00001fff | |
231 | #define TRM_DIGIT_TIME_POSITION 0 | |
232 | ||
233 | //TRM long digit time mask/position | |
234 | #define TRM_LONG_DIGIT_TIME_MASK 0x001fffff | |
235 | #define TRM_LONG_DIGIT_TIME_POSITION 0 | |
236 | ||
237 | //TRM TOT width mask/position | |
238 | #define TRM_TOT_WIDTH_MASK 0x001fe000 | |
239 | #define TRM_TOT_WIDTH_POSITION 13 | |
240 | ||
241 | //TRM chan mask/position | |
242 | #define TRM_CHAN_MASK 0x00e00000 | |
243 | #define TRM_CHAN_POSITION 21 | |
244 | ||
245 | //TRM TDC ID mask/position | |
246 | #define TRM_TDC_ID_MASK 0x0f000000 | |
247 | #define TRM_TDC_ID_POSITION 24 | |
248 | ||
249 | //TRM E-bit mask/position | |
250 | #define TRM_E_BIT_MASK 0x10000000 | |
251 | #define TRM_E_BIT_POSITION 28 | |
252 | ||
253 | //TRM PS-bits mask/position | |
254 | #define TRM_PS_BITS_MASK 0x60000000 | |
255 | #define TRM_PS_BITS_POSITION 29 | |
256 | ||
257 | #define TRM_FIRST_SLOT_ID 3 | |
258 | ||
259 | //define hptdc time bin width | |
7813bb1a | 260 | #define TIME_BIN_WIDTH 24.4e-3 //ns |
7813bb1a | 261 | |
262 | //define hptdc tot bin width | |
8af88ade | 263 | // already defined in AliTOFDecoder |
264 | //#define TOT_BIN_WIDTH 48.4e-3 //ns | |
7813bb1a | 265 | |
266 | //TRM errors | |
267 | ||
268 | //TRM TDC error word required bit pattern | |
269 | #define TRM_TDC_ERROR 0x6000000 | |
270 | ||
271 | //TRM TDC diagnostic error word required bit pattern | |
272 | #define TRM_TDC_DIAGNOSTIC_ERROR 0x6f00000 | |
273 | ||
274 | //TRM TDC error flags mask/position | |
275 | #define TRM_TDC_ERROR_FLAGS_MASK 0x00007fff | |
276 | #define TRM_TDC_ERROR_FLAGS_POSITION 0 | |
277 | ||
278 | //TRM TDC error TDC ID mask/position | |
279 | #define TRM_TDC_ERROR_TDC_ID_MASK 0x0f00000 | |
280 | #define TRM_TDC_ERROR_TDC_ID_POSITION 24 | |
281 | ||
282 | //TRM TDC fault chip flag ID mask/position | |
283 | #define TRM_TDC_ERROR_FAULT_CHIP_FLAG_ID_MASK 0x00007fff | |
284 | #define TRM_TDC_ERROR_FAULT_CHIP_FLAG_ID_POSITION 0 | |
285 | ||
286 | //TRM TDC error C-bit mask/position | |
287 | #define TRM_TDC_ERROR_C_BIT_MASK 0x00008000 | |
288 | #define TRM_TDC_ERROR_C_BIT_POSITION 15 | |
289 | ||
290 | //TRM TDC JTAG error code mask/position | |
291 | #define TRM_TDC_ERROR_JTAG_ERROR_CODE_MASK 0x000007ff | |
292 | #define TRM_TDC_ERROR_JTAG_ERROR_CODE_POSITION 0 | |
293 | ||
294 | //TRM TDC disgnostic error TDC ID mask/position | |
295 | #define TRM_TDC_DIAGNOSTIC_ERROR_TDC_ID_MASK 0x00007800 | |
296 | #define TRM_TDC_DIAGNOSTIC_ERROR_TDC_ID_POSITION 11 | |
297 | ||
298 | //TRM global trailer word required bit pattern | |
299 | //#define TRM_GLOBAL_TRAILER 0x50000000 | |
300 | #define TRM_GLOBAL_TRAILER 0x5000000f | |
301 | ||
302 | //TRM event CRC mask/position | |
303 | #define TRM_EVENT_CRC_MASK 0x0000fff0 | |
304 | #define TRM_EVENT_CRC_POSITION 4 | |
305 | ||
306 | //TRM event counter mask/position | |
307 | #define TRM_EVENT_COUNTER_MASK 0x0fff0000 | |
308 | #define TRM_EVENT_COUNTER_POSITION 16 | |
309 | ||
310 | ||
311 | /****************************************** | |
312 | LTM DATA FORMAT | |
313 | ******************************************/ | |
314 | ||
315 | //LTM global header word required bit pattern | |
316 | #define LTM_GLOBAL_HEADER 0x40000002 | |
317 | ||
318 | //LTM event words mask/position | |
319 | #define LTM_EVENT_WORDS_MASK 0x0001fff0 | |
320 | #define LTM_EVENT_WORDS_POSITION 4 | |
321 | ||
322 | //LTM C-bit mask/position | |
323 | #define LTM_C_BIT_MASK 0x00020000 | |
324 | #define LTM_C_BIT_POSITION 17 | |
325 | ||
326 | //LTM fault mask/position | |
327 | #define LTM_FAULT_MASK 0x00fc0000 | |
328 | #define LTM_FAULT_POSITION 18 | |
329 | ||
330 | //PDL data | |
331 | ||
332 | //PDL value 1 mask/position | |
333 | #define LTM_PDL_VALUE_1_MASK 0x000000ff | |
334 | #define LTM_PDL_VALUE_1_POSITION 0 | |
335 | ||
336 | //PDL value 2 mask/position | |
337 | #define LTM_PDL_VALUE_2_MASK 0x0000ff00 | |
338 | #define LTM_PDL_VALUE_2_POSITION 8 | |
339 | ||
340 | //PDL value 3 mask/position | |
341 | #define LTM_PDL_VALUE_3_MASK 0x00ff0000 | |
342 | #define LTM_PDL_VALUE_3_POSITION 16 | |
343 | ||
344 | //PDL value 4 mask/position | |
345 | #define LTM_PDL_VALUE_4_MASK 0xff000000 | |
346 | #define LTM_PDL_VALUE_4_POSITION 24 | |
347 | ||
348 | //ADC data | |
349 | ||
350 | //ADC value 1 mask/position | |
351 | #define LTM_ADC_VALUE_1_MASK 0x000003ff | |
352 | #define LTM_ADC_VALUE_1_POSITION 0 | |
353 | ||
354 | //ADC value 2 mask/position | |
355 | #define LTM_ADC_VALUE_2_MASK 0x000ffc00 | |
356 | #define LTM_ADC_VALUE_2_POSITION 10 | |
357 | ||
358 | //ADC value 3 mask/position | |
359 | #define LTM_ADC_VALUE_3_MASK 0x3ff00000 | |
360 | #define LTM_ADC_VALUE_3_POSITION 20 | |
361 | ||
362 | //LTM global trailer word required bit pattern | |
363 | #define LTM_GLOBAL_TRAILER 0x50000002 | |
364 | ||
365 | //LTM event CRC mask/position | |
366 | #define LTM_EVENT_CRC_MASK 0x0000fff0 | |
367 | #define LTM_EVENT_CRC_POSITION 4 | |
368 | ||
369 | //LTM event number mask/position | |
370 | #define LTM_EVENT_NUMBER_MASK 0x0fff0000 | |
371 | #define LTM_EVENT_NUMBER_POSITION 16 | |
372 | ||
373 | /****************************************** | |
374 | * END OF OLD DEFINITIONS | |
375 | ******************************************/ | |
376 | ||
377 | class TClonesArray; | |
571dda3d | 378 | class AliRawReader; |
15ec34b9 | 379 | class AliTOFrawData; |
571dda3d | 380 | |
571dda3d | 381 | class AliTOFRawStream: public TObject { |
d0eb8f39 | 382 | public: |
571dda3d | 383 | |
d0eb8f39 | 384 | AliTOFRawStream(); // default ctr |
385 | AliTOFRawStream(AliRawReader* rawReader); // ctr | |
386 | virtual ~AliTOFRawStream(); // default dtr | |
571dda3d | 387 | |
e07d7cf9 | 388 | AliTOFRawStream(const AliTOFRawStream& stream); // copy ctr |
389 | AliTOFRawStream& operator = (const AliTOFRawStream& stream); // ass. op. | |
390 | ||
15ec34b9 | 391 | virtual Bool_t Next(); |
571dda3d | 392 | |
15ec34b9 | 393 | virtual void LoadRawData(Int_t indexDDL); |
394 | ||
d0eb8f39 | 395 | Int_t GetDDL() const {return fDDL;}; |
396 | Int_t GetTRM() const {return fTRM;}; | |
397 | Int_t GetTDC() const {return fTDC;}; | |
398 | Int_t GetTRMchain() const {return fTRMchain;}; | |
399 | Int_t GetTDCchannel() const {return fTDCchannel;}; | |
571dda3d | 400 | |
d0eb8f39 | 401 | Int_t GetSector() const {return fSector;}; |
402 | Int_t GetPlate() const {return fPlate;}; | |
403 | Int_t GetStrip() const {return fStrip;}; | |
404 | Int_t GetPadZ() const {return fPadZ;}; | |
405 | Int_t GetPadX() const {return fPadX;}; | |
571dda3d | 406 | |
7813bb1a | 407 | Int_t GetTofBin() const {return fTime;}; |
408 | Int_t GetToTbin() const {return fToT;}; | |
15ec34b9 | 409 | Float_t GetLeadingEdge() const {return fLeadingEdge;}; |
410 | Float_t GetTrailingEdge() const {return fTrailingEdge;}; | |
411 | ||
412 | Int_t GetPSbit() const {return fPSbit;}; | |
413 | Int_t GetACQ() const {return fACQ;}; | |
571dda3d | 414 | |
15ec34b9 | 415 | Int_t GetErrorFlag() const {return fErrorFlag;}; |
416 | ||
f472295e | 417 | Bool_t GetDecoderVersion() const {return fNewDecoderVersion;}; |
418 | ||
d0eb8f39 | 419 | void SetDDL(Int_t nDDL) {fDDL = nDDL;}; |
420 | void SetTRM(Int_t nTRM) {fTRM = nTRM;}; | |
421 | void SetTDC(Int_t nTDC) {fTDC = nTDC;}; | |
422 | void SetTRMchain(Int_t nChain) {fTRMchain = nChain;}; | |
423 | void SetTDCchannel(Int_t nChannel) {fTDCchannel = nChannel;}; | |
424 | ||
f472295e | 425 | void SetDecoderVersion(Bool_t version) {fNewDecoderVersion = version;}; |
426 | ||
15ec34b9 | 427 | TClonesArray *GetRawData() const {return fTOFrawData;}; |
428 | ||
d0eb8f39 | 429 | void SetSector(); |
430 | void SetPlate(); | |
431 | void SetStrip(); | |
432 | void SetPadZ(); | |
433 | void SetPadX(); | |
7813bb1a | 434 | |
ca6d7f17 | 435 | Bool_t GetBCCorrections() {return fgApplyBCCorrections;}; // getter for the BC application switch |
436 | Int_t GetDDLBCshift(Int_t ddl) {return fgkddlBCshift[ddl];}; // getter for the DDL BC shift | |
437 | Int_t GetLocalEventCounterDRM() {return fLocalEventCounterDRM;}; // getter for the DRM event counter | |
438 | Int_t GetLocalEventCounterLTM() {return fLocalEventCounterLTM;}; // getter for the LTM event counter | |
439 | Int_t GetLocalEventCounterTRM(Int_t trm) {return fLocalEventCounterTRM[trm];}; // getter for the TRM event counter | |
440 | Int_t GetLocalEventCounterChain(Int_t trm, Int_t chain) {return fLocalEventCounterChain[trm][chain];}; // getter for the chain event counter | |
441 | Int_t GetChainBunchID(Int_t trm, Int_t chain) {return fChainBunchID[trm][chain];}; // getter for the chain BC ID | |
38f24f3f | 442 | |
f472295e | 443 | |
444 | void Raw2Digits(AliRawReader* rawReader, TClonesArray* digitsArray); | |
445 | void Raw2SDigits(AliRawReader* rawReader, TClonesArray* sdigitsArray); | |
446 | ||
a9137e31 | 447 | static void EquipmentId2VolumeId(Int_t nDDL, Int_t nTRM, Int_t iChain, |
448 | Int_t iTDC, Int_t iCH, Int_t *volume); | |
7813bb1a | 449 | void EquipmentId2VolumeId(AliTOFHitData *hitData, Int_t *volume) const; |
13d6bff9 | 450 | static Int_t Equip2VolNplate(Int_t iDDL, Int_t nTRM, Int_t nTDC); |
451 | static Int_t Equip2VolNstrip(Int_t iDDL, Int_t nTRM, Int_t nTDC); | |
452 | static Int_t Equip2VolNpad(Int_t iDDL, Int_t iChain, Int_t nTDC, Int_t iCH); | |
38f24f3f | 453 | static Int_t Equip2VolNpadX(Int_t iDDL, Int_t iChain, Int_t nTDC, Int_t iCH); |
454 | static Int_t Equip2VolNpadZ(Int_t iDDL, Int_t iChain, Int_t nTDC, Int_t iCH); | |
5f72a2bf | 455 | static Int_t GetDDLnumberPerSector(Int_t nDDL); |
456 | static Int_t GetSectorNumber(Int_t nDDL); | |
457 | ||
458 | static Int_t Geant2DDL(Int_t vol[]); | |
459 | static Int_t Geant2TRM(Int_t vol[]); | |
460 | static Int_t Geant2TDC(Int_t vol[]); | |
461 | static Int_t Geant2Chain(Int_t vol[]); | |
462 | static Int_t Geant2Channel(Int_t vol[]); | |
463 | static void Geant2EquipmentId(Int_t vol[], Int_t eqId[]); | |
d0eb8f39 | 464 | |
7813bb1a | 465 | Bool_t DecodeDDL(Int_t DDLMin, Int_t DDLMax, Int_t verbose); |
2fd622fa | 466 | Bool_t Decode(Int_t verbose); |
467 | AliTOFDecoder *GetDecoder() {return fDecoder;}; | |
468 | void SetV2718Patch(Bool_t V2718Patch = kTRUE) {fDecoder->SetV2718Patch(V2718Patch);}; | |
469 | ||
e1d95075 | 470 | void SetRawReader(AliRawReader *rawReader) {fRawReader=rawReader;}; |
d0eb8f39 | 471 | |
e1d95075 | 472 | AliTOFHitDataBuffer GetDataBuffer(Int_t DDL) {return fDataBuffer[DDL];}; |
473 | AliTOFHitDataBuffer GetPackedDataBuffer(Int_t DDL) {return fPackedDataBuffer[DDL];}; | |
7813bb1a | 474 | |
d35d0ea0 | 475 | void ResetDataBuffer(Int_t DDL) {fDataBuffer[DDL].Reset();}; |
476 | void ResetPackedDataBuffer(Int_t DDL) {fPackedDataBuffer[DDL].Reset();}; | |
7813bb1a | 477 | |
478 | void ResetBuffers(); | |
d0eb8f39 | 479 | |
7813bb1a | 480 | Bool_t LoadRawDataBuffers(Int_t indexDDL, Int_t verbose = 0); |
dd824655 | 481 | static void ApplyBCCorrections(Bool_t Value = kTRUE) {fgApplyBCCorrections = Value;}; |
7813bb1a | 482 | |
ca6d7f17 | 483 | Int_t GetEventID() const {return fEventID;}; // getter for the eventID1 (bunch crossing) in the common data header |
484 | ||
019f6101 | 485 | enum ETOFRawStreamError { |
486 | kPadXError = 0, | |
487 | kPadAlongStripError = 1, | |
488 | kPlateError = 2, | |
489 | kStripError = 3, | |
490 | kSectorError = 4, | |
491 | kDDLMinError = 5, | |
492 | kDDLMaxError = 6, | |
493 | kDDLdataReading = 7, | |
494 | kDDLDecoder = 8 | |
495 | }; | |
496 | ||
7813bb1a | 497 | private: |
498 | ||
499 | Int_t GetField(UInt_t word, Int_t fieldMask, Int_t fieldPosition) const; | |
500 | ||
d0eb8f39 | 501 | AliRawReader* fRawReader; // object for reading the raw data |
502 | ||
15ec34b9 | 503 | TClonesArray *fTOFrawData; // pointer to AliTOFrawData TClonesArray |
504 | ||
7813bb1a | 505 | AliTOFDecoder *fDecoder; //pointer to TOF decoder |
506 | ||
15ec34b9 | 507 | Int_t fDDL; // DDL file number [0;71] |
508 | Int_t fTRM; // TRM number [1;12] | |
509 | Int_t fTRMchain; // TRM chain number [0;1] | |
510 | Int_t fTDC; // TDC number [0;14] | |
511 | Int_t fTDCchannel; // TDC channel number [0;7] | |
7813bb1a | 512 | Int_t fTime; // time-of-flight measurement [0;8191] |
513 | Int_t fToT; // time-over-threshould measurement [0;255] | |
bf33f8f0 | 514 | Int_t fLeadingEdge; // leading edge measurement |
515 | Int_t fTrailingEdge; // trailing edge measurement | |
15ec34b9 | 516 | Int_t fErrorFlag; // error flag |
d0eb8f39 | 517 | |
518 | Int_t fSector; // sector number [0;17] | |
519 | Int_t fPlate; // plate number [0;4] | |
520 | Int_t fStrip; // strip number [0;14/18] | |
521 | Int_t fPadX; // pad number along the strip [0;47] | |
522 | Int_t fPadZ; // pad-row number [0;1] | |
523 | ||
15ec34b9 | 524 | Int_t fPackedDigits; // counter for packed digits |
525 | ||
d0eb8f39 | 526 | Int_t fWordType; // word type |
527 | Int_t fSlotID; // crate slot ID number | |
7813bb1a | 528 | Int_t fACQ; // flag to identif the aquisition kind |
d0eb8f39 | 529 | Int_t fPSbit; // flag for packing |
d0eb8f39 | 530 | Int_t fTDCerrorFlag; // TDC error flag |
531 | Bool_t fInsideDRM; // inside/outside DRM | |
532 | Bool_t fInsideTRM; // inside/outside TRM | |
533 | Bool_t fInsideLTM; // inside/outside LTM | |
534 | Bool_t fInsideTRMchain0; // inside/outside chain 0 | |
535 | Bool_t fInsideTRMchain1; // inside/outside chain 1 | |
571dda3d | 536 | |
d35d0ea0 | 537 | AliTOFHitDataBuffer fDataBuffer[72]; // AliTOFHitDataBuffer |
538 | AliTOFHitDataBuffer fPackedDataBuffer[72]; // AliTOFHitDataBuffer | |
7813bb1a | 539 | |
e1d95075 | 540 | Int_t fLocalEventCounterDRM; // event counter recorded in the DRM global trailer |
541 | Int_t fLocalEventCounterLTM; // event counter recorded in the LTM global trailer | |
542 | Int_t fLocalEventCounterTRM[13]; // event counter recorded in the TRMs global trailer | |
543 | Int_t fLocalEventCounterChain[13][2]; // event counter recorded in the chains trailer | |
544 | Int_t fChainBunchID[13][2]; // BC ID recorded in the chains header | |
38f24f3f | 545 | |
04bacbd9 | 546 | //AliTOFCableLengthMap * fCableLengthMap; // Pointer to the map of Amphenol cable length |
32ead898 | 547 | |
ca6d7f17 | 548 | Int_t fEventID; // event ID1 in the common data header |
32ead898 | 549 | |
f472295e | 550 | Bool_t fNewDecoderVersion; // setting whether to use the new decoder version |
551 | // -true -> new version | |
552 | // -false ->old version (default value!!) | |
553 | ||
ca6d7f17 | 554 | static const Int_t fgkddlBCshift[72]; // DDL BC shifts |
555 | static Bool_t fgApplyBCCorrections; // switch to choose if apply or not the BC shift corrections | |
32ead898 | 556 | |
96f01799 | 557 | ClassDef(AliTOFRawStream, 3) // class for reading TOF raw digits |
571dda3d | 558 | }; |
559 | ||
560 | #endif |