]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDarrayADC.h
extend debug stream to prepare studies of bremsstrahlung detection in
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayADC.h
CommitLineData
b65e5048 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;};
da43c135 29 void SetDataByAdcCol(Int_t nrow, Int_t ncol, Int_t ntime, Short_t value)
30 {fADC[(nrow*fNumberOfChannels+ncol)*fNtime+ntime]=value;};
b65e5048 31 Bool_t HasData() const {return fNtime ? 1 : 0;};
da43c135 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;
b65e5048 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;};
0d64b05f 45 void DeleteNegatives();
705d9e7b 46 void Reset();
da43c135 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 void CreateLut();
b65e5048 50
51 protected:
52
53 Int_t fNdet; //ID number of the chamber
54 Int_t fNrow; //Number of rows
da43c135 55 Int_t fNcol; //Number of columns(pads)
56 Int_t fNumberOfChannels; // Number of MCM channels per row
b65e5048 57 Int_t fNtime; //Number of time bins
58 Int_t fNAdim; //Dimension of the ADC array
59 Short_t* fADC; //[fNAdim] //Pointer to adc values
da43c135 60 Short_t *fLutPadNumbering; // [fNcol] Look Up Table
b65e5048 61
da43c135 62 ClassDef(AliTRDarrayADC,2) //ADC container class
b65e5048 63
64};
b72f4eaf 65
66inline void AliTRDarrayADC::GetData(Int_t r, Int_t c, Int_t t, Int_t n, Short_t *vals) const
67{
da43c135 68 Int_t ColNum = fLutPadNumbering[c];
69 for(Int_t ic=n, idx = (r*fNumberOfChannels+ColNum)*fNtime+t; ic--; idx+=fNtime) vals[ic] = fADC[idx];
70 }
b72f4eaf 71
b65e5048 72#endif
da43c135 73