]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDrawFastStream.cxx
Bugfixes enabling buffer navigation
[u/mrichter/AliRoot.git] / TRD / AliTRDrawFastStream.cxx
index 168809c611f4a8718f70ca6b8667f42153c4cd84..bbe8fb33935c98811ae3c1f5ada5c44190eb480e 100644 (file)
@@ -39,7 +39,6 @@
 #include "AliTRDarrayADC.h"\r
 #include "AliTRDSignalIndex.h"\r
 #include "AliTRDdigitsParam.h"\r
-#include "AliTRDrawTPStream.h"\r
 \r
 #include "AliRawReader.h"\r
 \r
@@ -144,7 +143,6 @@ AliTRDrawFastStream::AliTRDrawFastStream()
   , fpPosTemp(0)\r
   , fGlobalNTimeBins(0)\r
   , fIsTimeBinSet(kFALSE)\r
-  , fIsGlobalDigitsParamSet(kFALSE)\r
   , fStackNumber(-1)\r
   , fStackLinkNumber(-1)\r
   , fLinkTrackletCounter(-1)\r
@@ -191,7 +189,6 @@ AliTRDrawFastStream::AliTRDrawFastStream(AliRawReader *rawReader)
   , fpPosTemp(0)\r
   , fGlobalNTimeBins(0)\r
   , fIsTimeBinSet(kFALSE)\r
-  , fIsGlobalDigitsParamSet(kFALSE)\r
   , fStackNumber(-1)\r
   , fStackLinkNumber(-1)\r
   , fLinkTrackletCounter(-1)\r
@@ -242,7 +239,6 @@ AliTRDrawFastStream::AliTRDrawFastStream(const AliTRDrawFastStream& /*st*/)
   , fpPosTemp(0)\r
   , fGlobalNTimeBins(0)\r
   , fIsTimeBinSet(kFALSE)\r
-  , fIsGlobalDigitsParamSet(kFALSE)\r
   , fStackNumber(-1)\r
   , fStackLinkNumber(-1)\r
   , fLinkTrackletCounter(-1)\r
@@ -671,17 +667,15 @@ Int_t AliTRDrawFastStream::NextChamber(AliTRDdigitsManager *digitsManager, UInt_
       Int_t colMax = GetColMax();\r
       Int_t ntbins = GetGlobalNTimeBins(); \r
 \r
-      // Set digitparam variables\r
+      // Set digitsparam variables\r
       digitsparam = (AliTRDdigitsParam *) digitsManager->GetDigitsParam();\r
-      if (!fIsGlobalDigitsParamSet){\r
-        digitsparam->SetNTimeBins(ntbins);\r
-       fCommonAdditive=10;\r
-        digitsparam->SetADCbaseline(fCommonAdditive);\r
-        fIsGlobalDigitsParamSet = kTRUE;\r
-      } \r
+      digitsparam->SetNTimeBins(det,ntbins);\r
+      fCommonAdditive=10;\r
+      digitsparam->SetADCbaseline(det,fCommonAdditive);\r
 \r
       // Allocate memory space for the digits buffer\r
-      if (digits->GetNtime() == 0) {\r
+      //if (digits->GetNtime() == 0) {\r
+      if (ntbins != digits->GetNtime()) {\r
         digits->Allocate(rowMax, colMax, ntbins);\r
         if (digitsManager->UsesDictionaries()) {\r
           track0->Allocate(rowMax, colMax, ntbins);\r
@@ -695,7 +689,7 @@ Int_t AliTRDrawFastStream::NextChamber(AliTRDdigitsManager *digitsManager, UInt_
       indexes->SetStack(GetStack());\r
       indexes->SetLayer(GetLayer());\r
       indexes->SetDetNumber(det);\r
-      if (indexes->IsAllocated() == kFALSE)\r
+      if (indexes->GetNtime() != ntbins)\r
         indexes->Allocate(rowMax, colMax, ntbins);\r
     }\r
 \r
@@ -738,7 +732,7 @@ Int_t AliTRDrawFastStream::NextChamber(AliTRDdigitsManager *digitsManager, UInt_
          }\r
     else SeekEndOfData(); // make sure that finish off with the end of data markers\r
 \r
-    // set pritrigger phase since it is only avaliable after decoding HC header \r
+    // set pretrigger phase since it is only avaliable after decoding HC header \r
     digitsparam->SetPretriggerPhase(det,GetPreTriggerPhase());\r
 \r
     // copy tracklets in memory into tracklet container\r
@@ -1121,14 +1115,14 @@ Bool_t AliTRDrawFastStream::DecodeHC(AliTRDdigitsManager *digitsManager, AliTRDa
     }\r
   }\r
 \r
-  if ((fHC->fRawVMajor & 64) == 64) { // test pattern data\r
-    AliTRDrawTPStream *tpStream = new AliTRDrawTPStream(fHC->fRawVMajorOpt, fpPos);\r
-    if (tpStream->DecodeTPdata() == kFALSE) {\r
-      if (fWarnError) AliError("Failed to decode test pattern data");\r
-      return kFALSE;\r
-    }\r
-    return kTRUE;\r
-  }\r
+//   if ((fHC->fRawVMajor & 64) == 64) { // test pattern data\r
+//     AliTRDrawTPStream *tpStream = new AliTRDrawTPStream(fHC->fRawVMajorOpt, fpPos);\r
+//     if (tpStream->DecodeTPdata() == kFALSE) {\r
+//       if (fWarnError) AliError("Failed to decode test pattern data");\r
+//       return kFALSE;\r
+//     }\r
+//     return kTRUE;\r
+//   }\r
 \r
   fHC->fMCMmax = 0; // count number of mcms in a hc \r
   while (*fpPos != ENDOFRAWDATAMARKER && fpPos < fpEnd) {\r
@@ -1892,8 +1886,9 @@ const char *AliTRDrawFastStream::DumpHCinfoH0(const struct AliTRDrawHC *hc)
   if (!hc)\r
     return Form("Unable to dump. Null received as parameter!?!");\r
   else\r
-    return Form("[ HC[0] at 0x%08x ] : 0x%08x Info is : RawV %d SM %d Stack %d Layer %d Side %d DCSboard %d",\r
-                hc->fPos[0], *(hc->fPos[0]), hc->fRawVMajor, hc->fSM, hc->fStack, hc->fLayer, hc->fSide, hc->fDCSboard);\r
+     return Form("[ HC[0] at 0x%08x ] : 0x%08x Info is : RawV %d SM %d Stack %d Layer %d Side %d DCSboard %d",\r
+                hc->fPos[0], *(hc->fPos[0]), hc->fRawVMajor, fRawReader->GetEquipmentId()-1024, \r
+                hc->fStack, hc->fLayer, hc->fSide, hc->fDCSboard);\r
 }\r
 \r
 //--------------------------------------------------------\r