- };
-
- //--------------------------------------------------------
-
- AliTRDrawStream();
- AliTRDrawStream(AliRawReader *rawReader);
- virtual ~AliTRDrawStream();
-
- //--------------------------------------------------------
-
- virtual Bool_t Next(); // read the next data in the memory
- //virtual Int_t NextChamber(AliTRDdigitsManager *man); // read next chamber data in the momory
- virtual Int_t NextChamber(AliTRDdigitsManager *man, UInt_t **trackletContainer); // read next chamber data in the memory
- virtual Bool_t Init(); // initialize some internal variables
-
- Int_t NextBuffer(); // go and init next buffer if available - check the implementation file for return values
-
- Bool_t SetRawVersion(Int_t fraw); // set the raw version - used for backward compat.
-
- Bool_t IsCurrentPadShared() const {return fADC->fIsShared;} // is current pad shared between mcms
- void SetSharedPadReadout(Bool_t fv) {fSharedPadsOn = fv;} // set the flag on if the reader should return the shared pads
-
- Bool_t DecodeSM(void *buffer, UInt_t length); // decode a buffer
- Int_t DecodeSM(); // used with raw reader
- Int_t DecodeSM(AliRawReader *reader); // used with raw reader
-
- Bool_t SetReader(AliRawReader *reader); // set the raw reader to use
-
- // info from Supermodule Index Word
- Bool_t IsTrackletEnableBitSet() const {return fSM.fTrackletEnable;} // get status of tracklet enable bit
- Bool_t IsStackActive(Int_t is) const {return fSM.fStackActive[is];} // get status of stack enable bit
- Int_t GetNofActiveStacks() const {return fSM.fActiveStacks;} // get number of active stacks from stack mask
- UInt_t *GetGTUheaderWords() const {return fSM.fPos;} // get number of active stacks from stack mask
-
- // info from Stack Index Word
- Int_t GetNexpectedHalfChambers() const {return fSM.fNexpectedHalfChambers;} // get number of expected HC in a sm
- Int_t GetNofActiveLinksInStack(Int_t is) const {return fSM.fStacks[is].fActiveLinks;} // get number of active links in a stack
- Bool_t IsLinkActiveInStack(Int_t is, Int_t il) const {return fSM.fStacks[is].fLinksActive[il];} // check whether the link is active
-
- // info from Stack Header Word
- Short_t GetLinkMonitorError(Int_t is, Int_t il) const {return fSM.fStacks[is].fLinkMonitorError[il];} // get link monitor error
-
- // info from Tracklet Data
- Int_t GetTrackletErrorCode(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fTrackletError;}
- Int_t GetNTracklets(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fNTracklets;} // get number of tracklets
-
- // info from HC Header Word
- Int_t GetSM(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fSM;}
- Int_t GetLayer(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fLayer;}
- Int_t GetStack(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fStack;}
- Int_t GetSide(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fSide;}
- Int_t GetH0ErrorCode(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fH0Corrupted;}
- Int_t GetH1ErrorCode(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fH1Corrupted;}
- Int_t GetNumberOfTimeBins(Int_t is, Int_t il) const { return fSM.fStacks[is].fHalfChambers[il].fTimeBins;}
- UInt_t *GetTrackletWords(Int_t is, Int_t il) { return fSM.fStacks[is].fHalfChambers[il].fTrackletWords;}
-
- // info from HC data
- Int_t GetHCErrorCode(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fCorrupted;}
- Int_t GetHCMCMmax(Int_t is, Int_t il) const {return fSM.fStacks[is].fHalfChambers[il].fMCMmax;}
-
- // from MCM Header Word
- // rob and mcm ordering
- // 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
- // 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
- Int_t GetMCM(Int_t stack, Int_t link, Int_t mcm) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fMCM;}
- Int_t GetROB(Int_t stack, Int_t link, Int_t mcm) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fROB;}
- Int_t GetMCMhdErrorCode(Int_t stack, Int_t link, Int_t mcm) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fMCMhdCorrupted;}
- Int_t GetMCMADCMaskErrorCode(Int_t stack, Int_t link, Int_t mcm) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCmaskCorrupted;}
- Int_t GetEventNumber(Int_t stack, Int_t link, Int_t mcm) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fEvCounter;}
- Int_t GetADCcount(Int_t stack, Int_t link, Int_t mcm) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCcount;}
-
- // info from MCM data words
- Int_t GetMCMErrorCode(Int_t stack, Int_t link, Int_t mcm) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fCorrupted;} // get MCM data error code
- Int_t GetADCErrorCode(Int_t stack, Int_t link, Int_t mcm, Int_t adc) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCs[adc].fCorrupted;} // get ADC error code
- Int_t GetADCnumber(Int_t stack, Int_t link, Int_t mcm, Int_t adc) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCs[adc].fADCnumber;} // get ADC error code
-
- Int_t GetRow(Int_t stack, Int_t link, Int_t mcm) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fROW;} // get current row number
- Int_t GetCol(Int_t stack, Int_t link, Int_t mcm, Int_t adc) {return fSM.fStacks[stack].fHalfChambers[link].fMCMs[mcm].fADCs[adc].fCOL;} // get current column number
-
- // info from ADC data words
- 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;}
-
-
- // from here, only works with returning ADC channel pointer using Next()
- UInt_t *GetTrackletWords() const { return fHC->fTrackletWords;} // return tracklet words pointer per hc [mj]
- Int_t GetTrackletErrorCode() const {return fHC ? fHC->fTrackletError : -1;} // get tracklet error code
- Int_t GetNTracklets() const {return fHC ? fHC->fNTracklets : -1;} // get number of tracklets
-
- Int_t GetSpecialRawVersion() const {return fHC ? fHC->fSpecialRawV : -1;} // return special raw version
- Int_t GetMajorRawVersion() const {return fHC ? fHC->fRawVMajor : -1;} // major raw version getter
- Int_t GetRawVersion() const {return fHC ? fHC->fRawVMajor : -1;} // compatibility see funtion above
- Int_t GetMinorRawVersion() const {return fHC ? fHC->fRawVMinor : -1;} // minor raw version
-
- Int_t GetSM() const {return fHC ? fHC->fSM : -1;} // SM Position of CURRENT half chamber in full TRD
- Int_t GetLayer() const {return fHC ? fHC->fLayer : -1;} // Layer Position of CURRENT half chamber in full TRD
- Int_t GetStack() const {return fHC ? fHC->fStack : -1;} // Stack Position of CURRENT half chamber in full TRD
- Int_t GetSide() const {return fHC ? fHC->fSide : -1;} // get side
- Int_t GetDCS() const { return fHC ? fHC->fDCSboard : -1;} // DCS board number read from data (HC header)
- Int_t GetROC() const { return fHC ? fHC->fROC : -1;} // ROB Position of CURRENT half chamber in full TRD
- Int_t GetNumberOfTimeBins() const { return fHC ? fHC->fTimeBins : 0;} // Get Ntime bins
- UInt_t GetBunchCrossCounter() const {return fHC ? fHC->fBunchCrossCounter : 0;} // get bunch cross counter
- UInt_t GetPreTriggerCounter() const {return fHC ? fHC->fPreTriggerCounter : 0;} // get pre trigger info
- UInt_t GetPreTriggerPhase() const {return fHC ? fHC->fPreTriggerPhase : 0;} // get trigger phase
-
- Int_t GetRow() const {return fMCM ? fMCM->fROW : -1;} // get current row number
- Int_t GetCol() const {return fADC ? fADC->fCOL : -1;} // get current column number
- Int_t GetRowMax() const { return fHC ? fHC->fRowMax : -1;} // Get maximum rows in the current HC
- Int_t GetColMax() const { return fHC ? fHC->fColMax : -1;} // Get maximum cols in the current HC
- // compatibility
- Int_t GetMaxRow() const { return fHC ? fHC->fRowMax : -1;} // Get maximum rows in the current HC
- Int_t GetMaxCol() const { return fHC ? fHC->fColMax : -1;} // Get maximum cols in the current HC
-
- UInt_t GetHCword0() const {return fHC ? *fHC->fPos[0] : 0;} // get the HC word 0
- UInt_t GetHCword1() const {return fHC ? *fHC->fPos[1] : 0;} // get the HC word 1
-
- Int_t GetDET() const {return fHC ? fHC->fDET : -1;} // get current det number
- Int_t GetDet() const {return fHC ? fHC->fDET : -1;} // get current det number
-
- Int_t GetROB() const {return fMCM ? fMCM->fROB : -1;} // get current ROB number
- Int_t GetMCM() const {return fMCM ? fMCM->fMCM : -1;} // get current MCM number
- Int_t GetEventNumber() const { return fMCM->fEvCounter;} // MCM Event number and position of current MCM on TRD chamber
-
- Int_t GetADC() const { return fADC ? fADC->fADCnumber : -1;} // MCM ADC channel and Time Bin of word 1
- Int_t GetTimeBin() const { return 0;} // MCM ADC channel and Time Bin of word 1
- Int_t *GetSignals() const { return fADC ? fADC->fSignals : (Int_t *)fgEmptySignals;} // signals in the n-time bins from data word
-
- Int_t GetHCErrorCode() const {return fHC ? fHC->fCorrupted : -1;} // get HC error code
- Int_t GetH0ErrorCode() const {return fHC ? fHC->fH0Corrupted : -1;} // get HC header word0 error code
- Int_t GetH1ErrorCode() const {return fHC ? fHC->fH1Corrupted : -1;} // get HC header word1 error code
- Int_t GetMCMErrorCode() const {return fMCM ? fMCM->fCorrupted : -1;} // get MCM data error code
- Int_t GetADCErrorCode() const {return fADC ? fADC->fCorrupted : -1;} // get ADC data error code
- Int_t GetMCMhdErrorCode() const {return fMCM ? fMCM->fMCMhdCorrupted: -1;} // get MCM header word error code
- Int_t GetMCMADCMaskErrorCode() const {return fMCM ? fMCM->fADCmaskCorrupted: -1;} // get MCM adc mask error code
-
- UInt_t *GetSMstreamPosition() const {return fSM.fPos;} // get position of the SM index word in the buffer
-
- Bool_t IsSMbufferClean() const {return fSM.fClean;} // is data clean
-
- //----------------------------------------------------------
-
- static void SetNoDebug() {fgDebugFlag = kFALSE;} // allow debug info
- static void EnableMemoryReset() {fgEnableMemoryReset = kTRUE;} // allow memory reset
- static void SetNoErrorWarning() {fgWarnError = kFALSE;} // disable warning and error info
- static void SetForceCleanDataOnly() {fgCleanDataOnly = kTRUE;} // clean data only
- static void AllowCorruptedData() {fgCleanDataOnly = kFALSE;} // accept corrupted data
-
- static void SetExtraWordsFix() {fgExtraSkip = kTRUE;} // extra skip of 24 32-bit words
- static void SetSkipCDH() {fgSkipCDH = kTRUE;} // skip of 8 32-bit words
- static void SetDumpHead(UInt_t iv) {fgDumpHead = iv;}
- static void DisableStackNumberChecker() {fgStackNumberChecker = kFALSE;} // set false to cleanroom data
- static void DisableStackLinkNumberChecker() {fgStackLinkNumberChecker = kFALSE;}
- static void DisableSkipData() {fgSkipData = kFALSE;} // keep reading next words even previous words were corrupted - debugging purpose
- static void SetDumpingEnable() {fDumpingEnable = kTRUE;}
- static void SetDumpingMCM(Int_t sm, Int_t stack, Int_t layer, Int_t rob, Int_t mcm) {fDumpingSM = sm; fDumpingStack = stack; fDumpingLayer = layer; fDumpingROB = rob; fDumpingMCM = mcm;}
-
- // this is a temporary solution!
- // baseline should come with the HC header word 2 (count from 0!)
- static void SetSubtractBaseline(Int_t baseline) {fgCommonAdditive = baseline;}
- Int_t GetCommonAdditive() const {return fgCommonAdditive;} // return the common additive
-
- //--------------------------------------------------------
- // Decoding functions
- //--------------------------------------------------------
-
- void DecodeSMInfo(const UInt_t *word, struct AliTRDrawSM *sm) const ;
- const char *DumpSMInfo(const struct AliTRDrawSM *sm);
- void DecodeStackInfo(const UInt_t *word, struct AliTRDrawStack *st) const;
- void DecodeStackHeader(const UInt_t *word, struct AliTRDrawStack *st, Int_t iword) const;
- const char *DumpStackInfo(const struct AliTRDrawStack *st);
- Bool_t DecodeHCwordH0(const UInt_t *word, struct AliTRDrawHC *hc) const;
- Bool_t DecodeHCwordH1(const UInt_t *word, struct AliTRDrawHC *hc) const;
- const char *DumpHCinfoH0(const struct AliTRDrawHC *hc);
- const char *DumpHCinfoH1(const struct AliTRDrawHC *hc);
- void DecodeMCMheader(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
- UInt_t GetMCMadcMask(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
- void DecodeMask(const UInt_t *word, struct AliTRDrawMCM *mcm) const;
- void MCMADCwordsWithTbins(UInt_t fTbins, struct AliTRDrawMCM *mcm) const;
- const char *DumpMCMinfo(const struct AliTRDrawMCM *mcm);
- const char *DumpMCMadcMask(const struct AliTRDrawMCM *mcm);