]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDrawStreamTB.h
Introduce an enumerator for PID methods
[u/mrichter/AliRoot.git] / TRD / AliTRDrawStreamTB.h
index ef25c0e5edfa840756e98c0b855371689d1f7215..1036416f02fc46577ee937f104590d81e26c6bcb 100644 (file)
@@ -98,6 +98,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
       
     Int_t               fADCindex; // index of current ADC (comment: 1 ADC is 1 pad)
     Int_t               fADCmax;   // number of ADCs fired
+    Int_t               fADCcount;   // number of ADCs fired from double checking bit
     Int_t               fMCMADCWords; // mcm words to expect
     Int_t               fSingleADCwords; // n of words per ADC
       
@@ -122,6 +123,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
       , fADCchannel()      
       , fADCindex(0)
       , fADCmax(0)
+      , fADCcount(0)
       , fMCMADCWords(0)      
       , fSingleADCwords(0)
       , fCorrupted(0)      
@@ -147,6 +149,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
       , fADCchannel()      
       , fADCindex(p.fADCindex)
       , fADCmax(p.fADCmax)
+      , fADCcount(p.fADCcount)
       , fMCMADCWords(p.fMCMADCWords)      
       , fSingleADCwords(p.fSingleADCwords)
       , fCorrupted(p.fCorrupted)      
@@ -183,6 +186,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
     // word 0
     Int_t               fSpecialRawV;       // Raw data version
     Int_t               fRawVMajor;         // Raw data version
+    Int_t               fRawVMajorOpt;         // Raw data version
     Int_t               fRawVMinor;         // Raw data version
     Int_t               fNExtraWords;       // N extra HC header words
     Int_t               fDCSboard;          // DCS board number
@@ -214,6 +218,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
       , fH1ErrorCounter(0)
       , fSpecialRawV(0)
       , fRawVMajor(0)
+      , fRawVMajorOpt(0)
       , fRawVMinor(0)
       , fNExtraWords(0)
       , fDCSboard(-1)
@@ -244,6 +249,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
       , fH1ErrorCounter(p.fH1ErrorCounter)
       , fSpecialRawV(p.fSpecialRawV)
       , fRawVMajor(p.fRawVMajor)
+      , fRawVMajorOpt(p.fRawVMajorOpt)
       , fRawVMinor(p.fRawVMinor)
       , fNExtraWords(p.fNExtraWords)
       , fDCSboard(p.fDCSboard)
@@ -453,6 +459,10 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   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     GetHCErrorCode() const {return fHC ? fHC->fCorrupted : -1;} // get HC error code
+  Int_t     GetMCMErrorCode() const {return fMCM ? fMCM->fCorrupted : -1;} // get MCM error code
+  Int_t     GetADCErrorCode() const {return fADC ? fADC->fCorrupted : -1;} // get ADC error code
+
   Int_t     IsMCMcorrupted() const {return fMCM ? fMCM->fCorrupted : -1;} // is current MCM header corrupted
 
   Int_t    *GetSignals() const { return fADC ? fADC->fSignals : (Int_t *)fgEmptySignals;}//Signals in the n-time bins from Data Word
@@ -473,6 +483,8 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   static void    DeleteDebugStream(); // helper function to delete the debug streamer
   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  
 
   // this is a temporary solution!
   // baseline should come with the HC header word 2 (count from 0!)
@@ -500,6 +512,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   void MCMADCwordsWithTbins(UInt_t fTbins, struct AliTRDrawMCM *mcm) const;
   const char *DumpMCMinfo(const struct AliTRDrawMCM *mcm);
   const char *DumpMCMadcMask(const struct AliTRDrawMCM *mcm);
+  const unsigned long AdvancePseudoRandom(unsigned long *val) const; 
 
  protected:
 
@@ -516,6 +529,8 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   Bool_t DecodeHC();           // decode data in HC
 
   Bool_t DecodeADC();          // decode 10 ADC words
+  Bool_t DecodeADCTP1(unsigned long *randVal, Int_t *endbits); // decode TP ADC words
+  Bool_t DecodeADCTP23(unsigned long *expected); // decode TP ADC words
 
   Bool_t DecodeHCheader();       // decode HC  header
   Bool_t SeekEndOfData();      // go to next end of raw data marker (actually 1 word after)
@@ -525,6 +540,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   Bool_t IsRowValid(); // check if row within the range
   Bool_t IsHCheaderOK(); // check if current hc header data make sense
   Bool_t IsMCMheaderOK(); // check if current mcm header data make sense
+  Bool_t IsMCMevCounterOK(); // check if event counter matches in current mcm header
     
   void   ResetCounters(); // reset some counters
   void   ResetIterators(); // needed for Next()
@@ -544,6 +560,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   UInt_t *fpEnd;   // end of the buffer
 
   UInt_t  fWordLength; // length of the buffer in 32bit words
+  UInt_t  fEquipmentID; // equipment ID
 
   Int_t   fStackNumber;     // current stack number
   Int_t   fStackLinkNumber; // current link in the stack
@@ -580,8 +597,11 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   static Bool_t fgDebugFlag; // allow debugging info
   static Bool_t fgDebugStreamFlag; // set on debug streamer
   static Bool_t fgStackNumberChecker; // decide if we check stack number insanity - set false to cleanroom data
+  static Bool_t fgStackLinkNumberChecker; // decide if we check stack link number insanity - debuging purpose
+  static Bool_t fgSkipData; // decide if we skip corrupted data of given HC
   static TTreeSRedirector *fgDebugStreamer; //!Debug streamer
   static UInt_t fgStreamEventCounter; // event counter for debug streamer
+  static UInt_t fgFirstEquipmentID; // first equipmentID for debug streamer
   static UInt_t fgDumpHead; // number of words to dump (from the start of the buffer) on each Init
   static Int_t  fgEmptySignals[30]; // empty signals in case of ADC pointer = NULL
 
@@ -633,17 +653,6 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
 
 
 
-
-
-
-
-
-
-
-
-
-
-