]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDdigitizer.h
Fix positions of cooling material
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitizer.h
1 #ifndef ALITRDDIGITIZER_H
2 #define ALITRDDIGITIZER_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 TFile;
11 class TF1;
12
13 class AliTRD;
14 class AliTRDdigitsManager;
15 class AliTRDgeometry;
16
17 ///////////////////////////////////////////////////////
18 //  Produces digits from the hits information        //
19 ///////////////////////////////////////////////////////
20
21 class AliTRDdigitizer : public TNamed {
22
23  public:
24
25   AliTRDdigitizer();
26   AliTRDdigitizer(const Text_t* name, const Text_t* title);
27   AliTRDdigitizer(const AliTRDdigitizer &d);
28   virtual ~AliTRDdigitizer();
29   AliTRDdigitizer &operator=(const AliTRDdigitizer &d);
30
31   virtual void         Copy(TObject &d);
32   virtual void         Init();
33   virtual Bool_t       Open(const Char_t *name, Int_t nEvent = 0);
34   virtual Bool_t       MakeDigits();
35   virtual void         ReInit();
36   virtual Bool_t       SumSDigits();
37   virtual Bool_t       WriteDigits();
38   virtual Bool_t       InitDetector();
39
40   virtual void         SetGasGain(Float_t gasgain)      { fGasGain        = gasgain;  };
41   virtual void         SetNoise(Float_t noise)          { fNoise          = noise;    };
42   virtual void         SetChipGain(Float_t chipgain)    { fChipGain       = chipgain; };
43   virtual void         SetADCoutRange(Float_t range)    { fADCoutRange    = range;    };
44   virtual void         SetADCinRange(Float_t range)     { fADCinRange     = range;    };
45   virtual void         SetADCthreshold(Int_t thresh)    { fADCthreshold   = thresh;   };
46   virtual void         SetDiffusion(Int_t diffOn = 1)   { fDiffusionOn    = diffOn;   };
47   virtual void         SetElAttach(Int_t elOn = 1)      { fElAttachOn     = elOn;     };
48   virtual void         SetElAttachProp(Float_t prop)    { fElAttachProp   = prop;     };
49   virtual void         SetExB(Int_t exbOn = 1)          { fExBOn          = exbOn;    };
50   virtual void         SetPadResponse(Int_t prfOn = 1)  { fPRFOn          = prfOn;    };
51   virtual void         SetTimeResponse(Int_t trfOn = 1) { fTRFOn          = trfOn;   
52                                                           ReInit();                   };
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         SetCompress(Int_t c = 1)         { fCompress       = c;        };
58   virtual void         SetVerbose(Int_t v = 1)          { fVerbose        = v;        };
59   virtual void         SetSDigits(Int_t v = 1)          { fSDigits        = v;        };
60   virtual void         SetEvent(Int_t v = 0)            { fEvent          = v;        };
61
62   AliTRDdigitsManager *Digits() const                   { return fDigits;             };
63
64           Float_t      GetGasGain() const               { return fGasGain;            };
65           Float_t      GetNoise() const                 { return fNoise;              };
66           Float_t      GetChipGain() const              { return fChipGain;           };
67           Float_t      GetADCoutRange() const           { return fADCoutRange;        };
68           Float_t      GetADCinRange() const            { return fADCinRange;         };
69           Int_t        GetADCthreshold() const          { return fADCthreshold;       };
70           Float_t      GetDiffusionT() const            { return fDiffusionT;         };
71           Float_t      GetDiffusionL() const            { return fDiffusionL;         };
72           Float_t      GetElAttachProp() const          { return fElAttachProp;       };
73           Int_t        GetExB() const                   { return fExBOn;              };
74           Float_t      GetOmegaTau() const              { return fOmegaTau;           };
75           Float_t      GetDriftVelocity() const         { return fDriftVelocity;      };
76           Float_t      GetPadCoupling() const           { return fPadCoupling;        };
77           Float_t      GetTimeCoupling() const          { return fTimeCoupling;       };
78           Bool_t       GetCompress() const              { return fCompress;           };
79           Bool_t       GetSDigits() const               { return fSDigits;            };
80           Float_t      GetTimeBinWidth() const          { return fTimeBinWidth;       };
81   virtual Float_t      GetDiffusionL(Float_t vd, Float_t b);
82   virtual Float_t      GetDiffusionT(Float_t vd, Float_t b);
83   virtual Float_t      GetOmegaTau(Float_t vd, Float_t b);
84
85  protected:
86
87   TFile               *fInputFile;       //! ALIROOT-filename
88   AliTRDdigitsManager *fDigits;          //! TRD digits manager
89   AliTRD              *fTRD;             //! TRD detector class
90   AliTRDgeometry      *fGeo;             //! TRD geometry
91   
92   Int_t                fEvent;           //! Event number
93
94   Float_t              fField;           // Magnetic field
95   Float_t              fGasGain;         // Gas gain
96   Float_t              fNoise;           // Electronics noise
97   Float_t              fChipGain;        // Electronics gain
98   Float_t              fADCoutRange;     // ADC output range (number of channels)
99   Float_t              fADCinRange;      // ADC input range (input charge)
100   Float_t              fSinRange;        // Input range for summable digits 
101   Float_t              fSoutRange;       // Output range for summable digits 
102   Int_t                fADCthreshold;    // ADC threshold in ADC channel
103   Int_t                fDiffusionOn;     // Switch for the diffusion
104   Float_t              fDiffusionT;      // Diffusion in transverse direction
105   Float_t              fDiffusionL;      // Diffusion in longitudinal direction
106   Int_t                fElAttachOn;      // Switch for the electron attachment
107   Float_t              fElAttachProp;    // Propability for electron attachment (for 1m)
108   Int_t                fExBOn;           // Switch for the ExB effects
109   Float_t              fOmegaTau;        // Tangens of the Lorentz angle 
110   Float_t              fLorentzFactor;   // Factor due to Lorentz force
111   Int_t                fPRFOn;           // Switch for the pad response
112   Float_t             *fPRFsmp;          //!Sampled pad response
113   Int_t                fPRFbin;          // Number of bins for the PRF
114   Float_t              fPRFlo;           // Lower boundary of the PRF
115   Float_t              fPRFhi;           // Higher boundary of the PRF
116   Float_t              fPRFwid;          // Bin width of the sampled PRF
117   Int_t                fPRFpad;          // Distance to next pad in PRF
118   Int_t                fTRFOn;           // Switch for the time response
119   Float_t             *fTRFsmp;          //!Integrated time response
120   Int_t                fTRFbin;          // Number of bins for the TRF
121   Float_t              fTRFlo;           // Lower boundary of the TRF
122   Float_t              fTRFhi;           // Higher boundary of the TRF
123   Float_t              fTRFwid;          // Bin width of the integrated TRF
124   Float_t              fDriftVelocity;   // Drift velocity (cm / mus)
125   Float_t              fTimeBinWidth;    // Time bin width in ns
126   Float_t              fPadCoupling;     // Pad coupling factor
127   Float_t              fTimeCoupling;    // Time coupling factor (image charge of moving ions)
128   Bool_t               fCompress;        // Switch to keep only compressed data in memory
129   Int_t                fVerbose;         // Sets the verbose level
130   Bool_t               fSDigits;         // Switch for the summable digits
131
132  private:
133
134   virtual Int_t        Diffusion(Float_t driftlength, Float_t *xyz);
135   virtual Int_t        ExB(Float_t driftlength, Float_t *xyz);  
136   virtual Int_t        PadResponse(Float_t signal, Float_t dist, Float_t *pad);
137   virtual Float_t      TimeResponse(Float_t time);  
138   virtual Bool_t       CheckDetector(Int_t plane, Int_t chamber, Int_t sector);
139   virtual void         SamplePRF();
140   virtual void         SampleTRF();
141
142   ClassDef(AliTRDdigitizer,4)            // Produces TRD-Digits
143
144 };
145
146 #endif