]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDdataArray.h
Modification by Raphaelle, averaged t0
[u/mrichter/AliRoot.git] / TRD / AliTRDdataArray.h
index c6ecdf51e44f2b7497abb5e165cbe7a5b7545b9c..f4260aafd877d125f0149627da94e3b9c21ed0a0 100644 (file)
@@ -6,8 +6,6 @@
 
 /* $Id$ */
  
-#include   "AliTRDarrayI.h"
-#include   "AliTRDarrayF.h"
 #include   "AliTRDsegmentID.h"
 
 /////////////////////////////////////////////////////////////
@@ -15,6 +13,8 @@
 //  Adapted from AliDigits, origin M.Ivanov                //
 /////////////////////////////////////////////////////////////
 
+class AliTRDarrayI;
+
 class AliTRDdataArray : public AliTRDsegmentID {
 
  public:
@@ -25,21 +25,26 @@ class AliTRDdataArray : public AliTRDsegmentID {
   virtual ~AliTRDdataArray();
   AliTRDdataArray &operator=(const AliTRDdataArray &d);
 
-  virtual void   Copy(TObject &d);
+  virtual void   Copy(TObject &d) const;
   virtual void   Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
   virtual void   Reset();
 
-  virtual Int_t  GetNRow()                     { return fNrow;       };
-  virtual Int_t  GetNCol()                     { return fNcol;       };
-  virtual Int_t  GetNtime()                    { return fNtime;      };
-
-          Int_t  GetIndex(Int_t row, Int_t col, Int_t time);
+  virtual Int_t  GetNrow() const               { return fNrow;       };
+  virtual Int_t  GetNcol() const               { return fNcol;       };
+  virtual Int_t  GetNtime() const              { return fNtime;      };
+          Int_t  GetIndex(Int_t row, Int_t col, Int_t time) const;
+          Int_t  GetIndexUnchecked(Int_t row, Int_t col, Int_t time) const
+           { return time * fNrow*fNcol + GetIdx1Unchecked(row,col); };
+          Int_t  GetBufType() const            { return fBufType;    };
+  virtual Int_t  GetNelems() const             { return fNelems;     };
 
  protected:
 
-          Int_t  GetIdx1(Int_t row, Int_t col);
-  inline  Bool_t CheckBounds(const char *where, Int_t idx1, Int_t idx2);
-  inline  Bool_t OutOfBoundsError(const char *where, Int_t idx1, Int_t idx2);
+          Int_t  GetIdx1(Int_t row, Int_t col) const;
+  inline  Int_t  GetIdx1Unchecked(Int_t row, Int_t col) const
+                                               { return row + col * fNrow; };
+  inline  Bool_t CheckBounds(Int_t idx1, Int_t idx2);
+  inline  Bool_t OutOfBoundsError(Int_t idx1, Int_t idx2);
  
   Int_t          fNrow;            // Number of rows of the detector segement
   Int_t          fNcol;            // Number of columns of the detector segment