]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDfeeParam.h
c43c249f052ae6250cb1f3377355350d36069e36
[u/mrichter/AliRoot.git] / TRD / AliTRDfeeParam.h
1 #ifndef ALITRDFEEPARAM_H
2 #define ALITRDFEEPARAM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //////////////////////////////////////////////////
9 //                                              //
10 //  TRD front end electronics parameters class  //
11 //  Contains all FEE (MCM, TRAP, PASA) related  //
12 //  parameters, constants, and mapping.         //
13 //                                              //
14 //////////////////////////////////////////////////
15
16 #include <TObject.h>
17
18 class AliTRDCommonParam;
19 class AliTRDpadPlane;
20 class AliTRDgeometry;
21
22 //_____________________________________________________________________________
23 class AliTRDfeeParam : public TObject
24 {
25
26  public:
27
28   AliTRDfeeParam(const AliTRDfeeParam &p);
29   virtual           ~AliTRDfeeParam();
30   AliTRDfeeParam    &operator=(const AliTRDfeeParam &p);
31   virtual void       Copy(TObject &p) const;
32
33   static AliTRDfeeParam *Instance();  // Singleton
34   static void            Terminate();
35
36   // Translation from MCM to Pad and vice versa
37   virtual Int_t    GetPadRowFromMCM(Int_t irob, Int_t imcm) const;
38   virtual Int_t    GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
39   virtual Int_t    GetMCMfromPad(Int_t irow, Int_t icol) const;
40   virtual Int_t    GetROBfromPad(Int_t irow, Int_t icol) const;
41   virtual Int_t    GetRobSide(Int_t irob) const;
42   virtual Int_t    GetColSide(Int_t icol) const;
43
44   static  Float_t  GetSamplingFrequency() { return (Float_t)fgkLHCfrequency / 4000000.0; }
45   static  Int_t    GetNmcmRob()           { return fgkNmcmRob; }
46   static  Int_t    GetNmcmRobInRow()      { return fgkNmcmRobInRow; }
47   static  Int_t    GetNmcmRobInCol()      { return fgkNmcmRobInCol; }
48   static  Int_t    GetNrobC0()            { return fgkNrobC0; }
49   static  Int_t    GetNrobC1()            { return fgkNrobC1; }
50   static  Int_t    GetNadcMcm()           { return fgkNadcMcm; }
51   // static  Int_t    GetNtimebin()       { return fgkNtimebin; }
52   static  Int_t    GetNcol()              { return fgkNcol; }
53   static  Int_t    GetNcolMcm()           { return fgkNcolMcm; }
54   static  Int_t    GetNrowC0()            { return fgkNrowC0; }
55   static  Int_t    GetNrowC1()            { return fgkNrowC1; }
56
57   // static  Int_t    GetADCpedestal()    { return fgkADCpedestal; }
58   // static  Int_t    GetADCnoise()       { return fgkADCnoise; }
59   static  Int_t    GetADCDAC()            { return fgkADCDAC; }
60
61   static  Bool_t   isPFon()               { return fgkPFon; }
62   static  Bool_t   isGFon()               { return fgkGFon; }
63   static  Bool_t   isTFon()               { return fgkTFon; }
64
65   static  Int_t    GetPFtimeConstant()    {  return fgkPFtimeConstant; }
66   static  Int_t    GetPFeffectPedestal()  {  return fgkPFeffectPedestal; }
67
68   //        Float_t  GetClusThr()           { return fClusThr; };
69   //        Float_t  GetPadThr() const { return fPadThr; };
70   //        Int_t    GetTailCancelation() const { return fTCOn; };
71   //        Int_t    GetNexponential() const { return fTCnexp; };
72   //virtual void     GetFilterParam(Float_t &r1, Float_t &r2, Float_t &c1, Float_t &c2, Float_t &ped) const;
73   //        Int_t    GetFilterType() const { return fFilterType; };
74
75   static  Int_t    GetTFtype()            { return fgkTFtype; }
76   static  Int_t    GetTFnExp()            { return fgkTFnExp; }
77           Float_t  GetTFr1()              { return fTFr1; }
78           Float_t  GetTFr2()              { return fTFr2; }
79           Float_t  GetTFc1()              { return fTFc1; }
80           Float_t  GetTFc2()              { return fTFc2; }
81
82   static  Float_t  GetTFattPar()          { return ((Float_t)fgkTFattPar1) / ((Float_t)fgkTFattPar2) ; }
83   static  Float_t  GetTFf0()              { return 1 + fgkTFon*(-1+GetTFattPar()); }   // 1 if TC off
84   
85   static  Int_t    GetEBsglIndThr()       { return fgkEBsglIndThr; }
86   static  Int_t    GetEBsumIndThr()       { return fgkEBsumIndThr; }
87   static  Int_t    GetEBindLUT()          { return fgkEBindLUT; }
88   static  Int_t    GetEBignoreNeighbour() { return fgkEBignoreNeighbour; }
89
90   // Concerning raw data format
91           Int_t    GetRAWversion();
92           void     SetRAWversion( Int_t rawver );
93           Bool_t   GetRAWstoreRaw();
94           void     SetRAWstoreRaw( Bool_t storeraw );
95
96  protected:
97
98   static AliTRDfeeParam *fgInstance;
99   static Bool_t          fgTerminated;       //  Defines if this class has already been terminated                                                        
100
101   //  AliTRDgeometry    *fGeo;     // TRD geometry class
102   AliTRDCommonParam *fCP;      // TRD common parameters class
103
104   // Remark: ISO C++ allows initialization of static const values only for integer.
105
106   // Basic Geometrical numbers
107   static const Int_t    fgkLHCfrequency      = 40079000 ; // [Hz] LHC clock (should be moved to STEER?)
108   static const Int_t    fgkNmcmRob           = 16;        // Number of MCMs per ROB         (old fgkMCMmax)
109   static const Int_t    fgkNmcmRobInRow      = 4;         // Number of MCMs per ROB in row dir. (old fgkMCMrow)
110   static const Int_t    fgkNmcmRobInCol      = 4;         // Number of MCMs per ROB in col dir. (old fgkMCMrow)
111   static const Int_t    fgkNrobC0            = 6;         // Number of ROBs per C0 chamber  (old fgkROBmaxC0)
112   static const Int_t    fgkNrobC1            = 8;         // Number of ROBs per C1 chamber  (old fgkROBmaxC1)
113   static const Int_t    fgkNadcMcm           = 21;        // Number of ADC channels per MCM (old fgkADCmax)
114   // static const Int_t    fgkNtimebin       = 24;        // Number of Time bins should come from calibDB
115   static const Int_t    fgkNcol              = 144;       // Number of pads per padplane row(old fgkColmax)
116   static const Int_t    fgkNcolMcm           = 18;        // Number of pads per MCM         (old fgkPadmax)
117   static const Int_t    fgkNrowC0            = 12;        // Number of Rows per C0 chamber  (old fgkRowmaxC0)
118   static const Int_t    fgkNrowC1            = 16;        // Number of Rows per C1 chamber  (old fgkRowmaxC1)
119
120   // ADC intrinsic parameters
121   // static const Int_t    fgkADCpedestal    = 0;         // This is simulation parameter and not the value set in FEE, moved to simParam
122   // static const Int_t    fgkADCnoise       = 10;        // This is simulation parameter and not the value set in FEE, moved to simParam
123   static const Int_t    fgkADCDAC            = 0;         // 5 bit ADC gain parameter
124
125   // TRAP filter global setup
126   static const Bool_t   fgkPFon              = kTRUE;     // Pedestal Filter enable/disable flag.
127   static const Bool_t   fgkGFon              = kFALSE;    // Gain correction Filter enable/disable flag
128   static const Bool_t   fgkTFon              = kTRUE;     // Tail cancelation Filter enable/disable flag (old name fTCOn)
129
130   // PF setup
131   static const Int_t    fgkPFtimeConstant    =  0;    // 0 for fastest, 3 for slowest (no effect, probably)
132   static const Int_t    fgkPFeffectPedestal  = 10;    // [in ADC units] the desired baseline (Additive)
133
134   // GF setup
135   static const Int_t    fgkGFnoise           =  0;    // Noise level increased by gain filter x 100 [in ADC] (to be measured)
136
137   // TF setup
138   static const Int_t    fgkTFtype            = 1;     // TC type (0=analog, 1=digital, 2=MI) (old name fFilterType)
139
140   // OLD TF setup (calculated from above)  (valid only for fgkTFsimType = 0 or 1)
141   static const Int_t    fgkTFnExp          = 1;       // Number of exponential for simType 0 and 1
142
143   // following need Instance because initialized in constructor
144                Float_t  fTFr1;                        // Time constant [us] long (old name fR1)
145                Float_t  fTFr2;                        // Time constant [us] short(old name fR2)
146                Float_t  fTFc1;                        // Weight long  (old name fC1)
147                Float_t  fTFc2;                        // Weight short (old name fC2)
148
149   // here is for TRAP simulation (not yet used)
150   static const Int_t    fgkTFdecayWeightL     = 270;  // 0 to 1024 corresponds to 0 to 0.5
151   static const Int_t    fgkTFdecayParL        = 348;  // 0 to 511 corresponds to 0.75 to 1
152   static const Int_t    fgkTFdecayParS        = 449;  // 0 to 511 correponds to 0.25 to 0.5
153   static const Int_t    fgkTFattPar1          = 45;   // attenuationParameter = fgkTFattenuationParameter1/fgkTFattenuationParameter2
154   static const Int_t    fgkTFattPar2          = 14;   //                      = -alphaL/ln(lambdaL)-(1-alphaL)/ln(lambdaS)
155
156   // ZS parameters
157   static const Int_t    fgkEBsglIndThr        = 5;    // EBIS in ADC units
158   static const Int_t    fgkEBsumIndThr        = 5;    // EBIT in ADC units
159   static const Int_t    fgkEBindLUT           = 0xF0; // EBIL lookup table
160   static const Int_t    fgkEBignoreNeighbour  = 0;    // EBIN 0:include neighbor
161
162   // Charge accumulators
163   static const Int_t    fgkPREPqAcc0Start      =  0;   // Preprocessor Charge Accumulator 0 Start
164   static const Int_t    fgkPREPqAcc0End        = 10;   // Preprocessor Charge Accumulator 0 End
165   static const Int_t    fgkPREPqAcc1Start      = 11;   // Preprocessor Charge Accumulator 1 Start
166   static const Int_t    fgkPREPqAcc1End        = 20;   // Preprocessor Charge Accumulator 1 End
167   static const Int_t    fgkMinClusterCharge    = 20;   // Hit detection [in ADC units]
168
169   // OLD TRAP processing parameters calculated from above
170   //static const Float_t  fClusThr;                     // Cluster threshold
171   //static const Float_t  fPadThr;                      // Pad threshold
172
173   // For raw production
174                Int_t    fRAWversion;                    // Raw data production version
175   static const Int_t    fgkMaxRAWversion       = 3;     // Maximum raw version number supported
176                Bool_t   fRAWstoreRaw;                   // Store unfiltered data for raw data stream
177
178  private:
179
180   AliTRDfeeParam();
181
182   ClassDef(AliTRDfeeParam,1)  //
183 };
184
185 #endif