]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDrawStream.cxx
Bug detail:
[u/mrichter/AliRoot.git] / TRD / AliTRDrawStream.cxx
index d8a649b5121a8a196c7c90658d2a457248dd0179..bee76b0226c46b7d1434788e4a4eea8d5d3f7f8d 100644 (file)
@@ -39,8 +39,8 @@ q*                                                                        *
 #include "AliTRDarrayDictionary.h"\r
 #include "AliTRDarrayADC.h"\r
 #include "AliTRDSignalIndex.h"\r
-#include "AliTRDcalibDB.h"\r
-#include "Cal/AliTRDCalPadStatus.h"\r
+//#include "AliTRDcalibDB.h" \r
+//#include "Cal/AliTRDCalPadStatus.h" //is now read in clusterizer\r
 #include "AliTRDrawTPStream.h"\r
 \r
 #include "AliLog.h"\r
@@ -89,7 +89,7 @@ q*                                                                        *
 #define HC_NTIMEBINS(w) GET_VALUE_AT(w,0x3f,26)\r
 #define HC_BUNCH_CROSS_COUNTER(w) GET_VALUE_AT(w,0xffff,10)\r
 #define HC_PRETRIGGER_COUNTER(w) GET_VALUE_AT(w,0xf,6)\r
-#define HC_PRETRIGGER_PHASE(w) GET_VALUE_AT(w,0xf,6)\r
+#define HC_PRETRIGGER_PHASE(w) GET_VALUE_AT(w,0xf,2)\r
 \r
 // MCM word and ADC mask\r
 #define MCM_HEADER_MASK_ERR(w) ( ((w) & (0xf)) == (0xc) ? 0 : 1) // 0 if OK!!!\r
@@ -139,12 +139,12 @@ Short_t AliTRDrawStream::fgROBordering[] =
 Int_t  AliTRDrawStream::fgLastHC = -1;\r
 Int_t  AliTRDrawStream::fgLastROB = -1;\r
 Int_t  AliTRDrawStream::fgLastIndex = -1;\r
-Bool_t  AliTRDrawStream::fDumpingEnable = kFALSE;\r
-Int_t  AliTRDrawStream::fDumpingSM = -1;\r
-Int_t  AliTRDrawStream::fDumpingStack = -1;\r
-Int_t  AliTRDrawStream::fDumpingLayer = -1;\r
-Int_t  AliTRDrawStream::fDumpingROB = -1;\r
-Int_t  AliTRDrawStream::fDumpingMCM = -1;\r
+Bool_t  AliTRDrawStream::fgDumpingEnable = kFALSE;\r
+Int_t  AliTRDrawStream::fgDumpingSM = -1;\r
+Int_t  AliTRDrawStream::fgDumpingStack = -1;\r
+Int_t  AliTRDrawStream::fgDumpingLayer = -1;\r
+Int_t  AliTRDrawStream::fgDumpingROB = -1;\r
+Int_t  AliTRDrawStream::fgDumpingMCM = -1;\r
 \r
 \r
 AliTRDrawStream::AliTRDrawStream()\r
@@ -378,8 +378,11 @@ AliTRDrawStream::SkipWords(UInt_t iw)
 \r
 //------------------------------------------------------------\r
 Bool_t \r
