Merge with TRD-develop
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitizer.h
CommitLineData
dd9a6ee3 1#ifndef ALITRDDIGITIZER_H
2#define ALITRDDIGITIZER_H
f7336fa3 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>
f7336fa3 9
793ff80c 10// Time response function of the preamp
11Double_t TRFlandau(Double_t *x, Double_t *par);
6f1e466d 12
793ff80c 13class TFile;
14class TF1;
15
16class AliTRD;
6f1e466d 17class AliTRDdigitsManager;
793ff80c 18class AliTRDgeometry;
f7336fa3 19
20///////////////////////////////////////////////////////
21// Produces digits from the hits information //
22///////////////////////////////////////////////////////
23
f7336fa3 24class AliTRDdigitizer : public TNamed {
25
26 public:
27
28 AliTRDdigitizer();
29 AliTRDdigitizer(const Text_t* name, const Text_t* title);
dd9a6ee3 30 AliTRDdigitizer(const AliTRDdigitizer &d);
8230f242 31 virtual ~AliTRDdigitizer();
dd9a6ee3 32 AliTRDdigitizer &operator=(const AliTRDdigitizer &d);
f7336fa3 33
dd9a6ee3 34 virtual void Copy(TObject &d);
6f1e466d 35 virtual void Init();
36 virtual Bool_t Open(const Char_t *name, Int_t nEvent = 0);
37 virtual Bool_t MakeDigits();
38 virtual Bool_t WriteDigits();
793ff80c 39 virtual Bool_t InitDetector();
40
41 virtual void SetGasGain(Float_t gasgain) { fGasGain = gasgain; };
42 virtual void SetNoise(Float_t noise) { fNoise = noise; };
43 virtual void SetChipGain(Float_t chipgain) { fChipGain = chipgain; };
44 virtual void SetADCoutRange(Float_t range) { fADCoutRange = range; };
45 virtual void SetADCinRange(Float_t range) { fADCinRange = range; };
46 virtual void SetADCthreshold(Int_t thresh) { fADCthreshold = thresh; };
47 virtual void SetDiffusion(Int_t diffOn = 1) { fDiffusionOn = diffOn; };
48 virtual void SetDiffusionT(Float_t diff) { fDiffusionT = diff; };
49 virtual void SetDiffusionL(Float_t diff) { fDiffusionL = diff; };
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 SetOmegaTau(Float_t ot) { fOmegaTau = ot; };
54 virtual void SetPadResponse(Int_t prfOn = 1) { fPRFOn = prfOn; };
55 virtual void SetPRF(TF1 *prf);
56 virtual void SetTimeResponse(Int_t trfOn = 1) { fTRFOn = trfOn; };
57 virtual void SetTRF(TF1 *trf);
58 virtual void SetDriftVelocity(Float_t v) { fDriftVelocity = v; };
59 virtual void SetCompress(Int_t c = 1) { fCompress = c; };
60 virtual void SetVerbose(Int_t v = 1) { fVerbose = v; };
61
62 AliTRDdigitsManager *Digits() const { return fDigits; };
63
64 virtual Float_t GetGasGain() const { return fGasGain; };
65 virtual Float_t GetNoise() const { return fNoise; };
66 virtual Float_t GetChipGain() const { return fChipGain; };
67 virtual Float_t GetADCoutRange() const { return fADCoutRange; };
68 virtual Float_t GetADCinRange() const { return fADCinRange; };
69 virtual Int_t GetADCthreshold() const { return fADCthreshold; };
70 virtual Float_t GetDiffusionT() const { return fDiffusionT; };
71 virtual Float_t GetDiffusionL() const { return fDiffusionL; };
72 virtual Float_t GetElAttachProp() const { return fElAttachProp; };
73 virtual Float_t GetOmegaTau() const { return fOmegaTau; };
74 virtual TF1 *GetPadResponse() const { return fPRF; };
75 virtual TF1 *GetTimeResponse() const { return fTRF; };
76 virtual Float_t GetDriftVelocity() const { return fDriftVelocity; };
77 virtual Bool_t GetCompress() const { return fCompress; };
f7336fa3 78
79 protected:
80
6f1e466d 81 TFile *fInputFile; //! ALIROOT-filename
82 AliTRDdigitsManager *fDigits; //! TRD digits manager
83 AliTRD *fTRD; //! TRD detector class
84 AliTRDgeometry *fGeo; //! TRD geometry
f7336fa3 85
6f1e466d 86 Int_t fEvent; //! Event number
87
88 Float_t fGasGain; // Gas gain
89 Float_t fNoise; // Electronics noise
90 Float_t fChipGain; // Electronics gain
91 Float_t fADCoutRange; // ADC output range (number of channels)
92 Float_t fADCinRange; // ADC input range (input charge)
93 Int_t fADCthreshold; // ADC threshold in ADC channel
94 Int_t fDiffusionOn; // Switch for the diffusion
95 Float_t fDiffusionT; // Diffusion in transverse direction
96 Float_t fDiffusionL; // Diffusion in longitudinal direction
97 Int_t fElAttachOn; // Switch for the electron attachment
98 Float_t fElAttachProp; // Propability for electron attachment (for 1m)
99 Int_t fExBOn; // Switch for the ExB effects
793ff80c 100 Float_t fOmegaTau; // Tangens of the Lorentz angle
6f1e466d 101 Float_t fLorentzFactor; // Factor due to Lorentz force
793ff80c 102 Int_t fPRFOn; // Switch for the pad response
6f1e466d 103 TF1 *fPRF; // Pad response function
793ff80c 104 Int_t fTRFOn; // Switch for the time response
105 TF1 *fTRF; // Time response function of the shaper
106 Float_t *fTRFint; //!Integrated time response
107 Int_t fTRFbin; // Number of bins for the TRF
108 Float_t fTRFlo; // Lower boundary of the TRF
109 Float_t fTRFhi; // Higher boundary of the TRF
110 Float_t fTRFwid; // Bin width of the integrated TRF
111 Float_t fDriftVelocity; // Drift velocity (cm / mus)
112 Bool_t fCompress; // Switch to keep only compressed data in memory
113 Int_t fVerbose; // Sets the verbose level
f7336fa3 114
115 private:
116
793ff80c 117 virtual Int_t Diffusion(Float_t driftlength, Float_t *xyz);
118 virtual Int_t ExB(Float_t driftlength, Float_t *xyz);
119 virtual Int_t PadResponse(Float_t signal, Float_t dist, Float_t *pad);
120 virtual Float_t TimeResponse(Float_t time);
121 virtual Bool_t CheckDetector(Int_t plane, Int_t chamber, Int_t sector);
122 virtual void IntegrateTRF();
123
124 ClassDef(AliTRDdigitizer,2) // Produces TRD-Digits
f7336fa3 125
126};
127
128#endif