108{
109
110 if (verboseLevel > 3)
111 {
112 G4cout <<
"Calling G4DNABornIonisationModel2::Initialise()" <<
G4endl;
113 }
114
115 if(fParticleDef != nullptr && particle != fParticleDef)
116 {
118 description << "You are trying to initialized G4DNABornIonisationModel2 "
119 "for particle "
122 description << "G4DNABornIonisationModel2 was already initialised "
124 G4Exception(
"G4DNABornIonisationModel2::Initialise",
"bornIonInit",
126 }
127
128 fParticleDef = particle;
129
130
132
133
134
136 std::ostringstream fullFileName;
137 fullFileName << path;
138
139 if(particleName == "e-")
140 {
141 fTableFile = "dna/sigma_ionisation_e_born";
142 fLowEnergyLimit = 11.*eV;
143 fHighEnergyLimit = 1.*MeV;
144
145 if (fasterCode)
146 {
147 fullFileName << "/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat";
148 }
149 else
150 {
151 fullFileName << "/dna/sigmadiff_ionisation_e_born.dat";
152 }
153 }
154 else if(particleName == "proton")
155 {
156 fTableFile = "dna/sigma_ionisation_p_born";
157 fLowEnergyLimit = 500. * keV;
158 fHighEnergyLimit = 100. * MeV;
159
160 if (fasterCode)
161 {
162 fullFileName << "/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat";
163 }
164 else
165 {
166 fullFileName << "/dna/sigmadiff_ionisation_p_born.dat";
167 }
168 }
169
170
171
172 G4double scaleFactor = (1.e-22 / 3.343) * m*m;
175
176
177
178 std::ifstream diffCrossSection(fullFileName.str().c_str());
179
180 if (!diffCrossSection)
181 {
183 description <<
"Missing data file:" <<
G4endl << fullFileName.str() <<
G4endl;
184 G4Exception(
"G4DNABornIonisationModel2::Initialise",
"em0003",
186 }
187
188
189
190
191 fTdummyVec.clear();
192 fVecm.clear();
193
194 for (int j=0; j<5; j++)
195 {
196 fProbaShellMap[j].clear();
197 fDiffCrossSectionData[j].clear();
198 fNrjTransfData[j].clear();
199 }
200
201
202
203 fTdummyVec.push_back(0.);
204 while(!diffCrossSection.eof())
205 {
208 diffCrossSection>>tDummy>>eDummy;
209 if (tDummy != fTdummyVec.back()) fTdummyVec.push_back(tDummy);
210
212 for (int j=0; j<5; j++)
213 {
214 diffCrossSection>> tmp;
215
216 fDiffCrossSectionData[j][tDummy][eDummy] = tmp;
217
218 if (fasterCode)
219 {
220 fNrjTransfData[j][tDummy][fDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
221 fProbaShellMap[j][tDummy].push_back(fDiffCrossSectionData[j][tDummy][eDummy]);
222 }
223
224
225 if (!diffCrossSection.eof() && !fasterCode) fDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
226
227 if (!fasterCode) fVecm[tDummy].push_back(eDummy);
228
229 }
230 }
231
232
235
236 if( verboseLevel>0 )
237 {
238 G4cout <<
"Born ionisation model is initialized " <<
G4endl
239 << "Energy range: "
244 }
245
246
247
250
251
252
254
255 if (isInitialised)
256 { return;}
258 isInitialised = true;
259}
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4bool LoadData(const G4String &argFileName) override
static G4DNAMolecularMaterial * Instance()
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
const G4String & GetParticleName() const
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)