1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /* $Id: AliITSUSimuParam.cxx 48165 2011-03-07 17:48:57Z masera $ */
18 ///////////////////////////////////////////////////////////////////
20 // Implementation of the class to store the parameters used in //
21 // the simulation of SPD, SDD and SSD detectors //
22 // Origin: F.Prino, Torino, prino@to.infn.it //
24 ///////////////////////////////////////////////////////////////////
25 #include "AliITSUSimuParam.h"
29 const Double_t AliITSUSimuParam::fgkPixUpgBiasVoltageDefault = 18.182;
30 const Double_t AliITSUSimuParam::fgkPixUpgThreshDefault = 3000.;
31 const Double_t AliITSUSimuParam::fgkPixUpgThrSigmaDefault = 250.;
32 const UInt_t AliITSUSimuParam::fgkPixUpgCouplingOptDefault = AliITSUSimuParam::kOldCouplingPixUpg;
33 const Double_t AliITSUSimuParam::fgkPixUpgCouplColDefault = 0.;
34 const Double_t AliITSUSimuParam::fgkPixUpgCouplRowDefault = 0.055;
35 const Double_t AliITSUSimuParam::fgkPixUpgEccDiffDefault = 0.85;
36 const Double_t AliITSUSimuParam::fgkPixUpgLorentzHoleWeightDefault = 1.0;
37 const Double_t AliITSUSimuParam::fgkGeVtoChargeDefault = 3.6e-9;
38 const Double_t AliITSUSimuParam::fgkDOverVDefault = 0.000375;
39 const Double_t AliITSUSimuParam::fgkTDefault = 300;
41 const Double_t AliITSUSimuParam::fgkNsigmasDefault = 3.;
42 const Int_t AliITSUSimuParam::fgkNcompsDefault = 121;
44 ClassImp(AliITSUSimuParam)
46 //______________________________________________________________________
47 AliITSUSimuParam::AliITSUSimuParam()
48 : fGeVcharge(fgkGeVtoChargeDefault)
49 ,fDOverV(fgkDOverVDefault)
53 ,fPixUpgCouplOpt(kOldCouplingPixUpg)
54 ,fPixUpgCouplCol(fgkPixUpgCouplColDefault)
55 ,fPixUpgCouplRow(fgkPixUpgCouplRowDefault)
56 ,fPixUpgEccDiff(fgkPixUpgEccDiffDefault)
57 ,fPixUpgLorentzDrift(kTRUE)
58 ,fPixUpgLorentzHoleWeight(fgkPixUpgLorentzHoleWeightDefault)
59 ,fPixUpgAddNoisyFlag(kFALSE)
60 ,fPixUpgRemoveDeadFlag(kFALSE)
62 ,fPixUpgThreshDef(fgkPixUpgThreshDefault)
63 ,fPixUpgThrSigmaDef(fgkPixUpgThrSigmaDefault)
64 ,fPixUpgBiasVoltageDef(fgkPixUpgBiasVoltageDefault)
66 ,fPixUpgBaselineDef(0)
70 ,fPixUpgBiasVoltage(0)
75 // default constructor
78 //______________________________________________________________________
79 AliITSUSimuParam::AliITSUSimuParam(UInt_t nPixUpg)
80 :fGeVcharge(fgkGeVtoChargeDefault)
81 ,fDOverV(fgkDOverVDefault)
85 ,fPixUpgCouplOpt(kOldCouplingPixUpg)
86 ,fPixUpgCouplCol(fgkPixUpgCouplColDefault)
87 ,fPixUpgCouplRow(fgkPixUpgCouplRowDefault)
88 ,fPixUpgEccDiff(fgkPixUpgEccDiffDefault)
89 ,fPixUpgLorentzDrift(kTRUE)
90 ,fPixUpgLorentzHoleWeight(fgkPixUpgLorentzHoleWeightDefault)
91 ,fPixUpgAddNoisyFlag(kFALSE)
92 ,fPixUpgRemoveDeadFlag(kFALSE)
94 ,fPixUpgThreshDef(fgkPixUpgThreshDefault)
95 ,fPixUpgThrSigmaDef(fgkPixUpgThrSigmaDefault)
96 ,fPixUpgBiasVoltageDef(fgkPixUpgBiasVoltageDefault)
98 ,fPixUpgBaselineDef(0)
102 ,fPixUpgBiasVoltage(0)
107 // regular constructor
109 fPixUpgBiasVoltage = new Double_t[fNPixUpg];
110 fPixUpgThresh = new Double_t[fNPixUpg];
111 fPixUpgThrSigma = new Double_t[fNPixUpg];
112 fPixUpgNoise = new Double_t[fNPixUpg];
113 fPixUpgBaseline = new Double_t[fNPixUpg];
115 SetPixUpgThreshold(fgkPixUpgThreshDefault,fgkPixUpgThrSigmaDefault);
116 SetPixUpgNoise(0.,0.);
117 SetPixUpgBiasVoltage(fgkPixUpgBiasVoltageDefault);
121 //______________________________________________________________________
122 AliITSUSimuParam::AliITSUSimuParam(const AliITSUSimuParam &simpar)
124 ,fGeVcharge(simpar.fGeVcharge)
125 ,fDOverV(simpar.fDOverV)
128 ,fNPixUpg(simpar.fNPixUpg)
129 ,fPixUpgCouplOpt(simpar.fPixUpgCouplOpt)
130 ,fPixUpgCouplCol(simpar.fPixUpgCouplCol)
131 ,fPixUpgCouplRow(simpar.fPixUpgCouplRow)
132 ,fPixUpgEccDiff(simpar.fPixUpgEccDiff)
133 ,fPixUpgLorentzDrift(simpar.fPixUpgLorentzDrift)
134 ,fPixUpgLorentzHoleWeight(simpar.fPixUpgLorentzHoleWeight)
135 ,fPixUpgAddNoisyFlag(simpar.fPixUpgAddNoisyFlag)
136 ,fPixUpgRemoveDeadFlag(simpar.fPixUpgRemoveDeadFlag)
138 ,fPixUpgThreshDef(simpar.fPixUpgThreshDef)
139 ,fPixUpgThrSigmaDef(simpar.fPixUpgThrSigmaDef)
140 ,fPixUpgBiasVoltageDef(simpar.fPixUpgBiasVoltageDef)
141 ,fPixUpgNoiseDef(simpar.fPixUpgNoiseDef)
142 ,fPixUpgBaselineDef(simpar.fPixUpgBaselineDef)
146 ,fPixUpgBiasVoltage(0)
154 fPixUpgBiasVoltage = new Double_t[fNPixUpg];
155 fPixUpgThresh = new Double_t[fNPixUpg];
156 fPixUpgThrSigma = new Double_t[fNPixUpg];
157 fPixUpgNoise = new Double_t[fNPixUpg];
158 fPixUpgBaseline = new Double_t[fNPixUpg];
160 for (Int_t i=fNPixUpg;i--;) {
161 fPixUpgBiasVoltage[i] = simpar.fPixUpgBiasVoltage[i];
162 fPixUpgThresh[i] = simpar.fPixUpgThresh[i];
163 fPixUpgThrSigma[i] = simpar.fPixUpgThrSigma[i];
164 fPixUpgNoise[i] = simpar.fPixUpgNoise[i];
165 fPixUpgBaseline[i] = simpar.fPixUpgBaseline[i];
170 //______________________________________________________________________
171 AliITSUSimuParam& AliITSUSimuParam::operator=(const AliITSUSimuParam& source)
173 // Assignment operator.
174 if (this==&source) return *this;
175 this->~AliITSUSimuParam();
176 new(this) AliITSUSimuParam(source);
181 //______________________________________________________________________
182 AliITSUSimuParam::~AliITSUSimuParam()
185 delete[] fPixUpgBiasVoltage;
186 delete[] fPixUpgThresh;
187 delete[] fPixUpgThrSigma;
188 delete[] fPixUpgNoise;
189 delete[] fPixUpgBaseline;
192 //________________________________________________________________________
193 void AliITSUSimuParam::Print(Option_t *) const
195 // Dump all parameters
199 //_______________________________________________________________________
200 Double_t AliITSUSimuParam::ApplyPixUpgBaselineAndNoise(UInt_t mod) const
202 // generate random noise
205 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
206 base = fPixUpgBaselineDef;
207 noise = fPixUpgNoiseDef;
210 base = fPixUpgBaseline[mod];
211 noise = fPixUpgNoise[mod];
213 return base+noise*gRandom->Gaus();
216 //_______________________________________________________________________
217 Double_t AliITSUSimuParam::CalcProbNoiseOverThreshold(UInt_t mod) const
219 // calculate probability of noise exceeding the threshold
220 double base,noise,thresh;
222 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
223 base = fPixUpgBaselineDef;
224 noise = fPixUpgNoiseDef;
225 thresh = fPixUpgThreshDef;
228 base = fPixUpgBaseline[mod];
229 noise = fPixUpgNoise[mod];
230 thresh = fPixUpgThresh[mod];
233 if (base>thresh) return 1;
236 return CalcProbNoiseOverThreshold(base, noise, thresh);
239 //_______________________________________________________________________
240 void AliITSUSimuParam::SetPixUpgThreshold(Double_t thresh, Double_t sigma, int mod)
242 // set threshold params
244 fPixUpgThreshDef = thresh;
245 fPixUpgThrSigmaDef = sigma;
246 for (int i=fNPixUpg;i--;) {
247 fPixUpgThresh[i] = thresh;
248 fPixUpgThrSigma[i] = sigma;
251 else if (mod>=(int)fNPixUpg) {
252 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
253 fPixUpgThreshDef = thresh;
254 fPixUpgThrSigmaDef = sigma;
257 fPixUpgThresh[mod] = thresh;
258 fPixUpgThrSigma[mod] = sigma;
263 //_______________________________________________________________________
264 Double_t AliITSUSimuParam::GetPixUpgThreshold(UInt_t mod) const
268 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
269 return fPixUpgThreshDef;
271 else return fPixUpgThresh[mod];
274 //_______________________________________________________________________
275 void AliITSUSimuParam::GetPixUpgThreshold(UInt_t mod, Double_t &thresh, Double_t &sigma) const
279 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
280 thresh = fPixUpgThreshDef;
281 sigma = fPixUpgThrSigmaDef;
284 thresh = fPixUpgThresh[mod];
285 sigma = fPixUpgThrSigma[mod];
289 //_______________________________________________________________________
290 void AliITSUSimuParam::SetPixUpgBiasVoltage(Double_t val, int mod)
292 // set threshold params
294 fPixUpgBiasVoltageDef = val;
295 for (int i=fNPixUpg;i--;) fPixUpgBiasVoltage[i] = val;
297 else if (mod>=(int)fNPixUpg) {
298 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
299 fPixUpgBiasVoltageDef = val;
301 else fPixUpgBiasVoltage[mod] = val;
305 //_______________________________________________________________________
306 Double_t AliITSUSimuParam::GetPixUpgBiasVoltage(UInt_t mod) const
310 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
311 return fPixUpgBiasVoltageDef;
313 else return fPixUpgBiasVoltage[mod];
316 //_______________________________________________________________________
317 void AliITSUSimuParam::SetPixUpgNoise(Double_t noise, Double_t baseline, int mod)
321 fPixUpgNoiseDef = noise;
322 fPixUpgBaselineDef = baseline;
323 for (int i=fNPixUpg;i--;) {
324 fPixUpgNoise[i] = noise;
325 fPixUpgBaseline[i] = baseline;
328 else if (mod>=(int)fNPixUpg) {
329 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
330 fPixUpgNoiseDef = noise;
331 fPixUpgBaselineDef = baseline;
334 fPixUpgNoise[mod] = noise;
335 fPixUpgBaseline[mod] = baseline;
340 //_______________________________________________________________________
341 void AliITSUSimuParam::GetPixUpgNoise(UInt_t mod, Double_t &noise, Double_t &baseline) const
345 if (fNPixUpg>0) {AliFatal(Form("Wrong module %d, NPidUpg=%d",mod,fNPixUpg));}
346 noise = fPixUpgNoiseDef;
347 baseline = fPixUpgBaselineDef;
350 noise = fPixUpgNoise[mod];
351 baseline = fPixUpgBaseline[mod];
355 //_______________________________________________________________________
356 void AliITSUSimuParam::SetPixUpgCouplingOption(UInt_t opt)
358 // set coupling option
359 if (opt>=kMaxCouplingOptPixUpg) AliFatal(Form("Coupling option %d should be less than %d",opt,kMaxCouplingOptPixUpg));
360 fPixUpgCouplOpt = opt;
364 //______________________________________________________________________
365 Double_t AliITSUSimuParam::LorentzAngleHole(Double_t B) const
367 // Computes the Lorentz angle for electrons in Si
368 // Input: magnetic Field in KGauss
369 // Output: Lorentz angle in radians (positive if Bz is positive)
370 // Main Reference: NIM A 497 (2003) 389–396.
371 // "An algorithm for calculating the Lorentz angle in silicon detectors", V. Bartsch et al.
373 const Double_t krH=0.70; // Hall scattering factor for Hole
374 const Double_t kT0 = 300.; // reference Temperature (degree K).
375 const Double_t kmulow0 = 470.5; // cm^2/Volt-sec
376 const Double_t keT0 = -2.5; // Power of Temp.
377 const Double_t beta0 = 1.213; // beta coeff. at T0=300K
378 const Double_t keT1 = 0.17; // Power of Temp. for beta
379 const Double_t kvsat0 = 8.37E+06; // saturated velocity at T0=300K (cm/sec)
380 const Double_t keT2 = 0.52; // Power of Temp. for vsat
382 Double_t eE= 1./fDOverV;
383 Double_t muLow=kmulow0*TMath::Power(tT/kT0,keT0);
384 Double_t beta=beta0*TMath::Power(tT/kT0,keT1);
385 Double_t vsat=kvsat0*TMath::Power(tT/kT0,keT2);
386 Double_t mu=muLow/TMath::Power(1+TMath::Power(muLow*eE/vsat,beta),1/beta);
387 Double_t angle=TMath::ATan(krH*mu*B*1.E-05); // Conversion Factor
391 //______________________________________________________________________
392 Double_t AliITSUSimuParam::LorentzAngleElectron(Double_t B) const
394 // Computes the Lorentz angle for electrons in Si
395 // Input: magnetic Field in KGauss
396 // Output: Lorentz angle in radians (positive if Bz is positive)
397 // Main Reference: NIM A 497 (2003) 389–396.
398 // "An algorithm for calculating the Lorentz angle in silicon detectors", V. Bartsch et al.
400 const Double_t krH=1.15; // Hall scattering factor for Electron
401 const Double_t kT0 = 300.; // reference Temperature (degree K).
402 const Double_t kmulow0 = 1417.0; // cm^2/Volt-sec
403 const Double_t keT0 = -2.2; // Power of Temp.
404 const Double_t beta0 = 1.109; // beta coeff. at T0=300K
405 const Double_t keT1 = 0.66; // Power of Temp. for beta
406 const Double_t kvsat0 = 1.07E+07; // saturated velocity at T0=300K (cm/sec)
407 const Double_t keT2 = 0.87; // Power of Temp. for vsat
409 Double_t eE= 1./fDOverV;
410 Double_t muLow=kmulow0*TMath::Power(tT/kT0,keT0);
411 Double_t beta=beta0*TMath::Power(tT/kT0,keT1);
412 Double_t vsat=kvsat0*TMath::Power(tT/kT0,keT2);
413 Double_t mu=muLow/TMath::Power(1+TMath::Power(muLow*eE/vsat,beta),1/beta);
414 Double_t angle=TMath::ATan(krH*mu*B*1.E-05);
418 //______________________________________________________________________
419 Double_t AliITSUSimuParam::SigmaDiffusion3D(Double_t l) const
421 // Returns the Gaussian sigma^2 == <x^2+y^2+z^2> [cm^2] due to the
422 // defusion of electrons or holes through a distance l [cm] caused
423 // by an applied voltage v [volt] through a distance d [cm] in any
424 // material at a temperature T [degree K]. The sigma diffusion when
425 // expressed in terms of the distance over which the diffusion
426 // occures, l=time/speed, is independent of the mobility and therefore
427 // the properties of the material. The charge distributions is given by
428 // n = exp(-r^2/4Dt)/(4piDt)^1.5. From this <r^2> = 6Dt where D=mkT/e
429 // (m==mobility, k==Boltzman's constant, T==temparature, e==electric
430 // charge. and vel=m*v/d. consiquently sigma^2=6kTdl/ev.
432 // Double_t l Distance the charge has to travel.
436 // The Sigma due to the diffution of electrons. [cm]
437 const Double_t kcon = 5.17040258E-04; // == 6k/e [J/col or volts]
438 return TMath::Sqrt(kcon*fT*fDOverV*l); // [cm]
441 //______________________________________________________________________
442 Double_t AliITSUSimuParam::SigmaDiffusion2D(Double_t l) const
444 // Returns the Gaussian sigma^2 == <x^2+z^2> [cm^2] due to the defusion
445 // of electrons or holes through a distance l [cm] caused by an applied
446 // voltage v [volt] through a distance d [cm] in any material at a
447 // temperature T [degree K]. The sigma diffusion when expressed in terms
448 // of the distance over which the diffusion occures, l=time/speed, is
449 // independent of the mobility and therefore the properties of the
450 // material. The charge distributions is given by
451 // n = exp(-r^2/4Dt)/(4piDt)^1.5. From this <x^2+z^2> = 4Dt where D=mkT/e
452 // (m==mobility, k==Boltzman's constant, T==temparature, e==electric
453 // charge. and vel=m*v/d. consiquently sigma^2=4kTdl/ev.
455 // Double_t l Distance the charge has to travel.
459 // The Sigma due to the diffution of electrons. [cm]
460 const Double_t kcon = 3.446935053E-04; // == 4k/e [J/col or volts]
461 return TMath::Sqrt(kcon*fT*fDOverV*l); // [cm]
464 //______________________________________________________________________
465 Double_t AliITSUSimuParam::SigmaDiffusion1D(Double_t l) const
467 // Returns the Gaussian sigma^2 == <x^2> [cm^2] due to the defusion
468 // of electrons or holes through a distance l [cm] caused by an applied
469 // voltage v [volt] through a distance d [cm] in any material at a
470 // temperature T [degree K]. The sigma diffusion when expressed in terms
471 // of the distance over which the diffusion occures, l=time/speed, is
472 // independent of the mobility and therefore the properties of the
473 // material. The charge distributions is given by
474 // n = exp(-r^2/4Dt)/(4piDt)^1.5. From this <r^2> = 2Dt where D=mkT/e
475 // (m==mobility, k==Boltzman's constant, T==temparature, e==electric
476 // charge. and vel=m*v/d. consiquently sigma^2=2kTdl/ev.
478 // Double_t l Distance the charge has to travel.
482 // The Sigma due to the diffution of electrons. [cm]
483 const Double_t kcon = 1.723467527E-04; // == 2k/e [J/col or volts]
484 return TMath::Sqrt(kcon*fT*fDOverV*l); // [cm]