-AliTRDrawStream::SetReader(AliRawReader *reader)\r
+AliTRDrawStream::SetReader(AliRawReader * reader)\r
 {\r
+  //\r
+  // Set reader pointer\r
+  //\r
 \r
   if (reader != 0)\r
     {\r
@@ -662,7 +665,7 @@ if (fBufferRead)
             AliError(Form("HC missing at stack %d link %d", fStackNumber, fStackLinkNumber));\r
             return kFALSE;\r
           }\r
-        if (fHC->fCorrupted == 0 && (fHC->fH0Corrupted == 0 && fHC->fH1Corrupted == 0)) // if HC data corrupted(in any case), we don't read data at all from this HC \r
+        if (fHC->fCorrupted == 0 && (fHC->fH0Corrupted == 0 && fHC->fH1Corrupted == 0) | !fgSkipData) // if HC data corrupted(in any case), we don't read data at all from this HC \r
           {\r
             while (fhcMCMcounter < fHC->fMCMmax)\r
         {\r
@@ -730,14 +733,14 @@ if (fBufferRead)
 \r
 //------------------------------------------------------------\r
 Int_t \r
-AliTRDrawStream::NextChamber(AliTRDdigitsManager *digitsManager, UInt_t **trackletContainer) \r
+AliTRDrawStream::NextChamber(AliTRDdigitsManager *const digitsManager, UInt_t **trackletContainer) \r
 {\r
   //\r
   // Fills single chamber digit array \r
   // Return value is the detector number\r
   //\r
 \r
-  AliTRDcalibDB *cal = AliTRDcalibDB::Instance();\r
+  //AliTRDcalibDB *cal = AliTRDcalibDB::Instance();\r
   AliTRDarrayADC *digits = 0;\r
   AliTRDarrayDictionary *track0 = 0;\r
   AliTRDarrayDictionary *track1 = 0;\r
@@ -771,6 +774,7 @@ AliTRDrawStream::NextChamber(AliTRDdigitsManager *digitsManager, UInt_t **trackl
             {\r
               if (lastdet != -1)\r
                 {\r
+                fmcmADCcounter--; \r
                 return lastdet;\r
                 }\r
             }\r
@@ -789,6 +793,7 @@ AliTRDrawStream::NextChamber(AliTRDdigitsManager *digitsManager, UInt_t **trackl
       }\r
     else\r
       {\r
+        fmcmADCcounter--; \r
         return lastdet;\r
       }\r
 \r
@@ -853,7 +858,7 @@ AliTRDrawStream::NextChamber(AliTRDdigitsManager *digitsManager, UInt_t **trackl
       indexes->Allocate(rowMax, colMax, ntbins);\r
   }\r
 \r
-      Char_t padStatus =  cal->GetPadStatus(det, GetCol(), GetRow());\r
+      //Char_t padStatus =  cal->GetPadStatus(det, GetCol(), GetRow());\r
 \r
       // ntimebins data are ready to read\r
       for (it = 0; it < GetNumberOfTimeBins(); it++)\r
@@ -861,8 +866,8 @@ AliTRDrawStream::NextChamber(AliTRDdigitsManager *digitsManager, UInt_t **trackl
     if (GetSignals()[it] > 0)\r
       {\r
         digits->SetData(GetRow(), GetCol(), it, GetSignals()[it]);\r
-        if(padStatus)\r
-    digits->SetPadStatus(GetRow(), GetCol(), it, padStatus);\r
+        /*if(padStatus)\r
+         digits->SetPadStatus(GetRow(), GetCol(), it, padStatus);*/\r
                 \r
         indexes->AddIndexRC(GetRow(), GetCol());\r
               if (digitsManager->UsesDictionaries()) \r
@@ -917,7 +922,7 @@ AliTRDrawStream::Init()
 \r
 //------------------------------------------------------------\r
 Bool_t \r
-AliTRDrawStream::InitBuffer(void *buffer, UInt_t length)\r
+AliTRDrawStream::InitBuffer(void * const buffer, UInt_t length)\r
 {\r
   // \r
   // set initial information about the buffer\r
@@ -1037,7 +1042,7 @@ AliTRDrawStream::DecodeGTUheader()
 \r
 //------------------------------------------------------------\r
 Bool_t \r
-AliTRDrawStream::DecodeSM(void *buffer, UInt_t length)\r
+AliTRDrawStream::DecodeSM(void * const buffer, UInt_t length)\r
 {\r
   //\r
   // decode one sm data in buffer\r
@@ -1231,7 +1236,9 @@ AliTRDrawStream::SeekEndOfData()
 Bool_t\r
 AliTRDrawStream::SkipMCMdata(UInt_t iw)\r
 {\r
-\r
+  //\r
+  // skip mcm data words due to corruption \r
+  //\r
   if (fgDebugFlag) AliDebug(11,Form("Skip %d words due to MCM header corruption.",iw));\r
   UInt_t iwcounter = 0;  \r
   while ( *fpPos != ENDOFRAWDATAMARKER && iwcounter < iw)\r
@@ -1463,13 +1470,13 @@ AliTRDrawStream::DecodeMCMheader()
 \r
   DecodeMCMheader(fpPos, fMCM); \r
 \r
-  if (fDumpingEnable) \r
+  if (fgDumpingEnable) \r
     {\r
-      if (fMCM->fMCM == fDumpingMCM) \r
+      if (fMCM->fMCM == fgDumpingMCM) \r
         {\r
-          if (fMCM->fROB == fDumpingROB && fHC->fLayer == fDumpingLayer)\r
+          if (fMCM->fROB == fgDumpingROB && fHC->fLayer == fgDumpingLayer)\r
             {\r
-              if (fHC->fSM == fDumpingSM && fHC->fStack == fDumpingStack)\r
+              if (fHC->fSM == fgDumpingSM && fHC->fStack == fgDumpingStack)\r
                 { \r
                   if (fgDebugFlag) {\r
                     AliDebug(5,DumpHCinfoH0(fHC));\r
@@ -1985,6 +1992,9 @@ void AliTRDrawStream::DecodeStackInfo(const UInt_t *word, struct AliTRDrawStack
 //--------------------------------------------------------\r
 void AliTRDrawStream::DecodeStackHeader(const UInt_t *word, struct AliTRDrawStack *st, Int_t iword) const\r
 {\r
+  //\r
+  // decode gtu header for stack info\r
+  //\r
       st->fPos = (UInt_t*)word;\r
       \r
       UInt_t vword = *word;\r