]>
Commit | Line | Data |
---|---|---|
451f5018 | 1 | #ifndef ALIITSUSIMUPARAM_H |
2 | #define ALIITSUSIMUPARAM_H | |
3 | /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | ||
7 | /////////////////////////////////////////////////////////////////// | |
8 | // // | |
9 | // Class to store the parameters used in the simulation ITS // | |
10 | // // | |
11 | /////////////////////////////////////////////////////////////////// | |
12 | #include <TRandom.h> | |
13 | #include <TObject.h> | |
14 | #include <TMath.h> | |
02d6eccc | 15 | #include "AliMathBase.h" |
451f5018 | 16 | |
17 | class AliITSUSimuParam : public TObject { | |
18 | ||
19 | public: | |
20 | enum {kOldCouplingPixUpg,kNewCouplingPixUpg,kMaxCouplingOptPixUpg}; | |
21 | // | |
22 | AliITSUSimuParam(); | |
23 | AliITSUSimuParam(UInt_t nPixUpg); | |
24 | AliITSUSimuParam(const AliITSUSimuParam& simpar); | |
25 | // assignment operator | |
26 | AliITSUSimuParam& operator=(const AliITSUSimuParam& source); | |
27 | ~AliITSUSimuParam(); | |
28 | ||
29 | Double_t ApplyPixUpgBaselineAndNoise(UInt_t mod) const; | |
30 | Double_t CalcProbNoiseOverThreshold(UInt_t mod) const; | |
31 | // | |
32 | void SetPixUpgThreshold(Double_t thresh, Double_t sigma, int mod=-1); | |
33 | void GetPixUpgThreshold(UInt_t mod, Double_t& thresh, Double_t& sigma) const; | |
34 | Double_t GetPixUpgThreshold(UInt_t mod) const; | |
35 | // | |
36 | void SetPixUpgNoise(Double_t noise, Double_t baseline, Int_t mod=-1); | |
37 | void GetPixUpgNoise(UInt_t mod,Double_t &noise, Double_t &baseline) const; | |
38 | // | |
39 | void SetPixUpgBiasVoltage(Double_t bias=18.182,Int_t mod=-1); | |
40 | Double_t GetPixUpgBiasVoltage(UInt_t mod) const; | |
41 | ||
42 | ||
43 | void SetGeVToCharge(Double_t gc=fgkNcompsDefault) {fGeVcharge = gc;} | |
44 | Double_t GetGeVToCharge() const {return fGeVcharge;} | |
45 | Double_t GeVToCharge(Double_t gev) const {return gev/fGeVcharge;} | |
46 | // | |
47 | void SetDistanceOverVoltage(Double_t d,Double_t v) {fDOverV = d/v;} | |
48 | void SetDistanceOverVoltage(Double_t dv=fgkDOverVDefault) {fDOverV = dv;} | |
49 | Double_t GetDistanceOverVoltage() const {return fDOverV;} | |
50 | // | |
51 | void SetPixUpgCouplingOption(UInt_t opt); | |
52 | UInt_t GetPixUpgCouplingOption() const {return fPixUpgCouplOpt;} | |
53 | ||
54 | void SetPixUpgCouplingParam(Double_t col, Double_t row) {fPixUpgCouplCol = col; fPixUpgCouplRow = row;} | |
55 | void GetPixUpgCouplingParam(Double_t &col, Double_t &row) const {col = fPixUpgCouplCol; row = fPixUpgCouplRow;} | |
56 | ||
57 | void SetPixUpgSigmaDiffusionAsymmetry(Double_t ecc) {fPixUpgEccDiff=ecc;} | |
58 | void GetPixUpgSigmaDiffusionAsymmetry(Double_t &ecc) const {ecc=fPixUpgEccDiff;} | |
59 | ||
60 | void SetPixUpgLorentzDrift(Bool_t ison) {fPixUpgLorentzDrift=ison;} | |
61 | Bool_t GetPixUpgLorentzDrift() const {return fPixUpgLorentzDrift;} | |
62 | void SetPixUpgLorentzHoleWeight(Double_t weight) {fPixUpgLorentzHoleWeight=weight;} | |
63 | Double_t GetPixUpgLorentzHoleWeight() const {return fPixUpgLorentzHoleWeight;} | |
64 | ||
65 | void SetPixUpgAddNoisyFlag(Bool_t value) {fPixUpgAddNoisyFlag = value;} | |
66 | Bool_t GetPixUpgAddNoisyFlag() const {return fPixUpgAddNoisyFlag;} | |
67 | void SetPixUpgRemoveDeadFlag(Bool_t value) {fPixUpgRemoveDeadFlag = value;} | |
68 | Bool_t GetPixUpgRemoveDeadFlag() const {return fPixUpgRemoveDeadFlag;} | |
69 | // | |
70 | Double_t LorentzAngleElectron(Double_t bz) const; | |
71 | Double_t LorentzAngleHole(Double_t bz) const; | |
72 | // | |
73 | Double_t SigmaDiffusion3D(Double_t l) const; | |
74 | Double_t SigmaDiffusion2D(Double_t l) const; | |
75 | Double_t SigmaDiffusion1D(Double_t l) const; | |
76 | // | |
77 | virtual void Print(Option_t *opt = "") const; | |
78 | // | |
79 | static Double_t CalcProbNoiseOverThreshold(double base, double noise, double thresh); | |
80 | static Double_t GenerateNoiseQFunction(double prob, double mean, double sigma); | |
81 | // | |
82 | protected: | |
83 | ||
84 | static const Double_t fgkPixUpgBiasVoltageDefault;//default for fPixUpgBiasVoltage | |
85 | static const Double_t fgkPixUpgThreshDefault; //default for fThresh | |
86 | static const Double_t fgkPixUpgThrSigmaDefault; //default for fSigma | |
87 | static const Double_t fgkPixUpgCouplColDefault; //default for fPixUpgCouplCol | |
88 | static const Double_t fgkPixUpgCouplRowDefault; //default for fPixUpgCouplRow | |
89 | static const Double_t fgkPixUpgEccDiffDefault;//default for fPixUpgEccDiff | |
90 | static const Double_t fgkPixUpgLorentzHoleWeightDefault;//default for fPixUpgLorentzHoleWeight | |
91 | static const UInt_t fgkPixUpgCouplingOptDefault; // type of pixel Coupling (old or new) | |
92 | static const Double_t fgkDOverVDefault; // default distance over voltage | |
93 | static const Double_t fgkGeVtoChargeDefault; // default energy to ionize (free an electron) in GeV | |
94 | static const Double_t fgkTDefault; // default temperature | |
95 | ||
96 | static const Double_t fgkNsigmasDefault; //default for fNsigmas | |
97 | static const Int_t fgkNcompsDefault; //default for fNcomps | |
98 | ||
99 | private: | |
100 | // | |
101 | Double_t fGeVcharge; // Energy to ionize (free an electron) in GeV | |
102 | Double_t fDOverV; // The parameter d/v where d is the disance over which the the potential v is applied d/v [cm/volts] | |
103 | Double_t fT; // The temperature of the Si in Degree K. | |
104 | // | |
105 | UInt_t fNPixUpg; // number of PixUpg type detectors | |
106 | UInt_t fPixUpgCouplOpt; // PixUpg Coupling Option | |
107 | Double_t fPixUpgCouplCol; // PixUpg Coupling parameter along the cols | |
108 | Double_t fPixUpgCouplRow; // PixUpg Coupling parameter along the rows | |
109 | Double_t fPixUpgEccDiff; // Eccentricity (i.e. asymmetry parameter) in the Gaussian diffusion for PixUpg | |
110 | Bool_t fPixUpgLorentzDrift; // Flag to decide whether to simulate the Lorentz Drift or not in PixUpg | |
111 | Double_t fPixUpgLorentzHoleWeight;// Lorentz Angle is computed for PixUpg as average of Hole and Electron | |
112 | // this parameter gives the relative weights between the two | |
113 | Bool_t fPixUpgAddNoisyFlag; // Flag saying whether noisy pixels should be added to digits | |
114 | Bool_t fPixUpgRemoveDeadFlag; // Flag saying whether dead pixels should be removed from digits | |
115 | // | |
116 | Double_t fPixUpgThreshDef; // PixUpg Threshold value | |
117 | Double_t fPixUpgThrSigmaDef; // PixUpg Threshold fluctuation | |
118 | Double_t fPixUpgBiasVoltageDef; // Bias Voltage for the PixUpg | |
119 | Double_t fPixUpgNoiseDef; // PixUpg electronic noise: sigma | |
120 | Double_t fPixUpgBaselineDef; // PixUpg electronic noise: baseline | |
121 | // | |
122 | Double_t* fPixUpgThresh; //[fNPixUpg] PixUpg Threshold value | |
123 | Double_t* fPixUpgThrSigma; //[fNPixUpg] PixUpg Threshold fluctuation | |
124 | Double_t* fPixUpgBiasVoltage; //[fNPixUpg] Bias Voltage for the PixUpg | |
125 | Double_t* fPixUpgSigma; //[fNPixUpg] PixUpg threshold fluctuations spread | |
126 | Double_t* fPixUpgNoise; //[fNPixUpg] PixUpg electronic noise: sigma | |
127 | Double_t* fPixUpgBaseline; //[fNPixUpg] PixUpg electronic noise: baseline | |
128 | // | |
129 | ||
02d6eccc | 130 | ClassDef(AliITSUSimuParam,1); // ITSU simulataion params |
451f5018 | 131 | }; |
132 | ||
133 | //_______________________________________________________________________ | |
134 | inline Double_t AliITSUSimuParam::CalcProbNoiseOverThreshold(double mean, double sigma, double thresh) | |
135 | { | |
136 | // calculate probability of gaussian noise exceeding the threshold | |
02d6eccc | 137 | if (mean+6*sigma<thresh) return 0; |
138 | if (mean-6*sigma>thresh) return 1.; | |
451f5018 | 139 | const double ksqrt2 = 1.41421356237309515e+00; |
02d6eccc | 140 | return 0.5*AliMathBase::ErfcFast( (thresh-mean)/(sigma*ksqrt2)); |
451f5018 | 141 | } |
142 | ||
143 | //_______________________________________________________________________ | |
144 | inline Double_t AliITSUSimuParam::GenerateNoiseQFunction(double prob, double mean, double sigma) | |
145 | { | |
146 | // generate random noise exceeding threshold probability prob, i.e. find a random point in the right | |
147 | // tail of the gaussian(base,noise), provided that the tail integral = prob | |
148 | const double ksqrt2 = 1.41421356237309515e+00; | |
149 | return mean+sigma*ksqrt2*TMath::ErfcInverse(2*prob*(1.-gRandom->Rndm())); | |
150 | } | |
151 | ||
152 | ||
153 | ||
154 | #endif |