Line data Source code
1 : #ifndef ALIITSSIMUPARAM_H
2 : #define ALIITSSIMUPARAM_H
3 : /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /* $Id$ */
7 :
8 : ///////////////////////////////////////////////////////////////////
9 : // //
10 : // Class to store the parameters used in the simulation of //
11 : // SPD, SDD and SSD detectors //
12 : // Origin: F.Prino, Torino, prino@to.infn.it //
13 : // //
14 : ///////////////////////////////////////////////////////////////////
15 : #include <TRandom.h>
16 : #include<TObject.h>
17 : #include <TString.h>
18 : #include <TArrayF.h>
19 :
20 : class AliITSSimuParam : public TObject {
21 :
22 : public:
23 : AliITSSimuParam();
24 : AliITSSimuParam(const AliITSSimuParam& simpar);
25 : // assignment operator
26 : AliITSSimuParam& operator=(const AliITSSimuParam& source);
27 : ~AliITSSimuParam();
28 :
29 :
30 28 : void SetGeVToCharge(Double_t gc=3.6e-9){fGeVcharge = gc;}
31 2556 : Double_t GetGeVToCharge() const {return fGeVcharge;}
32 0 : Double_t GeVToCharge(Double_t gev) const {return gev/fGeVcharge;}
33 :
34 1922 : void SetDistanceOverVoltage(Double_t d,Double_t v){fDOverV = d/v;}
35 28 : void SetDistanceOverVoltage(Double_t dv=0.000375){fDOverV = dv;}
36 0 : Double_t GetDistanceOverVoltage() const {return fDOverV;}
37 :
38 :
39 :
40 6776 : void SetSPDBiasVoltageAll(Double_t bias=18.182) {for(Int_t i=0;i<240;i++) fSPDBiasVoltage[i]=bias;}
41 0 : void SetSPDBiasVoltage(Int_t mod, Double_t bias=18.182) {if(mod<0 || mod>239) return; fSPDBiasVoltage[mod]=bias;}
42 3844 : Double_t GetSPDBiasVoltage(Int_t mod=0) const {if(mod<0 || mod>239) return 0; return fSPDBiasVoltage[mod];}
43 :
44 : void SetSPDThresholdsAll(Double_t thresh, Double_t sigma)
45 6776 : {for(Int_t i=0;i<240;i++) {fSPDThresh[i]=thresh; fSPDSigma[i]=sigma;}}
46 : void SetSPDThresholds(Int_t mod,Double_t thresh, Double_t sigma)
47 0 : {if(mod<0 || mod>239) return; fSPDThresh[mod]=thresh; fSPDSigma[mod]=sigma; }
48 : void SPDThresholds(const Int_t mod, Double_t& thresh, Double_t& sigma) const;
49 : void SetSPDNoiseAll(Double_t noise, Double_t baseline)
50 6776 : {for(Int_t i=0;i<240;i++) {fSPDNoise[i]=noise; fSPDBaseline[i]=baseline;}}
51 : void SetSPDNoise(Int_t mod,Double_t noise, Double_t baseline)
52 0 : {if(mod<0 || mod>239) return; fSPDNoise[mod]=noise; fSPDBaseline[mod]=baseline; }
53 : void SPDNoise(const Int_t mod,Double_t &noise, Double_t &baseline) const;
54 : // Applies a random noise and addes the baseline
55 : Double_t ApplySPDBaselineAndNoise(Int_t mod=0) const
56 78643200 : {if (mod<0 || mod>239) mod=0; return fSPDBaseline[mod]+fSPDNoise[mod]*gRandom->Gaus();}
57 :
58 :
59 28 : void SetSPDCouplingOption(const char *opt) {fSPDCouplOpt=opt;}
60 2 : void GetSPDCouplingOption(char *opt) const {strncpy(opt,fSPDCouplOpt.Data(),fSPDCouplOpt.Sizeof());}
61 :
62 : void SetSPDCouplingParam(Double_t col, Double_t row)
63 0 : {fSPDCouplCol = col; fSPDCouplRow = row;}
64 : void GetSPDCouplingParam(Double_t &col, Double_t &row) const
65 6126 : {col = fSPDCouplCol; row = fSPDCouplRow;}
66 :
67 28 : void SetSPDSigmaDiffusionAsymmetry(Double_t ecc) {fSPDEccDiff=ecc;}
68 1920 : void GetSPDSigmaDiffusionAsymmetry(Double_t &ecc) const {ecc=fSPDEccDiff;}
69 :
70 0 : void SetSPDLorentzDrift(Bool_t ison) {fSPDLorentzDrift=ison;}
71 2 : Bool_t GetSPDLorentzDrift() const {return fSPDLorentzDrift;}
72 0 : void SetSPDLorentzHoleWeight(Float_t weight) {fSPDLorentzHoleWeight=weight;}
73 2 : Float_t GetSPDLorentzHoleWeight() const {return fSPDLorentzHoleWeight;}
74 :
75 0 : void SetSPDAddNoisyFlag(Bool_t value) {fSPDAddNoisyFlag = value;}
76 1920 : Bool_t GetSPDAddNoisyFlag() const {return fSPDAddNoisyFlag;}
77 0 : void SetSPDRemoveDeadFlag(Bool_t value) {fSPDRemoveDeadFlag = value;}
78 1920 : Bool_t GetSPDRemoveDeadFlag() const {return fSPDRemoveDeadFlag;}
79 :
80 28 : void SetSDDElectronics(Int_t p1=1) {fSDDElectronics=p1; }
81 2 : Int_t GetSDDElectronics() const {return fSDDElectronics;}
82 :
83 : void SetSDDDiffCoeff(Float_t p1, Float_t p2) {
84 28 : fSDDDiffCoeff=p1; fSDDDiffCoeff1=p2;}
85 : void GetSDDDiffCoeff(Float_t &diff,Float_t &diff1) const {
86 196 : diff=fSDDDiffCoeff; diff1=fSDDDiffCoeff1;}
87 :
88 0 : void SetSDDJitterError(Float_t jitter) {fSDDJitterError=jitter;}
89 196 : Float_t GetSDDJitterError() const {return fSDDJitterError;}
90 :
91 0 : void SetSDDDynamicRange(Double_t p1) {fSDDDynamicRange = p1;}
92 196 : Float_t GetSDDDynamicRange() const {return fSDDDynamicRange;}
93 :
94 28 : void SetSDDMaxAdc(Double_t p1) {fSDDMaxAdc=p1;}
95 392 : Float_t GetSDDMaxAdc() const {return fSDDMaxAdc;}
96 :
97 0 : void SetSDDChargeLoss(Double_t p1) {fSDDChargeLoss=p1;}
98 196 : Float_t GetSDDChargeLoss() const {return fSDDChargeLoss;}
99 :
100 0 : void SetSDDTrigDelay(Double_t p1) {fSDDTrigDelay=p1;}
101 196 : Float_t GetSDDTrigDelay() const {return fSDDTrigDelay;}
102 :
103 0 : void SetSDDCorrMapPrecision(Double_t p1) {fSDDMapPrec=p1;}
104 196 : Float_t GetSDDCorrMapPrecision() const {return fSDDMapPrec;}
105 :
106 0 : void SetSDDkeVtoADC(Double_t p1) {fSDDkeVtoADC=p1;}
107 196 : Float_t GetSDDkeVtoADC() const {return fSDDkeVtoADC;}
108 :
109 0 : void SetSDDRawDataFormatCarlos() {fSDDRawFormat=7;}
110 0 : void SetSDDRawDataFormatFixLen8bitEncoded() {fSDDRawFormat=0;}
111 8 : Char_t GetSDDRawDataFormat() const {return fSDDRawFormat;}
112 :
113 : // Use Lorentz's angle
114 0 : void SetSSDLorentzDrift(Bool_t ison) {fSSDLorentzDrift=ison;}
115 2 : Bool_t GetSSDLorentzDrift() const {return fSSDLorentzDrift;}
116 :
117 : Int_t GetSSDZSThreshold() const { // ZS threshold
118 19571968 : return fSSDZSThreshold; }
119 0 : virtual void SetSSDZSThreshold(Int_t zsth) { fSSDZSThreshold = zsth; }
120 :
121 : void SetSSDCouplings(Double_t pr, Double_t pl, Double_t nr, Double_t nl) {
122 28 : fSSDCouplingPR=pr; fSSDCouplingPL=pl; fSSDCouplingNR=nr; fSSDCouplingNL=nl; }
123 20851440 : Double_t GetSSDCouplingPR() const {return fSSDCouplingPR;}
124 20851440 : Double_t GetSSDCouplingPL() const {return fSSDCouplingPL;}
125 20851440 : Double_t GetSSDCouplingNR() const {return fSSDCouplingNR;}
126 20851440 : Double_t GetSSDCouplingNL() const {return fSSDCouplingNL;}
127 :
128 0 : void SetNSigmaIntegration(Double_t p1) {fNsigmas=p1;}
129 196 : Float_t GetNSigmaIntegration() const {return fNsigmas;}
130 : void SetNLookUp(Int_t p1);
131 196 : Int_t GetGausNLookUp() const {return fNcomps;}
132 : Float_t GetGausLookUp(Int_t i) {
133 832181 : if (!fGaus) SetNLookUp(fgkNcompsDefault);
134 1248270 : if(i<0 || i>=fNcomps) return 0.;return fGaus->At(i);
135 416090 : }
136 :
137 : // Set the impurity concentrations in [#/cm^3]
138 0 : void SetImpurity(Double_t n=0.0){fN = n;}
139 : // Returns the impurity consentration in [#/cm^3]
140 0 : Double_t Impurity() const {return fN;}
141 :
142 : // Electron mobility in Si. [cm^2/(Volt Sec)]. T in degree K, N in #/cm^3
143 : Double_t MobilityElectronSiEmp() const ;
144 : // Hole mobility in Si. [cm^2/(Volt Sec)] T in degree K, N in #/cm^3
145 : Double_t MobilityHoleSiEmp() const ;
146 : // Einstein relation for Diffusion Coefficient of Electrons. [cm^2/sec]
147 : // T in degree K, N in #/cm^3
148 : Double_t DiffusionCoefficientElectron() const ;
149 : // Einstein relation for Diffusion Coefficient of Holes. [cm^2/sec]
150 : // T in [degree K], N in [#/cm^3]
151 : Double_t DiffusionCoefficientHole() const ;
152 : // Electron <speed> under an applied electric field E=Volts/cm. [cm/sec]
153 : // d distance-thickness in [cm], v in [volts], T in [degree K],
154 : // N in [#/cm^3]
155 : Double_t SpeedElectron() const ;
156 : // Holes <speed> under an applied electric field E=Volts/cm. [cm/sec]
157 : // d distance-thickness in [cm], v in [volts], T in [degree K],
158 : // N in [#/cm^3]
159 : Double_t SpeedHole() const ;
160 : // Returns the Gaussian sigma == <x^2+z^2> [cm^2] due to the defusion of
161 : // electrons or holes through a distance l [cm] caused by an applied
162 : // voltage v [volt] through a distance d [cm] in any material at a
163 : // temperature T [degree K].
164 : Double_t SigmaDiffusion3D(Double_t l) const;
165 : // Returns the Gaussian sigma == <x^2 +y^2+z^2> [cm^2] due to the
166 : // defusion of electrons or holes through a distance l [cm] caused by an
167 : // applied voltage v [volt] through a distance d [cm] in any material at a
168 : // temperature T [degree K].
169 : Double_t SigmaDiffusion2D(Double_t l) const;
170 : // Returns the Gaussian sigma == <x^2+z^2> [cm^2] due to the defusion of
171 : // electrons or holes through a distance l [cm] caused by an applied
172 : // voltage v [volt] through a distance d [cm] in any material at a
173 : // temperature T [degree K].
174 : Double_t SigmaDiffusion1D(Double_t l) const;
175 : // Computes the Lorentz angle for Electron and Hole, under the Magnetic field bz (in kGauss)
176 : Double_t LorentzAngleElectron(Double_t bz) const;
177 : Double_t LorentzAngleHole(Double_t bz) const;
178 : // Compute the thickness of the depleted region in a Si detector, version A
179 : Double_t DepletedRegionThicknessA(Double_t dopCons,
180 : Double_t voltage,
181 : Double_t elecCharge,
182 : Double_t voltBuiltIn=0.5)const;
183 : // Compute the thickness of the depleted region in a Si detector, version B
184 : Double_t DepletedRegionThicknessB(Double_t resist,Double_t voltage,
185 : Double_t mobility,
186 : Double_t voltBuiltIn=0.5,
187 : Double_t dielConst=1.E-12)const;
188 : // Computes the temperature dependance of the reverse bias current
189 : Double_t ReverseBiasCurrent(Double_t temp,Double_t revBiasCurT1,
190 : Double_t tempT1,Double_t energy=1.2)const;
191 :
192 :
193 : void PrintParameters() const;
194 0 : void SetSPDReadoutStrobe(Int_t win[2]){fSPDHitStrobe[0]=win[0];fSPDHitStrobe[1]=win[1];}
195 0 : void SetSPDFastOrStrobe(Int_t win[2]){fSPDFoStrobe[0]=win[0];fSPDFoStrobe[1]=win[1];}
196 1920 : const Int_t* GetSPDHitStrobe() const {return fSPDHitStrobe;}
197 1920 : const Int_t* GetSPDFoStrobe() const {return fSPDFoStrobe;}
198 :
199 : protected:
200 :
201 : static const Float_t fgkSPDBiasVoltageDefault;//default for fSPDBiasVoltage
202 : static const Double_t fgkSPDThreshDefault; //default for fThresh
203 : static const Double_t fgkSPDSigmaDefault; //default for fSigma
204 : static const TString fgkSPDCouplingOptDefault; // type of pixel Coupling (old or new)
205 : static const Double_t fgkSPDCouplColDefault; //default for fSPDCouplCol
206 : static const Double_t fgkSPDCouplRowDefault; //default for fSPDCouplRow
207 : static const Float_t fgkSPDEccDiffDefault;//default for fSPDEccDiff
208 : static const Float_t fgkSPDLorentzHoleWeightDefault;//default for fSPDLorentzHoleWeight
209 : static const Float_t fgkSDDDiffCoeffDefault; // default for fSDDDiffCoeff
210 : static const Float_t fgkSDDDiffCoeff1Default; // default for fSDDDiffCoeff1
211 : static const Float_t fgkSDDJitterErrorDefault; // default for fSDDJitterError
212 : static const Float_t fgkSDDDynamicRangeDefault; // default for fSDDDynamicRange
213 : static const Int_t fgkSDDMaxAdcDefault; // default for fSDDMaxAdc
214 : static const Float_t fgkSDDChargeLossDefault; // default for fSDDChargeLoss
215 : static const Float_t fgkSDDTrigDelayDefault; // default for fSDDTrigDelay
216 : static const Float_t fgkSDDMapPrecDefault; // default for fSDDTrigDelay
217 : static const Float_t fgkSDDkeVtoADCDefault; // default for keV->ADC conv.
218 :
219 : static const Double_t fgkSSDCouplingPRDefault; // default values
220 : static const Double_t fgkSSDCouplingPLDefault; // for the
221 : static const Double_t fgkSSDCouplingNRDefault; // various SSD
222 : static const Double_t fgkSSDCouplingNLDefault; // couplings
223 : static const Int_t fgkSSDZSThresholdDefault; // default for fSSDZSThreshold
224 :
225 : static const Float_t fgkNsigmasDefault; //default for fNsigmas
226 : static const Int_t fgkNcompsDefault; //default for fNcomps
227 :
228 : private:
229 : Double_t fGeVcharge; // Energy to ionize (free an electron) in GeV
230 : Double_t fDOverV; // The parameter d/v where d is the disance over which the
231 : // the potential v is applied d/v [cm/volts]
232 :
233 :
234 : Double_t fSPDBiasVoltage[240]; // Bias Voltage for the SPD
235 : Double_t fSPDThresh[240]; // SPD Threshold value
236 : Double_t fSPDSigma[240]; // SPD threshold fluctuations spread
237 : Double_t fSPDNoise[240]; // SPD electronic noise: sigma
238 : Double_t fSPDBaseline[240]; // SPD electronic noise: baseline
239 : TString fSPDCouplOpt; // SPD Coupling Option
240 : Double_t fSPDCouplCol; // SPD Coupling parameter along the cols
241 : Double_t fSPDCouplRow; // SPD Coupling parameter along the rows
242 : Int_t fSPDHitStrobe[2]; // Hit read out strobe (left and right readout windows wrt the collision)
243 : Int_t fSPDFoStrobe[2]; // FastOr read out strobe (left and right readout windows wrt the collision)
244 : Float_t fSPDEccDiff; // Eccentricity (i.e. asymmetry parameter) in the
245 : // Gaussian diffusion for SPD
246 : Bool_t fSPDLorentzDrift; // Flag to decide whether to simulate the Lorentz Drift or not in SPD
247 : Float_t fSPDLorentzHoleWeight;// Lorentz Angle is computed for SPD as average of Hole and Electron
248 : // this parameter gives the relative weights between the two
249 : Bool_t fSPDAddNoisyFlag; // Flag saying whether noisy pixels should be added to digits
250 : Bool_t fSPDRemoveDeadFlag; // Flag saying whether dead pixels should be removed from digits
251 :
252 : Int_t fSDDElectronics; // SDD Electronics Pascal (1) or OLA (2)
253 : Float_t fSDDDiffCoeff; // SDD Diffusion Coefficient (scaling the time)
254 : Float_t fSDDDiffCoeff1; // SDD Diffusion Coefficient (constant term)
255 : Float_t fSDDJitterError; // SDD jitter error
256 : Float_t fSDDDynamicRange; // SDD Dynamic Range
257 : Float_t fSDDMaxAdc; // SDD ADC saturation value
258 : Float_t fSDDChargeLoss; // Set Linear Coefficient for Charge Loss
259 : Float_t fSDDTrigDelay; // SDD time-zero
260 : Float_t fSDDMapPrec; // SDD maps precision
261 : Float_t fSDDkeVtoADC; // SDD keV->ADC conv. factor
262 : Char_t fSDDRawFormat; // Index for SDD RawFormat
263 :
264 : Bool_t fSSDLorentzDrift; // Flag to decide whether to simulate the Lorentz Drift or not in SSD
265 :
266 : Double_t fSSDCouplingPR; // SSD couplings
267 : Double_t fSSDCouplingPL; // SSD couplings
268 : Double_t fSSDCouplingNR; // SSD couplings
269 : Double_t fSSDCouplingNL; // SSD couplings
270 : Int_t fSSDZSThreshold; // SSD threshold for the zero suppresion
271 :
272 : Float_t fNsigmas; // Number of sigmas over which charge disintegration
273 : // is performed
274 : Int_t fNcomps; // Number of samplings along the gaussian
275 : TArrayF *fGaus; // Gaussian lookup table for signal generation
276 :
277 : Double_t fN; // the impurity concentration of the material in #/cm^3 (NOT USED!)
278 : Float_t fT; // The temperature of the Si in Degree K.
279 :
280 118 : ClassDef(AliITSSimuParam,7);
281 : };
282 : #endif
|