]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDarrayADC.h
Faster version of baseline correction by Theodor with additional protection against...
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayADC.h
CommitLineData
8c25d014 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
16class 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 SetDataByAdcCol(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value)
30 {fADC[(nrow*fNumberOfChannels+ncol)*fNtime+ntime]=value-fBaseline;};
31 Bool_t HasData() const {return fNtime ? 1 : 0;};
32 Short_t GetDataByAdcCol(Int_t nrow, Int_t ncol, Int_t ntime) const
33 {return fADC[(nrow*fNumberOfChannels+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 GetDataBits(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 Short_t GetData(Int_t nrow, Int_t ncol, Int_t ntime) const;
48 void SetData(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value);
49 static void CreateLut();
50 void SetBaseline(Short_t baseline) {fBaseline=baseline;}
51
52 protected:
53
54 Int_t fNdet; //ID number of the chamber
55 Int_t fNrow; //Number of rows
56 Int_t fNcol; //Number of columns(pads)
57 Int_t fNumberOfChannels; // Number of MCM channels per row
58 Int_t fNtime; //Number of time bins
59 Int_t fNAdim; //Dimension of the ADC array
60 Short_t fBaseline;
61 Short_t* fADC; //[fNAdim] //Pointer to adc values
62 static Short_t *fgLutPadNumbering; // [fNcol] Look Up Table
63
64 ClassDef(AliTRDarrayADC,4) //ADC container class
65
66};
67
68inline void AliTRDarrayADC::GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const
69{
70 Int_t colNum = fgLutPadNumbering[c];
71 for(Int_t ic=n, idx = (r*fNumberOfChannels+colNum)*fNtime+t; ic--; idx+=fNtime) vals[ic] = fADC[idx];
72 }
73
74#endif
75