66 G4cout <<
"Emfietzoglou ionisation model is constructed " <<
G4endl;
96 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
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;
130 char *path = getenv(
"G4LEDATA");
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)
157 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_emfietzoglou.dat");
160 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_emfietzoglou.dat");
181 while(!eDiffCrossSection.eof())
185 eDiffCrossSection>>tDummy>>eDummy;
187 for (
G4int j=0; j<5; j++)
193 eNrjTransfData[j][tDummy][eDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
194 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
200 eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
212 G4cout <<
"Emfietzoglou ionisation model is initialized " <<
G4endl
248 <<
"Calling CrossSectionPerVolume() of G4DNAEmfietzoglouIonisationModel"
264 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
277 G4Exception(
"G4DNAEmfietzoglouIonisationModel::CrossSectionPerVolume",
"em0002",
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;
331 if (k<bindingEnergy)
return;
350 if (secondaryKinetic>0)
353 fvect->push_back(dp);
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;
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()",
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)));
489 if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum =
490 differentialCrossSection;
495 G4double secondaryElectronKineticEnergy = 0.;
503 return secondaryElectronKineticEnergy;
558 G4int ionizationLevelIndex)
584 std::vector<G4double>::iterator
t2 = std::upper_bound(
eTdummyVec.begin(),
588 std::vector<G4double>::iterator
t1 = t2 - 1;
592 if(energyTransfer <
eVecm[(*t1)].back() &&
593 energyTransfer <
eVecm[(*t2)].back())
595 std::vector<G4double>::iterator e12 =
596 std::upper_bound(
eVecm[(*t1)].begin(),
599 std::vector<G4double>::iterator e11 = e12 - 1;
601 std::vector<G4double>::iterator e22 =
602 std::upper_bound(
eVecm[(*t2)].begin(),
605 std::vector<G4double>::iterator e21 = e22 - 1;
634 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
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);
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));
754 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
772 value += valuesBuffer[i];
783 if(valuesBuffer[i] > value)
785 delete[] valuesBuffer;
788 value -= valuesBuffer[i];
791 if(valuesBuffer)
delete[] valuesBuffer;
797 G4Exception(
"G4DNAEmfietzoglouIonisationModel::RandomSelect",
800 "Model not applicable to particle type.");
814 G4double secondaryElectronKineticEnergy = 0.;
823 if(secondaryElectronKineticEnergy < 0.)
return 0.;
825 return secondaryElectronKineticEnergy;
832 G4int ionizationLevelIndex)
860 std::vector<G4double>::iterator
k1 = k2-1;
878 std::vector<G4double>::iterator prob12 = std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
881 std::vector<G4double>::iterator prob11 = prob12-1;
883 std::vector<G4double>::iterator prob22 = std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
886 std::vector<G4double>::iterator prob21 = prob22-1;
890 valuePROB21 =*prob21;
891 valuePROB22 =*prob22;
892 valuePROB12 =*prob12;
893 valuePROB11 =*prob11;
900 nrjTransf11 =
eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
901 nrjTransf12 =
eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
902 nrjTransf21 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
903 nrjTransf22 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
917 if ( random >
eProbaShellMap[ionizationLevelIndex][(*k1)].back() )
920 std::vector<G4double>::iterator prob22 = std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
923 std::vector<G4double>::iterator prob21 = prob22-1;
927 valuePROB21 =*prob21;
928 valuePROB22 =*prob22;
932 nrjTransf21 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
933 nrjTransf22 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
935 G4double interpolatedvalue2 =
Interpolate(valuePROB21, valuePROB22, random, nrjTransf21, nrjTransf22);
958 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21 * nrjTransf22;
962 if (nrjTransfProduct != 0.)
965 valuePROB21, valuePROB22,
966 nrjTransf11, nrjTransf12,
967 nrjTransf21, nrjTransf22,