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
6 /* $Id: AliTRDarrayADC.h 23387 2008-01-17 17:25:16Z cblume $ */
\r
8 ///////////////////////////////////////////////
\r
10 // Container class for ADC values //
\r
12 ///////////////////////////////////////////////
\r
14 #include <TObject.h>
\r
16 class AliTRDarrayADC: public TObject
\r
21 AliTRDarrayADC(Int_t nrow, Int_t ncol, Int_t ntime);
\r
22 AliTRDarrayADC(const AliTRDarrayADC &b);
\r
24 AliTRDarrayADC &operator=(const AliTRDarrayADC &b);
\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
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
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 void SubtractBaseline(Short_t baseline);
\r
54 Int_t fNdet; //ID number of the chamber
\r
55 Int_t fNrow; //Number of rows
\r
56 Int_t fNcol; //Number of columns(pads)
\r
57 Int_t fNumberOfChannels; // Number of MCM channels per row
\r
58 Int_t fNtime; //Number of time bins
\r
59 Int_t fNAdim; //Dimension of the ADC array
\r
60 Short_t* fADC; //[fNAdim] //Pointer to adc values
\r
61 static Short_t *fgLutPadNumbering; // [fNcol] Look Up Table
\r
63 ClassDef(AliTRDarrayADC,4) //ADC container class
\r
67 inline void AliTRDarrayADC::GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const
\r
69 Int_t colNum = fgLutPadNumbering[c];
\r
70 for(Int_t ic=n, idx = (r*fNumberOfChannels+colNum)*fNtime+t; ic--; idx+=fNtime) vals[ic] = fADC[idx];
\r