]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDfeeParam.h
added protection for missing AODEvent in cases we write only delta AOD (Andrei G.)
[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 //  Author:                                                               //
15 //    Ken Oyama (oyama@physi.uni-heidelberg.de)                           //
16 //                                                                        //
17 ////////////////////////////////////////////////////////////////////////////
18
19 #include <TObject.h>
20
21 class TRootIoCtor;
22
23 class AliTRDCommonParam;
24 class AliTRDpadPlane;
25 class AliTRDgeometry;
26
27 //_____________________________________________________________________________
28 class AliTRDfeeParam : public TObject
29 {
30
31  public:
32
33   AliTRDfeeParam(TRootIoCtor *);
34   AliTRDfeeParam(const AliTRDfeeParam &p);
35   virtual           ~AliTRDfeeParam();
36   AliTRDfeeParam    &operator=(const AliTRDfeeParam &p);
37   virtual void       Copy(TObject &p) const;
38
39   static AliTRDfeeParam *Instance();  // Singleton
40   static void            Terminate();
41
42   // Translation from MCM to Pad and vice versa
43   virtual Int_t    GetPadRowFromMCM(Int_t irob, Int_t imcm) const;
44   virtual Int_t    GetPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
45   virtual Int_t    GetExtendedPadColFromADC(Int_t irob, Int_t imcm, Int_t iadc) const;
46   virtual Int_t    GetMCMfromPad(Int_t irow, Int_t icol) const;
47   virtual Int_t    GetROBfromPad(Int_t irow, Int_t icol) const;
48   virtual Int_t    GetRobSide(Int_t irob) const;
49   virtual Int_t    GetColSide(Int_t icol) const;
50
51   static  Float_t  GetSamplingFrequency() { return (Float_t)fgkLHCfrequency / 4000000.0; }
52   static  Int_t    GetNmcmRob()           { return fgkNmcmRob;      }
53   static  Int_t    GetNmcmRobInRow()      { return fgkNmcmRobInRow; }
54   static  Int_t    GetNmcmRobInCol()      { return fgkNmcmRobInCol; }
55   static  Int_t    GetNrobC0()            { return fgkNrobC0;       }
56   static  Int_t    GetNrobC1()            { return fgkNrobC1;       }
57   static  Int_t    GetNadcMcm()           { return fgkNadcMcm;      }
58   // static  Int_t    GetNtimebin()       { return fgkNtimebin;     }
59   static  Int_t    GetNcol()              { return fgkNcol;         }
60   static  Int_t    GetNcolMcm()           { return fgkNcolMcm;      }
61   static  Int_t    GetNrowC0()            { return fgkNrowC0;       }
62   static  Int_t    GetNrowC1()            { return fgkNrowC1;       }
63
64   // static  Int_t    GetADCpedestal()    { return fgkADCpedestal;  }
65   // static  Int_t    GetADCnoise()       { return fgkADCnoise;     }
66   static  Int_t    GetADCDAC()            { return fgkADCDAC;       }
67
68   static  Bool_t   IsPFon()               { return fgkPFon;         }
69   static  Bool_t   IsGFon()               { return fgkGFon;         }
70   static  Bool_t   IsTFon()               { return fgkTFon;         }
71
72   static  Int_t    GetPFtimeConstant()    { return fgkPFtimeConstant;   }
73   static  Int_t    GetPFeffectPedestal()  { return fgkPFeffectPedestal; }
74
75   //new
76   static  Int_t    GetQacc0Start()        {  return fgkPREPqAcc0Start; }
77   static  Int_t    GetQacc0End()          {  return fgkPREPqAcc0End; }
78   static  Int_t    GetQacc1Start()        {  return fgkPREPqAcc1Start; }
79   static  Int_t    GetQacc1End()          {  return fgkPREPqAcc1End; }
80           Float_t  GetMinClusterCharge() const {  return fgkMinClusterCharge; }
81   static  Int_t    GetLinearFitStart()    {  return fgkPREPLinearFitStart; }
82   static  Int_t    GetLinearFitEnd()      {  return fgkPREPLinearFitEnd;  }
83
84   //        Float_t  GetClusThr()           { return fClusThr; };
85   //        Float_t  GetPadThr() const { return fPadThr; };
86   //        Int_t    GetTailCancelation() const { return fTCOn; };
87   //        Int_t    GetNexponential() const { return fTCnexp; };
88   //virtual void     GetFilterParam(Float_t &r1, Float_t &r2, Float_t &c1, Float_t &c2, Float_t &ped) const;
89   //        Int_t    GetFilterType() const { return fFilterType; };
90
91   static  Int_t    GetTFtype()            { return fgkTFtype;       }
92   //static  Int_t    GetTFnExp()            { return fgkTFnExp;       }
93           Int_t    GetTFnExp()      const { return fTFnExp;         }
94           Float_t  GetTFr1()        const { return fTFr1;           }
95           Float_t  GetTFr2()        const { return fTFr2;           }
96           Float_t  GetTFc1()        const { return fTFc1;           }
97           Float_t  GetTFc2()        const { return fTFc2;           }
98
99  // for tracklets
100           Bool_t   GetTracklet()         const { return fgTracklet; } 
101   static  void     SetTracklet(Bool_t trackletSim = kTRUE) { fgTracklet = trackletSim; }
102           Int_t    GetMaxNrOfTracklets() const { return fgkMaxNrOfTracklets; } 
103           Bool_t    GetMCTrackletOutput() const { return fgkMCTrackletOutput; }
104
105   static  Float_t  GetTFattPar()          { return ((Float_t) fgkTFattPar1) / ((Float_t) fgkTFattPar2); }
106           Float_t  GetTFf0()        const { return 1.0 + fgkTFon*(-1.0+GetTFattPar()); }   // 1 if TC off
107
108           void     SetEBsglIndThr(Int_t val);  
109           Int_t    GetEBsglIndThr() const { return fEBsglIndThr;    }
110
111           void     SetEBsumIndThr(Int_t val);
112           Int_t    GetEBsumIndThr() const { return fEBsumIndThr;    }
113
114           void     SetEBindLUT(Int_t val);
115           Int_t    GetEBindLUT()    const { return fEBindLUT;       }
116
117           void     SetEBignoreNeighbour(Int_t val);
118           Int_t    GetEBignoreNeighbour() const             { return fEBignoreNeighbour; }
119
120   // Concerning raw data format
121           Int_t    GetRAWversion() const                    { return fRAWversion;        }
122           void     SetRAWversion( Int_t rawver );
123           Bool_t   GetRAWstoreRaw() const                   { return fRAWstoreRaw;       }
124           void     SetRAWstoreRaw( Bool_t storeraw )        { fRAWstoreRaw = storeraw;   }
125
126           void     SetXenon();
127           void     SetArgon();
128
129  protected:
130
131   static AliTRDfeeParam *fgInstance;         // Singleton instance
132   static Bool_t          fgTerminated;       // Defines if this class has already been terminated
133
134   AliTRDCommonParam     *fCP;                // TRD common parameters class
135
136   // Remark: ISO C++ allows initialization of static const values only for integer.
137
138   // Basic Geometrical numbers
139   static const Int_t    fgkLHCfrequency      = 40079000 ; // [Hz] LHC clock (should be moved to STEER?)
140   static const Int_t    fgkNmcmRob           = 16;        // Number of MCMs per ROB         (old fgkMCMmax)
141   static const Int_t    fgkNmcmRobInRow      = 4;         // Number of MCMs per ROB in row dir. (old fgkMCMrow)
142   static const Int_t    fgkNmcmRobInCol      = 4;         // Number of MCMs per ROB in col dir. (old fgkMCMrow)
143   static const Int_t    fgkNrobC0            = 6;         // Number of ROBs per C0 chamber  (old fgkROBmaxC0)
144   static const Int_t    fgkNrobC1            = 8;         // Number of ROBs per C1 chamber  (old fgkROBmaxC1)
145   static const Int_t    fgkNadcMcm           = 21;        // Number of ADC channels per MCM (old fgkADCmax)
146   // static const Int_t    fgkNtimebin       = 24;        // Number of Time bins should come from calibDB
147   static const Int_t    fgkNcol              = 144;       // Number of pads per padplane row(old fgkColmax)
148   static const Int_t    fgkNcolMcm           = 18;        // Number of pads per MCM         (old fgkPadmax)
149   static const Int_t    fgkNrowC0            = 12;        // Number of Rows per C0 chamber  (old fgkRowmaxC0)
150   static const Int_t    fgkNrowC1            = 16;        // Number of Rows per C1 chamber  (old fgkRowmaxC1)
151
152   // ADC intrinsic parameters
153   static const Int_t    fgkADCDAC            = 0;         // 5 bit ADC gain parameter
154
155   // TRAP filter global setup
156   static const Bool_t   fgkPFon              = kTRUE;     // Pedestal Filter enable/disable flag.
157   static const Bool_t   fgkGFon              = kFALSE;    // Gain correction Filter enable/disable flag
158   static const Bool_t   fgkTFon              = kTRUE;     // Tail cancelation Filter enable/disable flag (old name fTCOn)
159
160   // PF setup
161   static const Int_t    fgkPFtimeConstant    =  0;        // 0 for fastest, 3 for slowest (no effect, probably)
162   static const Int_t    fgkPFeffectPedestal  = 10;        // [in ADC units] the desired baseline (Additive)
163
164   // GF setup
165   static const Int_t    fgkGFnoise           =  0;        // Noise level increased by gain filter x 100 [in ADC] (to be measured)
166
167   // TF setup
168   static const Int_t    fgkTFtype            = 1;         // TC type (0=analog, 1=digital, 2=MI, 3=close to electronics) (old name fFilterType)
169
170   // OLD TF setup (calculated from above)  (valid only for fgkTFsimType = 0 or 1)
171   //static const Int_t    fgkTFnExp          = 1;           // Number of exponential for simType 0 and 1
172                Int_t    fTFnExp;                            // Number of exponential for simType 0 and 1
173
174  // Tracklet  processing on/off 
175   static       Bool_t   fgTracklet; // tracklet processing
176
177   static const Int_t    fgkMaxNrOfTracklets = 4;          // Max. nr of tracklet words for one mcm
178
179   // additional tracklet folder structure output, 
180   // containing all necessary Monte Carlo information; maybe this should go somewhere else;
181   static const Bool_t   fgkMCTrackletOutput = kTRUE;      // Default should be kTRUE
182
183   // following need Instance because initialized in constructor
184                Float_t  fTFr1;                            // Time constant [us] long (old name fR1)
185                Float_t  fTFr2;                            // Time constant [us] short(old name fR2)
186                Float_t  fTFc1;                            // Weight long  (old name fC1)
187                Float_t  fTFc2;                            // Weight short (old name fC2)
188
189   // here is for TRAP simulation (not yet used)
190   static const Int_t    fgkTFdecayWeightL     = 270;      // 0 to 1024 corresponds to 0 to 0.5
191   static const Int_t    fgkTFdecayParL        = 348;      // 0 to 511 corresponds to 0.75 to 1
192   static const Int_t    fgkTFdecayParS        = 449;      // 0 to 511 correponds to 0.25 to 0.5
193   static const Int_t    fgkTFattPar1          = 45;       // attenuationParameter = fgkTFattenuationParameter1/fgkTFattenuationParameter2
194   static const Int_t    fgkTFattPar2          = 14;       //                      = -alphaL/ln(lambdaL)-(1-alphaL)/ln(lambdaS)
195
196   // ZS parameters
197                Int_t    fEBsglIndThr;                     // EBIS in ADC units
198                Int_t    fEBsumIndThr;                     // EBIT in ADC units
199                Int_t    fEBindLUT;                        // EBIL lookup table
200                Int_t    fEBignoreNeighbour;               // EBIN 0:include neighbor
201
202   // Charge accumulators
203   static const Int_t    fgkPREPqAcc0Start     =  5;       // Preprocessor Charge Accumulator 0 Start
204   static const Int_t    fgkPREPqAcc0End       = 10;       // Preprocessor Charge Accumulator 0 End
205   static const Int_t    fgkPREPqAcc1Start     = 11;       // Preprocessor Charge Accumulator 1 Start
206   static const Int_t    fgkPREPqAcc1End       = 20;       // Preprocessor Charge Accumulator 1 End
207   static const Int_t    fgkMinClusterCharge   = 20;       // Hit detection [in ADC units]
208
209   //new
210   static const Int_t    fgkPREPLinearFitStart = 5;        // Time constants for linear fit
211   static const Int_t    fgkPREPLinearFitEnd   = 20;       // Time constants for linear fit
212
213   // OLD TRAP processing parameters calculated from above
214   //static const Float_t  fClusThr;                       // Cluster threshold
215   //static const Float_t  fPadThr;                        // Pad threshold
216
217   // For raw production
218                Int_t    fRAWversion;                      // Raw data production version
219   static const Int_t    fgkMaxRAWversion      = 3;        // Maximum raw version number supported
220                Bool_t   fRAWstoreRaw;                     // Store unfiltered data for raw data stream
221
222  private:
223
224   AliTRDfeeParam();
225
226   ClassDef(AliTRDfeeParam,3)                              // The TRD front end electronics parameter
227
228 };
229 #endif