66 G4cout <<
"Emfietzoglou ionisation model is constructed " <<
G4endl;
71 fAtomDeexcitation =
nullptr;
73 fpMolWaterDensity =
nullptr;
96 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator pos;
97 for(pos = tableData.begin(); pos != tableData.end(); ++pos)
117 G4cout <<
"Calling G4DNAEmfietzoglouIonisationModel::Initialise()" <<
G4endl;
122 G4String fileElectron(
"dna/sigma_ionisation_e_emfietzoglou");
128 G4double scaleFactor = (1.e-22 / 3.343) * m*m;
136 tableFile[electron] = fileElectron;
141 tableE->LoadData(fileElectron);
143 tableData[electron] = tableE;
147 std::ostringstream eFullFileName;
149 if (fasterCode) eFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_e_emfietzoglou.dat";
150 if (!fasterCode) eFullFileName << path <<
"/dna/sigmadiff_ionisation_e_emfietzoglou.dat";
152 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
154 if (!eDiffCrossSection)
156 if (fasterCode)
G4Exception(
"G4DNAEmfietzoglouIonisationModel::Initialise",
"em0003",
157 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_emfietzoglou.dat");
159 if (!fasterCode)
G4Exception(
"G4DNAEmfietzoglouIonisationModel::Initialise",
"em0003",
160 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_emfietzoglou.dat");
172 eProbaShellMap->clear();
174 eDiffCrossSectionData->clear();
176 eNrjTransfData->clear();
180 eTdummyVec.push_back(0.);
181 while(!eDiffCrossSection.eof())
185 eDiffCrossSection>>tDummy>>eDummy;
186 if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy);
187 for (
G4int j=0; j<5; j++)
189 eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy];
193 eNrjTransfData[j][tDummy][eDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
194 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
198 if (!eDiffCrossSection.eof() && !fasterCode)
200 eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
203 if (!fasterCode) eVecm[tDummy].push_back(eDummy);
212 G4cout <<
"Emfietzoglou ionisation model is initialized " <<
G4endl
233 isInitialised =
true;
248 <<
"Calling CrossSectionPerVolume() of G4DNAEmfietzoglouIonisationModel"
264 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
265 pos = tableData.find(particleName);
267 if (pos != tableData.end())
270 if (table !=
nullptr)
277 G4Exception(
"G4DNAEmfietzoglouIonisationModel::CrossSectionPerVolume",
"em0002",
282 if (verboseLevel > 2)
284 G4cout <<
"__________________________________" <<
G4endl;
285 G4cout <<
"G4DNAEmfietzoglouIonisationModel - XS INFO START" <<
G4endl;
286 G4cout <<
"Kinetic energy(eV)=" << ekin/eV <<
" particle : " << particleName <<
G4endl;
287 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/cm/cm <<
G4endl;
288 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) <<
G4endl;
289 G4cout <<
"G4DNAEmfietzoglouIonisationModel - XS INFO END" <<
G4endl;
292 return sigma*waterDensity;
307 G4cout <<
"Calling SampleSecondaries() of G4DNAEmfietzoglouIonisationModel"
319 G4double totalEnergy = k + particleMass;
320 G4double pSquare = k * (totalEnergy + particleMass);
321 G4double totalMomentum = std::sqrt(pSquare);
323 G4int ionizationShell = 0;
325 ionizationShell = RandomSelect(k,particleName);
331 if (k<bindingEnergy)
return;
336 if (!fasterCode) secondaryKinetic = RandomizeEjectedElectronEnergy(particle->
GetDefinition(),k,ionizationShell);
339 secondaryKinetic = RandomizeEjectedElectronEnergyFromCumulatedDcs(particle->
GetDefinition(),k,ionizationShell);
350 if (secondaryKinetic>0)
353 fvect->push_back(dp);
356 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
358 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.
x();
359 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.
y();
360 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.
z();
361 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
362 finalPx /= finalMomentum;
363 finalPy /= finalMomentum;
364 finalPz /= finalMomentum;
367 direction.
set(finalPx,finalPy,finalPz);
375 size_t secNumberInit = 0;
376 size_t secNumberFinal = 0;
378 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
381 if((fAtomDeexcitation !=
nullptr) && ionizationShell == 4)
385 secNumberInit = fvect->size();
387 secNumberFinal = fvect->size();
389 if(secNumberFinal > secNumberInit) {
390 for (
size_t i=secNumberInit; i<secNumberFinal; ++i) {
392 if (bindingEnergy >= ((*fvect)[i])->GetKineticEnergy())
395 bindingEnergy -= ((*fvect)[i])->GetKineticEnergy();
410 if(bindingEnergy < 0.0)
411 G4Exception(
"G4DNAEmfietzoglouIonisatioModel1::SampleSecondaries()",
444G4DNAEmfietzoglouIonisationModel::
454 G4double maximumEnergyTransfer = 0.;
456 maximumEnergyTransfer = k;
474 G4double maxEnergy = maximumEnergyTransfer;
475 G4int nEnergySteps = 50;
478 G4double stpEnergy(std::pow(maxEnergy / value,
479 1. /
static_cast<G4double>(nEnergySteps - 1)));
480 G4int step(nEnergySteps);
489 if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum =
490 differentialCrossSection;
495 G4double secondaryElectronKineticEnergy = 0.;
501 (secondaryElectronKineticEnergy+waterStructure.
IonisationEnergy(shell))/eV,shell));
503 return secondaryElectronKineticEnergy;
558 G4int ionizationLevelIndex)
562 if(energyTransfer >= waterStructure.
IonisationEnergy(ionizationLevelIndex)/eV)
579 if (k==eTdummyVec.back()) k=k*(1.-1e-12);
584 auto t2 = std::upper_bound(eTdummyVec.begin(),
592 if(energyTransfer < eVecm[(*t1)].back() &&
593 energyTransfer < eVecm[(*t2)].back())
596 std::upper_bound(eVecm[(*t1)].begin(),
602 std::upper_bound(eVecm[(*t2)].begin(),
614 xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
615 xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
616 xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
617 xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
634 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
637 sigma = QuadInterpolator(valueE11,
669 if(e1 != 0 && e2 != 0 && (std::log10(e2) - std::log10(e1)) != 0
672 G4double a = (std::log10(xs2) - std::log10(xs1))
673 / (std::log10(e2) - std::log10(e1));
674 G4double b = std::log10(xs2) - a * std::log10(e2);
675 G4double sigma = a * std::log10(e) + b;
676 value = (std::pow(10., sigma));
690 if((e2 - e1) != 0 && xs1 != 0 && xs2 != 0 && fasterCode)
694 value = std::pow(10., (d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
700 if((e2 - e1) != 0 && (xs1 == 0 || xs2 == 0) && fasterCode)
704 value = (d1 + (d2 - d1) * (e - e1) / (e2 - e1));
736 G4double interpolatedvalue1 = Interpolate(e11, e12, e, xs11, xs12);
737 G4double interpolatedvalue2 = Interpolate(e21, e22, e, xs21, xs22);
749G4int G4DNAEmfietzoglouIonisationModel::RandomSelect(
G4double k,
754 auto pos = tableData.find(particle);
756 if(pos != tableData.cend())
771 value += valuesBuffer[i];
782 if(valuesBuffer[i] > value)
784 delete[] valuesBuffer;
787 value -= valuesBuffer[i];
790 delete[] valuesBuffer;
796 G4Exception(
"G4DNAEmfietzoglouIonisationModel::RandomSelect",
799 "Model not applicable to particle type.");
813 G4double secondaryElectronKineticEnergy = 0.;
815 secondaryElectronKineticEnergy = RandomTransferedEnergy(particleDefinition,
822 if(secondaryElectronKineticEnergy < 0.)
return 0.;
824 return secondaryElectronKineticEnergy;
831 G4int ionizationLevelIndex)
853 if (k==eTdummyVec.back()) k=k*(1.-1e-12);
857 auto k2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
873 if ( random <= eProbaShellMap[ionizationLevelIndex][(*k1)].back()
874 && random <= eProbaShellMap[ionizationLevelIndex][(*k2)].back() )
877 auto prob12 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
878 eProbaShellMap[ionizationLevelIndex][(*k1)].end(), random);
880 auto prob11 = prob12-1;
882 auto prob22 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
883 eProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
885 auto prob21 = prob22-1;
889 valuePROB21 =*prob21;
890 valuePROB22 =*prob22;
891 valuePROB12 =*prob12;
892 valuePROB11 =*prob11;
899 nrjTransf11 = eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
900 nrjTransf12 = eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
901 nrjTransf21 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
902 nrjTransf22 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
916 if ( random > eProbaShellMap[ionizationLevelIndex][(*k1)].back() )
919 auto prob22 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
920 eProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
922 auto prob21 = prob22-1;
926 valuePROB21 =*prob21;
927 valuePROB22 =*prob22;
931 nrjTransf21 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
932 nrjTransf22 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
934 G4double interpolatedvalue2 = Interpolate(valuePROB21, valuePROB22, random, nrjTransf21, nrjTransf22);
938 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
957 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21 * nrjTransf22;
961 if (nrjTransfProduct != 0.)
963 nrj = QuadInterpolator( valuePROB11, valuePROB12,
964 valuePROB21, valuePROB22,
965 nrjTransf11, nrjTransf12,
966 nrjTransf21, nrjTransf22,
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
void set(double x, double y, double z)
static G4DNAChemistryManager * Instance()
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
size_t NumberOfComponents() const override
const G4VEMDataSet * GetComponent(G4int componentId) const override
G4double FindValue(G4double e, G4int componentId=0) const override
~G4DNAEmfietzoglouIonisationModel() override
G4ParticleChangeForGamma * fParticleChangeForGamma
G4double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector())) override
G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax) override
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4DNAEmfietzoglouIonisationModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="DNAEmfietzoglouIonisationModel")
G4double IonisationEnergy(G4int level)
static G4DNAMolecularMaterial * Instance()
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * ElectronDefinition()
static G4Electron * Electron()
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
const G4Material * GetMaterial() const
std::size_t GetIndex() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
G4double GetPDGMass() const
const G4String & GetParticleName() const
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, G4int shellID, const G4Material *)
void SetHighEnergyLimit(G4double)
G4VEmAngularDistribution * GetAngularDistribution()
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)
void SetDeexcitationFlag(G4bool val)
void SetAngularDistribution(G4VEmAngularDistribution *)
const G4Track * GetCurrentTrack() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)