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