]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDarrayADC.h
67e9d70ae922283bbcfce20dd5c05176fb33f31e
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayADC.h
1 #ifndef ALITRDARRAYADC_H
2 #define ALITRDARRAYADC_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * 
4  * See cxx source for full Copyright notice */ 
5
6 /* $Id: AliTRDarrayADC.h 23387 2008-01-17 17:25:16Z cblume $ */
7
8 ///////////////////////////////////////////////
9 //                                           //
10 // Container class for ADC values            //
11 //                                           // 
12 ///////////////////////////////////////////////
13
14 #include <TObject.h>
15
16 class AliTRDarrayADC: public TObject
17 {
18  public:
19
20   AliTRDarrayADC();
21   AliTRDarrayADC(Int_t nrow, Int_t ncol, Int_t ntime);
22   AliTRDarrayADC(const AliTRDarrayADC &b);
23   ~AliTRDarrayADC();
24   AliTRDarrayADC &operator=(const AliTRDarrayADC &b);
25
26   void    Allocate(Int_t nrow, Int_t ncol, Int_t ntime);
27   void    SetNdet(Int_t ndet) {fNdet=ndet;};  
28   Int_t   GetNdet()  const {return fNdet;};
29   void    SetData(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value)
30                         {fADC[(nrow*fNcol+ncol)*fNtime+ntime]=value;};
31   Bool_t  HasData() const {return fNtime ? 1 : 0;};
32   Short_t GetData(Int_t nrow, Int_t ncol, Int_t ntime) const
33                        {return fADC[(nrow*fNcol+ncol)*fNtime+ntime];};
34   inline void GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const;
35   Short_t GetDataB(Int_t nrow, Int_t ncol, Int_t ntime) const;
36   UChar_t GetPadStatus(Int_t nrow, Int_t ncol, Int_t ntime) const;
37   void    SetPadStatus(Int_t nrow, Int_t ncol, Int_t ntime, UChar_t status);
38   Bool_t  IsPadCorrupted(Int_t nrow, Int_t ncol, Int_t ntime);
39   void    Compress();
40   void    Expand();
41   Int_t   GetNtime() const {return fNtime;};
42   Int_t   GetNrow() const {return fNrow;};
43   Int_t   GetNcol() const {return fNcol;};
44   Int_t   GetDim() const {return fNAdim;};
45   void    DeleteNegatives();
46   void    Reset();
47
48  protected:
49
50   Int_t fNdet;    //ID number of the chamber
51   Int_t fNrow;    //Number of rows
52   Int_t fNcol;    //Number of columns
53   Int_t fNtime;   //Number of time bins
54   Int_t fNAdim;   //Dimension of the ADC array
55   Short_t* fADC;  //[fNAdim]   //Pointer to adc values
56
57   ClassDef(AliTRDarrayADC,1) //ADC container class
58     
59 };
60
61 inline void AliTRDarrayADC::GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const
62 {
63   for(Int_t ic=n, idx = (r*fNcol+c)*fNtime+t; ic--; idx+=fNtime) vals[ic] = fADC[idx];
64 }
65
66 #endif