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