1 #ifndef ALITRDDATAARRAY_H
2 #define ALITRDDATAARRAY_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 #include "AliTRDsegmentID.h"
11 /////////////////////////////////////////////////////////////
12 // General container for data from TRD detector segments //
13 // Adapted from AliDigits, origin M.Ivanov //
14 /////////////////////////////////////////////////////////////
18 class AliTRDdataArray : public AliTRDsegmentID {
23 AliTRDdataArray(Int_t nrow, Int_t ncol,Int_t ntime);
24 AliTRDdataArray(const AliTRDdataArray &d);
25 virtual ~AliTRDdataArray();
26 AliTRDdataArray &operator=(const AliTRDdataArray &d);
28 virtual void Copy(TObject &d);
29 virtual void Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
32 virtual Int_t GetNrow() const { return fNrow; };
33 virtual Int_t GetNcol() const { return fNcol; };
34 virtual Int_t GetNtime() const { return fNtime; };
35 Int_t GetIndex(Int_t row, Int_t col, Int_t time) const;
36 Int_t GetIndexUnchecked(Int_t row, Int_t col, Int_t time) const
37 { return time * fNrow*fNcol + GetIdx1Unchecked(row,col); };
38 Int_t GetBufType() const { return fBufType; };
39 virtual Int_t GetNelems() const { return fNelems; };
43 Int_t GetIdx1(Int_t row, Int_t col) const;
44 inline Int_t GetIdx1Unchecked(Int_t row, Int_t col) const
45 { return row + col * fNrow; };
46 inline Bool_t CheckBounds(const char *where, Int_t idx1, Int_t idx2);
47 inline Bool_t OutOfBoundsError(const char *where, Int_t idx1, Int_t idx2);
49 Int_t fNrow; // Number of rows of the detector segement
50 Int_t fNcol; // Number of columns of the detector segment
51 Int_t fNtime; // Number of timebins of the detector segment
53 Int_t fNdim1; // First dimension of the array (row * column)
54 Int_t fNdim2; // Second dimension of the array (time, not compressed)
56 AliTRDarrayI *fIndex; // Index position of column
57 Int_t fBufType; // Type of the buffer - defines the compression algorithm
58 Int_t fNelems; // Total number of elements
59 Int_t fCurrentIdx1; // !Current index 1
60 Int_t fCurrentIdx2; // !Current index 2
61 Int_t fCurrentIndex; // !Current index in field
63 ClassDef(AliTRDdataArray,1) // Data container for one TRD detector segment