]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDarrayADC.h
Time data monitoring (Raphael)
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayADC.h
CommitLineData
2163de14 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
16class 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
e570c2a5 50 void SubtractBaseline(Short_t baseline);\r
2163de14 51\r
52 protected:\r
53\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
f41a4d6a 61 static Short_t *fgLutPadNumbering; // [fNcol] Look Up Table\r
2163de14 62\r
f41a4d6a 63 ClassDef(AliTRDarrayADC,4) //ADC container class\r
2163de14 64 \r
65};\r
66\r
67inline void AliTRDarrayADC::GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const\r
68{\r
f41a4d6a 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
2163de14 71 }\r
72\r
73#endif \r
74\r