96{
97
98 if(verboseLevel > 3)
99 {
100 G4cout <<
"Calling G4DNAIonElasticModel::Initialise()" <<
G4endl;
101 }
102
103
104
106 {
107 G4cout <<
"G4DNAIonElasticModel: low energy limit increased from " <<
110 }
111
113 {
114 G4cout <<
"G4DNAIonElasticModel: high energy limit decreased from " <<
117 }
118
119
120
122
124
125 if (path == nullptr)
126 {
127 G4Exception(
"G4IonElasticModel::Initialise",
"em0006",
129 return;
130 }
131
133 std::ostringstream fullFileName;
134
144
145 if (
146 (particleDefinition == protonDef && protonDef != nullptr)
147 ||
148 (particleDefinition == hydrogenDef && hydrogenDef != nullptr)
149 )
150 {
151
152 fParticle_Mass = 1.;
153 totalXSFile = "dna/sigma_elastic_proton_HTran";
154
155
156 fullFileName << path << "/dna/sigmadiff_cumulated_elastic_proton_HTran.dat";
157 }
158
159 if (
160 (particleDefinition == instance->
GetIon(
"helium") && (heliumDef !=
nullptr))
161 ||
162 (particleDefinition == instance->
GetIon(
"alpha+") && (alphaplusDef !=
nullptr))
163 ||
164 (particleDefinition == instance->
GetIon(
"alpha++") && (alphaplusplusDef !=
nullptr))
165 )
166 {
167
168 fParticle_Mass = 4.;
169 totalXSFile = "dna/sigma_elastic_alpha_HTran";
170
171
172 fullFileName << path << "/dna/sigmadiff_cumulated_elastic_alpha_HTran.dat";
173 }
174
177 std::ifstream diffCrossSection(fullFileName.str().c_str());
178
179 if (!diffCrossSection)
180 {
182 description << "Missing data file:"
183 <<fullFileName.str().c_str()<<
G4endl;
184 G4Exception(
"G4IonElasticModel::Initialise",
"em0003",
186 description);
187 }
188
189
190
191 eTdummyVec.clear();
192 eVecm.clear();
193 fDiffCrossSectionData.clear();
194
195
196
197 eTdummyVec.push_back(0.);
198
199 while(!diffCrossSection.eof())
200 {
203 diffCrossSection>>tDummy>>eDummy;
204
205
206
207 if (tDummy != eTdummyVec.back())
208 {
209 eTdummyVec.push_back(tDummy);
210 eVecm[tDummy].push_back(0.);
211 }
212
213 diffCrossSection>>fDiffCrossSectionData[tDummy][eDummy];
214
215 if (eDummy != eVecm[tDummy].back()) eVecm[tDummy].push_back(eDummy);
216
217 }
218
219
220 if( verboseLevel>0 )
221 {
222 if (verboseLevel > 2)
223 {
224 G4cout <<
"Loaded cross section files for ion elastic model" <<
G4endl;
225 }
227 << "Energy range: "
231 }
232
233
237
238 if (isInitialised) return;
240 isInitialised = true;
241}
const char * G4FindDataDir(const char *)
std::ostringstream G4ExceptionDescription
G4bool LoadData(const G4String &argFileName) override
static G4DNAGenericIonsManager * Instance()
G4ParticleDefinition * GetIon(const G4String &name)
static G4DNAMolecularMaterial * Instance()
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const