1 #ifndef TRDdataArrayF_H
2 #define TRDdataArrayF_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /* $Id: AliTRDdataArrayF.h,v */
9 #include "AliTRDdataArray.h"
11 /////////////////////////////////////////////////////////////
13 // General container for float data from TRD detector //
15 // Adapted from AliDigits, origin M.Ivanov //
17 /////////////////////////////////////////////////////////////
19 class AliTRDdataArrayF : public AliTRDdataArray {
24 AliTRDdataArrayF(Int_t nrow, Int_t ncol,Int_t ntime);
27 virtual void Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
28 virtual void Compress(Int_t bufferType, Float_t threshold);
29 virtual void Compress(Int_t bufferType);
30 virtual void Expand();
31 virtual Bool_t First();
32 virtual Bool_t Next();
35 inline void SetData(Int_t row, Int_t col, Int_t time, Float_t value);
36 virtual void SetThreshold(Float_t threshold) { fThreshold = threshold; };
38 virtual Float_t GetData(Int_t row, Int_t col, Int_t time);
39 virtual Float_t GetThreshold() { return fThreshold; };
41 virtual Int_t GetSize();
42 virtual Int_t GetDataSize();
43 virtual Int_t GetOverThreshold(Float_t threshold);
47 inline void SetDataFast(Int_t idx1, Int_t idx2, Float_t value);
48 inline Float_t GetDataFast(Int_t idx1, Int_t idx2);
50 Float_t GetData1(Int_t idx1, Int_t idx2);
60 AliTRDarrayF *fElements; // Buffer of 4 bytes floats for the array content
61 Float_t fThreshold; // Threshold for zero suppression
63 ClassDef(AliTRDdataArrayF,1) // Container for float data of one TRD detector segment
68 //_____________________________________________________________________________
69 inline Float_t AliTRDdataArrayF::GetDataFast(Int_t idx1, Int_t idx2)
72 // Returns the value at a given position in the array
75 return fElements->At(fIndex->At(idx2) + idx1);
79 //_____________________________________________________________________________
80 inline void AliTRDdataArrayF::SetData(Int_t row, Int_t col, Int_t time
84 // Sets the data value at a given position of the array
85 // Includes boundary checking
88 if ((row >= 0) && (col >= 0) && (time >= 0)) {
89 Int_t idx1 = GetIdx1(row,col);
90 if ((idx1 >= 0) && (time < fNdim2)) {
91 SetDataFast(idx1,time,value);
95 TObject::Error("SetData"
96 ,"time %d out of bounds (size: %d, this: 0x%08x)"
104 //_____________________________________________________________________________
105 inline void AliTRDdataArrayF::SetDataFast(Int_t idx1, Int_t idx2, Float_t value)
108 // Set the value at a given position in the array
111 if ((idx1 < 0) || (idx1 >= fNdim1) ||
112 (idx2 < 0) || (idx2 >= fNdim2)) {
113 TObject::Error("SetDataFast"
114 ,"idx1 %d idx2 %d out of bounds (size: %d x %d, this: 0x%08x)"
115 ,idx1,idx2,fNdim1,fNdim2,this);
118 (*fElements)[fIndex->fArray[idx2] + idx1] = value;