]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDrawFastStream.h
- put baseline subtraction into the clusterizer and remove all other
[u/mrichter/AliRoot.git] / TRD / AliTRDrawFastStream.h
CommitLineData
615f0826 1#ifndef ALITRDRAWHLTSTREAM_H\r\r
2#define ALITRDRAWHLTSTREAM_H\r\r
3\r\r
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r\r
5 * See cxx source for full Copyright notice */\r\r
6\r\r
7/* $Id: AliTRDrawFastStream.h 27696 2008-07-31 09:18:53Z cblume $ */\r\r
8\r\r
9/////////////////////////////////////////////////////////////////////////////////\r\r
10// //\r\r
11// This class provides access to TRD digits in raw data in a way of streaming. //\r\r
12// //\r\r
13/////////////////////////////////////////////////////////////////////////////////\r\r
14\r\r
15#include "TObject.h"\r\r
16#include "TString.h"\r\r
17#include "AliTRDrawStreamBase.h"\r\r
18#include "AliTRDarrayADC.h"\r\r
19#include "AliTRDarrayDictionary.h"\r\r
20#include "AliTRDSignalIndex.h"\r\r
21\r\r
22class AliTRDgeometry;\r\r
23class AliRawReader;\r\r
24class AliTRDdigitsManager;\r\r
25class TTreeSRedirector;\r\r
26class AliTRDfeeParam;\r\r
27\r\r
28\r\r
29class AliTRDrawFastStream : public AliTRDrawStreamBase\r\r
30{ // class def begin\r\r
31\r\r
32 public:\r\r
33 \r\r
34 //--------------------------------------------------------\r\r
35 // THE STRUCTURES\r\r
36 //--------------------------------------------------------\r\r
37\r\r
38 struct AliTRDrawMCM\r\r
39 { // mcm struct\r\r
40 Int_t fROB; // ROB number\r\r
41 Int_t fMCM; // MCM number\r\r
42 Int_t fROW; // row number filed during decoding\r\r
43 \r\r
44 UInt_t fEvCounter; // MCM event counter\r\r
45 UInt_t fADCMask; // ADC mask\r\r
46 UInt_t fADCMaskWord; // word with ADC mask in\r\r
47 UInt_t fADCchannel[TRDMAXADC]; // channels to be decoded accrording to ADC mask\r\r
48 \r\r
49 Int_t fADCmax; // number of ADCs fired\r\r
50 Int_t fADCcount; // number of ADCs fired from double checking bit\r\r
51 Int_t fMCMADCWords; // mcm words to expect\r\r
52 Int_t fSingleADCwords; // n of words per ADC\r\r
53 \r\r
54 Int_t fMCMhdCorrupted; // is mcm header corrupted\r\r
55 Int_t fADCmaskCorrupted; // is mcm adc mask corrupted\r\r
56 Bool_t fDataCorrupted; // true if the corruption is in ADC data level \r\r
57 \r\r
58 UInt_t *fPos; //! position of mcm header in the buffer\r\r
59 UInt_t *fAdcDataPos; //! start of ADC data for this mcm\r\r
60\r\r
61 Int_t fADCcounter; // count the adcs decoded\r\r
62 \r\r
63\r\r
64 AliTRDrawMCM()\r\r
65 : fROB(-1)\r\r
66 , fMCM(-1)\r\r
67 , fROW(-1)\r\r
68 , fEvCounter(0)\r\r
69 , fADCMask(0)\r\r
70 , fADCMaskWord(0)\r\r
71 , fADCchannel() \r\r
72 , fADCmax(0)\r\r
73 , fADCcount(0)\r\r
74 , fMCMADCWords(0) \r\r
75 , fSingleADCwords(0)\r\r
76 , fMCMhdCorrupted(0) \r\r
77 , fADCmaskCorrupted(0) \r\r
78 , fDataCorrupted(0) \r\r
79 , fPos(0)\r\r
80 , fAdcDataPos(0)\r\r
81 , fADCcounter(0)\r\r
82 {\r\r
83 // default constructor\r\r
84 };\r\r
85\r\r
86 AliTRDrawMCM(const AliTRDrawMCM & p):\r\r
87 fROB(p.fROB)\r\r
88 , fMCM(p.fMCM)\r\r
89 , fROW(p.fROW)\r\r
90 , fEvCounter(p.fEvCounter)\r\r
91 , fADCMask(p.fADCMask)\r\r
92 , fADCMaskWord(p.fADCMaskWord)\r\r
93 , fADCchannel() \r\r
94 , fADCmax(p.fADCmax)\r\r
95 , fADCcount(p.fADCcount)\r\r
96 , fMCMADCWords(p.fMCMADCWords) \r\r
97 , fSingleADCwords(p.fSingleADCwords)\r\r
98 , fMCMhdCorrupted(p.fMCMhdCorrupted) \r\r
99 , fADCmaskCorrupted(p.fADCmaskCorrupted) \r\r
100 , fDataCorrupted(p.fDataCorrupted) \r\r
101 , fPos(p.fPos)\r\r
102 , fAdcDataPos(p.fAdcDataPos)\r\r
103 , fADCcounter(p.fADCcounter)\r\r
104 {\r\r
105 // copy constructor\r\r
106 };\r\r
107\r\r
108 AliTRDrawMCM &operator=(const AliTRDrawMCM &)\r\r
109 {\r\r
110 // assignment operator\r\r
111 // not implemented\r\r
112 return *this;\r\r
113 };\r\r
114\r\r
115 };\r\r
116\r\r
117 //--------------------------------------------------------\r\r
118\r\r
119 struct AliTRDrawHC\r\r
120 { // hc struct\r\r
121 \r\r
122 //tacklet words of given HC\r\r
123 UInt_t fTrackletWords[MAXTRACKLETSPERHC]; // array to keep tracklet words \r\r
124 Short_t fNTracklets; // number of tracklet \r\r
125\r\r
126 // header word 0\r\r
127 Int_t fSpecialRawV; // Raw data version\r\r
128 Int_t fRawVMajor; // Raw data version\r\r
129 Int_t fRawVMajorOpt; // Raw data version\r\r
130 Int_t fRawVMinor; // Raw data version\r\r
131 Int_t fNExtraWords; // N extra HC header words\r\r
132 Int_t fDCSboard; // DCS board number\r\r
133 Int_t fSM; // Super Module number\r\r
134 Int_t fSMHCheader; // Super Module number from HC header\r\r
135 Int_t fStack; // Stack number (some people might call it a chamber)\r\r
136 Int_t fStackHCheader; // Stack number from HC header(some people might call it a chamber)\r\r
137 Int_t fLayer; // Layer number (some people might call it a plane)\r\r
138 Int_t fLayerHCheader; // Layer number from HC header(some people might call it a plane)\r\r
139 Int_t fSide; // Side of HC\r\r
140 Int_t fSideHCheader; // Side of HC from HC header\r\r
141 \r\r
142 // header word 1\r\r
143 Int_t fTimeBins; // N of t bins\r\r
144 UInt_t fBunchCrossCounter; // Bunch crossing counter\r\r
145 UInt_t fPreTriggerCounter; // Pre Trigger counter\r\r
146 UInt_t fPreTriggerPhase; // Pre Trigger phase\r\r
147 \r\r
148 // error \r\r
149 UShort_t fErrorCodes[1411]; // array to keep encoded errors\r\r
150 UInt_t fNErrors; // number of total errors of given hc \r\r
151\r\r
152 Short_t fH0Corrupted; // is hc header 0 corrupted \r\r
153 Short_t fH1Corrupted; // is hc header 1 corrupted\r\r
154 Short_t fCorrupted; // is hc data corrupted \r\r
155 Bool_t fEOTECorrupted; // if the corruption is due to meet END_OF_TRACKLET_MARKERNEW\r\r
156 Bool_t fBufferCorrupted; // if the corruption is due to buffer end\r\r
157 Bool_t fDataCorrupted; // if the corruption is on the MCM data\r\r
158\r\r
159 Short_t fMCMCorrupted[TRDMAXMCM]; // is hc data corrupted \r\r
160\r\r
161 UInt_t *fPos[2]; //! position of the header words in buffer\r\r
162 \r\r
163 Int_t fDET; // filled while decoding\r\r
164 Int_t fROC; // filled while decoding\r\r
165 Int_t fRowMax; // filled while decoding\r\r
166 Int_t fColMax; // filled while decoding\r\r
167\r\r
168 // hc data\r\r
169 Int_t fMCMmax; // number of mcm found\r\r
170\r\r
171 AliTRDrawHC()\r\r
172 : fTrackletWords() \r\r
173 , fNTracklets(0)\r\r
174 , fSpecialRawV(0)\r\r
175 , fRawVMajor(0)\r\r
176 , fRawVMajorOpt(0)\r\r
177 , fRawVMinor(0)\r\r
178 , fNExtraWords(0)\r\r
179 , fDCSboard(-1)\r\r
180 , fSM(-1)\r\r
181 , fSMHCheader(-1)\r\r
182 , fStack(-1)\r\r
183 , fStackHCheader(-1)\r\r
184 , fLayer(-1)\r\r
185 , fLayerHCheader(-1)\r\r
186 , fSide(-1)\r\r
187 , fSideHCheader(-1)\r\r
188 , fTimeBins(0)\r\r
189 , fBunchCrossCounter(0)\r\r
190 , fPreTriggerCounter(0)\r\r
191 , fPreTriggerPhase(0)\r\r
192 , fNErrors(0)\r\r
193 , fH0Corrupted(0)\r\r
194 , fH1Corrupted(0)\r\r
195 , fCorrupted(0)\r\r
196 , fEOTECorrupted(0)\r\r
197 , fBufferCorrupted(0)\r\r
198 , fDataCorrupted(0)\r\r
199 , fPos()\r\r
200 , fDET(-1)\r\r
201 , fROC(-1)\r\r
202 , fRowMax(-1)\r\r
203 , fColMax(-1)\r\r
204 , fMCMmax(0)\r\r
205 {\r\r
206 // default constructor hc info \r\r
207 };\r\r
208\r\r
209 AliTRDrawHC(const AliTRDrawHC & p):\r\r
210 fTrackletWords() \r\r
211 , fNTracklets(p.fNTracklets)\r\r
212 , fSpecialRawV(p.fSpecialRawV)\r\r
213 , fRawVMajor(p.fRawVMajor)\r\r
214 , fRawVMajorOpt(p.fRawVMajorOpt)\r\r
215 , fRawVMinor(p.fRawVMinor)\r\r
216 , fNExtraWords(p.fNExtraWords)\r\r
217 , fDCSboard(p.fDCSboard)\r\r
218 , fSM(p.fSM)\r\r
219 , fSMHCheader(p.fSMHCheader)\r\r
220 , fStack(p.fStack)\r\r
221 , fStackHCheader(p.fStackHCheader)\r\r
222 , fLayer(p.fLayer)\r\r
223 , fLayerHCheader(p.fLayerHCheader)\r\r
224 , fSide(p.fSide)\r\r
225 , fSideHCheader(p.fSideHCheader)\r\r
226 , fTimeBins(p.fTimeBins)\r\r
227 , fBunchCrossCounter(p.fBunchCrossCounter)\r\r
228 , fPreTriggerCounter(p.fPreTriggerCounter)\r\r
229 , fPreTriggerPhase(p.fPreTriggerPhase)\r\r
230 , fNErrors(p.fNErrors)\r\r
231 , fH0Corrupted(p.fH0Corrupted)\r\r
232 , fH1Corrupted(p.fH1Corrupted)\r\r
233 , fCorrupted(p.fCorrupted)\r\r
234 , fEOTECorrupted(p.fEOTECorrupted)\r\r
235 , fBufferCorrupted(p.fBufferCorrupted)\r\r
236 , fDataCorrupted(p.fDataCorrupted)\r\r
237 , fPos()\r\r
238 , fDET(p.fDET)\r\r
239 , fROC(p.fROC)\r\r
240 , fRowMax(p.fRowMax)\r\r
241 , fColMax(p.fColMax)\r\r
242 , fMCMmax(p.fMCMmax)\r\r
243 {\r\r
244 // copy constructor\r\r
245 };\r\r
246\r\r
247 AliTRDrawHC &operator=(const AliTRDrawHC &)\r\r
248 {\r\r
249 // assignment operator\r\r
250 // not implemented\r\r
251 return *this;\r\r
252 };\r\r
253\r\r
254 };\r\r
255\r\r
256 //--------------------------------------------------------\r\r
257 \r\r
258 struct AliTRDrawStack\r\r
259 {\r\r
260 UInt_t fHeaderSize; // header size of the stack info\r\r
261 Bool_t fLinksActive[12]; // data links active - 1 per half chamber\r\r
262 Short_t fLinksDataType[12]; // 0 indicating real data for the front-end electronics \r\r
263 Short_t fLinksMonitor[12]; // 0 indicating properly operating link \r\r
264 Short_t fLinkMonitorError[12]; // record link monitor error\r\r
265 Int_t fActiveLinks; // number of active links\r\r
266 UInt_t *fPos; //! position in the buffer\r\r
267 \r\r
268 AliTRDrawHC fHalfChambers[12]; // 12 half chambers in a stack\r\r
269 \r\r
270 AliTRDrawStack()\r\r
271 : fHeaderSize(0)\r\r
272 , fLinksActive()\r\r
273 , fLinksDataType()\r\r
274 , fLinksMonitor()\r\r
275 , fLinkMonitorError()\r\r
276 , fActiveLinks(0)\r\r
277 , fPos(0)\r\r
278 , fHalfChambers()\r\r
279 {\r\r
280 // default constructor\r\r
281 }; \r\r
282\r\r
283 AliTRDrawStack(const AliTRDrawStack & p):\r\r
284 fHeaderSize(p.fHeaderSize)\r\r
285 , fLinksActive()\r\r
286 , fLinksDataType()\r\r
287 , fLinksMonitor()\r\r
288 , fLinkMonitorError()\r\r
289 , fActiveLinks(p.fActiveLinks)\r\r
290 , fPos(p.fPos)\r\r
291 , fHalfChambers()\r\r
292 {\r\r
293 // copy constructor\r\r
294 };\r\r
295\r\r
296 AliTRDrawStack &operator=(const AliTRDrawStack &)\r\r
297 {\r\r
298 // assignment operator\r\r
299 // not implemented\r\r
300 return *this;\r\r
301 };\r\r
302\r\r
303 };\r\r
304\r\r
305 //--------------------------------------------------------\r\r
306\r\r
307 struct AliTRDrawSM\r\r
308 {\r\r
309 UInt_t fHeaderSize; // size of the header in words\r\r
310 Bool_t fTrackletEnable; // tracklet enable bit\r\r
311 Bool_t fStackActive[5]; // map of active/expected stacks\r\r
312 Int_t fActiveStacks; // number of active stacks\r\r
313 Int_t fCorrupted; // is sm info corrupted\r\r
314 Int_t fNexpectedHalfChambers; // number of half chambers to be read out in this sm\r\r
315 UInt_t *fPos; // location of the sm info - should be the first word (after CDH if not DDL buffer)\r\r
316\r\r
317 AliTRDrawStack fStacks[5]; \r\r
318\r\r
319 AliTRDrawSM()\r\r
320 : fHeaderSize(0)\r\r
321 , fTrackletEnable(0)\r\r
322 , fStackActive()\r\r
323 , fActiveStacks(0)\r\r
324 , fCorrupted(0)\r\r
325 , fNexpectedHalfChambers(0)\r\r
326 , fPos(0)\r\r
327 , fStacks()\r\r
328 {\r\r
329 // Default constructor\r\r
330 }; \r\r
331\r\r
332 AliTRDrawSM(const AliTRDrawSM & p):\r\r
333 fHeaderSize(p.fHeaderSize)\r\r
334 , fTrackletEnable(p.fTrackletEnable)\r\r
335 , fStackActive()\r\r
336 , fActiveStacks(p.fActiveStacks)\r\r
337 , fCorrupted(p.fCorrupted)\r\r
338 , fNexpectedHalfChambers(p.fNexpectedHalfChambers)\r\r
339 , fPos(p.fPos)\r\r
340 , fStacks()\r\r
341 {\r\r
342 // copy constructor\r\r
343 };\r\r
344\r\r
345 AliTRDrawSM &operator=(const AliTRDrawSM &)\r\r
346 {\r\r
347 // assignment operator\r\r
348 // not implemented\r\r
349 return *this;\r\r
350 };\r\r
351\r\r
352 };\r\r
353 \r\r
354 //--------------------------------------------------------\r\r
355 \r\r
356 AliTRDrawFastStream();\r\r
357 AliTRDrawFastStream(AliRawReader *rawReader);\r\r
358 virtual ~AliTRDrawFastStream();\r\r
359\r\r
360 //--------------------------------------------------------\r\r
361\r\r
362 virtual Bool_t Next(); // read the next data in the memory\r\r
363 virtual Int_t NextChamber(AliTRDdigitsManager *man, UInt_t **trackletContainer, UShort_t **errorCodeContainer); // read next chamber data in the memory\r\r
364 virtual Bool_t Init(); // initialize some internal variables\r\r
365\r\r
366 Int_t NextBuffer(); // go and init next buffer if available - check the implementation file for return values\r\r
367\r\r
368 Bool_t SetRawVersion(Int_t fraw); // set the raw version - used for backward compat.\r\r
369 \r\r
370 void SetSharedPadReadout(Bool_t fv) {fSharedPadsOn = fv;} // set the flag on if the reader should return the shared pads\r\r
371 \r\r
372 Bool_t DecodeSMHeader(void *buffer, UInt_t length); // decode a buffer\r\r
373 Bool_t SetReader(AliRawReader *reader); // set the raw reader to use\r\r
374 \r\r
375 // from MCM Header Word\r\r
376 // rob and mcm ordering\r\r
377 // side 0(even link) - ROB: 0 2 4 6 MCM: 12 13 14 15 8 9 10 11 4 5 6 7 0 1 2 3 \r\r
378 // side 1( odd link) - ROB: 1 3 5 7 MCM: 12 13 14 15 8 9 10 11 4 5 6 7 0 1 2 3 \r\r
379\r\r
380\r\r
381 UShort_t *GetErrorCodes() const { return fHC->fErrorCodes;} // return error codes pointer per hc \r\r
382 UInt_t GetNErrors() const {return fHC ? fHC->fNErrors: 0;} // [mj temp]\r\r
383\r\r
384 // info from ADC data words\r\r
385 // from here, only works with returning ADC channel pointer using Next() \r\r
386\r\r
387 UInt_t *GetTrackletWords() const { return fHC->fTrackletWords;} // return tracklet words pointer per hc \r\r
388 Int_t GetNTracklets() const {return fHC ? fHC->fNTracklets : -1;} // get number of tracklets \r\r
389\r\r
390 Int_t GetSpecialRawVersion() const {return fHC ? fHC->fSpecialRawV : -1;} // return special raw version\r\r
391 Int_t GetMajorRawVersion() const {return fHC ? fHC->fRawVMajor : -1;} // major raw version getter\r\r
392 Int_t GetRawVersion() const {return fHC ? fHC->fRawVMajor : -1;} // compatibility see funtion above\r\r
393 Int_t GetMinorRawVersion() const {return fHC ? fHC->fRawVMinor : -1;} // minor raw version\r\r
394\r\r
395 Int_t GetSM() const {return fHC ? fHC->fSM : -1;} // SM Position of CURRENT half chamber in full TRD\r\r
396 Int_t GetLayer() const {return fHC ? fHC->fLayer : -1;} // Layer Position of CURRENT half chamber in full TRD\r\r
397 Int_t GetStack() const {return fHC ? fHC->fStack : -1;} // Stack Position of CURRENT half chamber in full TRD\r\r
398 Int_t GetSide() const {return fHC ? fHC->fSide : -1;} // get side\r\r
399 Int_t GetDCS() const { return fHC ? fHC->fDCSboard : -1;} // DCS board number read from data (HC header)\r\r
400 Int_t GetROC() const { return fHC ? fHC->fROC : -1;} // ROB Position of CURRENT half chamber in full TRD\r\r
401 Int_t GetNumberOfTimeBins() const { return fHC ? fHC->fTimeBins : 0;} // Get Ntime bins\r\r
402 UInt_t GetBunchCrossCounter() const {return fHC ? fHC->fBunchCrossCounter : 0;} // get bunch cross counter\r\r
403 UInt_t GetPreTriggerCounter() const {return fHC ? fHC->fPreTriggerCounter : 0;} // get pre trigger info\r\r
404 UInt_t GetPreTriggerPhase() const {return fHC ? fHC->fPreTriggerPhase : 0;} // get trigger phase\r\r
405\r\r
406 Int_t GetRow() const {return fMCM.fROW;} // get current row number\r\r
407 Int_t GetCol() const {return fCOL;} \r\r
408 Int_t GetExtendedCol() const {return fExtendedCOL;} \r\r
409 Int_t GetRowMax() const { return fHC ? fHC->fRowMax : -1;} // Get maximum rows in the current HC\r\r
410 Int_t GetColMax() const { return fHC ? fHC->fColMax : -1;} // Get maximum cols in the current HC\r\r
411 // compatibility\r\r
412 Int_t GetMaxRow() const { return fHC ? fHC->fRowMax : -1;} // Get maximum rows in the current HC\r\r
413 Int_t GetMaxCol() const { return fHC ? fHC->fColMax : -1;} // Get maximum cols in the current HC\r\r
414\r\r
415 UInt_t GetHCword0() const {return fHC ? *fHC->fPos[0] : 0;} // get the HC word 0\r\r
416 UInt_t GetHCword1() const {return fHC ? *fHC->fPos[1] : 0;} // get the HC word 1\r\r
417 \r\r
418 Int_t GetDET() const {return fHC ? fHC->fDET : -1;} // get current det number\r\r
419 Int_t GetDet() const {return fHC ? fHC->fDET : -1;} // get current det number\r\r
420 \r\r
421 Int_t GetROB() const {return fMCM.fROB;} // get current ROB number\r\r
422 Int_t GetMCM() const {return fMCM.fMCM;} // get current MCM number\r\r
423 Int_t GetEventNumber() const { return fMCM.fEvCounter;} // MCM Event number and position of current MCM on TRD chamber\r\r
424\r\r
425 Int_t GetTimeBin() const { return 0;} // MCM ADC channel and Time Bin of word 1\r\r
426\r\r
427 UInt_t *GetSMstreamPosition() const {return fSM.fPos;} // get position of the SM index word in the buffer\r\r
428\r\r
429\r\r
430 //----------------------------------------------------------\r\r
431 \r\r
432 static void SetNoDebug() {fgDebugFlag = kFALSE;} // allow debug info\r\r
433 static void EnableMemoryReset() {fgEnableMemoryReset = kTRUE;} // allow memory reset\r\r
434 static void SetNoErrorWarning() {fgWarnError = kFALSE;} // disable warning and error info\r\r
435 static void SetForceCleanDataOnly() {fgCleanDataOnly = kTRUE;} // clean data only\r\r
436 static void AllowCorruptedData() {fgCleanDataOnly = kFALSE;} // accept corrupted data\r\r
437\r\r
438 static void SetExtraWordsFix() {fgExtraSkip = kTRUE;} // extra skip of 24 32-bit words \r\r
439 static void SetSkipCDH() {fgSkipCDH = kTRUE;} // skip of 8 32-bit words \r\r
440 static void SetDumpHead(Int_t iv) {fgDumpHead = iv;}\r\r
441 static void DisableStackNumberChecker() {fgStackNumberChecker = kFALSE;} // set false to cleanroom data \r\r
442 static void DisableStackLinkNumberChecker() {fgStackLinkNumberChecker = kFALSE;} \r\r
443 static void DisableSkipData() {fgSkipData = kFALSE;} // keep reading next words even previous words were corrupted - debugging purpose \r\r
444 static void SetDumpingEnable() {fDumpingEnable = kTRUE;} \r\r
445\r\r
446 static void EnableDecodeConfigData() {fgEnableDecodeConfigData = kTRUE;} // allow configuration data decoding\r\r
447 static Bool_t fgEnableDecodeConfigData;\r\r
448\r\r
449 Int_t GetGlobalNTimeBins() {return fGlobalNTimeBins;} // get number of time information for the digit container\r\r
450\r\r
451 //--------------------------------------------------------\r\r
452 // Decoding functions\r\r
453 //--------------------------------------------------------\r\r
454\r\r
455 void DecodeSMInfo(const UInt_t *word, struct AliTRDrawSM *sm) const ;\r\r
456 const char *DumpSMInfo(const struct AliTRDrawSM *sm);\r\r
457 void DecodeStackInfo(const UInt_t *word, struct AliTRDrawStack *st) const;\r\r
458 void DecodeStackHeader(const UInt_t *word, struct AliTRDrawStack *st, Int_t iword) const;\r\r
459 const char *DumpStackInfo(const struct AliTRDrawStack *st);\r\r
460 Bool_t DecodeHCwordH0(const UInt_t *word, struct AliTRDrawHC *hc) const;\r\r
461 Bool_t DecodeHCwordH1(const UInt_t *word, struct AliTRDrawHC *hc) const;\r\r
462 const char *DumpHCinfoH0(const struct AliTRDrawHC *hc);\r\r
463 const char *DumpHCinfoH1(const struct AliTRDrawHC *hc);\r\r
464 void DecodeMCMheader(const UInt_t *word, struct AliTRDrawMCM *mcm) const;\r\r
465 UInt_t GetMCMadcMask(const UInt_t *word, struct AliTRDrawMCM *mcm) const;\r\r
466 void DecodeMask(const UInt_t *word, struct AliTRDrawMCM *mcm) const;\r\r
467 void MCMADCwordsWithTbins(UInt_t fTbins, struct AliTRDrawMCM *mcm) const;\r\r
468 const char *DumpMCMinfo(const struct AliTRDrawMCM *mcm);\r\r
469 const char *DumpMCMadcMask(const struct AliTRDrawMCM *mcm);\r\r
470\r\r
471\r\r
472 protected:\r\r
473\r\r
474 Bool_t InitBuffer(void *buffer, UInt_t length); // init the buffer - called by DecodeSM(void*, UInt_t)\r\r
475 Bool_t DumpWords(UInt_t *px, UInt_t iw, UInt_t marker = 0); // dump some words onto the screen\r\r
476\r\r
477 void SwapOnEndian(); // swap if endian is BIG\r\r
478 Bool_t SkipWords(UInt_t iw); // skip number of words\r\r
479 Bool_t DecodeGTUheader(); // decode data in GTU header\r\r
480 Bool_t DecodeTracklets(); // decode tracklets\r\r
481 Bool_t DecodeHC(AliTRDdigitsManager *digitsManager, AliTRDarrayADC *digits, AliTRDarrayDictionary *track0, AliTRDarrayDictionary *track1, AliTRDarrayDictionary *track2, AliTRDSignalIndex *indexes); // decode data in HC\r\r
482\r\r
483 Bool_t DecodeADC(AliTRDdigitsManager *digitsManager, AliTRDarrayADC *digits, AliTRDarrayDictionary *track0, AliTRDarrayDictionary *track1, AliTRDarrayDictionary *track2, AliTRDSignalIndex *indexes); // decode 10 ADC words\r\r
484 Bool_t DecodeADCExtended(AliTRDdigitsManager *digitsManager, AliTRDarrayADC *digits, AliTRDarrayDictionary *track0, AliTRDarrayDictionary *track1, AliTRDarrayDictionary *track2, AliTRDSignalIndex *indexes); // decode 10 ADC words\r\r
485\r\r
486 Bool_t DecodeHCheader(); // decode HC header\r\r
487 Bool_t SeekEndOfData(); // go to next end of raw data marker (actually 1 word after)\r\r
488 Bool_t SkipMCMdata(UInt_t iw); // skip this mcm data due to mcm header corruption\r\r
489 Bool_t SeekNextMCMheader(); // go to next mcm header\r\r
490 Bool_t DecodeMCMheader(); // decode mcm header\r\r
491\r\r
492 Bool_t IsRowValid(); // check if row within the range\r\r
493 Bool_t IsHCheaderOK(); // check if current hc header data make sense\r\r
494 Bool_t IsMCMheaderOK(); // check if current mcm header data make sense\r\r
495 \r\r
496 Bool_t SetGlobalNTimebins(); // set number of timebin based on the value read from HC header, this value will be used in the digit container\r\r
497 Bool_t SetNTimebins(); // set number of timebin based on the value read from HC header\r\r
498\r\r
499 void ResetCounters(); // reset some counters\r\r
500 void ResetIterators(); // needed for Next()\r\r
501 void ResetPerSM(); // reset every SM \r\r
502 void ResetPerStack(); // reset every Stack \r\r
503 void ResetPerHC(); // reset every HC \r\r
504 void ResetPerMCM(); // reset every MCM \r\r
505 void ResetMemory(); // reset all data members\r\r
506\r\r
507 AliTRDrawFastStream(const AliTRDrawFastStream& st);\r\r
508 AliTRDrawFastStream &operator=(const AliTRDrawFastStream &);\r\r
509\r\r
510 // ----------------- DATA MEMBERS START\r\r
511\r\r
512 struct AliTRDrawSM fSM; // one SM per buffer\r\r
513 struct AliTRDrawStack *fStack; //! pointer to the current stack\r\r
514 struct AliTRDrawHC *fHC; //! current HC\r\r
515 struct AliTRDrawHC *fLastHC; //! last HC\r\r
516 struct AliTRDrawMCM fMCM; //! current MCM\r\r
517 \r\r
518 UInt_t *fpPos; // current position in the buffer\r\r
519 UInt_t *fpBegin; // begin - pointer to the buffer word 0\r\r
520 UInt_t *fpEnd; // end of the buffer\r\r
521\r\r
522 UInt_t fWordLength; // length of the buffer in 32bit words\r\r
523\r\r
524 UInt_t *fpPosTemp; // specific position in the buffer \r\r
525 Int_t fGlobalNTimeBins; // number of time bin to be used in the digit container\r\r
526 Bool_t fIsTimeBinSet; // set true if the global time bin is set to avoid multiple search\r\r
527 Bool_t fIsGlobalDigitsParamSet; // set true if the global digit parameters are already set\r\r
528\r\r
529 Int_t fStackNumber; // current stack number\r\r
530 Int_t fStackLinkNumber; // current link in the stack\r\r
531\r\r
532 Int_t fLinkTrackletCounter; // count the tracklets in the current HC\r\r
533 Int_t fEndOfTrackletCount; // count link by link (hc by hc) used for debug\r\r
534 Int_t fNWordsCounter; // counts words of given hc having link monitor error\r\r
535\r\r
536 UInt_t fMaskADCword; // temp mask when decoding adcs\r\r
537 UInt_t fTbinADC; // temp adc \r\r
538\r\r
539 UInt_t fEventCounter; // stores the valid/current MCM event counter\r\r
540 UInt_t fLastEventCounter; // last known event counter of MCM\r\r
541\r\r
542 Bool_t fSharedPadsOn; // do we want to output shared pads - default is off\r\r
543 Int_t fMaxADCgeom; // maximum ADC channels per mcm\r\r
544\r\r
545 Short_t fADCnumber; // number of the ADC 0 .. 20\r\r
546 Short_t fCOL; // column - row from MCM\r\r
547 Short_t fExtendedCOL; // virtual column for extended digit container\r\r
548 Bool_t fIsShared;\r\r
549\r\r
550 Bool_t fBufferRead;\r\r
551\r\r
552 AliTRDgeometry *fGeometry; //! TRD geometry\r\r
553 AliRawReader *fRawReader; //! raw reader \r\r
554\r\r
555 AliTRDfeeParam *fTRDfeeParam; // pointer to the fee params\r\r
556 Int_t fCommonAdditive;\r
557\r\r
558 // STATIC \r\r
559\r\r
560 static Bool_t fgExtraSkip; // whether we should skip the leading 24 words\r\r
561 static Bool_t fgSkipCDH; // whether we should skip CDH (8 words)\r\r
562 static Bool_t fgWarnError; // no errors no warnings\r\r
563 static Bool_t fgCleanDataOnly; // release only clean events = no errors\r\r
564 static Bool_t fgDebugFlag; // allow debugging info\r\r
565 static Bool_t fgEnableMemoryReset; // allow memory reset\r\r
566 static Bool_t fgStackNumberChecker; // decide if we check stack number insanity - set false to cleanroom data\r\r
567 static Bool_t fgStackLinkNumberChecker; // decide if we check stack link number insanity - debuging purpose\r\r
568 static Bool_t fgSkipData; // decide if we skip corrupted data of given HC\r\r
569 static Int_t fgDumpHead; // number of words to dump (from the start of the buffer) on each Init\r\r
570 static Short_t fgMCMordering[16]; // mcm number odering for mcm header corruption check\r\r
571 static Short_t fgROBordering[16]; // mcm number odering for mcm header corruption check\r\r
572 static Int_t fgLastHC; // HC number indicator to check HC numbering\r\r
573 static Int_t fgLastROB; // ROB number indicator to check ROB numbering \r\r
574 static Int_t fgLastIndex; // variable to check mcm number odering\r\r
575\r\r
576 static Bool_t fDumpingEnable; \r\r
577\r\r
578 static Int_t fDumpingSM;\r\r
579 static Int_t fDumpingStack;\r\r
580 static Int_t fDumpingLayer;\r\r
581 static Int_t fDumpingROB;\r\r
582 static Int_t fDumpingMCM;\r\r
583\r\r
584 // ----------------- DATA MEMBERS STOP\r\r
585\r\r
586 enum ETRDzRawStreamError \r\r
587 {\r\r
588 kDecodeStackInfo = 1 //\r\r
589 , kMissingData = 2 //\r\r
590 , kLinkDataMissing = 3 //\r\r
591 , kHCdataMissing = 4 //\r\r
592 , kTrackletOverflow = 5 //\r\r
593 , kEOTrackeltsMissing = 6 //\r\r
594 , kWrongPadrow = 7 //\r\r
595 , kMCMheaderCorrupted = 8 //\r\r
596 , kWrongMCMorROB = 9 //\r\r
597 , kMCMeventMissmatch = 10 //\r\r
598 , kMCMADCMaskMissing = 11 //\r\r
599 , kHCHeaderCorrupt = 12 //\r\r
600 , kHCHeaderWrongStack = 13 //\r\r
601 , kHCHeaderWrongLayer = 14 //\r\r
602 , kHCHeaderWrongSide = 15 //\r\r
603 , kHCHeaderWrongSM = 16 //\r\r
604 , kHCHeaderWrongDet = 17 //\r\r
605 , kHCHeaderWrongROC = 18 //\r\r
606 , kHCWordMissing = 19 //\r\r
607 , kMCMdataMissing = 20 //\r\r
608 , kMCMoverflow = 21 //\r\r
609 , kADCdataMissing = 22 //\r\r
610 , kADCmaskMissmatch = 23 //\r\r
611 , kWrongPadcolumn = 24 //\r\r
612 }; \r\r
613\r\r
614 ClassDef(AliTRDrawFastStream, 0)\r\r
615}; //clas def end\r\r
616\r\r
617#endif\r\r