]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDrawStreamTB.h
data specification and meta data for CDB entries (Jenny)
[u/mrichter/AliRoot.git] / TRD / AliTRDrawStreamTB.h
CommitLineData
d4232bb6 1#ifndef ALITRDRAWSTREAMTB_H
2#define ALITRDRAWSTREAMTB_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id$ */
8
9///////////////////////////////////////////////////////////////////////////////
10// //
11// This class provides access to TRD digits in raw data. //
12// //
13///////////////////////////////////////////////////////////////////////////////
14
15#include "TObject.h"
16#include "TString.h"
dfbb4bb9 17#include "AliTRDrawStreamBase.h"
d4232bb6 18
19class AliTRDgeometry;
20class AliRawReader;
21class AliTRDdigitsManager;
22class TTreeSRedirector;
23class AliTRDfeeParam;
24
dfbb4bb9 25// definitions in AliTRDrawStreamBase.h:
26/* #define TRD_MAX_TBINS 30 */
27/* #define TRD_MAX_ADC 21 */
28/* #define TRD_MAX_MCM 4 * 16 */
d4232bb6 29
dfbb4bb9 30//class AliTRDrawStreamTB : public TObject
31class AliTRDrawStreamTB : public AliTRDrawStreamBase
d4232bb6 32{ // class def begin
33
34 public:
35
36 //--------------------------------------------------------
37
38 // THE STRUCTURES
39
40 //--------------------------------------------------------
41
42 struct AliTRDrawADC
43 {//adc struct
44
45 UInt_t *fPos; //! position of ADC 1st word in the buffer
46 Short_t fADCnumber; // number of the ADC 0 .. 20
47 Short_t fCOL; // column - row from MCM
48 Int_t fSignals[TRD_MAX_TBINS]; // signals for this adc
49 Bool_t fIsShared; // is pad chared between MCMs
50 Short_t fCorrupted; // is adc word corrupted
51
52 AliTRDrawADC()
53 : fPos(0)
54 , fADCnumber(0)
55 , fCOL(0)
56 , fSignals()
57 , fIsShared(kFALSE)
58 , fCorrupted(0)
59 {
60 // default constructor
61 ;
62 }
63
6bd744d3 64 AliTRDrawADC(const AliTRDrawADC& p):
65 fPos(p.fPos)
66 , fADCnumber(p.fADCnumber)
67 , fCOL(p.fCOL)
68 , fSignals()
69 , fIsShared(p.fIsShared)
70 , fCorrupted(p.fCorrupted)
71 {
72 // copy constructor
73 ;
74 }
75
76 AliTRDrawADC &operator=(const AliTRDrawADC &)
77 {
78 // assignment operator
79 // not implemented
80 return *this;
81 }
82
83
d4232bb6 84 };
85
86 //--------------------------------------------------------
87
88 struct AliTRDrawMCM
89 { // mcm struct
90 Int_t fROB; // ROB number
91 Int_t fMCM; // MCM number
92 Int_t fROW; //filed during decoding!
93
94 UInt_t fEvCounter; // MCM event counter
95 UInt_t fADCMask; // ADC mask
96 UInt_t fADCMaskWord; // word with ADC mask in
97 UInt_t fADCchannel[30]; // channels to be decoded accrording to ADC mask
98
99 Int_t fADCindex; // index of current ADC (comment: 1 ADC is 1 pad)
100 Int_t fADCmax; // number of ADCs fired
101 Int_t fMCMADCWords; // mcm words to expect
102 Int_t fSingleADCwords; // n of words per ADC
103
104 Int_t fCorrupted; // is mcm word corrupted
105
106 UInt_t fErrorCounter; // count the mcm header errors
107 UInt_t fMaskErrorCounter; // count the adc mask errors
108
109 UInt_t *fPos; //! position of mcm header in the buffer
110 UInt_t *fAdcDataPos; //! start of ADC data for this mcm
111
112 Int_t fADCcounter; // count the adcs decoded
113 AliTRDrawADC fADCs[TRD_MAX_ADC]; // 21 adcs
114
115 AliTRDrawMCM()
116 : fROB(-1)
117 , fMCM(-1)
118 , fROW(-1)
119 , fEvCounter(0)
120 , fADCMask(0)
121 , fADCMaskWord(0)
122 , fADCchannel()
123 , fADCindex(0)
124 , fADCmax(0)
125 , fMCMADCWords(0)
126 , fSingleADCwords(0)
127 , fCorrupted(0)
128 , fErrorCounter(0)
129 , fMaskErrorCounter(0)
130 , fPos(0)
131 , fAdcDataPos(0)
132 , fADCcounter(0)
133 , fADCs()
134 {
135 // default constructor
136 /* the following violates coding conventions */
137 //for (Int_t i = 0; i < 30; i++) fADCchannel[i] = 0;
138 }
6bd744d3 139
140 AliTRDrawMCM(const AliTRDrawMCM & p):
141 fROB(p.fROB)
142 , fMCM(p.fMCM)
143 , fROW(p.fROW)
144 , fEvCounter(p.fEvCounter)
145 , fADCMask(p.fADCMask)
146 , fADCMaskWord(p.fADCMaskWord)
147 , fADCchannel()
148 , fADCindex(p.fADCindex)
149 , fADCmax(p.fADCmax)
150 , fMCMADCWords(p.fMCMADCWords)
151 , fSingleADCwords(p.fSingleADCwords)
152 , fCorrupted(p.fCorrupted)
153 , fErrorCounter(p.fErrorCounter)
154 , fMaskErrorCounter(p.fMaskErrorCounter)
155 , fPos(p.fPos)
156 , fAdcDataPos(p.fAdcDataPos)
157 , fADCcounter(p.fADCcounter)
158 , fADCs()
159 {
160 // copy constructor
161 ;
162 }
163
164 AliTRDrawMCM &operator=(const AliTRDrawMCM &)
165 {
166 // assignment operator
167 // not implemented
168 return *this;
169 }
170
d4232bb6 171 };
172
173 //--------------------------------------------------------
174
175 struct AliTRDrawHC
176 { // hc struct
177 // global
178 Int_t fCorrupted; // Zero if not corrupted
179
180 UInt_t fH0ErrorCounter; // Count the H0 word errors
181 UInt_t fH1ErrorCounter; // Count the H1 word errors
182
183 // word 0
184 Int_t fSpecialRawV; // Raw data version
185 Int_t fRawVMajor; // Raw data version
dc25a859 186 Int_t fRawVMajorOpt; // Raw data version
d4232bb6 187 Int_t fRawVMinor; // Raw data version
188 Int_t fNExtraWords; // N extra HC header words
189 Int_t fDCSboard; // DCS board number
190 Int_t fSM; // Super Module number
191 Int_t fStack; // Stack number (some people might call it a chamber)
192 Int_t fLayer; // Layer number (some people might call it a plane)
193 Int_t fSide; // Side of HC
194
195 //word 1
196 Int_t fTimeBins; // N of t bins
197 UInt_t fBunchCrossCounter; // Bunch crossing counter
198 UInt_t fPreTriggerCounter; // Pre Trigger counter
199 UInt_t fPreTriggerPhase; // Pre Trigger phase
200
201 UInt_t *fPos[2]; //! position of the header words in buffer
202
203 Int_t fDET; // filled while decoding
204 Int_t fROC; // filled while decoding
205 Int_t fRowMax; // filled while decoding
206 Int_t fColMax; // filled while decoding
207
208 //AliTRDrawMCM fMCMs[4][16]; // 4 ROBS 16 each - that is max!
209 Int_t fMCMmax; // number of mcm found
210 AliTRDrawMCM fMCMs[TRD_MAX_MCM]; // 4 ROBS 16 each - that is max!
211
212 AliTRDrawHC()
213 : fCorrupted(0)
214 , fH0ErrorCounter(0)
215 , fH1ErrorCounter(0)
216 , fSpecialRawV(0)
217 , fRawVMajor(0)
dc25a859 218 , fRawVMajorOpt(0)
d4232bb6 219 , fRawVMinor(0)
220 , fNExtraWords(0)
221 , fDCSboard(-1)
222 , fSM(-1)
223 , fStack(-1)
224 , fLayer(-1)
225 , fSide(-1)
226 , fTimeBins(0)
227 , fBunchCrossCounter(0)
228 , fPreTriggerCounter(0)
229 , fPreTriggerPhase(0)
230 , fPos()
231 , fDET(-1)
232 , fROC(-1)
233 , fRowMax(-1)
234 , fColMax(-1)
235 , fMCMmax(0)
236 , fMCMs()
237 {
238 // default constructor hc info
239 /* the following violates coding conventions */
240 //fPos[0] = fPos[0] = 0;
241 }
6bd744d3 242
243 AliTRDrawHC(const AliTRDrawHC & p):
244 fCorrupted(p.fCorrupted)
245 , fH0ErrorCounter(p.fH0ErrorCounter)
246 , fH1ErrorCounter(p.fH1ErrorCounter)
247 , fSpecialRawV(p.fSpecialRawV)
248 , fRawVMajor(p.fRawVMajor)
dc25a859 249 , fRawVMajorOpt(p.fRawVMajorOpt)
6bd744d3 250 , fRawVMinor(p.fRawVMinor)
251 , fNExtraWords(p.fNExtraWords)
252 , fDCSboard(p.fDCSboard)
253 , fSM(p.fSM)
254 , fStack(p.fStack)
255 , fLayer(p.fLayer)
256 , fSide(p.fSide)
257 , fTimeBins(p.fTimeBins)
258 , fBunchCrossCounter(p.fBunchCrossCounter)
259 , fPreTriggerCounter(p.fPreTriggerCounter)
260 , fPreTriggerPhase(p.fPreTriggerPhase)
261 , fPos()
262 , fDET(p.fDET)
263 , fROC(p.fROC)
264 , fRowMax(p.fRowMax)
265 , fColMax(p.fColMax)
266 , fMCMmax(p.fMCMmax)
267 , fMCMs()
268 {
269 // copy constructor
270 ;
271 }
272
273 AliTRDrawHC &operator=(const AliTRDrawHC &)
274 {
275 // assignment operator
276 // not implemented
277 return *this;
278 }
279
d4232bb6 280 };
281
282 //--------------------------------------------------------
283
284 struct AliTRDrawStack
285 {
286 UInt_t fHeaderSize; // header size of the stack info
287 Bool_t fLinksActive[12]; // data links active - 1 per half chamber
288 Bool_t fTrackletDecode[12]; // book keeping while decoding - set false after decoding
289 Bool_t fHCDecode[12]; // book keeping while decoding - set false after HC header decoding
290 Int_t fActiveLinks; // number of active links
291 UInt_t *fPos; //! position in the buffer
292
293 AliTRDrawHC fHalfChambers[12]; // 6 chambers in a stack
294
295 AliTRDrawStack()
296 : fHeaderSize(0)
297 , fLinksActive()
298 , fTrackletDecode() //book keeping while decoding - set false after decoding
299 , fHCDecode() //book keeping while decoding - set false after HC header decoding
300 , fActiveLinks(0)
301 , fPos(0)
302 , fHalfChambers()
303 {
304 // default constructor
305 }
6bd744d3 306
307 AliTRDrawStack(const AliTRDrawStack & p):
308 fHeaderSize(p.fHeaderSize)
309 , fLinksActive()
310 , fTrackletDecode() //book keeping while decoding - set false after decoding
311 , fHCDecode() //book keeping while decoding - set false after HC header decoding
312 , fActiveLinks(p.fActiveLinks)
313 , fPos(p.fPos)
314 , fHalfChambers()
315 {
316 // copy constructor
317 ;
318 }
319
320 AliTRDrawStack &operator=(const AliTRDrawStack &)
321 {
322 // assignment operator
323 // not implemented
324 return *this;
325 }
326
d4232bb6 327 };
328
329 /* the following violates coding conventions */
330/* for (Int_t i = 0; i < 12; i++) */
331/* { */
332/* fLinksActive[i] = fTrackletDecode[i] = fHCDecode[i] = kFALSE; */
333/* } */
334
335 //--------------------------------------------------------
336
337 struct AliTRDrawSM
338 {
339 UInt_t fHeaderSize; // size of the header in words
340 Bool_t fTrackletEnable; // tracklet enable bit
341 Bool_t fStackActive[5]; // map of active/expected stacks
342 Int_t fActiveStacks; // number of active stacks
343 Int_t fCorrupted; // is sm info corrupted
344 Int_t fNexpectedHalfChambers; // number of half chambers to be read out
345 Bool_t fClean; // true if everything went OK - false is some error occured
346 UInt_t *fPos; //! location of the sm info - should be the first word (after CDH if not DDL buffer)
347
348 AliTRDrawStack fStacks[5]; // we do have only five stacks ;)
349
350 AliTRDrawSM()
351 : fHeaderSize(0)
352 , fTrackletEnable(0)
353 , fStackActive()
354 , fActiveStacks(0)
355 , fCorrupted(0)
356 , fNexpectedHalfChambers(0)
357 , fClean(kTRUE)
358 , fPos(0)
359 , fStacks()
360 {
361 // Default constructor
362 // coding rule violation in the next line
363 //for (Int_t i = 0; i < 5; i++) fStackActive[i] = kFALSE;
364 };
6bd744d3 365
366 AliTRDrawSM(const AliTRDrawSM & p):
367 fHeaderSize(p.fHeaderSize)
368 , fTrackletEnable(p.fTrackletEnable)
369 , fStackActive()
370 , fActiveStacks(p.fActiveStacks)
371 , fCorrupted(p.fCorrupted)
372 , fNexpectedHalfChambers(p.fNexpectedHalfChambers)
373 , fClean(p.fClean)
374 , fPos(p.fPos)
375 , fStacks()
376 {
377 // copy constructor
378 ;
379 }
380
381 AliTRDrawSM &operator=(const AliTRDrawSM &)
382 {
383 // assignment operator
384 // not implemented
385 return *this;
386 }
387
d4232bb6 388 };
389
390 //--------------------------------------------------------
391
392 AliTRDrawStreamTB();
393 AliTRDrawStreamTB(AliRawReader *rawReader);
394 virtual ~AliTRDrawStreamTB();
395
396 //--------------------------------------------------------
397
398 virtual Bool_t Next(); // Read the next data
399 virtual Int_t NextChamber(AliTRDdigitsManager *man); // read next chamber data
400 virtual Bool_t Init(); // Init some internal variables
401
dfbb4bb9 402 Bool_t SetRawVersion(Int_t fraw); // set the raw version - used for backward compat.
d4232bb6 403
d4232bb6 404 Bool_t IsCurrentPadShared() const {return fADC->fIsShared;} // is current pad shared between mcms
405 void SetSharedPadReadout(Bool_t fv) {fSharedPadsOn = fv;} // set the flag on if the reader should return the shared pads
406 Bool_t IsDataZeroSuppressed() const {return (fHC->fRawVMajor > 2) ? kTRUE : kFALSE;} // check the version and tell if ZS is on
407
408 Bool_t DecodeSM(void *buffer, UInt_t length); //decode a buffer
409 Int_t DecodeSM(); // used with raw reader
410 Int_t DecodeSM(AliRawReader *reader); // used with raw reader
411
412 Bool_t SetReader(AliRawReader *reader); // set the raw reader to use
413
414 Bool_t IsTrackletEnableBitSet() const {return fSM.fTrackletEnable;} // get status of the tracklets enable bit
415 Bool_t IsStackActive(Int_t is) const {return fSM.fStackActive[is];} // get status of a stack
416 Int_t GetNofActiveStacks() const {return fSM.fActiveStacks;} // get number of active stacks
417 UInt_t *GetSMstreamPosition() const {return fSM.fPos;} // get position of the SM index word in the buffer
418
419 Bool_t IsSMbufferClean() const {return fSM.fClean;} // is data clean
420
421 Bool_t IsLinkActiveInStack(Int_t is, Int_t il) const {return fSM.fStacks[is].fLinksActive[il];} // check whether the link is active
422 Int_t GetActiveLinksInStack(Int_t is) const {return fSM.fStacks[is].fActiveLinks;} //get active links in a stack
423
424 Int_t GetSpecialRawVersion() const {return fHC ? fHC->fSpecialRawV : -1;} // return special raw version
425 Int_t GetMajorRawVersion() const {return fHC ? fHC->fRawVMajor : -1;} // major raw version getter
426 Int_t GetRawVersion() const {return fHC ? fHC->fRawVMajor : -1;} // compatibility see funtion above
427 Int_t GetMinorRawVersion() const {return fHC ? fHC->fRawVMinor : -1;} // minor raw version
428
429 Int_t GetSM() const {return fHC ? fHC->fSM : -1;} // Position of CURRENT half chamber in full TRD
430 Int_t GetLayer() const {return fHC ? fHC->fLayer : -1;} // PLANE = Position of CURRENT half chamber in full TRD
431 Int_t GetStack() const {return fHC ? fHC->fStack : -1;} // CHAMBER = Position of CURRENT half chamber in full TRD
432 Int_t GetSide() const {return fHC ? fHC->fSide : -1;} // get side
433 Int_t GetDCS() const { return fHC ? fHC->fDCSboard : -1;} // DCS board number read from data (HC header)
434 //Int_t GetDCSboard() {return fHC ? fHC->fDCSboard : -1;} // DCS board number read from data (HC header)
435 Int_t GetROC() const { return fHC ? fHC->fROC : -1;} // Position of CURRENT half chamber in full TRD
436 Int_t GetNumberOfTimeBins() const { return fHC ? fHC->fTimeBins : 0;} // Get Ntime bins
437 UInt_t GetBunchCrossCounter() const {return fHC ? fHC->fBunchCrossCounter : 0;} // get bunch cross counter
438 UInt_t GetPreTriggerCounter() const {return fHC ? fHC->fPreTriggerCounter : 0;} // get pre trigger info
439 UInt_t GetPreTriggerPhase() const {return fHC ? fHC->fPreTriggerPhase : 0;} // get trigger phase
440
441 Int_t GetRow() const {return fMCM ? fMCM->fROW : -1;} // get current row number
442 Int_t GetCol() const {return fADC ? fADC->fCOL : -1;} // get current column number
443 Int_t GetRowMax() const { return fHC ? fHC->fRowMax : -1;} // Get maximum rows in the current HC
444 Int_t GetColMax() const { return fHC ? fHC->fColMax : -1;} // Get maximum cols in the current HC
445 // compatibility
446 Int_t GetMaxRow() const { return fHC ? fHC->fRowMax : -1;} // Get maximum rows in the current HC
447 Int_t GetMaxCol() const { return fHC ? fHC->fColMax : -1;} // Get maximum cols in the current HC
448
449 UInt_t GetHCword0() const {return fHC ? *fHC->fPos[0] : 0;} // get the HC word 0
450 UInt_t GetHCword1() const {return fHC ? *fHC->fPos[1] : 0;} // get the HC word 1
451
452 Int_t GetDET() const {return fHC ? fHC->fDET : -1;} // get current det number
453 Int_t GetDet() const {return fHC ? fHC->fDET : -1;} // get current det number
454
455 Int_t GetROB() const {return fMCM ? fMCM->fROB : -1;} // get current ROB number
456 Int_t GetMCM() const {return fMCM ? fMCM->fMCM : -1;} // get current MCM number
457 Int_t GetEventNumber() const { return fMCM->fEvCounter;} // MCM Event number and position of current MCM on TRD chamber
458
dc25a859 459 Int_t GetMCMErrorCode() const {return fMCM ? fMCM->fCorrupted : -1;} // get HC error code
460 //Int_t GetHCErrorCode() const {return fHC ? fHC->fCorrupted : -1;} // get HC error code
461
d4232bb6 462 Int_t IsMCMcorrupted() const {return fMCM ? fMCM->fCorrupted : -1;} // is current MCM header corrupted
463
464 Int_t *GetSignals() const { return fADC ? fADC->fSignals : (Int_t *)fgEmptySignals;}//Signals in the n-time bins from Data Word
465 Int_t GetADC() const { return fADC ? fADC->fADCnumber : -1 ;} // MCM ADC channel and Time Bin of word 1
466 Int_t GetTimeBin() const { return 0;} // MCM ADC channel and Time Bin of word 1
467
468 //----------------------------------------------------------
469
470 static void SetNoDebug() {fgDebugFlag = kFALSE;} // allow debug info
471 static void SetNoErrorWarning() {fgWarnError = kFALSE;} // disable warning and error info
472 static void SetForceCleanDataOnly() {fgCleanDataOnly = kTRUE;} // clean data only
473 static void AllowCorruptedData() {fgCleanDataOnly = kFALSE;} // accept corrupted data
474
475 static void SetExtraWordsFix() {fgExtraSkip = kTRUE;} // extra skip of 24 32-bit words
476 static void SetSkipCDH() {fgSkipCDH = kTRUE;} // skip of 8 32-bit words
477 void EnableDebug(TTreeSRedirector *debugStream = 0); // enable the debug stream - use the paramter if non zero
478 static void EnableDebugStream() {fgDebugStreamFlag = kTRUE;} //global enable of the dbug stream
479 static void DeleteDebugStream(); // helper function to delete the debug streamer
480 static void SetDumpHead(UInt_t iv) {fgDumpHead = iv;}
6bd744d3 481 static void DisableStackNumberChecker() {fgStackNumberChecker = kFALSE;} // set false to cleanroom data
dc25a859 482 static void DisableStackLinkNumberChecker() {fgStackLinkNumberChecker = kFALSE;}
d4232bb6 483
1ced3838 484 // this is a temporary solution!
485 // baseline should come with the HC header word 2 (count from 0!)
486 static void SetSubtractBaseline(Int_t baseline) {fgCommonAdditive = baseline;}
487 Int_t GetCommonAdditive() const {return fgCommonAdditive;} // return the common additive
488
d4232bb6 489 void DumpErrorCount();
490 void ReSetStreamEventCounter(Int_t ival = 0) {fgStreamEventCounter = ival;} // reset the event counter for the debug streamer
491
492 //--------------------------------------------------------
493 // Decoding functions
494 //--------------------------------------------------------
495
496 void DecodeSMInfo(const UInt_t *word, struct AliTRDrawSM *sm) const ;
497 const char *DumpSMInfo(const struct AliTRDrawSM *sm);
498 void DecodeStackInfo(const UInt_t *word, struct AliTRDrawStack *st) const;
499 const char *DumpStackInfo(const struct AliTRDrawStack *st);
500 void DecodeHCwordH0(const UInt_t *word, struct AliTRDrawHC *hc) const;
501 void DecodeHCwordH1(const UInt_t *word, struct AliTRDrawHC *hc) const;
502 const char *DumpHCinfoH0(const struct AliTRDrawHC *hc);
503 const char *DumpHCinfoH1(const struct AliTRDrawHC *hc);
504 void DecodeMCMheader(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
505 UInt_t GetMCMadcMask(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
506 void DecodeMask(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
507 void MCMADCwordsWithTbins(UInt_t fTbins, struct AliTRDrawMCM *mcm) const;
508 const char *DumpMCMinfo(const struct AliTRDrawMCM *mcm);
509 const char *DumpMCMadcMask(const struct AliTRDrawMCM *mcm);
dc25a859 510 const unsigned long AdvancePseudoRandom(unsigned long *val);
d4232bb6 511
512 protected:
513
514 private:
515
516 Bool_t InitBuffer(void *buffer, UInt_t length); // init the buffer - called by DecodeSM(void*, UInt_t)
517 Bool_t DumpWords(UInt_t *px, UInt_t iw, UInt_t marker = 0); // dump some words onto the screen
518
519 Int_t NextBuffer(); // go and init next buffer if available - check the implementation file for return values
520
521 void SwapOnEndian(); // swap if endian is BIG
522 Bool_t SkipWords(UInt_t iw); // skip number of words
523 Bool_t DecodeTracklets(); // decode tracklets
524 Bool_t DecodeHC(); // decode data in HC
525
526 Bool_t DecodeADC(); // decode 10 ADC words
dc25a859 527 Bool_t DecodeADCTP1(unsigned long *randVal, int *endbits); // decode TP ADC words
d4232bb6 528
529 Bool_t DecodeHCheader(); // decode HC header
530 Bool_t SeekEndOfData(); // go to next end of raw data marker (actually 1 word after)
531 Bool_t SeekNextMCMheader(); // go to next mcm header
532 Bool_t DecodeMCMheader(); // decode mcm header
533
534 Bool_t IsRowValid(); // check if row within the range
535 Bool_t IsHCheaderOK(); // check if current hc header data make sense
536 Bool_t IsMCMheaderOK(); // check if current mcm header data make sense
537
538 void ResetCounters(); // reset some counters
539 void ResetIterators(); // needed for Next()
540 AliTRDrawStreamTB(const AliTRDrawStreamTB& st);
541 AliTRDrawStreamTB &operator=(const AliTRDrawStreamTB &);
542
543 // ----------------- DATA MEMBERS START
544
545 struct AliTRDrawSM fSM; // one SM per buffer
546 struct AliTRDrawStack *fStack; //! pointer to the current stack
547 struct AliTRDrawHC *fHC; //! current HC
548 struct AliTRDrawMCM *fMCM; //! current MCM
549 struct AliTRDrawADC *fADC; //! current ADC
550
551 UInt_t *fpPos; // current position in the buffer
552 UInt_t *fpBegin; // begin - pointer to the buffer word 0
553 UInt_t *fpEnd; // end of the buffer
554
555 UInt_t fWordLength; // length of the buffer in 32bit words
7e8f4d17 556 UInt_t fEquipmentID; // equipment ID
d4232bb6 557
558 Int_t fStackNumber; // current stack number
559 Int_t fStackLinkNumber; // current link in the stack
560
561 Int_t fhcMCMcounter; // mcm counter inside single hc - used in Next()
562 Int_t fmcmADCcounter; // adc counrer inside single adc - used in Next()
563
564 Int_t fLinkTrackletCounter; // count the tracklets in the current HC
565 Int_t fEndOfTrackletCount; // count link by link (hc by hc) used for debug
566
567 UInt_t fMaskADCword; // temp mask when decoding adcs
568 UInt_t fTbinADC; // temp adc
569 Int_t fDecodedADCs; // counter of decoded adcs
570
571 UInt_t fEventCounter; // stores the valid/current MCM event counter
572 UInt_t fLastEventCounter; // last known event counter of MCM
573
d4232bb6 574 Bool_t fSharedPadsOn; // do we want to output shared pads - default is off
575 Int_t fMaxADCgeom; // maximum ADC channels per mcm
576
577 AliTRDgeometry *fGeometry; //! TRD geometry
578 AliRawReader *fRawReader; //! raw reader
579
580 AliTRDfeeParam *fTRDfeeParam; // pointer to the fee params
581
582 Bool_t fDebugStreamOwned; // created in this case by this - allowed to delete?
583
584 // STATIC
585
586 static Bool_t fgExtraSkip; // whether we should skip the leading 24 words
587 static Bool_t fgSkipCDH; // whether we should skip CDH (8 words)
588 static Bool_t fgWarnError; // no errors no warnings
589 static Bool_t fgCleanDataOnly; // release only clean events = no errors
590 static Bool_t fgDebugFlag; // allow debugging info
591 static Bool_t fgDebugStreamFlag; // set on debug streamer
6bd744d3 592 static Bool_t fgStackNumberChecker; // decide if we check stack number insanity - set false to cleanroom data
7e8f4d17 593 static Bool_t fgStackLinkNumberChecker; // decide if we check stack link number insanity - debuging purpose
d4232bb6 594 static TTreeSRedirector *fgDebugStreamer; //!Debug streamer
595 static UInt_t fgStreamEventCounter; // event counter for debug streamer
7e8f4d17 596 static UInt_t fgFirstEquipmentID; // first equipmentID for debug streamer
d4232bb6 597 static UInt_t fgDumpHead; // number of words to dump (from the start of the buffer) on each Init
598 static Int_t fgEmptySignals[30]; // empty signals in case of ADC pointer = NULL
599
600
1ced3838 601 // this is a temporary solution!
602 // baseline should come with the HC header word 2 (count from 0!)
603 static Int_t fgCommonAdditive; // common additive - should be decoded! from HC word2
604
d4232bb6 605 // ----------------- DATA MEMBERS STOP
606
607 enum ETRDzRawStreamError
608 {
609 kDecodeStackInfo = 1 //
610 , kMissingData = 2 //
611 , kLinkDataMissing = 3 //
612 , kHCdataMissing = 4 //
613 , kTrackletOverflow = 5 //
614 , kEOTrackeltsMissing = 6 //
615 , kWrongPadrow = 7 //
616 , kMCMheaderCorrupted = 8 //
617 , kWrongMCMorROB = 9 //
618 , kMCMeventMissmatch = 10 //
619 , kMCMADCMaskMissing = 11 //
620 , kHCHeaderCorrupt = 12 //
621 , kHCHeaderWrongStack = 13 //
622 , kHCHeaderWrongLayer = 14 //
623 , kHCHeaderWrongSide = 15 //
624 , kHCHeaderWrongSM = 16 //
625 , kHCHeaderWrongDet = 17 //
626 , kHCHeaderWrongROC = 18 //
627 , kHCWordMissing = 19 //
628 , kMCMdataMissing = 20 //
629 , kMCMoverflow = 21 //
630 , kADCdataMissing = 22 //
631 , kADCmaskMissmatch = 23 //
632 , kWrongPadcolumn = 24 //
633 };
634
635 ClassDef(AliTRDrawStreamTB, 0)
636}; //clas def end
637
638#endif
639
640
641
642
643
644
645
646
647
d4232bb6 648
649
650
651