-#ifndef TRDdataArrayI_H
-#define TRDdataArrayI_H
+#ifndef ALITRDDATAARRAYI_H
+#define ALITRDDATAARRAYI_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
AliTRDdataArrayI();
AliTRDdataArrayI(Int_t nrow, Int_t ncol, Int_t ntime);
- ~AliTRDdataArrayI();
+ AliTRDdataArrayI(const AliTRDdataArrayI &a);
+ virtual ~AliTRDdataArrayI();
+ AliTRDdataArrayI &operator=(const AliTRDdataArrayI &a);
virtual void Allocate(Int_t nrow, Int_t ncol, Int_t ntime);
+ virtual void Copy(TObject &a) const;
virtual void Compress(Int_t bufferType, Int_t threshold);
virtual void Compress(Int_t bufferType);
virtual void Expand();
virtual Bool_t Next();
virtual void Reset();
- inline void SetData(Int_t row, Int_t col, Int_t time, Int_t value);
+ void SetData(Int_t row, Int_t col, Int_t time, Int_t value);
+ void SetDataUnchecked(Int_t row, Int_t col, Int_t time, Int_t value)
+ { SetDataFast(GetIdx1Unchecked(row,col),time,value); };
+
virtual void SetThreshold(Int_t threshold) { fThreshold = threshold; };
- virtual Int_t GetData(Int_t row, Int_t col, Int_t time);
- virtual Int_t GetThreshold() { return fThreshold; };
+ virtual Int_t GetData(Int_t row, Int_t col, Int_t time) const;
+ Int_t GetDataUnchecked(Int_t row, Int_t col, Int_t time) const
+ { return GetDataFast(GetIdx1Unchecked(row,col),time); };
+
+ virtual Int_t GetThreshold() const { return fThreshold; };
- virtual Int_t GetSize();
- virtual Int_t GetDataSize();
+ virtual Int_t GetSize() const;
+ virtual Int_t GetDataSize() const;
virtual Int_t GetOverThreshold(Int_t threshold);
protected:
- inline void SetDataFast(Int_t idx1, Int_t idx2, Int_t value);
- inline Int_t GetDataFast(Int_t idx1, Int_t idx2);
+ void SetDataFast(Int_t idx1, Int_t idx2, Int_t value);
+ Int_t GetDataFast(Int_t idx1, Int_t idx2) const;
- Int_t GetData1(Int_t idx1, Int_t idx2);
+ Int_t GetData1(Int_t idx1, Int_t idx2) const;
void Expand1();
void Compress1();
void Expand2();
};
-
-//_____________________________________________________________________________
-inline Int_t AliTRDdataArrayI::GetDataFast(Int_t idx1, Int_t idx2)
-{
- //
- // Returns the value at a given position in the array
- //
-
- return fElements->At(fIndex->At(idx2) + idx1);
-
-}
-
-//_____________________________________________________________________________
-inline void AliTRDdataArrayI::SetData(Int_t row, Int_t col, Int_t time
- , Int_t value)
-{
- //
- // Sets the data value at a given position of the array
- // Includes boundary checking
- //
-
- if ((row >= 0) && (col >= 0) && (time >= 0)) {
- Int_t idx1 = GetIdx1(row,col);
- if ((idx1 >= 0) && (time < fNdim2)) {
- SetDataFast(idx1,time,value);
- }
- else {
- if (idx1 >= 0) {
- TObject::Error("SetData"
- ,"time %d out of bounds (size: %d, this: 0x%08x)"
- ,time,fNdim2,this);
- }
- }
- }
-
-}
-
-//_____________________________________________________________________________
-inline void AliTRDdataArrayI::SetDataFast(Int_t idx1, Int_t idx2, Int_t value)
-{
- //
- // Set the value at a given position in the array
- //
-
- if ((idx1 < 0) || (idx1 >= fNdim1) ||
- (idx2 < 0) || (idx2 >= fNdim2)) {
- TObject::Error("SetDataFast"
- ,"idx1 %d idx2 %d out of bounds (size: %d x %d, this: 0x%08x)"
- ,idx1,idx2,fNdim1,fNdim2,this);
- }
-
- (*fElements)[fIndex->fArray[idx2] + idx1] = value;
-
-}
-
#endif
+