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