1 #ifndef ALITRDRAWSTREAMOLD_H
\r
2 #define ALITRDRAWSTREAMOLD_H
\r
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
5 * See cxx source for full Copyright notice */
\r
7 /* $Id: AliTRDrawStreamOld.h 27696 2008-07-31 09:18:53Z cblume $ */
\r
9 ///////////////////////////////////////////////////////////////////////////////
\r
11 // This class provides access to TRD digits in raw data. //
\r
13 ///////////////////////////////////////////////////////////////////////////////
\r
15 #include "AliTRDrawStreamBase.h"
\r
17 class AliTRDgeometry;
\r
19 class AliTRDdigitsManager;
\r
20 class TTreeSRedirector;
\r
21 class AliTRDfeeParam;
\r
24 class AliTRDrawStreamOld : public AliTRDrawStreamBase
\r
25 { // class def begin
\r
29 //--------------------------------------------------------
\r
31 //--------------------------------------------------------
\r
36 UInt_t *fPos; //! position of ADC 1st word in the buffer
\r
37 Short_t fADCnumber; // number of the ADC 0 .. 20
\r
38 Short_t fExtendedCOL; // column - row from MCM
\r
39 Short_t fCOL; // column - row from MCM
\r
40 Int_t fSignals[TRDMAXTBINS]; // signals for this adc
\r
41 Bool_t fIsShared; // is pad chared between MCMs
\r
42 Short_t fCorrupted; // is adc word corrupted
\r
53 // default constructor
\r
56 AliTRDrawADC(const AliTRDrawADC& p):
\r
58 , fADCnumber(p.fADCnumber)
\r
59 , fExtendedCOL(p.fExtendedCOL)
\r
62 , fIsShared(p.fIsShared)
\r
63 , fCorrupted(p.fCorrupted)
\r
68 AliTRDrawADC &operator=(const AliTRDrawADC &)
\r
70 // assignment operator
\r
77 //--------------------------------------------------------
\r
81 Int_t fROB; // ROB number
\r
82 Int_t fMCM; // MCM number
\r
83 Int_t fROW; // row number filed during decoding
\r
85 UInt_t fEvCounter; // MCM event counter
\r
86 UInt_t fADCMask; // ADC mask
\r
87 UInt_t fADCMaskWord; // word with ADC mask in
\r
88 UInt_t fADCchannel[TRDMAXADC]; // channels to be decoded accrording to ADC mask
\r
90 Int_t fADCmax; // number of ADCs fired
\r
91 Int_t fADCcount; // number of ADCs fired from double checking bit
\r
92 Int_t fSingleADCwords; // n of words per ADC
\r
94 Int_t fMCMhdCorrupted; // is mcm header corrupted
\r
95 Int_t fADCmaskCorrupted; // is mcm adc mask corrupted
\r
96 Int_t fCorrupted; // is mcm data missing
\r
98 UInt_t *fPos; //! position of mcm header in the buffer
\r
99 UInt_t *fAdcDataPos; //! start of ADC data for this mcm
\r
101 Int_t fADCcounter; // count the adcs decoded
\r
102 AliTRDrawADC fADCs[TRDMAXADC]; // 21 adcs
\r
114 , fSingleADCwords(0)
\r
115 , fMCMhdCorrupted(0)
\r
116 , fADCmaskCorrupted(0)
\r
123 // default constructor
\r
126 AliTRDrawMCM(const AliTRDrawMCM & p):
\r
130 , fEvCounter(p.fEvCounter)
\r
131 , fADCMask(p.fADCMask)
\r
132 , fADCMaskWord(p.fADCMaskWord)
\r
134 , fADCmax(p.fADCmax)
\r
135 , fADCcount(p.fADCcount)
\r
136 , fSingleADCwords(p.fSingleADCwords)
\r
137 , fMCMhdCorrupted(p.fMCMhdCorrupted)
\r
138 , fADCmaskCorrupted(p.fADCmaskCorrupted)
\r
139 , fCorrupted(p.fCorrupted)
\r
141 , fAdcDataPos(p.fAdcDataPos)
\r
142 , fADCcounter(p.fADCcounter)
\r
145 // copy constructor
\r
148 AliTRDrawMCM &operator=(const AliTRDrawMCM &)
\r
150 // assignment operator
\r
157 //--------------------------------------------------------
\r
162 //tacklet words of given HC
\r
163 UInt_t fTrackletWords[MAXTRACKLETSPERHC]; // array to keep tracklet words [mj]
\r
164 Short_t fTrackletError; // tracklet error
\r
165 Short_t fNTracklets; // number of tracklet
\r
168 Int_t fSpecialRawV; // Raw data version
\r
169 Int_t fRawVMajor; // Raw data version
\r
170 Int_t fRawVMajorOpt; // Raw data version
\r
171 Int_t fRawVMinor; // Raw data version
\r
172 Int_t fNExtraWords; // N extra HC header words
\r
173 Int_t fDCSboard; // DCS board number
\r
174 Int_t fSM; // Super Module number
\r
175 Int_t fStack; // Stack number (some people might call it a chamber)
\r
176 Int_t fLayer; // Layer number (some people might call it a plane)
\r
177 Int_t fSide; // Side of HC
\r
180 Int_t fTimeBins; // N of t bins
\r
181 UInt_t fBunchCrossCounter; // Bunch crossing counter
\r
182 UInt_t fPreTriggerCounter; // Pre Trigger counter
\r
183 UInt_t fPreTriggerPhase; // Pre Trigger phase
\r
186 Int_t fH0Corrupted; // is hc header 0 corrupted
\r
187 Int_t fH1Corrupted; // is hc header 1 corrupted
\r
188 Int_t fCorrupted; // is hc data corrupted
\r
190 UInt_t *fPos[2]; //! position of the header words in buffer
\r
192 Int_t fDET; // filled while decoding
\r
193 Int_t fROC; // filled while decoding
\r
194 Int_t fRowMax; // filled while decoding
\r
195 Int_t fColMax; // filled while decoding
\r
198 Int_t fMCMmax; // number of mcm found
\r
199 AliTRDrawMCM fMCMs[TRDMAXMCM]; // 4 ROBS 16 each
\r
202 : fTrackletWords() //[mj]
\r
203 , fTrackletError(0)
\r
216 , fBunchCrossCounter(0)
\r
217 , fPreTriggerCounter(0)
\r
218 , fPreTriggerPhase(0)
\r
230 // default constructor hc info
\r
233 AliTRDrawHC(const AliTRDrawHC & p):
\r
234 fTrackletWords() //[mj]
\r
235 , fTrackletError(p.fTrackletError)
\r
236 , fNTracklets(p.fNTracklets)
\r
237 , fSpecialRawV(p.fSpecialRawV)
\r
238 , fRawVMajor(p.fRawVMajor)
\r
239 , fRawVMajorOpt(p.fRawVMajorOpt)
\r
240 , fRawVMinor(p.fRawVMinor)
\r
241 , fNExtraWords(p.fNExtraWords)
\r
242 , fDCSboard(p.fDCSboard)
\r
247 , fTimeBins(p.fTimeBins)
\r
248 , fBunchCrossCounter(p.fBunchCrossCounter)
\r
249 , fPreTriggerCounter(p.fPreTriggerCounter)
\r
250 , fPreTriggerPhase(p.fPreTriggerPhase)
\r
251 , fH0Corrupted(p.fH0Corrupted)
\r
252 , fH1Corrupted(p.fH1Corrupted)
\r
253 , fCorrupted(p.fCorrupted)
\r
257 , fRowMax(p.fRowMax)
\r
258 , fColMax(p.fColMax)
\r
259 , fMCMmax(p.fMCMmax)
\r
262 // copy constructor
\r
265 AliTRDrawHC &operator=(const AliTRDrawHC &)
\r
267 // assignment operator
\r
274 //--------------------------------------------------------
\r
276 struct AliTRDrawStack
\r
278 UInt_t fHeaderSize; // header size of the stack info
\r
279 Bool_t fLinksActive[12]; // data links active - 1 per half chamber
\r
280 Short_t fLinksDataType[12]; // 0 indicating real data for the front-end electronics
\r
281 Short_t fLinksMonitor[12]; // 0 indicating properly operating link
\r
282 Short_t fLinkMonitorError[12]; // record link monitor error
\r
283 Int_t fActiveLinks; // number of active links
\r
284 UInt_t *fPos; //! position in the buffer
\r
286 AliTRDrawHC fHalfChambers[12]; // 12 half chambers in a stack
\r
293 , fLinkMonitorError()
\r
298 // default constructor
\r
301 AliTRDrawStack(const AliTRDrawStack & p):
\r
302 fHeaderSize(p.fHeaderSize)
\r
306 , fLinkMonitorError()
\r
307 , fActiveLinks(p.fActiveLinks)
\r
311 // copy constructor
\r
314 AliTRDrawStack &operator=(const AliTRDrawStack &)
\r
316 // assignment operator
\r
323 //--------------------------------------------------------
\r
327 UInt_t fHeaderSize; // size of the header in words
\r
328 Bool_t fTrackletEnable; // tracklet enable bit
\r
329 Bool_t fStackActive[5]; // map of active/expected stacks
\r
330 Int_t fActiveStacks; // number of active stacks
\r
331 Int_t fCorrupted; // is sm info corrupted
\r
332 Int_t fNexpectedHalfChambers; // number of half chambers to be read out in this sm
\r
333 Bool_t fClean; // true if everything went OK - false is some error occured
\r
334 UInt_t *fPos; // location of the sm info - should be the first word (after CDH if not DDL buffer)
\r
336 AliTRDrawStack fStacks[5]; // objects for 5 stacks
\r
340 , fTrackletEnable(0)
\r
344 , fNexpectedHalfChambers(0)
\r
349 // Default constructor
\r
352 AliTRDrawSM(const AliTRDrawSM & p):
\r
353 fHeaderSize(p.fHeaderSize)
\r
354 , fTrackletEnable(p.fTrackletEnable)
\r
356 , fActiveStacks(p.fActiveStacks)
\r
357 , fCorrupted(p.fCorrupted)
\r
358 , fNexpectedHalfChambers(p.fNexpectedHalfChambers)
\r
363 // copy constructor
\r
366 AliTRDrawSM &operator=(const AliTRDrawSM &)
\r
368 // assignment operator
\r
375 //--------------------------------------------------------
\r
377 AliTRDrawStreamOld();
\r
378 AliTRDrawStreamOld(AliRawReader *rawReader);
\r
379 virtual ~AliTRDrawStreamOld();
\r
381 //--------------------------------------------------------
\r
383 virtual Bool_t Next(); // read the next data in the memory
\r
384 //virtual Int_t NextChamber(AliTRDdigitsManager *man); // read next chamber data in the momory
\r
385 virtual Int_t NextChamber(AliTRDdigitsManager *man, UInt_t **trackletContainer, UShort_t **/*errorCodeContainer*/=NULL); // read next chamber data in the memory
\r
386 virtual Bool_t Init(); // initialize some internal variables
\r
388 Int_t NextBuffer(); // go and init next buffer if available - check the implementation file for return values
\r
390 Bool_t SetRawVersion(Int_t fraw); // set the raw version - used for backward compat.
\r
392 Bool_t IsCurrentPadShared() const {return fADC->fIsShared;} // is current pad shared between mcms
\r
393 void SetSharedPadReadout(Bool_t fv) {fSharedPadsOn = fv;} // set the flag on if the reader should return the shared pads
\r
395 Bool_t DecodeSM(void *buffer, UInt_t length); // decode a buffer
\r
396 Int_t DecodeSM(); // used with raw reader
\r
397 Int_t DecodeSM(AliRawReader *reader); // used with raw reader
\r
399 Bool_t SetReader(AliRawReader *reader); // set the raw reader to use
\r
400 void SetNoErrorWarning() {fWarnError = kFALSE;} // disable warning and error info
\r
402 // info from Supermodule Index Word
\r
403 Bool_t IsTrackletEnableBitSet() const {return fSM.fTrackletEnable;} // get status of tracklet enable bit
\r
404 Bool_t IsStackActive(Int_t is) const {return fSM.fStackActive[is];} // get status of stack enable bit
\r
405 Int_t GetNofActiveStacks() const {return fSM.fActiveStacks;} // get number of active stacks from stack mask
\r
406 UInt_t *GetGTUheaderWords() const {return fSM.fPos;} // get number of active stacks from stack mask
\r
408 // info from Stack Index Word
\r
409 Int_t GetNexpectedHalfChambers() const {return fSM.fNexpectedHalfChambers;} // get number of expected HC in a sm
\r
410 Int_t GetNofActiveLinksInStack(Int_t is) const {return fSM.fStacks[is].fActiveLinks;} // get number of active links in a stack
\r
411 Bool_t IsLinkActiveInStack(Int_t is, Int_t il) const {return fSM.fStacks[is].fLinksActive[il];} // check whether the link is active
\r
413 // info from Stack Header Word
\r
414 Short_t GetLinkMonitorError(Int_t is, Int_t il) const {return fSM.fStacks[is].fLinkMonitorError[il];} // get link monitor error
\r
416 // info from Tracklet Data
\r
417 Int_t GetTrackletErrorCode(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fTrackletError;}
\r
418 Int_t GetNTracklets(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fNTracklets;} // get number of tracklets
\r
420 // info from HC Header Word
\r
421 Int_t GetSM(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fSM;}
\r
422 Int_t GetLayer(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fLayer;}
\r
423 Int_t GetStack(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fStack;}
\r
424 Int_t GetSide(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fSide;}
\r
425 Int_t GetH0ErrorCode(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fH0Corrupted;}
\r
426 Int_t GetH1ErrorCode(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fH1Corrupted;}
\r
427 Int_t GetNumberOfTimeBins(Int_t is, Int_t il) const { return fSM.fStacks[is].fHalfChambers[il].fTimeBins;}
\r
428 UInt_t *GetTrackletWords(Int_t is, Int_t il) { return fSM.fStacks[is].fHalfChambers[il].fTrackletWords;}
\r
430 // info from HC data
\r
431 Int_t GetHCErrorCode(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fCorrupted;}
\r
432 Int_t GetHCMCMmax(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fMCMmax;}
\r
434 // from MCM Header Word
\r
435 // rob and mcm ordering
\r
436 // 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
437 // 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
438 Int_t GetMCM(Int_t stack, Int_t link, Int_t mcm) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fMCM;}
\r
439 Int_t GetROB(Int_t stack, Int_t link, Int_t mcm) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fROB;}
\r
440 Int_t GetMCMhdErrorCode(Int_t stack, Int_t link, Int_t mcm) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fMCMhdCorrupted;}
\r
441 Int_t GetMCMADCMaskErrorCode(Int_t stack, Int_t link, Int_t mcm) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCmaskCorrupted;}
\r
442 Int_t GetEventNumber(Int_t stack, Int_t link, Int_t mcm) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fEvCounter;}
\r
443 Int_t GetADCcount(Int_t stack, Int_t link, Int_t mcm) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCcount;}
\r
445 // info from MCM data words
\r
446 Int_t GetMCMErrorCode(Int_t stack, Int_t link, Int_t mcm) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fCorrupted;} // get MCM data error code
\r
447 Int_t GetADCErrorCode(Int_t stack, Int_t link, Int_t mcm, Int_t adc) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCs[adc].fCorrupted;} // get ADC error code
\r
448 Int_t GetADCnumber(Int_t stack, Int_t link, Int_t mcm, Int_t adc) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCs[adc].fADCnumber;} // get ADC error code
\r
450 Int_t GetRow(Int_t stack, Int_t link, Int_t mcm) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fROW;} // get current row number
\r
451 Int_t GetCol(Int_t stack, Int_t link, Int_t mcm, Int_t adc) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCs[adc].fCOL;} // get current column number
\r
452 Int_t GetExtendedCol(Int_t stack, Int_t link, Int_t mcm, Int_t adc) const {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCs[adc].fExtendedCOL;} // get current column number
\r
454 // info from ADC data words
\r
455 Int_t *GetSignalDirect(Int_t stack, Int_t link, Int_t mcm, Int_t adc) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCs[adc].fSignals;}
\r
458 // from here, only works with returning ADC channel pointer using Next()
\r
459 UInt_t *GetTrackletWords() const { return fHC->fTrackletWords;} // return tracklet words pointer per hc [mj]
\r
460 Int_t GetTrackletErrorCode() const {return fHC ? fHC->fTrackletError : -1;} // get tracklet error code
\r
461 Int_t GetNTracklets() const {return fHC ? fHC->fNTracklets : -1;} // get number of tracklets
\r
463 Int_t GetSpecialRawVersion() const {return fHC ? fHC->fSpecialRawV : -1;} // return special raw version
\r
464 Int_t GetMajorRawVersion() const {return fHC ? fHC->fRawVMajor : -1;} // major raw version getter
\r
465 Int_t GetRawVersion() const {return fHC ? fHC->fRawVMajor : -1;} // compatibility see funtion above
\r
466 Int_t GetMinorRawVersion() const {return fHC ? fHC->fRawVMinor : -1;} // minor raw version
\r
468 Int_t GetSM() const {return fHC ? fHC->fSM : -1;} // SM Position of CURRENT half chamber in full TRD
\r
469 Int_t GetLayer() const {return fHC ? fHC->fLayer : -1;} // Layer Position of CURRENT half chamber in full TRD
\r
470 Int_t GetStack() const {return fHC ? fHC->fStack : -1;} // Stack Position of CURRENT half chamber in full TRD
\r
471 Int_t GetSide() const {return fHC ? fHC->fSide : -1;} // get side
\r
472 Int_t GetDCS() const { return fHC ? fHC->fDCSboard : -1;} // DCS board number read from data (HC header)
\r
473 Int_t GetROC() const { return fHC ? fHC->fROC : -1;} // ROB Position of CURRENT half chamber in full TRD
\r
474 Int_t GetNumberOfTimeBins() const { return fHC ? fHC->fTimeBins : 0;} // Get Ntime bins
\r
475 UInt_t GetBunchCrossCounter() const {return fHC ? fHC->fBunchCrossCounter : 0;} // get bunch cross counter
\r
476 UInt_t GetPreTriggerCounter() const {return fHC ? fHC->fPreTriggerCounter : 0;} // get pre trigger info
\r
477 UInt_t GetPreTriggerPhase() const {return fHC ? fHC->fPreTriggerPhase : 0;} // get trigger phase
\r
479 Int_t GetRow() const {return fMCM ? fMCM->fROW : -1;} // get current row number
\r
480 Int_t GetExtendedCol() const {return fADC ? fADC->fExtendedCOL : -1;} // get current column number
\r
481 Int_t GetCol() const {return fADC ? fADC->fCOL : -1;} // get current column number
\r
482 Int_t GetRowMax() const { return fHC ? fHC->fRowMax : -1;} // Get maximum rows in the current HC
\r
483 Int_t GetColMax() const { return fHC ? fHC->fColMax : -1;} // Get maximum cols in the current HC
\r
485 Int_t GetMaxRow() const { return fHC ? fHC->fRowMax : -1;} // Get maximum rows in the current HC
\r
486 Int_t GetMaxCol() const { return fHC ? fHC->fColMax : -1;} // Get maximum cols in the current HC
\r
488 UInt_t GetHCword0() const {return fHC ? *fHC->fPos[0] : 0;} // get the HC word 0
\r
489 UInt_t GetHCword1() const {return fHC ? *fHC->fPos[1] : 0;} // get the HC word 1
\r
491 Int_t GetDET() const {return fHC ? fHC->fDET : -1;} // get current det number
\r
492 Int_t GetDet() const {return fHC ? fHC->fDET : -1;} // get current det number
\r
494 Int_t GetROB() const {return fMCM ? fMCM->fROB : -1;} // get current ROB number
\r
495 Int_t GetMCM() const {return fMCM ? fMCM->fMCM : -1;} // get current MCM number
\r
496 Int_t GetEventNumber() const { return fMCM->fEvCounter;} // MCM Event number and position of current MCM on TRD chamber
\r
498 Int_t GetADC() const { return fADC ? fADC->fADCnumber : -1;} // MCM ADC channel and Time Bin of word 1
\r
499 Int_t GetTimeBin() const { return 0;} // MCM ADC channel and Time Bin of word 1
\r
500 Int_t *GetSignals() const { return fADC ? fADC->fSignals : (Int_t *)fgEmptySignals;} // signals in the n-time bins from data word
\r
502 Int_t GetHCErrorCode() const {return fHC ? fHC->fCorrupted : -1;} // get HC error code
\r
503 Int_t GetH0ErrorCode() const {return fHC ? fHC->fH0Corrupted : -1;} // get HC header word0 error code
\r
504 Int_t GetH1ErrorCode() const {return fHC ? fHC->fH1Corrupted : -1;} // get HC header word1 error code
\r
505 Int_t GetMCMErrorCode() const {return fMCM ? fMCM->fCorrupted : -1;} // get MCM data error code
\r
506 Int_t GetADCErrorCode() const {return fADC ? fADC->fCorrupted : -1;} // get ADC data error code
\r
507 Int_t GetMCMhdErrorCode() const {return fMCM ? fMCM->fMCMhdCorrupted: -1;} // get MCM header word error code
\r
508 Int_t GetMCMADCMaskErrorCode() const {return fMCM ? fMCM->fADCmaskCorrupted: -1;} // get MCM adc mask error code
\r
510 UInt_t *GetSMstreamPosition() const {return fSM.fPos;} // get position of the SM index word in the buffer
\r
512 Bool_t IsSMbufferClean() const {return fSM.fClean;} // is data clean
\r
514 //----------------------------------------------------------
\r
516 static void SetNoDebug() {fgDebugFlag = kFALSE;} // allow debug info
\r
517 static void EnableMemoryReset() {fgEnableMemoryReset = kTRUE;} // allow memory reset
\r
518 static void SetForceCleanDataOnly() {fgCleanDataOnly = kTRUE;} // clean data only
\r
519 static void AllowCorruptedData() {fgCleanDataOnly = kFALSE;} // accept corrupted data
\r
521 static void SetExtraWordsFix() {fgExtraSkip = kTRUE;} // extra skip of 24 32-bit words
\r
522 static void SetSkipCDH() {fgSkipCDH = kTRUE;} // skip of 8 32-bit words
\r
523 static void SetDumpHead(Int_t iv) {fgDumpHead = iv;}
\r
524 static void DisableStackNumberChecker() {fgStackNumberChecker = kFALSE;} // set false to cleanroom data
\r
525 static void DisableStackLinkNumberChecker() {fgStackLinkNumberChecker = kFALSE;}
\r
526 static void DisableSkipData() {fgSkipData = kFALSE;} // keep reading next words even previous words were corrupted - debugging purpose
\r
527 static void SetDumpingEnable() {fgDumpingEnable = kTRUE;}
\r
528 static void SetDumpingMCM(Int_t sm, Int_t stack, Int_t layer, Int_t rob, Int_t mcm) {fgDumpingSM = sm; fgDumpingStack = stack; fgDumpingLayer = layer; fgDumpingROB = rob; fgDumpingMCM = mcm;}
\r
530 // this is a temporary solution!
\r
531 // baseline should come with the HC header word 2 (count from 0!)
\r
533 static void EnableDecodeConfigData() {fgEnableDecodeConfigData = kTRUE;} // allow configuration data decoding
\r
534 static Bool_t fgEnableDecodeConfigData; // flag to decode configuration data
\r
537 //--------------------------------------------------------
\r
538 // Decoding functions
\r
539 //--------------------------------------------------------
\r
541 void DecodeSMInfo(const UInt_t *word, struct AliTRDrawSM *sm) const ;
\r
542 const char *DumpSMInfo(const struct AliTRDrawSM *sm);
\r
543 void DecodeStackInfo(const UInt_t *word, struct AliTRDrawStack *st) const;
\r
544 void DecodeStackHeader(const UInt_t *word, struct AliTRDrawStack *st, Int_t iword) const;
\r
545 const char *DumpStackInfo(const struct AliTRDrawStack *st);
\r
546 Bool_t DecodeHCwordH0(const UInt_t *word, struct AliTRDrawHC *hc) const;
\r
547 Bool_t DecodeHCwordH1(const UInt_t *word, struct AliTRDrawHC *hc) const;
\r
548 const char *DumpHCinfoH0(const struct AliTRDrawHC *hc);
\r
549 const char *DumpHCinfoH1(const struct AliTRDrawHC *hc);
\r
550 void DecodeMCMheader(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
\r
551 UInt_t GetMCMadcMask(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
\r
552 void DecodeMask(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
\r
553 void MCMADCwordsWithTbins(UInt_t fTbins, struct AliTRDrawMCM *mcm) const;
\r
554 const char *DumpMCMinfo(const struct AliTRDrawMCM *mcm);
\r
555 const char *DumpMCMadcMask(const struct AliTRDrawMCM *mcm);
\r
560 Bool_t InitBuffer(void *buffer, UInt_t length); // init the buffer - called by DecodeSM(void*, UInt_t)
\r
561 Bool_t DumpWords(UInt_t *px, UInt_t iw, UInt_t marker = 0); // dump some words onto the screen
\r
563 void SwapOnEndian(); // swap if endian is BIG
\r
564 Bool_t SkipWords(UInt_t iw); // skip number of words
\r
565 Bool_t DecodeGTUheader(); // decode data in GTU header
\r
566 Bool_t DecodeTracklets(); // decode tracklets
\r
567 Bool_t DecodeHC(); // decode data in HC
\r
569 Bool_t DecodeADC(); // decode 10 ADC words
\r
570 Bool_t DecodeADCExtended(); // decode TRAP data with ZS and more than 32 samples
\r
572 Bool_t DecodeHCheader(); // decode HC header
\r
573 Bool_t SeekEndOfData(); // go to next end of raw data marker (actually 1 word after)
\r
574 Bool_t SkipMCMdata(UInt_t iw); // skip this mcm data due to mcm header corruption
\r
575 Bool_t SeekNextMCMheader(); // go to next mcm header
\r
576 Bool_t DecodeMCMheader(); // decode mcm header
\r
578 Bool_t IsRowValid(); // check if row within the range
\r
579 Bool_t IsHCheaderOK(); // check if current hc header data make sense
\r
580 Bool_t IsMCMheaderOK(); // check if current mcm header data make sense
\r
582 void ResetCounters(); // reset some counters
\r
583 void ResetIterators(); // needed for Next()
\r
584 void ResetPerSM(); // reset every SM
\r
585 void ResetPerStack(); // reset every Stack
\r
586 void ResetPerHC(); // reset every HC
\r
587 void ResetPerMCM(); // reset every MCM
\r
588 void ResetPerADC(); // reset every ADC
\r
589 void ResetMemory(); // reset all data members
\r
591 AliTRDrawStreamOld(const AliTRDrawStreamOld& st);
\r
592 AliTRDrawStreamOld &operator=(const AliTRDrawStreamOld &);
\r
594 // ----------------- DATA MEMBERS START
\r
596 struct AliTRDrawSM fSM; // one SM per buffer
\r
597 struct AliTRDrawStack *fStack; //! pointer to the current stack
\r
598 struct AliTRDrawHC *fHC; //! current HC
\r
599 struct AliTRDrawHC *fLastHC; //! last HC
\r
600 struct AliTRDrawMCM *fMCM; //! current MCM
\r
601 struct AliTRDrawADC *fADC; //! current ADC
\r
603 UInt_t *fpPos; // current position in the buffer
\r
604 UInt_t *fpBegin; // begin - pointer to the buffer word 0
\r
605 UInt_t *fpEnd; // end of the buffer
\r
607 UInt_t fWordLength; // length of the buffer in 32bit words
\r
609 Int_t fStackNumber; // current stack number
\r
610 Int_t fStackLinkNumber; // current link in the stack
\r
612 Int_t fhcMCMcounter; // mcm counter inside single hc - used in Next()
\r
613 Int_t fmcmADCcounter; // adc counrer inside single adc - used in Next()
\r
615 Int_t fLinkTrackletCounter; // count the tracklets in the current HC
\r
616 Int_t fEndOfTrackletCount; // count link by link (hc by hc) used for debug
\r
617 Int_t fNWordsCounter; // counts words of given hc having link monitor error
\r
619 UInt_t fMaskADCword; // temp mask when decoding adcs
\r
620 UInt_t fTbinADC; // temp adc
\r
621 Int_t fDecodedADCs; // counter of decoded adcs [mj] do we need?
\r
623 UInt_t fEventCounter; // stores the valid/current MCM event counter
\r
624 UInt_t fLastEventCounter; // last known event counter of MCM
\r
626 Bool_t fSharedPadsOn; // do we want to output shared pads - default is off
\r
627 Int_t fMaxADCgeom; // maximum ADC channels per mcm
\r
629 Bool_t fBufferRead; // set to be true if buffer is read for a given equipment
\r
631 AliTRDgeometry *fGeometry; //! TRD geometry
\r
632 AliRawReader *fRawReader; //! raw reader
\r
634 AliTRDfeeParam *fTRDfeeParam; // pointer to the fee params
\r
635 Int_t fCommonAdditive; // baseline value
\r
636 Bool_t fWarnError; // no errors no warnings
\r
640 static Bool_t fgExtraSkip; // whether we should skip the leading 24 words
\r
641 static Bool_t fgSkipCDH; // whether we should skip CDH (8 words)
\r
642 static Bool_t fgCleanDataOnly; // release only clean events = no errors
\r
643 static Bool_t fgDebugFlag; // allow debugging info
\r
644 static Bool_t fgEnableMemoryReset; // allow memory reset
\r
645 static Bool_t fgStackNumberChecker; // decide if we check stack number insanity - set false to cleanroom data
\r
646 static Bool_t fgStackLinkNumberChecker; // decide if we check stack link number insanity - debuging purpose
\r
647 static Bool_t fgSkipData; // decide if we skip corrupted data of given HC
\r
648 static Int_t fgDumpHead; // number of words to dump (from the start of the buffer) on each Init
\r
649 static Int_t fgEmptySignals[30]; // empty signals in case of ADC pointer = NULL
\r
650 static Short_t fgMCMordering[16]; // mcm number odering for mcm header corruption check
\r
651 static Short_t fgROBordering[16]; // mcm number odering for mcm header corruption check
\r
652 static Int_t fgLastHC; // HC number indicator to check HC numbering
\r
653 static Int_t fgLastROB; // ROB number indicator to check ROB numbering
\r
654 static Int_t fgLastIndex; // variable to check mcm number odering
\r
656 static Bool_t fgDumpingEnable; // flag to dump MCM data words
\r
658 static Int_t fgDumpingSM; // sm number to dump MCM data words
\r
659 static Int_t fgDumpingStack; // stack number to dump MCM data words
\r
660 static Int_t fgDumpingLayer; // layer number to dump MCM data words
\r
661 static Int_t fgDumpingROB; // rob number to dump MCM data words
\r
662 static Int_t fgDumpingMCM; // mcm number to dump MCM data words
\r
664 // ----------------- DATA MEMBERS STOP
\r
666 enum ETRDzRawStreamError
\r
668 kDecodeStackInfo = 1 //
\r
669 , kMissingData = 2 //
\r
670 , kLinkDataMissing = 3 //
\r
671 , kHCdataMissing = 4 //
\r
672 , kTrackletOverflow = 5 //
\r
673 , kEOTrackeltsMissing = 6 //
\r
674 , kWrongPadrow = 7 //
\r
675 , kMCMheaderCorrupted = 8 //
\r
676 , kWrongMCMorROB = 9 //
\r
677 , kMCMeventMissmatch = 10 //
\r
678 , kMCMADCMaskMissing = 11 //
\r
679 , kHCHeaderCorrupt = 12 //
\r
680 , kHCHeaderWrongStack = 13 //
\r
681 , kHCHeaderWrongLayer = 14 //
\r
682 , kHCHeaderWrongSide = 15 //
\r
683 , kHCHeaderWrongSM = 16 //
\r
684 , kHCHeaderWrongDet = 17 //
\r
685 , kHCHeaderWrongROC = 18 //
\r
686 , kHCWordMissing = 19 //
\r
687 , kMCMdataMissing = 20 //
\r
688 , kMCMoverflow = 21 //
\r
689 , kADCdataMissing = 22 //
\r
690 , kADCmaskMissmatch = 23 //
\r
691 , kWrongPadcolumn = 24 //
\r
694 ClassDef(AliTRDrawStreamOld, 1)
\r