]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug on ADC data corruption handling fixed
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Jul 2008 07:55:01 +0000 (07:55 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Jul 2008 07:55:01 +0000 (07:55 +0000)
TRD/AliTRDRawStream.cxx
TRD/AliTRDRawStream.h
TRD/AliTRDRawStreamV2.cxx
TRD/AliTRDRawStreamV2.h
TRD/AliTRDrawStreamTB.cxx
TRD/AliTRDrawStreamTB.h

index bfadec32b418071eb37301aa89c9fd37d609aa67..ff3c13f897b90f3f920e3d739160dfb78ade1acf 100644 (file)
@@ -625,7 +625,7 @@ Bool_t AliTRDRawStream::Next()
 }
 
 //____________________________________________________________________________
-Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man, UInt_t *trackletContainer)
+Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man, UInt_t** /*trackletContainer*/)
 {
   //
   // Updates the next data word pointer
index 294e309dced5561b89c38e36eecb077e2d8c716b..b66b71b7742cc117dcbf2a345cde5611b1eb5c2e 100644 (file)
@@ -34,7 +34,7 @@ class AliTRDRawStream: public AliTRDrawStreamBase {
     virtual ~AliTRDRawStream();
 
     virtual Bool_t       Next();                                // Read the next data
-    virtual Int_t        NextChamber(AliTRDdigitsManager *man, UInt_t *trackletContainer); //  Read next chamber data
+    virtual Int_t        NextChamber(AliTRDdigitsManager *man, UInt_t **trackletContainer); //  Read next chamber data
     virtual Bool_t        Init();                                // Init for the fRawVersion > 1
 
     enum { kDDLOffset = 0x400 };                                // Offset for DDL numbers
index 5bf429fcec39e0747b0bdbb07969ce89d1f3cd60..3792d6e29c5c9a6d8699b93beb72a15f4273ad8b 100644 (file)
@@ -1207,7 +1207,7 @@ Bool_t AliTRDRawStreamV2::Next()
 }
 
 //____________________________________________________________________________
-Int_t AliTRDRawStreamV2::NextChamber(AliTRDdigitsManager *man, UInt_t *trackletContainer)
+Int_t AliTRDRawStreamV2::NextChamber(AliTRDdigitsManager *man, UInt_t** /*trackletContainer*/)
 {
   //
   // Fills single chamber digit array 
index 759556ee5adbf506644fbb1b2cc017ec356d9e28..5a7d37fc121734812a00c2b0b973b57b3c618fb7 100644 (file)
@@ -28,7 +28,7 @@ class AliTRDRawStreamV2 : public AliTRDrawStreamBase {
     virtual ~AliTRDRawStreamV2();
 
     virtual Bool_t       Next();                                //  Read the next data
-    virtual Int_t        NextChamber(AliTRDdigitsManager *man, UInt_t *trackletContainer); //  Read next chamber data
+    virtual Int_t        NextChamber(AliTRDdigitsManager *man, UInt_t **trackletContainer); //  Read next chamber data
     virtual Bool_t        Init();                                //  Init for the fRawVersion > 1
 
     enum { kDDLOffset = 0x400 };                                //  Offset for DDL numbers
index bd000b95e6ddfca50ae31a8354d5bf2d2eed3562..6b9c9359a5ec29552bf9ee13b9caeb460d63b455 100644 (file)
@@ -142,6 +142,13 @@ Short_t AliTRDrawStreamTB::fgROBordering[] =
 Int_t  AliTRDrawStreamTB::fgLastHC = -1;
 Int_t  AliTRDrawStreamTB::fgLastROB = -1;
 Int_t  AliTRDrawStreamTB::fgLastIndex = -1;
+Bool_t  AliTRDrawStreamTB::fDumpingEnable = kFALSE;
+Int_t  AliTRDrawStreamTB::fDumpingSM = -1;
+Int_t  AliTRDrawStreamTB::fDumpingStack = -1;
+Int_t  AliTRDrawStreamTB::fDumpingLayer = -1;
+Int_t  AliTRDrawStreamTB::fDumpingROB = -1;
+Int_t  AliTRDrawStreamTB::fDumpingMCM = -1;
+
 
 AliTRDrawStreamTB::AliTRDrawStreamTB()
   : AliTRDrawStreamBase()
@@ -822,6 +829,8 @@ AliTRDrawStreamTB::InitBuffer(void *buffer, UInt_t length)
   //
 
   if (fgDebugFlag)  AliDebug(5, Form("Equipment ID: %d",fRawReader->GetEquipmentId()));
+  if (fRawReader->GetEquipmentId()<1024 || fRawReader->GetEquipmentId()>1041) //tmp protection
+    return kFALSE; 
 
   if(fgStreamEventCounter == 0) fgFirstEquipmentID = fRawReader->GetEquipmentId();
   fEquipmentID = fRawReader->GetEquipmentId(); 
@@ -1195,6 +1204,7 @@ AliTRDrawStreamTB::DecodeTracklets()
 
   fLinkTrackletCounter = 0;
   fEndOfTrackletCount = 0;
+  fHC->fNTracklets = 0;
 
   for (Int_t i = 0; i < MAX_TRACKLETS_PERHC; i++) //[mj]
   fHC->fTrackletWords[i] = 0; //[mj]
@@ -1358,6 +1368,25 @@ AliTRDrawStreamTB::DecodeMCMheader()
   //
 
   DecodeMCMheader(fpPos, fMCM); 
+
+  if (fDumpingEnable) 
+    {
+      if (fMCM->fMCM == fDumpingMCM) 
+        {
+          if (fMCM->fROB == fDumpingROB && fHC->fLayer == fDumpingLayer)
+            {
+              if (fHC->fSM == fDumpingSM && fHC->fStack == fDumpingStack)
+                { 
+                  if (fgDebugFlag) {
+                    AliDebug(4,DumpHCinfoH0(fHC));
+                    AliDebug(4,DumpMCMinfo(fMCM));
+                  }
+                  DumpWords(fpPos, 212);
+                }  
+            }
+        }
+    }
+
   if (fHC->fCorrupted >= 16)
     {
       fpPos--; 
@@ -1749,13 +1778,13 @@ AliTRDrawStreamTB::DecodeADC()
          if (fgDebugFlag) AliDebug(11,Form("Wrong column! ADCnumber %d MaxIs %d Col %d MaxIs %d MCM= %s", 
                                           fADC->fADCnumber, fMaxADCgeom, fADC->fCOL, fHC->fColMax, DumpMCMinfo(fMCM)));
        }
-      else
-       {
+      //else
+       //{
          // we are out of the det when the pad is shared
-         if (fgDebugFlag) AliDebug(11, Form("Column out of the detector! ADCnumber %d MaxIs %d Col %d MaxIs %d MCM= %s", 
-                                            fADC->fADCnumber, fMaxADCgeom, fADC->fCOL, fHC->fColMax, DumpMCMinfo(fMCM)));
-         fADC->fCorrupted += 32;
-       }
+         //if (fgDebugFlag) AliDebug(11, Form("Column out of the detector! ADCnumber %d MaxIs %d Col %d MaxIs %d MCM= %s", 
+         //                                 fADC->fADCnumber, fMaxADCgeom, fADC->fCOL, fHC->fColMax, DumpMCMinfo(fMCM)));
+         //fADC->fCorrupted += 32;
+       //}
     }
 
   if (fADC->fCorrupted > 0)
index 5ec25165b934375ce4be71bf2ee4aa86a5930369..b404bcfcf84060d9c8523a219a0270f9ceae26a9 100644 (file)
@@ -412,6 +412,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   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
@@ -432,6 +433,8 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   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;}
@@ -528,6 +531,8 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   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!)
@@ -622,7 +627,7 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   Bool_t  fSharedPadsOn; // do we want to output shared pads - default is off
   Int_t   fMaxADCgeom;   // maximum ADC channels per mcm
 
-  Bool_t fBufferRead;
+  Bool_t  fBufferRead;
 
   AliTRDgeometry *fGeometry;  //! TRD geometry
   AliRawReader   *fRawReader; //! raw reader    
@@ -645,9 +650,17 @@ class AliTRDrawStreamTB : public AliTRDrawStreamBase
   static Int_t  fgEmptySignals[30]; // empty signals in case of ADC pointer = NULL
   static Short_t  fgMCMordering[16]; // mcm number odering for mcm header corruption check
   static Short_t  fgROBordering[16]; // mcm number odering for mcm header corruption check
-  static Int_t fgLastHC; 
-  static Int_t fgLastROB; 
-  static Int_t fgLastIndex; 
+  static Int_t  fgLastHC; 
+  static Int_t  fgLastROB; 
+  static Int_t  fgLastIndex; 
+
+  static Bool_t fDumpingEnable; 
+
+  static Int_t  fDumpingSM;
+  static Int_t  fDumpingStack;
+  static Int_t  fDumpingLayer;
+  static Int_t  fDumpingROB;
+  static Int_t  fDumpingMCM;
 
   // this is a temporary solution!
   // baseline should come with the HC header word 2 (count from 0!)