Geant4-11
G4DNAELSEPAElasticModel.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// Created on 2016/01/18
27//
28// Authors: D. Sakata, W.G. Shin, S. Incerti
29//
30// Based on a recent release of the ELSEPA code
31// developed and provided kindly by F. Salvat et al.
32// See
33// Computer Physics Communications, 165(2), 157-190. (2005)
34// http://dx.doi.org/10.1016/j.cpc.2004.09.006
35//
36
39#include "G4SystemOfUnits.hh"
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
43
44using namespace std;
45
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
47
49const G4String& nam) :
50G4VEmModel(nam), isInitialised(false)
51{
52 verboseLevel = 0;
53
54 G4ProductionCutsTable* theCoupleTable =
56 G4int numOfCouples = theCoupleTable->GetTableSize();
57
58 for(G4int i=0; i<numOfCouples; ++i)
59 {
60 const G4MaterialCutsCouple* couple =
61 theCoupleTable->GetMaterialCutsCouple(i);
62 const G4Material* material = couple->GetMaterial();
63 G4int nelm = material->GetNumberOfElements();
64 const G4ElementVector* theElementVector = material->GetElementVector();
65
66 if(nelm==1)
67 {// Protection: only for single element
68 G4int Z = 79;
69 Z = G4lrint((*theElementVector)[0]->GetZ());
70 // Protection: only for GOLD
71 if (Z==79){
72 fkillBelowEnergy_Au = 10. * eV; // Kills e- tracking
73 flowEnergyLimit = 0 * eV; // Must stay at zero for killing
74 fhighEnergyLimit = 1 * GeV; // Default
77 }else{
78 //continue;
79 }
80 }else{// Protection: H2O only is available
81 if(material->GetName()=="G4_WATER"){
82 flowEnergyLimit = 10. * eV;
83 fhighEnergyLimit = 1 * MeV;
86 }else{
87 //continue;
88 }
89 }
90
91 if (verboseLevel > 0)
92 {
93 G4cout << "ELSEPA Elastic model is constructed for "
94 << material->GetName() << G4endl
95 << "Energy range: "
96 << flowEnergyLimit / eV << " eV - "
97 << fhighEnergyLimit / MeV << " MeV"
98 << G4endl;
99 }
100 }
101
102
104 fpMolDensity = 0;
105
106 fpData_Au=nullptr;
107 fpData_H2O=nullptr;
108}
109
110//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
111
113{
114 //std::map<G4int,G4DNACrossSectionDataSet*,
115 // std::less<G4String>>::iterator posZ;
116 //for (posZ = tableZData.begin(); posZ != tableZData.end(); ++posZ)
117 //{
118 // G4DNACrossSectionDataSet* table = posZ->second;
119 // delete table;
120 //}
121 //for (posZ = tableZData_Au.begin(); posZ != tableZData_Au.end(); ++posZ)
122 //{
123 // G4DNACrossSectionDataSet* table = posZ->second;
124 // delete table;
125 //}
126 //for (posZ = tableZData_H2O.begin(); posZ != tableZData_H2O.end(); ++posZ)
127 //{
128 // G4DNACrossSectionDataSet* table = posZ->second;
129 // delete table;
130 //}
131
132 if(fpData_Au) delete fpData_Au;
133 if(fpData_H2O) delete fpData_H2O;
134
135 //eEdummyVecZ.clear();
136 //eCumZ.clear();
137 //fAngleDataZ.clear();
138
139 eEdummyVec_Au.clear();
140 eEdummyVec_H2O.clear();
141 eCum_Au.clear();
142 eCum_H2O.clear();
143 fAngleData_Au.clear();
144 fAngleData_H2O.clear();
145}
146
147//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
148
150const G4DataVector& )
151{
152 if (verboseLevel > 3)
153 G4cout << "Calling G4DNAELSEPAElasticModel::Initialise()" << G4endl;
154
155 if (isInitialised) {return;}
156
157 if(particle->GetParticleName() != "e-")
158 {
159 G4Exception("G4DNAELSEPAElasticModel::Initialise","em0001",
160 FatalException,"Model not applicable to particle type.");
161 return;
162 }
163
164 G4ProductionCutsTable* theCoupleTable =
166 G4int numOfCouples = theCoupleTable->GetTableSize();
167
168 // UNIT OF TCS
169 G4double scaleFactor = 1.*cm*cm;
170
171 //tableZData.clear();
172 //tableZData_Au.clear();
173 //tableZData_H2O.clear();
174
175 fpData_Au=nullptr;
176 fpData_H2O=nullptr;
177
178 for(G4int i=0; i<numOfCouples; ++i)
179 {
180 const G4MaterialCutsCouple* couple =
181 theCoupleTable->GetMaterialCutsCouple(i);
182 const G4Material* material = couple->GetMaterial();
183 const G4ElementVector* theElementVector = material->GetElementVector();
184
185 G4int nelm = material->GetNumberOfElements();
186 if (nelm==1){// Protection: only for single element
187 G4int Z = G4lrint((*theElementVector)[0]->GetZ());
188 if (Z!=79)// Protection: only for GOLD
189 {
190 continue;
191 }
192
193 if (Z>0)
194 {
195 G4String fileZElectron("dna/sigma_elastic_e_elsepa_Z");
196 std::ostringstream oss;
197 oss.str("");
198 oss.clear(stringstream::goodbit);
199 oss << Z;
200 fileZElectron += oss.str()+"_muffintin";
201
202 //G4DNACrossSectionDataSet* tableZE =
203 // new G4DNACrossSectionDataSet
204 // (new G4LogLogInterpolation, eV,scaleFactor );
205 //tableZE->LoadData(fileZElectron);
207 //tableZData[Z] = tableZE;
208
210 eV,
211 scaleFactor );
212 fpData_Au->LoadData(fileZElectron);
213
214 std::ostringstream eFullFileNameZ;
215 char *path = getenv("G4LEDATA");
216 if (!path)
217 {
218 G4Exception("G4DNAELSEPAElasticModel::Initialise","em0002",
219 FatalException,"G4LEDATA environment variable not set.");
220 return;
221 }
222
223 eFullFileNameZ.str("");
224 eFullFileNameZ.clear(stringstream::goodbit);
225
226 eFullFileNameZ
227 << path
228 << "/dna/sigmadiff_cumulated_elastic_e_elsepa_Z"
229 << Z << "_muffintin.dat";
230
231 std::ifstream eDiffCrossSectionZ(eFullFileNameZ.str().c_str());
232
233 if (!eDiffCrossSectionZ)
234 {
235 G4Exception("G4DNAELSEPAElasticModel::Initialise","em0003",
236 FatalException,"Missing data file for cumulated DCS");
237 return;
238 }
239
240 //eEdummyVecZ.clear();
241 //eCumZ.clear();
242 //fAngleDataZ.clear();
243
244 eEdummyVec_Au.clear();
245 eCum_Au.clear();
246 fAngleData_Au.clear();
247
248 //eEdummyVecZ[Z].push_back(0.);
249 eEdummyVec_Au.push_back(0.);
250 do
251 {
252 G4double eDummy;
253 G4double cumDummy;
254 eDiffCrossSectionZ>>eDummy>>cumDummy;
255 //if (eDummy != eEdummyVecZ[Z].back())
256 if (eDummy != eEdummyVec_Au.back())
257 {
258
259 //eEdummyVecZ[Z].push_back(eDummy);
260 eEdummyVec_Au.push_back(eDummy);
261 //eCumZ[Z][eDummy].push_back(0.);
262 eCum_Au[eDummy].push_back(0.);
263 }
264 //eDiffCrossSectionZ>>fAngleDataZ[Z][eDummy][cumDummy];
265 eDiffCrossSectionZ>>fAngleData_Au[eDummy][cumDummy];
266 //if (cumDummy != eCumZ[Z][eDummy].back())
267 if (cumDummy != eCum_Au[eDummy].back())
268 {
269 //eCumZ[Z][eDummy].push_back(cumDummy);
270 eCum_Au[eDummy].push_back(cumDummy);
271 }
272 }while(!eDiffCrossSectionZ.eof());
273 }
274
275 }else{// Protection: H2O only is available
276 if(material->GetName()=="G4_WATER"){
277 if (LowEnergyLimit() < 10*eV)
278 {
279 G4cout<<"G4DNAELSEPAElasticModel: low energy limit increased from "
280 << LowEnergyLimit()/eV << " eV to " << 10 << " eV"
281 << G4endl;
283 }
284
285 if (HighEnergyLimit() > 1.*MeV)
286 {
287 G4cout<<"G4DNAELSEPAElasticModel: high energy limit decreased from "
288 << HighEnergyLimit()/MeV << " MeV to " << 1. << " MeV"
289 << G4endl;
291 }
292
293 G4String fileZElectron("dna/sigma_elastic_e_elsepa_muffin");
294
295 //G4DNACrossSectionDataSet* tableZE =
296 // new G4DNACrossSectionDataSet(
297 // new G4LogLogInterpolation, eV,scaleFactor );
298 //tableZE->LoadData(fileZElectron);
300 //tableZData[0] = tableZE;
301
303 eV,
304 scaleFactor );
305 fpData_H2O->LoadData(fileZElectron);
306
307 std::ostringstream eFullFileNameZ;
308
309 char *path = getenv("G4LEDATA");
310 if (!path)
311 {
312 G4Exception("G4DNAELSEPAElasticModel::Initialise","em0004",
313 FatalException,"G4LEDATA environment variable not set.");
314 return;
315 }
316
317 eFullFileNameZ.str("");
318 eFullFileNameZ.clear(stringstream::goodbit);
319
320 eFullFileNameZ
321 << path
322 << "/dna/sigmadiff_cumulated_elastic_e_elsepa_muffin.dat";
323
324 std::ifstream eDiffCrossSectionZ(eFullFileNameZ.str().c_str());
325
326 if (!eDiffCrossSectionZ)
327 G4Exception("G4DNAELSEPAElasticModel::Initialise","em0005",
329 "Missing data file for cumulated DCS");
330
331 //eEdummyVecZ.clear();
332 //eCumZ.clear();
333 //fAngleDataZ.clear();
334
335 eEdummyVec_H2O.clear();
336 eCum_H2O.clear();
337 fAngleData_H2O.clear();
338
339 //eEdummyVecZ[0].push_back(0.);
340 eEdummyVec_H2O.push_back(0.);
341
342 do
343 {
344 G4double eDummy;
345 G4double cumDummy;
346 eDiffCrossSectionZ>>eDummy>>cumDummy;
347 //if (eDummy != eEdummyVecZ[0].back())
348 if (eDummy != eEdummyVec_H2O.back())
349 {
350 //eEdummyVecZ[0].push_back(eDummy);
351 eEdummyVec_H2O.push_back(eDummy);
352 //eCumZ[0][eDummy].push_back(0.);
353 eCum_H2O[eDummy].push_back(0.);
354 }
355 //eDiffCrossSectionZ>>fAngleDataZ[0][eDummy][cumDummy];
356 eDiffCrossSectionZ>>fAngleData_H2O[eDummy][cumDummy];
357 //if (cumDummy != eCumZ[0][eDummy].back()){
358 if (cumDummy != eCum_H2O[eDummy].back()){
359 //eCumZ[0][eDummy].push_back(cumDummy);
360 eCum_H2O[eDummy].push_back(cumDummy);
361 }
362 }while(!eDiffCrossSectionZ.eof());
363 }
364 }
365 if (verboseLevel > 2)
366 G4cout << "Loaded cross section files of ELSEPA Elastic model for"
367 << material->GetName() << G4endl;
368
369 if( verboseLevel>0 )
370 {
371 G4cout << "ELSEPA elastic model is initialized " << G4endl
372 << "Energy range: "
373 << LowEnergyLimit() / eV << " eV - "
374 << HighEnergyLimit()/ MeV << " MeV"
375 << G4endl;
376 }
377 } // Loop on couples
378
379
381 fpMolDensity = 0;
382
383 isInitialised = true;
384}
385
386//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
387
389(const G4Material* material,
390 const G4ParticleDefinition* particle,
391 G4double ekin,
392 G4double,
393 G4double)
394{
395
396 if (verboseLevel > 3)
397 {
398 G4cout <<
399 "Calling CrossSectionPerVolume() of G4DNAELSEPAElasticModel"
400 << G4endl;
401 }
402
403 G4double atomicNDensity=0.0;
404 G4double sigma=0;
405
406 const G4ElementVector* theElementVector = material->GetElementVector();
407 G4int nelm = material->GetNumberOfElements();
408 if (nelm==1) {// Protection: only for single element
409 // Protection: only for GOLD
410 if (material->GetZ()!=79) return 0;
411
412 G4int Z = G4lrint((*theElementVector)[0]->GetZ());
413
414 const G4String& particleName = particle->GetParticleName();
415 atomicNDensity = material->GetAtomicNumDensityVector()[0];
416 if(atomicNDensity!= 0.0)
417 {
418 if (ekin < fhighEnergyLimit)
419 {
420 if (ekin < fkillBelowEnergy_Au) return DBL_MAX;
421
422 //std::map< G4int,G4DNACrossSectionDataSet*,
423 // std::less<G4String> >::iterator pos;
425 //pos = tableZData.find(Z);
426 //
428 //if (pos != tableZData.end())
429 //{
430 // G4DNACrossSectionDataSet* table = pos->second;
431 // if (table != 0)
432 // {
433 // // XS takes its 10 eV value below 10 eV for GOLD
434 // if (ekin < 10*eV) sigma = table->FindValue(10*eV);
435 // else sigma = table->FindValue(ekin);
436 // }
437 //}
438 //else
439 //{
440 // G4Exception("G4DNAELSEPAElasticModel::ComputeCrossSectionPerVolume",
441 // "em0006",FatalException,"Model not applicable to particle type.");
442 //}
443
444 if (ekin < 10*eV) sigma = fpData_Au->FindValue(10*eV);
445 else sigma = fpData_Au->FindValue(ekin);
446 }
447 }
448 if (verboseLevel > 2)
449 {
450 G4cout << "__________________________________" << G4endl;
451 G4cout << "=== G4DNAELSEPAElasticModel - XS INFO START" << G4endl;
452 G4cout << "=== Material is made of one element with Z =" << Z << G4endl;
453 G4cout << "=== Kinetic energy(eV)=" << ekin/eV << " particle : "
454 << particleName << G4endl;
455 G4cout << "=== Cross section per atom for Z="<<Z<<" is (cm^2)"
456 << sigma/cm/cm << G4endl;
457 G4cout << "=== Cross section per atom for Z="<<Z<<" is (cm^-1)="
458 << sigma*atomicNDensity/(1./cm) << G4endl;
459 G4cout << "=== G4DNAELSEPAElasticModel - XS INFO END" << G4endl;
460 }
461 }else{
464 GetNumMolPerVolTableFor(G4Material::GetMaterial("G4_WATER"));
465 atomicNDensity = (*fpMolDensity)[material->GetIndex()];
466 if(atomicNDensity!= 0.0)
467 {
468 if (ekin < HighEnergyLimit() && ekin >= LowEnergyLimit())
469 {
470 //std::map< G4int,G4DNACrossSectionDataSet*,
471 //std::less<G4String> >::iterator pos;
473 //pos = tableZData.find(0); // the data is stored as Z=0
477 //if (pos != tableZData.end())
478 //{
479 // G4DNACrossSectionDataSet* table = pos->second;
480 // if (table != 0)
481 // {
482 // sigma = table->FindValue(ekin);
483 // }
484 //}
485
486 sigma = fpData_H2O->FindValue(ekin);
487 }
488 }
489 if (verboseLevel > 2)
490 {
491 G4cout << "__________________________________" << G4endl;
492 G4cout << "=== G4DNAELSEPAElasticModel - XS INFO START" << G4endl;
493 G4cout << "=== Kinetic energy(eV)=" << ekin/eV
494 << " particle : " << particle->GetParticleName() << G4endl;
495 G4cout << "=== Cross section per water molecule (cm^2)="
496 << sigma/cm/cm << G4endl;
497 G4cout << "=== Cross section per water molecule (cm^-1)="
498 << sigma*atomicNDensity/(1./cm) << G4endl;
499 G4cout << "=== G4DNAELSEPAElasticModel - XS INFO END" << G4endl;
500 }
501 }
502
503 return sigma*atomicNDensity;
504}
505
506//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
507
509 std::vector<G4DynamicParticle*>*,
510 const G4MaterialCutsCouple* couple,
511 const G4DynamicParticle* aDynamicElectron,
512 G4double,
513 G4double)
514{
515
516 if (verboseLevel > 3){
517 G4cout <<
518 "Calling SampleSecondaries() of G4DNAELSEPAElasticModel"
519 << G4endl;
520 }
521
522 G4double electronEnergy0 = aDynamicElectron->GetKineticEnergy();
523
524 const G4Material* material = couple->GetMaterial();
525 const G4ElementVector* theElementVector = material->GetElementVector();
526 G4int nelm = material->GetNumberOfElements();
527 if (nelm==1){// Protection: only for single element
528 G4int Z = G4lrint((*theElementVector)[0]->GetZ());
529 if (Z!=79) return;
530 if (electronEnergy0 < fkillBelowEnergy_Au)
531 {
536 return;
537 }
538
539 if(electronEnergy0>= fkillBelowEnergy_Au && electronEnergy0 < fhighEnergyLimit)
540 {
541 G4double cosTheta = 0;
542 if (electronEnergy0>=10*eV){
543 cosTheta = RandomizeCosTheta(Z,electronEnergy0);
544 }else {
545 cosTheta = RandomizeCosTheta(Z,10*eV);
546 }
547
548 G4double phi = 2. * CLHEP::pi * G4UniformRand();
549
550 G4ThreeVector zVers = aDynamicElectron->GetMomentumDirection();
551 G4ThreeVector xVers = zVers.orthogonal();
552 G4ThreeVector yVers = zVers.cross(xVers);
553
554 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
555 G4double yDir = xDir;
556 xDir *= std::cos(phi);
557 yDir *= std::sin(phi);
558
559 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
562
563 }
564 }else{
565 if(material->GetName()=="G4_WATER"){
566 //The data for water is stored as Z=0
567 G4double cosTheta = RandomizeCosTheta(0,electronEnergy0);
568
569 G4double phi = 2. * pi * G4UniformRand();
570
571 G4ThreeVector zVers = aDynamicElectron->GetMomentumDirection();
572 G4ThreeVector xVers = zVers.orthogonal();
573 G4ThreeVector yVers = zVers.cross(xVers);
574
575 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
576 G4double yDir = xDir;
577 xDir *= std::cos(phi);
578 yDir *= std::sin(phi);
579
580 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
583 }
584 }
585}
586
587//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
588
590 G4ParticleDefinition * particleDefinition,
591 G4double k,
592 G4double integrDiff)
593{
594
595 G4double theta = 0.;
596 G4double valueE1 = 0.;
597 G4double valueE2 = 0.;
598 G4double valuecum21 = 0.;
599 G4double valuecum22 = 0.;
600 G4double valuecum12 = 0.;
601 G4double valuecum11 = 0.;
602 G4double a11 = 0.;
603 G4double a12 = 0.;
604 G4double a21 = 0.;
605 G4double a22 = 0.;
606
607 if (particleDefinition == G4Electron::ElectronDefinition())
608 {
609 //std::vector<G4double>::iterator e2
610 // = std::upper_bound(eEdummyVecZ[Z].begin(),
611 // eEdummyVecZ[Z].end(), k);
612 std::vector<G4double>::iterator e2;
613 if(Z==0){
614 e2 = std::upper_bound(eEdummyVec_H2O.begin(),
615 eEdummyVec_H2O.end(), k);
616 }else if (Z==79){
617 e2 = std::upper_bound(eEdummyVec_Au.begin(),
618 eEdummyVec_Au.end(), k);
619 }
620
621 std::vector<G4double>::iterator e1 = e2 - 1;
622
623 //std::vector<G4double>::iterator cum12
624 // = std::upper_bound(eCumZ[Z][(*e1)].begin(),
625 // eCumZ[Z][(*e1)].end(),integrDiff);
626 std::vector<G4double>::iterator cum12;
627 if(Z==0){
628 cum12 = std::upper_bound(eCum_H2O[(*e1)].begin(),
629 eCum_H2O[(*e1)].end(),integrDiff);
630 }else if (Z==79){
631 cum12 = std::upper_bound(eCum_Au[(*e1)].begin(),
632 eCum_Au[(*e1)].end(),integrDiff);
633 }
634
635 std::vector<G4double>::iterator cum11 = cum12 - 1;
636
637 //std::vector<G4double>::iterator cum22
638 // = std::upper_bound(eCumZ[Z][(*e2)].begin(),
639 // eCumZ[Z][(*e2)].end(),integrDiff);
640 std::vector<G4double>::iterator cum22;
641 if(Z==0){
642 cum22 = std::upper_bound(eCum_H2O[(*e2)].begin(),
643 eCum_H2O[(*e2)].end(),integrDiff);
644 }else if(Z==79){
645 cum22 = std::upper_bound(eCum_Au[(*e2)].begin(),
646 eCum_Au[(*e2)].end(),integrDiff);
647 }
648
649 std::vector<G4double>::iterator cum21 = cum22 - 1;
650
651 valueE1 = *e1;
652 valueE2 = *e2;
653 valuecum11 = *cum11;
654 valuecum12 = *cum12;
655 valuecum21 = *cum21;
656 valuecum22 = *cum22;
657
658
659 //a11 = fAngleDataZ[Z][valueE1][valuecum11];
660 //a12 = fAngleDataZ[Z][valueE1][valuecum12];
661 //a21 = fAngleDataZ[Z][valueE2][valuecum21];
662 //a22 = fAngleDataZ[Z][valueE2][valuecum22];
663 if(Z==0){
664 a11 = fAngleData_H2O[valueE1][valuecum11];
665 a12 = fAngleData_H2O[valueE1][valuecum12];
666 a21 = fAngleData_H2O[valueE2][valuecum21];
667 a22 = fAngleData_H2O[valueE2][valuecum22];
668 }else if (Z==79){
669 a11 = fAngleData_Au[valueE1][valuecum11];
670 a12 = fAngleData_Au[valueE1][valuecum12];
671 a21 = fAngleData_Au[valueE2][valuecum21];
672 a22 = fAngleData_Au[valueE2][valuecum22];
673 }
674
675 }
676
677 if (a11 == 0 && a12 == 0 && a21 == 0 && a22 == 0) return (0.);
678
679 theta = QuadInterpolator(valuecum11, valuecum12, valuecum21, valuecum22,
680 a11, a12,a21, a22, valueE1, valueE2, k, integrDiff);
681 return theta;
682}
683
684//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
685//
688G4double e,
689G4double xs1,
690G4double xs2)
691{
692 G4double value=0.;
693 if(e1!=0){
694 G4double a = std::log10(e) - std::log10(e1);
695 G4double b = std::log10(e2) - std::log10(e);
696 value = xs1 + a/(a+b)*(xs2-xs1);
697 }
698 else{
699 G4double d1 = xs1;
700 G4double d2 = xs2;
701 value = (d1 + (d2 - d1) * (e - e1) / (e2 - e1));
702 }
703
704 return value;
705}
706
707//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
708
711G4double e,
712G4double xs1,
713G4double xs2)
714{
715 G4double d1 = std::log10(xs1);
716 G4double d2 = std::log10(xs2);
717 G4double value = std::pow(10,(d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
718 return value;
719}
720
721//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
722
725G4double e,
726G4double xs1,
727G4double xs2)
728{
729 G4double d1 = xs1;
730 G4double d2 = xs2;
731 G4double value = (d1 + (d2 - d1) * (e - e1) / (e2 - e1));
732 return value;
733}
734
735//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
736
739G4double e,
740G4double xs1,
741G4double xs2)
742{
743 G4double a = (std::log10(xs2) - std::log10(xs1))
744 / (std::log10(e2) - std::log10(e1));
745 G4double b = std::log10(xs2) - a * std::log10(e2);
746 G4double sigma = a * std::log10(e) + b;
747 G4double value = (std::pow(10., sigma));
748 return value;
749}
750
751//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
752
754G4double cum11,
755G4double cum12,
756G4double cum21,
757G4double cum22,
758G4double a11,
759G4double a12,
760G4double a21,
761G4double a22,
764G4double t,
765G4double cum)
766{
767 G4double value=0;
768 G4double interpolatedvalue1=0;
769 G4double interpolatedvalue2=0;
770
771 if(cum11!=0){
772 interpolatedvalue1 = LinLogInterpolate(cum11, cum12, cum, a11, a12);
773 }
774 else{
775 interpolatedvalue1 = LinLinInterpolate(cum11, cum12, cum, a11, a12);
776 }
777 if(cum21!=0){
778 interpolatedvalue2 = LinLogInterpolate(cum21, cum22, cum, a21, a22);
779 }
780 else{
781 interpolatedvalue2 = LinLinInterpolate(cum21, cum22, cum, a21, a22);
782 }
783
784 value = LogLinInterpolate(e1,e2,t,interpolatedvalue1,interpolatedvalue2);
785
786 return value;
787}
788
789//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
790
792{
793
794 G4double integrdiff = 0.;
796 integrdiff = uniformRand;
797
798 G4double theta = 0.;
799 G4double cosTheta = 0.;
800 theta = Theta(Z, G4Electron::ElectronDefinition(), k / eV, integrdiff);
801
802 cosTheta = std::cos(theta * CLHEP::pi / 180.);
803
804 return cosTheta;
805}
806
807//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
808
810{
811 fkillBelowEnergy_Au = threshold;
812
813 if (threshold < 10 * eV)
814 {
815 G4cout<< "*** WARNING : the G4DNAELSEPAElasticModel model is not "
816 "defined below 10 eV !" << G4endl;
817 }
818}
static const G4double e1[44]
static const G4double e2[44]
static const G4double d1
static const G4double d2
std::vector< const G4Element * > G4ElementVector
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
static constexpr double eV
Definition: G4SIunits.hh:201
static constexpr double GeV
Definition: G4SIunits.hh:203
static constexpr double MeV
Definition: G4SIunits.hh:200
static constexpr double pi
Definition: G4SIunits.hh:55
static constexpr double cm
Definition: G4SIunits.hh:99
CLHEP::Hep3Vector G4ThreeVector
@ fStopAndKill
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
Hep3Vector unit() const
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
virtual G4double FindValue(G4double e, G4int componentId=0) const
virtual G4bool LoadData(const G4String &argFileName)
const std::vector< G4double > * fpMolDensity
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *particle, G4double ekin, G4double emin, G4double emax)
std::vector< G4double > eEdummyVec_Au
G4double LogLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4double Theta(G4int Z, G4ParticleDefinition *aParticleDefinition, G4double k, G4double integrDiff)
G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4DNAELSEPAElasticModel(const G4ParticleDefinition *particle=0, const G4String &nam="DNAELSEPAElasticModel")
G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4double QuadInterpolator(G4double e11, G4double e12, G4double e21, G4double e22, G4double x11, G4double x12, G4double x21, G4double x22, G4double t1, G4double t2, G4double t, G4double e)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
std::vector< G4double > eEdummyVec_H2O
void SetKillBelowThreshold(G4double threshold)
G4double RandomizeCosTheta(G4int Z, G4double k)
virtual void Initialise(const G4ParticleDefinition *particle, const G4DataVector &)
G4ParticleChangeForGamma * fParticleChangeForGamma
G4DNACrossSectionDataSet * fpData_H2O
G4DNACrossSectionDataSet * fpData_Au
static G4DNAMolecularMaterial * Instance()
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:88
const G4Material * GetMaterial() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:686
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:767
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:123
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:662
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:655
void SetLowEnergyLimit(G4double)
Definition: G4VEmModel.hh:774
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double pi
Definition: SystemOfUnits.h:55
string material
Definition: eplot.py:19
int G4lrint(double ad)
Definition: templates.hh:134
#define DBL_MAX
Definition: templates.hh:62