]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDrawStream.cxx
fixing coding violations
[u/mrichter/AliRoot.git] / TRD / AliTRDrawStream.cxx
index 2d693352e323d0e99bc5bea4c2499e208d17f869..3f9f49e8000e75f69dd498d2fed34f7ad83d32f6 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
@@ -120,7 +120,8 @@ Bool_t AliTRDrawStream::fgEnableMemoryReset = kTRUE;
 Bool_t AliTRDrawStream::fgStackNumberChecker = kTRUE;\r
 Bool_t AliTRDrawStream::fgStackLinkNumberChecker = kTRUE;\r
 Bool_t AliTRDrawStream::fgSkipData = kTRUE;\r
-UInt_t AliTRDrawStream::fgDumpHead = 0;\r
+Bool_t AliTRDrawStream::fgEnableDecodeConfigData = kFALSE;\r
+Int_t AliTRDrawStream::fgDumpHead = -1;\r
 Int_t  AliTRDrawStream::fgCommonAdditive = 0;\r
 Int_t AliTRDrawStream::fgEmptySignals[] = \r
   {\r
@@ -138,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
@@ -331,22 +332,21 @@ AliTRDrawStream::SwapOnEndian()
 }\r
 \r
 //------------------------------------------------------------\r
-Bool_t \r
+Bool_t\r
 AliTRDrawStream::DumpWords(UInt_t *px, UInt_t iw, UInt_t marker)\r
 {\r
+    //UInt_t iEnd = iw;\r
+    //if ( iw ==0 ) iEnd = (fpEnd - px)/sizeof(UInt_t); // if iw is 0, dump all words\r
 \r
   TString tsreturn = Form("\n[ Dump Sequence at 0x%08x ] : ", px);\r
   for (UInt_t i = 0; i < iw; i++)\r
+  //for (UInt_t i = 0; i < iEnd; i++)\r
     {\r
-      if (px + iw >= fpEnd)\r
-  return kFALSE;\r
+      if ( iw != 0 && px + iw > fpEnd) return kFALSE;\r
 \r
-      if (i % 8 == 0)\r
-  tsreturn += "\n                              ";\r
-      if (marker != 0 && marker == px[i])\r
-  tsreturn += Form(" *>0x%08x<* ", px[i]);\r
-      else\r
-  tsreturn += Form("0x%08x ", px[i]);\r
+      if (i % 8 == 0) tsreturn += "\n                              ";\r
+      if (marker != 0 && marker == px[i]) tsreturn += Form(" *>0x%08x<* ", px[i]);\r
+      else tsreturn += Form("0x%08x ", px[i]);\r
     }\r
   tsreturn += "\n";\r
 \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
@@ -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
@@ -853,7 +856,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,10 +864,10 @@ 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->AddIndexTBin(GetRow(), GetCol(), it);\r
+        indexes->AddIndexRC(GetRow(), GetCol());\r
               if (digitsManager->UsesDictionaries()) \r
                 {\r
             track0->SetData(GetRow(), GetCol(), it, 0);\r
@@ -917,7 +920,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
@@ -949,15 +952,16 @@ AliTRDrawStream::InitBuffer(void *buffer, UInt_t length)
 \r
   SwapOnEndian();\r
 \r
-  if (fgDumpHead > 0)\r
-    {\r
-      AliInfo(Form("---------- Dumping %u words from the beginnig of the buffer ----------",fgDumpHead));\r
-      if (DumpWords(fpBegin, fgDumpHead) == kFALSE)\r
-  {\r
-    AliError("Dump failed. Not enough data.");   \r
-  }\r
-      AliInfo(Form("---------- Dumping ended ----------------------------------------------"));\r
+  if (fgDumpHead >= 0){\r
+    if ( fgDumpHead == 0 ){ // dump all words\r
+        AliInfo(Form("---------- Dumping all words from the beginnig of the buffer ----------"));\r
+        if (DumpWords(fpBegin, fWordLength) == kFALSE) AliError("Dump failed. Not enough data.");\r
+    } else {\r
+        AliInfo(Form("---------- Dumping %u words from the beginnig of the buffer ----------",fgDumpHead));\r
+        if (DumpWords(fpBegin, fgDumpHead) == kFALSE) AliError("Dump failed. Not enough data.");\r
     }\r
+    AliInfo(Form("---------- Dumping ended ----------------------------------------------"));\r
+  }\r
 \r
   return kTRUE;\r
 }\r
@@ -1036,7 +1040,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
@@ -1118,7 +1122,6 @@ AliTRDrawStream::DecodeSM(void *buffer, UInt_t length)
           fgLastIndex = -1 ; // to check mcm number odering \r
     if (DecodeHC() == kFALSE)\r
       {\r
-        if ((fHC->fRawVMajor & 64) == 64 && fHC->fRawVMajorOpt == 7) continue; // special treatmeant for the configuration data which doesn't have data-end-marker \r
         fSM.fClean = kFALSE;\r
               if (fHC->fCorrupted < 16)  SeekEndOfData(); // In case that we meet END_OF_TRACKLET_MARKERNEW \r
                                                           // during ADC data decoding or MCM header decoding\r
@@ -1231,7 +1234,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 +1468,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
@@ -1490,7 +1495,6 @@ AliTRDrawStream::DecodeMCMheader()
   fMCM->fROW = fTRDfeeParam->GetPadRowFromMCM(fMCM->fROB, fMCM->fMCM); \r
 \r
   if ((fHC->fRawVMajor > 2 && fHC->fRawVMajor <5) || ((fHC->fRawVMajor & 32) == 32)) //cover old and new version definition of ZS data\r
-  //if ((fHC->fRawVMajor > 2 && fHC->fRawVMajor <5) || (fHC->fRawVMajor > 31 && fHC->fRawVMajor < 64)) //cover old and new version definition of ZS data\r
     {\r
       fpPos++;\r
       if ( fpPos < fpEnd )\r
@@ -1700,7 +1704,6 @@ AliTRDrawStream::DecodeHC()
          if (fgWarnError) AliError("failed to decode test pattern data");\r
          return kFALSE; \r
         }\r
-      else if(fHC->fRawVMajorOpt == 7) return kFALSE; // always return false in case of configuration data(special treatment due to lack of data-end-marker).\r
       return kTRUE;\r
     } \r
 \r
@@ -1987,6 +1990,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