BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmStsRadTool.cxx
Go to the documentation of this file.
1/** @file CbmStsRadTool.cxx
2 ** @author Volker Friese <v.friese@gsi.de>
3 ** @date 6 December 2011
4 **/
5
6#include "CbmStsRadTool.h"
7
8#include "TMath.h"
9#include "TString.h"
10
11#include <fstream>
12#include <iostream>
13
14// ===== Constructor ==================================================
16 : TObject()
17 , niel_neutron()
18 , niel_proton()
19 , niel_pion()
21 , fIAlpha(0.)
22 , fEGap0(0.)
23 , fEGapAlpha(0.)
24 , fEGapBeta(0.)
25 , fNeff0(0.)
26 , fNeffC(0.)
27 , fNeffGc(0.)
28 , fEpsilon(0.)
29{
30 Init();
31}
32// ========================================================================
33
34// ===== Destructor ===================================================
36// ========================================================================
37
38// ===== Get leakage current ==========================================
40{
41
42 // --- Boltzmann constant in ev/K
43 Double_t kB = TMath::K() / TMath::Qe();
44
45 // --- Leakage current at room temperature (293 K)
46 Double_t i20 = fIAlpha * fluence * volume;
47
48 // --- Gap energy at given temperature
49 Double_t eGap = fEGap0 - fEGapAlpha * temperature * temperature / (temperature + fEGapBeta);
50
51 // --- Leakage current at given temperature
52 Double_t exponent = -1. * eGap / 2. / kB * (1. / temperature - 1. / 293.);
53 Double_t iLeak = i20 * temperature * temperature / 85849. * TMath::Exp(exponent);
54
55 return iLeak;
56}
57// ========================================================================
58
59// ===== Get NIEL factor ==============================================
61{
62
63 // Convert energy to MeV like in table
64 energy = energy * 1000.;
65
66 map<Double_t, Double_t>* table = NULL;
67 Int_t atype = TMath::Abs(type);
68
69 // Select table according to particle type
70 switch (atype) {
71 case 2112:
72 table = &niel_neutron;
73 break; // neutrons
74 case 2212:
75 table = &niel_proton;
76 break; // protons
77 case 211:
78 table = &niel_pion;
79 break; // pions
80 case 11:
81 table = &niel_electron;
82 break; // electrons
83 default:
84 table = NULL;
85 }
86
87 // Return zero for unknown particles
88 if (!table)
89 return 0.;
90
91 // First table entry above selected energy
92 map<Double_t, Double_t>::iterator it = table->upper_bound(energy);
93
94 // Return zero if below lower limit
95 if (it == table->begin()) {
96 // cout << "-I- Below table limit: " << atype << " " << energy << endl;
97 return 0.;
98 }
99
100 // Return asymptotic value if above upper limit
101 if (it == table->end()) {
102 // cout << "-I- Above table limit: " << atype << " " << energy << endl;
103 switch (atype) {
104 case 2112:
105 return 0.44;
106 break;
107 case 2212:
108 return 0.50;
109 break;
110 case 211:
111 return 0.38;
112 break;
113 case 11:
114 return 0.08;
115 break;
116 default:
117 return 0.00;
118 break;
119 }
120 }
121
122 // Interpolate within table values
123 Double_t e2 = (*it).first;
124 Double_t v2 = (*it).second;
125 it--;
126 Double_t e1 = (*it).first;
127 Double_t v1 = (*it).second;
128
129 Double_t v = v1 + (v2 - v1) * (energy - e1) / (e2 - e1);
130
131 return v;
132}
133// ========================================================================
134
135// ===== Get full depletion voltage ===================================
137{
138
139 // --- Calculate effective doping concentration at given fluence
140 Double_t corr1 = 0.7 * fNeff0 * (1. - TMath::Exp(-1. * fNeffC * fluence));
141 Double_t corr2 = fNeffGc * fluence;
142 Double_t nEff = fNeff0 - corr1 - corr2;
143
144 // --- Calculate full depletion voltage from doping concentration
145 Double_t vfd = TMath::Qe() * nEff * d * d / 2. / fEpsilon;
146
147 return vfd;
148}
149// ========================================================================
150
151// ===== Private method Init ==========================================
153{
154
155 // --- Read NIEL tables
156 ReadData("niel_neutrons.dat", niel_neutron);
157 ReadData("niel_protons.dat", niel_proton);
158 ReadData("niel_pions.dat", niel_pion);
159 ReadData("niel_electrons.dat", niel_electron);
160
161 // --- Proportionality constant of leakage current and fluence
162 // --- for Silicon at room temperature
163 // --- Numerical value provided by S. Chatterji
164 fIAlpha = 4.e-17; // [A/cm]
165
166 // --- Constants for temperature dependence of leakage current
167 // --- Values are for Silicon
168 // --- Numerical values provided by S. Chatterji
169 fEGap0 = 1.166; // Gap energy [eV] at T = 0K
170 fEGapAlpha = 4.73e-4; // [ev/K]
171 fEGapBeta = 636.; // [K]
172
173 // --- Constants for effective doping concentration
174 // --- Values are for Silicon
175 // --- Numerical values provided by S. Chatterji
176 fNeff0 = 9.0e11; // Doping concentration without irradiation [cm^-3];
177 fNeffC = 2.5e-14; // [cm^2]
178 fNeffGc = 1.5e-2; // [1/cm]
179
180 // --- Permittivivity of Silicon
181 fEpsilon = 1.04e-12; // [F/cm]
182}
183// ========================================================================
184
185// ===== Private method ReadData ======================================
186void CbmStsRadTool::ReadData(const char* file, map<Double_t, Double_t>& table)
187{
188
189 TString wrkdir = getenv("VMCWORKDIR");
190 TString fileName = wrkdir + "/input/" + TString(file);
191 cout << "-I- Reading " << fileName << endl;
192
193 ifstream* data = new ifstream(fileName.Data());
194 if (!data->is_open()) {
195 cout << "-E- Error when reading from file!" << endl;
196 Fatal("ReadData", "Read error");
197 }
198
199 Double_t e = 0.;
200 Double_t v = 0.;
201 Int_t nEntries = 0;
202
203 *data >> e >> v;
204 while (!data->eof()) {
205 table[e] = v;
206 nEntries++;
207 *data >> e >> v;
208 }
209
210 data->close();
211 delete data;
212
213 map<Double_t, Double_t>::iterator it1 = table.begin();
214 map<Double_t, Double_t>::iterator it2 = table.end();
215 it2--;
216
217 cout << "-I- " << nEntries << " values read; energy range " << (*it1).first << " to " << (*it2).first
218 << " MeV; map size " << table.size() << endl;
219}
220// ========================================================================
__m128 v
Definition P4_F32vec4.h:1
int Int_t
double Double_t
Double_t fIAlpha
Proportionality constant of leakage current and fluence.
map< Double_t, Double_t > niel_proton
Double_t fEpsilon
Permittivity of Silicon.
Double_t fEGapAlpha
Double_t fEGap0
Constants for temperature dependence of leakage current.
Double_t GetLeakageCurrent(Double_t fluence, Double_t volume, Double_t temperature)
Get leakage current.
CbmStsRadTool()
Constructor.
virtual ~CbmStsRadTool()
Destructor.
Double_t fNeff0
Constants for effective doping concentration as function of fluence.
Double_t GetVfd(Double_t fluence, Double_t d)
Get full depletion voltage.
Double_t GetNiel(Int_t type, Double_t energy)
Get NIEL factor.
Double_t fNeffC
map< Double_t, Double_t > niel_neutron
Tables of NIEL factors as fnct.
void Init()
Initialisation.
map< Double_t, Double_t > niel_electron
map< Double_t, Double_t > niel_pion
void ReadData(const char *file, map< Double_t, Double_t > &map)
Read data from file.
Double_t fEGapBeta
virtual void Fatal(const char *method, const char *msgfmt,...) const
const char * Data() const
Double_t Exp(Double_t x)
constexpr Double_t K()
constexpr Double_t Qe()
Double_t Abs(Double_t d)