]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDSignalIndex.cxx
AliDCSClient "multiSplit" option added in the DCS configuration
[u/mrichter/AliRoot.git] / TRD / AliTRDSignalIndex.cxx
index 3dcdd0a02c54c429d8c0a24a4322b1a9a7d13d50..d95628c1dd648815ad4e9f6eadc6459c96cde37e 100644 (file)
@@ -197,6 +197,43 @@ void AliTRDSignalIndex::Reset()
   Allocate(fNrows, fNcols, fNtbins);
 }
 
+//_____________________________________________________________________________
+void AliTRDSignalIndex::ResetContent()
+{
+  //
+  // Reset the array but keep the size - no realloc
+  //
+
+  fIndex->Reset(-1);
+  ResetCounters();
+  fHasEntry = kFALSE;
+}
+
+//_____________________________________________________________________________
+void AliTRDSignalIndex::ResetContentConditional(Int_t nrow, Int_t ncol,Int_t ntime)
+{
+  //
+  // Reset the array but keep the size if no need to enlarge - no realloc
+  //
+
+  fDet = -1;
+  fLayer = -1;
+  fStack = -1;
+  fSM = -1;
+
+  if (nrow > fNrows || ncol > fNcols || ntime > fNtbins)
+    {
+      Allocate(nrow, ncol, ntime);
+    }
+  else
+    {
+      fIndex->Reset(-1);
+      ResetCounters();
+      fHasEntry = kFALSE;
+    }
+}
+
+
 //_____________________________________________________________________________
 void AliTRDSignalIndex::ClearAll()
 {
@@ -230,7 +267,8 @@ void AliTRDSignalIndex::AddIndexTBin(Int_t row, Int_t col, Int_t tbin)
   // the RC index is updated to!!!
   // this is to be used in the TRD clusterizer!
 
-  if (fPositionCol + fNtbins >= fMaxLimit)
+  //if (fPositionCol + fNtbins >= fMaxLimit)
+  if (row * col * tbin + row * col * 2 >= fMaxLimit)
     {
       AliError(Form("Out-of-limits fPositionCol + fNtbins %d. Limit is: %d", fPositionCol + fNtbins, fMaxLimit));
       return;
@@ -257,9 +295,8 @@ void AliTRDSignalIndex::AddIndexTBin(Int_t row, Int_t col, Int_t tbin)
       (*fIndex)[fPositionRow] = row;
       (*fIndex)[fPositionCol] = col;
       (*fIndex)[fPositionCol + fPositionTbin] = tbin;
-
+      //AliInfo(Form("x1: fPositionCol + fPositionTbin = %d", fPositionCol + fPositionTbin));
       ++fPositionTbin;
-      //AliDebug(3, Form("fNRCindexed=%d", fNRCindexed));
     }
   else
     {
@@ -270,6 +307,7 @@ void AliTRDSignalIndex::AddIndexTBin(Int_t row, Int_t col, Int_t tbin)
       //       }
       
       (*fIndex)[fPositionCol + fPositionTbin] = tbin;
+      //AliInfo(Form("x2: fPositionCol + fPositionTbin = %d", fPositionCol + fPositionTbin));
       ++fPositionTbin;      
     }
   
@@ -285,19 +323,13 @@ Bool_t  AliTRDSignalIndex::NextRCIndex(Int_t &row, Int_t &col)
 {
   // return the position (index in the data array) of the next available pad
 
-  if (fPositionCol + fNtbins >= fMaxLimit)
-    {
-      //AliDebug(8, "Out of index range");
-      return kFALSE;
-    }
-
   if (fResetCounters == kTRUE)
     {
       fPositionRow = 0;
       fPositionCol = 1;
       
       fResetCounters = kFALSE;
-      AliDebug(2, "Reset counters");
+      //AliDebug(2, "Reset counters");
     }
   else
     {
@@ -305,6 +337,12 @@ Bool_t  AliTRDSignalIndex::NextRCIndex(Int_t &row, Int_t &col)
       fPositionCol += fNtbins + 2;
     }
 
+  if (fPositionRow >= fMaxLimit)
+    {
+      //AliDebug(8, "Out of index range");
+      return kFALSE;
+    }
+
   //AliDebug(8, Form("Next RC %d", fPositionRow / (fNtbins + 2)));
 
   fPositionTbin = 1;
@@ -324,11 +362,9 @@ Bool_t  AliTRDSignalIndex::NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin)
   // return the position (index in the data array) of the next available tbin 
   // within the current pad
 
-//   if (fNRCcounter >= fNRCindexed)
-//     return kFALSE;
-
-  if (fPositionCol + fNtbins >= fMaxLimit)
+  if (fPositionRow >= fMaxLimit)
     {
+      //AliDebug(8, "Out of index range");
       return kFALSE;
     }
 
@@ -343,7 +379,6 @@ Bool_t  AliTRDSignalIndex::NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin)
     {
       if (NextRCIndex(row, col))
        {
-         //return NextTbinIndex(tbin);
          return NextRCTbinIndex(row, col, tbin);
        }
     }
@@ -357,11 +392,9 @@ Bool_t  AliTRDSignalIndex::NextTbinIndex(Int_t &tbin)
   // return the position (index in the data array) of the next available tbin 
   // within the current pad
 
-//   if (fNRCcounter >= fNRCindexed)
-//     return kFALSE;
-
-  if (fPositionCol + fNtbins >= fMaxLimit || fPositionTbin > fNtbins)
+  if (fPositionCol + fPositionTbin >= fMaxLimit || fPositionTbin > fNtbins)
     {
+      //AliDebug(8, "Out of index range");
       return kFALSE;
     }