58 for(
G4int i=0; i<numOfCouples; ++i)
69 Z =
G4lrint((*theElementVector)[0]->GetZ());
72 fkillBelowEnergy_Au = 10. * eV;
73 flowEnergyLimit = 0 * eV;
74 fhighEnergyLimit = 1 * GeV;
81 if(material->
GetName()==
"G4_WATER"){
82 flowEnergyLimit = 10. * eV;
83 fhighEnergyLimit = 1 * MeV;
93 G4cout <<
"ELSEPA Elastic model is constructed for "
96 << flowEnergyLimit / eV <<
" eV - "
97 << fhighEnergyLimit / MeV <<
" MeV"
104 fpMolDensity =
nullptr;
139 eEdummyVec_Au.clear();
140 eEdummyVec_H2O.clear();
143 fAngleData_Au.clear();
144 fAngleData_H2O.clear();
152 if (verboseLevel > 3)
153 G4cout <<
"Calling G4DNAELSEPAElasticModel::Initialise()" <<
G4endl;
155 if (isInitialised) {
return;}
159 G4Exception(
"G4DNAELSEPAElasticModel::Initialise",
"em0001",
178 for(
G4int i=0; i<numOfCouples; ++i)
195 G4String fileZElectron(
"dna/sigma_elastic_e_elsepa_Z");
196 std::ostringstream oss;
198 oss.clear(stringstream::goodbit);
200 fileZElectron += oss.str()+
"_muffintin";
214 std::ostringstream eFullFileNameZ;
218 G4Exception(
"G4DNAELSEPAElasticModel::Initialise",
"em0002",
223 eFullFileNameZ.str(
"");
224 eFullFileNameZ.clear(stringstream::goodbit);
228 <<
"/dna/sigmadiff_cumulated_elastic_e_elsepa_Z"
229 << Z <<
"_muffintin.dat";
231 std::ifstream eDiffCrossSectionZ(eFullFileNameZ.str().c_str());
233 if (!eDiffCrossSectionZ)
235 G4Exception(
"G4DNAELSEPAElasticModel::Initialise",
"em0003",
244 eEdummyVec_Au.clear();
246 fAngleData_Au.clear();
249 eEdummyVec_Au.push_back(0.);
254 eDiffCrossSectionZ>>eDummy>>cumDummy;
256 if (eDummy != eEdummyVec_Au.back())
260 eEdummyVec_Au.push_back(eDummy);
262 eCum_Au[eDummy].push_back(0.);
265 eDiffCrossSectionZ>>fAngleData_Au[eDummy][cumDummy];
267 if (cumDummy != eCum_Au[eDummy].back())
270 eCum_Au[eDummy].push_back(cumDummy);
272 }
while(!eDiffCrossSectionZ.eof());
276 if(material->
GetName()==
"G4_WATER"){
279 G4cout<<
"G4DNAELSEPAElasticModel: low energy limit increased from "
287 G4cout<<
"G4DNAELSEPAElasticModel: high energy limit decreased from "
293 G4String fileZElectron(
"dna/sigma_elastic_e_elsepa_muffin");
305 fpData_H2O->
LoadData(fileZElectron);
307 std::ostringstream eFullFileNameZ;
312 G4Exception(
"G4DNAELSEPAElasticModel::Initialise",
"em0004",
317 eFullFileNameZ.str(
"");
318 eFullFileNameZ.clear(stringstream::goodbit);
322 <<
"/dna/sigmadiff_cumulated_elastic_e_elsepa_muffin.dat";
324 std::ifstream eDiffCrossSectionZ(eFullFileNameZ.str().c_str());
326 if (!eDiffCrossSectionZ)
327 G4Exception(
"G4DNAELSEPAElasticModel::Initialise",
"em0005",
329 "Missing data file for cumulated DCS");
335 eEdummyVec_H2O.clear();
337 fAngleData_H2O.clear();
340 eEdummyVec_H2O.push_back(0.);
346 eDiffCrossSectionZ>>eDummy>>cumDummy;
348 if (eDummy != eEdummyVec_H2O.back())
351 eEdummyVec_H2O.push_back(eDummy);
353 eCum_H2O[eDummy].push_back(0.);
356 eDiffCrossSectionZ>>fAngleData_H2O[eDummy][cumDummy];
358 if (cumDummy != eCum_H2O[eDummy].back()){
360 eCum_H2O[eDummy].push_back(cumDummy);
362 }
while(!eDiffCrossSectionZ.eof());
365 if (verboseLevel > 2)
366 G4cout <<
"Loaded cross section files of ELSEPA Elastic model for"
371 G4cout <<
"ELSEPA elastic model is initialized " <<
G4endl
381 fpMolDensity =
nullptr;
383 isInitialised =
true;
396 if (verboseLevel > 3)
399 "Calling CrossSectionPerVolume() of G4DNAELSEPAElasticModel"
411 if (material->
GetZ()!=79)
return 0.0;
417 if(atomicNDensity!= 0.0)
419 if (ekin < fhighEnergyLimit)
421 if (ekin < fkillBelowEnergy_Au)
return DBL_MAX;
445 if (ekin < 10*eV) sigma = fpData_Au->
FindValue(10*eV);
449 if (verboseLevel > 2)
451 G4cout <<
"__________________________________" <<
G4endl;
452 G4cout <<
"=== G4DNAELSEPAElasticModel - XS INFO START" <<
G4endl;
453 G4cout <<
"=== Material is made of one element with Z =" << Z <<
G4endl;
454 G4cout <<
"=== Kinetic energy(eV)=" << ekin/eV <<
" particle : "
455 << particleName <<
G4endl;
456 G4cout <<
"=== Cross section per atom for Z="<<Z<<
" is (cm^2)"
458 G4cout <<
"=== Cross section per atom for Z="<<Z<<
" is (cm^-1)="
459 << sigma*atomicNDensity/(1./cm) <<
G4endl;
460 G4cout <<
"=== G4DNAELSEPAElasticModel - XS INFO END" <<
G4endl;
468 atomicNDensity = (*fpMolDensity)[material->
GetIndex()];
469 if(atomicNDensity!= 0.0)
492 if (verboseLevel > 2)
494 G4cout <<
"__________________________________" <<
G4endl;
495 G4cout <<
"=== G4DNAELSEPAElasticModel - XS INFO START" <<
G4endl;
496 G4cout <<
"=== Kinetic energy(eV)=" << ekin/eV
498 G4cout <<
"=== Cross section per water molecule (cm^2)="
500 G4cout <<
"=== Cross section per water molecule (cm^-1)="
501 << sigma*atomicNDensity/(1./cm) <<
G4endl;
502 G4cout <<
"=== G4DNAELSEPAElasticModel - XS INFO END" <<
G4endl;
506 return sigma*atomicNDensity;
512 std::vector<G4DynamicParticle*>*,
519 if (verboseLevel > 3){
521 "Calling SampleSecondaries() of G4DNAELSEPAElasticModel"
534 if (electronEnergy0 < fkillBelowEnergy_Au)
543 if(electronEnergy0>= fkillBelowEnergy_Au && electronEnergy0 < fhighEnergyLimit)
546 if (electronEnergy0>=10*eV)
548 cosTheta = RandomizeCosTheta(Z,electronEnergy0);
552 cosTheta = RandomizeCosTheta(Z,10*eV);
561 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
563 xDir *= std::cos(phi);
564 yDir *= std::sin(phi);
566 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
574 if(material->
GetName()==
"G4_WATER")
577 G4double cosTheta = RandomizeCosTheta(0,electronEnergy0);
585 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
587 xDir *= std::cos(phi);
588 yDir *= std::sin(phi);
590 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
622 std::vector<G4double>::iterator e2;
624 e2 = std::upper_bound(eEdummyVec_H2O.begin(),
625 eEdummyVec_H2O.end(), k);
627 e2 = std::upper_bound(eEdummyVec_Au.begin(),
628 eEdummyVec_Au.end(), k);
636 std::vector<G4double>::iterator cum12;
638 cum12 = std::upper_bound(eCum_H2O[(*e1)].begin(),
639 eCum_H2O[(*e1)].end(),integrDiff);
641 cum12 = std::upper_bound(eCum_Au[(*e1)].begin(),
642 eCum_Au[(*e1)].end(),integrDiff);
645 auto cum11 = cum12 - 1;
650 std::vector<G4double>::iterator cum22;
652 cum22 = std::upper_bound(eCum_H2O[(*e2)].begin(),
653 eCum_H2O[(*e2)].end(),integrDiff);
655 cum22 = std::upper_bound(eCum_Au[(*e2)].begin(),
656 eCum_Au[(*e2)].end(),integrDiff);
659 auto cum21 = cum22 - 1;
674 a11 = fAngleData_H2O[valueE1][valuecum11];
675 a12 = fAngleData_H2O[valueE1][valuecum12];
676 a21 = fAngleData_H2O[valueE2][valuecum21];
677 a22 = fAngleData_H2O[valueE2][valuecum22];
679 a11 = fAngleData_Au[valueE1][valuecum11];
680 a12 = fAngleData_Au[valueE1][valuecum12];
681 a21 = fAngleData_Au[valueE2][valuecum21];
682 a22 = fAngleData_Au[valueE2][valuecum22];
687 if (a11 == 0 && a12 == 0 && a21 == 0 && a22 == 0)
return (0.);
689 theta = QuadInterpolator(valuecum11, valuecum12, valuecum21, valuecum22,
690 a11, a12,a21, a22, valueE1, valueE2, k, integrDiff);
704 G4double a = std::log10(e) - std::log10(e1);
705 G4double b = std::log10(e2) - std::log10(e);
706 value = xs1 + a/(a+b)*(xs2-xs1);
711 value = (d1 + (d2 - d1) * (e - e1) / (e2 - e1));
727 G4double value = std::pow(10,(d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
741 G4double value = (d1 + (d2 - d1) * (e - e1) / (e2 - e1));
753 G4double a = (std::log10(xs2) - std::log10(xs1))
754 / (std::log10(e2) - std::log10(e1));
755 G4double b = std::log10(xs2) - a * std::log10(e2);
756 G4double sigma = a * std::log10(e) + b;
757 G4double value = (std::pow(10., sigma));
763G4double G4DNAELSEPAElasticModel::QuadInterpolator(
782 interpolatedvalue1 = LinLogInterpolate(cum11, cum12, cum, a11, a12);
785 interpolatedvalue1 = LinLinInterpolate(cum11, cum12, cum, a11, a12);
788 interpolatedvalue2 = LinLogInterpolate(cum21, cum22, cum, a21, a22);
791 interpolatedvalue2 = LinLinInterpolate(cum21, cum22, cum, a21, a22);
794 value = LogLinInterpolate(e1,e2,t,interpolatedvalue1,interpolatedvalue2);
806 integrdiff = uniformRand;
812 cosTheta = std::cos(theta * CLHEP::pi / 180.);
821 fkillBelowEnergy_Au = threshold;
823 if (threshold < 10 * eV)
825 G4cout<<
"*** WARNING : the G4DNAELSEPAElasticModel model is not "
826 "defined below 10 eV !" <<
G4endl;
std::vector< const G4Element * > G4ElementVector
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
G4bool LoadData(const G4String &argFileName) override
G4double FindValue(G4double e, G4int componentId=0) const override
G4DNAELSEPAElasticModel(const G4ParticleDefinition *particle=nullptr, const G4String &nam="DNAELSEPAElasticModel")
G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *particle, G4double ekin, G4double emin, G4double emax) override
void Initialise(const G4ParticleDefinition *particle, const G4DataVector &) override
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
~G4DNAELSEPAElasticModel() override
void SetKillBelowThreshold(G4double threshold)
G4ParticleChangeForGamma * fParticleChangeForGamma
static G4DNAMolecularMaterial * Instance()
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * ElectronDefinition()
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
const G4double * GetAtomicNumDensityVector() const
std::size_t GetIndex() const
std::size_t GetNumberOfElements() const
const G4String & GetName() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
const G4String & GetParticleName() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)