]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDparameter.h
Introduce parameter class
[u/mrichter/AliRoot.git] / TRD / AliTRDparameter.h
1 #ifndef ALITRDPARAMETER_H
2 #define ALITRDPARAMETER_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 #include "TNamed.h"
9
10 class AliTRDgeometry;
11
12 class AliTRDparameter : public TNamed {
13
14  public:
15
16   enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
17  
18   AliTRDparameter();
19   AliTRDparameter(const Text_t* name, const Text_t* title);
20   AliTRDparameter(const AliTRDparameter &p);   
21   virtual ~AliTRDparameter();
22   AliTRDparameter &operator=(const AliTRDparameter &p); 
23
24   virtual void     Copy(TObject &p);
25   virtual void     Init();
26   virtual void     ReInit();
27  
28   virtual void     SetNRowPad();
29   virtual void     SetNRowPad(const Int_t p, const Int_t c, const Int_t npad);
30   virtual void     SetColPadSize(const Int_t p, const Float_t s);
31   virtual void     SetNTimeBin(const Int_t nbin);
32   virtual void     SetExpandTimeBin(const Int_t nbefore, const Int_t nafter)
33                                                                   { fTimeBefore = nbefore;
34                                                                     fTimeAfter  = nafter; };
35
36   virtual void     SetGasGain(Float_t gasgain)                    { fGasGain        = gasgain;  };
37   virtual void     SetNoise(Float_t noise)                        { fNoise          = noise;    };
38   virtual void     SetChipGain(Float_t chipgain)                  { fChipGain       = chipgain; };
39   virtual void     SetADCoutRange(Float_t range)                  { fADCoutRange    = range;    };
40   virtual void     SetADCinRange(Float_t range)                   { fADCinRange     = range;    };
41   virtual void     SetADCthreshold(Int_t thresh)                  { fADCthreshold   = thresh;   };
42   virtual void     SetDiffusion(Int_t diffOn = 1)                 { fDiffusionOn    = diffOn;   };
43   virtual void     SetElAttach(Int_t elOn = 1)                    { fElAttachOn     = elOn;     };
44   virtual void     SetElAttachProp(Float_t prop)                  { fElAttachProp   = prop;     };
45   virtual void     SetExB(Int_t exbOn = 1)                        { fExBOn          = exbOn;    };
46   virtual void     SetPadResponse(Int_t prfOn = 1)                { fPRFOn          = prfOn;    };
47   virtual void     SetTimeResponse(Int_t trfOn = 1)               { fTRFOn          = trfOn;   
48                                                                     ReInit();                   };
49   virtual void     SetCrossTalk(Int_t ctOn = 1)                   { fCTOn           = ctOn;   
50                                                                     ReInit();                   };
51   virtual void     SetTailCancelation(Int_t tcOn = 1)             { fTCOn           = tcOn;     };
52   virtual void     SetNexponential(Int_t nexp)                    { fTCnexp         = nexp;     };
53   virtual void     SetDriftVelocity(Float_t v)                    { fDriftVelocity  = v;       
54                                                                     ReInit();                   };
55   virtual void     SetPadCoupling(Float_t v)                      { fPadCoupling    = v;        };
56   virtual void     SetTimeCoupling(Float_t v)                     { fTimeCoupling   = v;        };
57   virtual void     SetTiltingAngle(Float_t v);
58
59   virtual void     SetLUT(Int_t lutOn = 1)                        { fLUTOn          = lutOn;    };
60   virtual void     SetClusMaxThresh(Int_t thresh)                 { fClusMaxThresh  = thresh;   };
61   virtual void     SetClusSigThresh(Int_t thresh)                 { fClusSigThresh  = thresh;   };
62   
63           Int_t    GetRowMax(const Int_t p, const Int_t c, const Int_t s)     
64                                                             const { return fRowMax[p][c][s]; };
65           Int_t    GetColMax(const Int_t p)                 const { return fColMax[p];       };
66           Int_t    GetTimeMax()                             const { return fTimeMax;         };
67           Int_t    GetTimeBefore()                          const { return fTimeBefore;      }; 
68           Int_t    GetTimeAfter()                           const { return fTimeAfter;       }; 
69           Int_t    GetTimeTotal()                           const { return fTimeMax 
70                                                                          + fTimeBefore 
71                                                                          + fTimeAfter; };
72
73           Float_t  GetRow0(const Int_t p, const Int_t c, const Int_t s)       
74                                                             const { return fRow0[p][c][s]; };
75           Float_t  GetCol0(const Int_t p)                   const { return fCol0[p];       };
76           Float_t  GetTime0(const Int_t p)                  const { return fTime0[p];      };
77
78           Float_t  GetRowPadSize(const Int_t p, const Int_t c, const Int_t s) 
79                                                             const { return fRowPadSize[p][c][s]; };
80           Float_t  GetColPadSize(const Int_t p)             const { return fColPadSize[p];       };
81           Float_t  GetTimeBinSize()                         const { return fTimeBinSize;         };
82
83           Float_t  GetGasGain()                             const { return fGasGain;       };
84           Float_t  GetNoise()                               const { return fNoise;         };
85           Float_t  GetChipGain()                            const { return fChipGain;      };
86           Float_t  GetADCoutRange()                         const { return fADCoutRange;   };
87           Float_t  GetADCinRange()                          const { return fADCinRange;    };
88           Int_t    GetADCthreshold()                        const { return fADCthreshold;  };
89           Float_t  GetDiffusionT()                          const { return fDiffusionT;    };
90           Float_t  GetDiffusionL()                          const { return fDiffusionL;    };
91           Float_t  GetElAttachProp()                        const { return fElAttachProp;  };
92           Float_t  GetOmegaTau()                            const { return fOmegaTau;      };
93           Float_t  GetDriftVelocity()                       const { return fDriftVelocity; };
94           Float_t  GetPadCoupling()                         const { return fPadCoupling;   };
95           Float_t  GetTimeCoupling()                        const { return fTimeCoupling;  };
96           Float_t  GetTimeBinWidth()                        const { return fTimeBinWidth;  };
97           Float_t  GetTRFlo()                               const { return fTRFlo;         };
98           Float_t  GetTRFhi()                               const { return fTRFhi;         };
99           Float_t  GetLorentzFactor()                       const { return fLorentzFactor; };
100           Float_t  GetTCnexp()                              const { return fTCnexp;        };
101           Float_t  GetTiltingAngle() const;
102   virtual Float_t  GetDiffusionL(Float_t vd, Float_t b);
103   virtual Float_t  GetDiffusionT(Float_t vd, Float_t b);
104   virtual Float_t  GetOmegaTau(Float_t vd, Float_t b);
105
106   virtual Int_t    GetClusMaxThresh()                       const { return fClusMaxThresh; };
107   virtual Int_t    GetClusSigThresh()                       const { return fClusSigThresh; };
108
109           Int_t    ExBOn()                                  const { return fExBOn;         };
110           Int_t    PRFOn()                                  const { return fPRFOn;         };
111           Int_t    TRFOn()                                  const { return fTRFOn;         };
112           Int_t    ElAttachOn()                             const { return fElAttachOn;    }; 
113           Int_t    DiffusionOn()                            const { return fDiffusionOn;   };
114           Int_t    CTOn()                                   const { return fCTOn;          };
115           Int_t    TCOn()                                   const { return fTCOn;          };
116           Int_t    LUTOn()                                  const { return fLUTOn;         };
117
118   virtual Int_t    Diffusion(Float_t driftlength, Float_t *xyz);
119   virtual Int_t    ExB(Float_t driftlength, Float_t *xyz);  
120   virtual Float_t  Col0Tilted(Float_t col0, Float_t rowOffset, Int_t plane);
121   virtual Int_t    PadResponse(Float_t signal, Float_t dist, Int_t plane, Float_t *pad);
122   virtual Float_t  CrossTalk(Float_t time); 
123   virtual Float_t  TimeResponse(Float_t time);  
124   virtual Double_t LUTposition(Int_t iplane, Double_t ampL, Double_t ampC, Double_t ampR);
125
126  protected:
127
128   AliTRDgeometry      *fGeo;                                //! TRD geometry       
129
130   // Pad plane geometry
131   Int_t                fRowMax[kNplan][kNcham][kNsect];     //  Number of pad-rows
132   Int_t                fColMax[kNplan];                     //  Number of pad-columns
133   Int_t                fTimeMax;                            //  Number of timebins in the drift region
134   Int_t                fTimeBefore;                         //  Number of timebins before the drift region
135   Int_t                fTimeAfter;                          //  Number of timebins after the drift region
136
137   Float_t              fRow0[kNplan][kNcham][kNsect];       //  Row-position of pad 0
138   Float_t              fCol0[kNplan];                       //  Column-position of pad 0
139   Float_t              fTime0[kNplan];                      //  Time-position of pad 0
140
141   Float_t              fRowPadSize[kNplan][kNcham][kNsect]; //  Pad size in z-direction
142   Float_t              fColPadSize[kNplan];                 //  Pad size in rphi-direction
143   Float_t              fTimeBinSize;                        //  Size of the time buckets
144
145   // Digitization parameter
146   Float_t              fField;                              //  Magnetic field
147   Float_t              fGasGain;                            //  Gas gain
148   Float_t              fNoise;                              //  Electronics noise
149   Float_t              fChipGain;                           //  Electronics gain
150   Float_t              fADCoutRange;                        //  ADC output range (number of channels)
151   Float_t              fADCinRange;                         //  ADC input range (input charge)
152   Int_t                fADCthreshold;                       //  ADC threshold in ADC channel
153   Int_t                fDiffusionOn;                        //  Switch for the diffusion
154   Float_t              fDiffusionT;                         //  Diffusion in transverse direction
155   Float_t              fDiffusionL;                         //  Diffusion in longitudinal direction
156   Int_t                fElAttachOn;                         //  Switch for the electron attachment
157   Float_t              fElAttachProp;                       //  Propability for electron attachment (for 1m)
158   Int_t                fExBOn;                              //  Switch for the ExB effects
159   Float_t              fOmegaTau;                           //  Tangens of the Lorentz angle 
160   Float_t              fLorentzFactor;                      //  Factor due to Lorentz force
161   Int_t                fPRFOn;                              //  Switch for the pad response
162   Float_t             *fPRFsmp;                             //! Sampled pad response
163   Int_t                fPRFbin;                             //  Number of bins for the PRF
164   Float_t              fPRFlo;                              //  Lower boundary of the PRF
165   Float_t              fPRFhi;                              //  Higher boundary of the PRF
166   Float_t              fPRFwid;                             //  Bin width of the sampled PRF
167   Int_t                fPRFpad;                             //  Distance to next pad in PRF
168   Int_t                fTRFOn;                              //  Switch for the time response
169   Float_t             *fTRFsmp;                             //! Integrated time response
170   Int_t                fTRFbin;                             //  Number of bins for the TRF
171   Float_t              fTRFlo;                              //  Lower boundary of the TRF
172   Float_t              fTRFhi;                              //  Higher boundary of the TRF
173   Float_t              fTRFwid;                             //  Bin width of the integrated TRF
174   Int_t                fCTOn;                               //  Switch for cross talk
175   Float_t             *fCTsmp;                              //! Integrated cross talk
176   Int_t                fTCOn;                               //  Switch for the tail cancelation
177   Int_t                fTCnexp;                             //  Number of exponential of the digital filter
178   Float_t              fDriftVelocity;                      //  Drift velocity (cm / mus)
179   Float_t              fTimeBinWidth;                       //  Time bin width in ns
180   Float_t              fPadCoupling;                        //  Pad coupling factor
181   Float_t              fTimeCoupling;                       //  Time coupling factor (image charge of moving ions)
182   Float_t              fTiltingAngle;                       //  Tilting angle of the readout pads
183
184   // Clusterization parameter
185   Int_t                fClusMaxThresh;                      //  Threshold value for cluster maximum
186   Int_t                fClusSigThresh;                      //  Threshold value for cluster signal
187   Int_t                fLUTOn;                              //  Switch for the lookup table method
188   Int_t                fLUTbin;                             //  Number of bins of the LUT
189   Float_t             *fLUT;                                //! The lookup table
190
191  private:
192
193   virtual void         SamplePRF();
194   virtual void         SampleTRF();
195   virtual void         FillLUT();
196
197   ClassDef(AliTRDparameter,1)                               //  TRD parameter class
198
199 };
200
201 #endif