]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliDigits.h
1.
[u/mrichter/AliRoot.git] / TPC / AliDigits.h
index a4aa29f06003c550562e42a1694f9bfebfa1f60b..ccbc722b036f75292f168647b25ab4cf4595b399 100644 (file)
@@ -10,8 +10,8 @@
 //  segment is for example one pad row in TPC //
 ////////////////////////////////////////////////
 
-#include   "AliArrayI.h"
-#include   "AliArrayS.h"
+#include   <TArrayI.h>
+#include   <TArrayS.h>
 #include   "AliSegmentID.h"
 class AliH2F;
 
@@ -21,7 +21,9 @@ public:
   AliDigits(const AliDigits &digits); //copy constructor
   AliDigits &operator = (const AliDigits & digits); //assignment operator
   virtual ~AliDigits();
+  Short_t * GetDigits(){return fElements->GetArray();}   //return row  pointer to the array digits
   Short_t GetDigitFast(Int_t row, Int_t column);  //return value at given row and collumn
+  Short_t GetDigitUnchecked(Int_t row, Int_t column);  //return value at given row and collumn
   void  SetDigitFast(Short_t value,Int_t row, Int_t column);  //set value at given row and collumn
   Bool_t BoundsOK(const char *where, Int_t row, Int_t col) ;  //Check If Bound Ok
   Bool_t OutOfBoundsError(const char *where, Int_t row, Int_t column);
@@ -45,6 +47,9 @@ public:
   Int_t GetSize();//return total size of object in bytes
   Int_t GetDigitSize(); //return total size of pure digits 
   Int_t GetOverTh(Float_t threshold,Float_t x1=-1, Float_t x2=-1, Float_t y1=-1, Float_t y2=-1); //return number of digits over threshold 
+
+  inline Short_t * GetDigitsColumn(Int_t row);                              //return row  pointer to the array digits
+
 protected:
   virtual  void Invalidate();  
   void ExpandBuffer1(); //expand buffer of type to twodimensional array
@@ -58,8 +63,8 @@ protected:
   Int_t     fNrows;   //number of rows in Segment
   Int_t     fNcols; //number of collumns in Segment 
 private:
-  AliArrayS *fElements;  //buffer of 2 bytes integers for digits
-  AliArrayI *fIndex;  //index position of column
+  TArrayS *fElements;  //buffer of 2 bytes integers for digits
+  TArrayI *fIndex;  //index position of column
   Int_t     fBufType; //type of the buffer - define compression algorithm  
   Int_t     fThreshold; //treshold for zero suppresion
   Int_t     fNelems;  //total number of elements 
@@ -67,7 +72,7 @@ private:
   Int_t fCurrentCol;   //!current column iteration
   Int_t fCurrentIndex; //!current index in field
  
-  ClassDef(AliDigits,1
+  ClassDef(AliDigits,2
 };
  
 
@@ -90,12 +95,29 @@ inline Short_t AliDigits::GetDigitFast(Int_t row, Int_t column)
   return fElements->At(fIndex->At(column)+row); 
 }
 
+inline Short_t AliDigits::GetDigitUnchecked(Int_t row, Int_t column)
+{
+  //
+  //return digit from  fDigits array
+  //if out of range return dummy value  ( value at row = 0, collumn = 0)
+  //
+  return fElements->fArray[fIndex->fArray[column]+row]; 
+}
+
+inline Short_t * AliDigits::GetDigitsColumn(Int_t column){
+  //
+  //return row  pointer to the array digits
+  //
+  return &(fElements->fArray[fIndex->fArray[column]]);
+}
+
+
 inline void  AliDigits::SetDigitFast(Short_t value, Int_t row, Int_t column)
 {
   //
   //set  digit 
   //
-  if ( (row<0) || (row>=fNrows)  || (column<0) || (column>=fNrows) ) 
+  if ( (row<0) || (row>=fNrows)  || (column<0) || (column>=fNcols) ) 
        Error("AliDigits::SetDigitFast", "row %d  col %d out of bounds (size: %d x %d, this: 0x%08x)", 
           row, column, fNrows, fNcols, this);
   (*fElements)[fIndex->At(column)+row]=value;