Inherits now from AliDetector
[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
85cbec76 8#include "AliDigitizer.h"
f7336fa3 9
793ff80c 10class TFile;
11class TF1;
12
85cbec76 13class AliRunDigitizer;
14
793ff80c 15class AliTRD;
6f1e466d 16class AliTRDdigitsManager;
793ff80c 17class AliTRDgeometry;
f7336fa3 18
19///////////////////////////////////////////////////////
20// Produces digits from the hits information //
21///////////////////////////////////////////////////////
22
85cbec76 23class AliTRDdigitizer : public AliDigitizer {
f7336fa3 24
25 public:
26
27 AliTRDdigitizer();
28 AliTRDdigitizer(const Text_t* name, const Text_t* title);
85cbec76 29 AliTRDdigitizer(AliRunDigitizer *manager, 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);
85cbec76 35 virtual Bool_t Init();
abaf1f1d 36 virtual Bool_t InitDetector();
85cbec76 37 virtual Bool_t ReInit();
6f1e466d 38 virtual Bool_t Open(const Char_t *name, Int_t nEvent = 0);
abaf1f1d 39 virtual Bool_t MakeBranch(const Char_t *file = 0);
6f1e466d 40 virtual Bool_t MakeDigits();
85cbec76 41 virtual void AddSDigitsManager(AliTRDdigitsManager *manager);
abaf1f1d 42 virtual Bool_t ConvertSDigits();
43 virtual Bool_t MergeSDigits();
44 virtual Bool_t SDigits2Digits();
6f1e466d 45 virtual Bool_t WriteDigits();
793ff80c 46
16bf9884 47 virtual void SetGasGain(Float_t gasgain) { fGasGain = gasgain; };
48 virtual void SetNoise(Float_t noise) { fNoise = noise; };
49 virtual void SetChipGain(Float_t chipgain) { fChipGain = chipgain; };
50 virtual void SetADCoutRange(Float_t range) { fADCoutRange = range; };
51 virtual void SetADCinRange(Float_t range) { fADCinRange = range; };
52 virtual void SetADCthreshold(Int_t thresh) { fADCthreshold = thresh; };
53 virtual void SetDiffusion(Int_t diffOn = 1) { fDiffusionOn = diffOn; };
54 virtual void SetElAttach(Int_t elOn = 1) { fElAttachOn = elOn; };
55 virtual void SetElAttachProp(Float_t prop) { fElAttachProp = prop; };
56 virtual void SetExB(Int_t exbOn = 1) { fExBOn = exbOn; };
57 virtual void SetPadResponse(Int_t prfOn = 1) { fPRFOn = prfOn; };
58 virtual void SetTimeResponse(Int_t trfOn = 1) { fTRFOn = trfOn;
59 ReInit(); };
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 SetCompress(Int_t c = 1) { fCompress = c; };
65 virtual void SetVerbose(Int_t v = 1) { fVerbose = v; };
66 virtual void SetSDigits(Int_t v = 1) { fSDigits = v; };
abaf1f1d 67 virtual void SetSDigitsScale(Float_t s) { fSDigitsScale = s; };
16bf9884 68 virtual void SetEvent(Int_t v = 0) { fEvent = v; };
abaf1f1d 69 virtual void SetManager(AliTRDdigitsManager *man) { fDigitsManager = man; };
793ff80c 70
abaf1f1d 71 AliTRDdigitsManager *Digits() const { return fDigitsManager; };
872a7aba 72
16bf9884 73 Float_t GetGasGain() const { return fGasGain; };
74 Float_t GetNoise() const { return fNoise; };
75 Float_t GetChipGain() const { return fChipGain; };
76 Float_t GetADCoutRange() const { return fADCoutRange; };
77 Float_t GetADCinRange() const { return fADCinRange; };
78 Int_t GetADCthreshold() const { return fADCthreshold; };
79 Float_t GetDiffusionT() const { return fDiffusionT; };
80 Float_t GetDiffusionL() const { return fDiffusionL; };
81 Float_t GetElAttachProp() const { return fElAttachProp; };
82 Int_t GetExB() const { return fExBOn; };
83 Float_t GetOmegaTau() const { return fOmegaTau; };
84 Float_t GetDriftVelocity() const { return fDriftVelocity; };
85 Float_t GetPadCoupling() const { return fPadCoupling; };
86 Float_t GetTimeCoupling() const { return fTimeCoupling; };
87 Bool_t GetCompress() const { return fCompress; };
88 Bool_t GetSDigits() const { return fSDigits; };
abaf1f1d 89 Float_t GetSDigitsScale() const { return fSDigitsScale; };
16bf9884 90 Float_t GetTimeBinWidth() const { return fTimeBinWidth; };
db30bf0f 91 virtual Float_t GetDiffusionL(Float_t vd, Float_t b);
92 virtual Float_t GetDiffusionT(Float_t vd, Float_t b);
93 virtual Float_t GetOmegaTau(Float_t vd, Float_t b);
f7336fa3 94
95 protected:
96
abaf1f1d 97 TFile *fInputFile; //! ALIROOT-file
98 AliTRDdigitsManager *fDigitsManager; //! Manager for the output digits
99 AliTRDdigitsManager *fSDigitsManager; //! Manager for the summed input s-digits
100 TList *fSDigitsManagerList; //! List of managers of input s-digits
101 AliTRD *fTRD; //! TRD detector class
102 AliTRDgeometry *fGeo; //! TRD geometry
f7336fa3 103
abaf1f1d 104 Int_t fEvent; //! Event number
105
106 Float_t fField; // Magnetic field
107 Float_t fGasGain; // Gas gain
108 Float_t fNoise; // Electronics noise
109 Float_t fChipGain; // Electronics gain
110 Float_t fADCoutRange; // ADC output range (number of channels)
111 Float_t fADCinRange; // ADC input range (input charge)
112 Int_t fADCthreshold; // ADC threshold in ADC channel
113 Int_t fDiffusionOn; // Switch for the diffusion
114 Float_t fDiffusionT; // Diffusion in transverse direction
115 Float_t fDiffusionL; // Diffusion in longitudinal direction
116 Int_t fElAttachOn; // Switch for the electron attachment
117 Float_t fElAttachProp; // Propability for electron attachment (for 1m)
118 Int_t fExBOn; // Switch for the ExB effects
119 Float_t fOmegaTau; // Tangens of the Lorentz angle
120 Float_t fLorentzFactor; // Factor due to Lorentz force
121 Int_t fPRFOn; // Switch for the pad response
122 Float_t *fPRFsmp; //! Sampled pad response
123 Int_t fPRFbin; // Number of bins for the PRF
124 Float_t fPRFlo; // Lower boundary of the PRF
125 Float_t fPRFhi; // Higher boundary of the PRF
126 Float_t fPRFwid; // Bin width of the sampled PRF
127 Int_t fPRFpad; // Distance to next pad in PRF
128 Int_t fTRFOn; // Switch for the time response
129 Float_t *fTRFsmp; //! Integrated time response
130 Int_t fTRFbin; // Number of bins for the TRF
131 Float_t fTRFlo; // Lower boundary of the TRF
132 Float_t fTRFhi; // Higher boundary of the TRF
133 Float_t fTRFwid; // Bin width of the integrated TRF
134 Float_t fDriftVelocity; // Drift velocity (cm / mus)
135 Float_t fTimeBinWidth; // Time bin width in ns
136 Float_t fPadCoupling; // Pad coupling factor
137 Float_t fTimeCoupling; // Time coupling factor (image charge of moving ions)
138 Bool_t fCompress; // Switch to keep only compressed data in memory
139 Int_t fVerbose; // Sets the verbose level
140 Bool_t fSDigits; // Switch for the summable digits
141 Float_t fSDigitsScale; // Scale factor for the summable digits
f7336fa3 142
143 private:
144
793ff80c 145 virtual Int_t Diffusion(Float_t driftlength, Float_t *xyz);
146 virtual Int_t ExB(Float_t driftlength, Float_t *xyz);
147 virtual Int_t PadResponse(Float_t signal, Float_t dist, Float_t *pad);
148 virtual Float_t TimeResponse(Float_t time);
149 virtual Bool_t CheckDetector(Int_t plane, Int_t chamber, Int_t sector);
e153aaf6 150 virtual void SamplePRF();
6244debe 151 virtual void SampleTRF();
793ff80c 152
abaf1f1d 153 ClassDef(AliTRDdigitizer,5) // Produces TRD-Digits
f7336fa3 154
155};
156
157#endif