59 G4cout <<
"Born ionisation model is constructed " <<
G4endl;
90 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
111 G4cout <<
"Calling G4DNABornIonisationModel1::Initialise()" <<
G4endl;
116 G4String fileElectron(
"dna/sigma_ionisation_e_born");
117 G4String fileProton(
"dna/sigma_ionisation_p_born");
125 G4double scaleFactor = (1.e-22 / 3.343) *
m*
m;
127 char *path = getenv(
"G4LEDATA");
147 std::ostringstream eFullFileName;
149 if (
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat";
150 if (!
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_ionisation_e_born.dat";
152 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
154 if (!eDiffCrossSection)
157 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat");
160 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_born.dat");
172 for (
G4int j=0; j<5; j++)
187 while(!eDiffCrossSection.eof())
191 eDiffCrossSection>>tDummy>>eDummy;
195 for (
G4int j=0; j<5; j++)
197 eDiffCrossSection>>
tmp;
204 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
233 std::ostringstream pFullFileName;
235 if (
fasterCode) pFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat";
237 if (!
fasterCode) pFullFileName << path <<
"/dna/sigmadiff_ionisation_p_born.dat";
239 std::ifstream pDiffCrossSection(pFullFileName.str().c_str());
241 if (!pDiffCrossSection)
244 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat");
247 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_p_born.dat");
251 while(!pDiffCrossSection.eof())
255 pDiffCrossSection>>tDummy>>eDummy;
257 for (
G4int j=0; j<5; j++)
263 pNrjTransfData[j][tDummy][pDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
264 pProbaShellMap[j][tDummy].push_back(pDiffCrossSectionData[j][tDummy][eDummy]);
268 if (!pDiffCrossSection.eof() && !
fasterCode) pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
276 if (particle==electronDef)
282 if (particle==protonDef)
290 G4cout <<
"Born ionisation model is initialized " <<
G4endl
325 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornIonisationModel1"
347 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
351 lowLim = pos1->second;
354 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
358 highLim = pos2->second;
361 if (ekin >= lowLim && ekin <= highLim)
363 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
377 G4double A = 1.39241700556072800000E-009 ;
378 G4double B = -8.52610412942622630000E-002 ;
379 sigma = sigma *
G4Exp(A*(ekin/
eV)+B);
387 G4Exception(
"G4DNABornIonisationModel1::CrossSectionPerVolume",
"em0002",
394 G4cout <<
"__________________________________" <<
G4endl;
395 G4cout <<
"G4DNABornIonisationModel1 - XS INFO START" <<
G4endl;
396 G4cout <<
"Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << particleName <<
G4endl;
397 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
398 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
399 G4cout <<
"G4DNABornIonisationModel1 - XS INFO END" <<
G4endl;
402 return sigma*waterDensity;
416 G4cout <<
"Calling SampleSecondaries() of G4DNABornIonisationModel1"
427 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
432 lowLim = pos1->second;
435 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
440 highLim = pos2->second;
443 if (k >= lowLim && k <= highLim)
447 G4double totalEnergy = k + particleMass;
448 G4double pSquare = k * (totalEnergy + particleMass);
449 G4double totalMomentum = std::sqrt(pSquare);
451 G4int ionizationShell = 0;
471 if (k<bindingEnergy)
return;
493 if (secondaryKinetic>0)
496 fvect->push_back(dp);
503 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.
x();
504 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.
y();
505 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.
z();
506 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
507 finalPx /= finalMomentum;
508 finalPy /= finalMomentum;
509 finalPz /= finalMomentum;
512 direction.
set(finalPx,finalPy,finalPz);
523 size_t secNumberInit = 0;
524 size_t secNumberFinal = 0;
526 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
533 secNumberInit = fvect->size();
535 secNumberFinal = fvect->size();
541 if(secNumberFinal > secNumberInit)
543 for (
size_t i=secNumberInit; i<secNumberFinal; ++i)
546 if (bindingEnergy >= ((*fvect)[i])->GetKineticEnergy())
549 bindingEnergy -= ((*fvect)[i])->GetKineticEnergy();
573 if(bindingEnergy < 0.0)
574 G4Exception(
"G4DNABornIonisatioModel1::SampleSecondaries()",
614 G4double maximumEnergyTransfer = 0.;
616 maximumEnergyTransfer =
k;
634 G4double maxEnergy = maximumEnergyTransfer;
635 G4int nEnergySteps = 50;
638 G4double stpEnergy(std::pow(maxEnergy / value,
639 1. / static_cast<G4double>(nEnergySteps - 1)));
649 if (differentialCrossSection >= crossSectionMaximum)
650 crossSectionMaximum = differentialCrossSection;
655 G4double secondaryElectronKineticEnergy = 0.;
663 return secondaryElectronKineticEnergy;
669 G4double maximumKineticEnergyTransfer = 4.
681 if (differentialCrossSection >= crossSectionMaximum)
682 crossSectionMaximum = differentialCrossSection;
685 G4double secondaryElectronKineticEnergy = 0.;
688 secondaryElectronKineticEnergy =
G4UniformRand()* maximumKineticEnergyTransfer;
693 return secondaryElectronKineticEnergy;
747 G4int ionizationLevelIndex)
774 std::vector<G4double>::iterator
t2 = std::upper_bound(
eTdummyVec.begin(),
778 std::vector<G4double>::iterator
t1 = t2 - 1;
781 if (energyTransfer <=
eVecm[(*t1)].back()
782 && energyTransfer <=
eVecm[(*t2)].back())
784 std::vector<G4double>::iterator e12 =
785 std::upper_bound(
eVecm[(*t1)].begin(),
788 std::vector<G4double>::iterator e11 = e12 - 1;
790 std::vector<G4double>::iterator e22 =
791 std::upper_bound(
eVecm[(*t2)].begin(),
794 std::vector<G4double>::iterator e21 = e22 - 1;
819 std::vector<G4double>::iterator
t2 = std::upper_bound(
pTdummyVec.begin(),
822 std::vector<G4double>::iterator
t1 = t2 - 1;
824 std::vector<G4double>::iterator e12 = std::upper_bound(
pVecm[(*t1)].begin(),
827 std::vector<G4double>::iterator e11 = e12 - 1;
829 std::vector<G4double>::iterator e22 = std::upper_bound(
pVecm[(*t2)].begin(),
832 std::vector<G4double>::iterator e21 = e22 - 1;
848 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
881 if (e1 != 0 && e2 != 0 && (std::log10(e2) - std::log10(e1)) != 0
884 G4double a = (std::log10(xs2) - std::log10(xs1))
885 / (std::log10(e2) - std::log10(e1));
886 G4double b = std::log10(xs2) - a * std::log10(e2);
888 value = (std::pow(10., sigma));
902 if ((e2 - e1) != 0 && xs1 != 0 && xs2 != 0 &&
fasterCode)
906 value = std::pow(10., (d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
912 if ((e2 - e1) != 0 && (xs1 == 0 || xs2 == 0) &&
fasterCode)
916 value = (d1 + (d2 -
d1) * (e - e1) / (e2 -
e1));
964 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
983 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
1001 value += valuesBuffer[i];
1012 if (valuesBuffer[i] > value)
1014 delete[] valuesBuffer;
1017 value -= valuesBuffer[i];
1021 delete[] valuesBuffer;
1026 G4Exception(
"G4DNABornIonisationModel1::RandomSelect",
1029 "Model not applicable to particle type.");
1043 G4double secondaryElectronKineticEnergy = 0.;
1055 if (secondaryElectronKineticEnergy < 0.)
1059 return secondaryElectronKineticEnergy;
1066 G4int ionizationLevelIndex,
1090 std::vector<G4double>::iterator
k2 = std::upper_bound(
eTdummyVec.begin(),
1093 std::vector<G4double>::iterator
k1 = k2 - 1;
1110 std::vector<G4double>::iterator prob12 =
1111 std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
1115 std::vector<G4double>::iterator prob11 = prob12 - 1;
1117 std::vector<G4double>::iterator prob22 =
1118 std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1122 std::vector<G4double>::iterator prob21 = prob22 - 1;
1126 valuePROB21 = *prob21;
1127 valuePROB22 = *prob22;
1128 valuePROB12 = *prob12;
1129 valuePROB11 = *prob11;
1136 nrjTransf11 =
eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
1137 nrjTransf12 =
eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
1138 nrjTransf21 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1139 nrjTransf22 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1154 std::vector<G4double>::iterator prob22 =
1155 std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1159 std::vector<G4double>::iterator prob21 = prob22 - 1;
1163 valuePROB21 = *prob21;
1164 valuePROB22 = *prob22;
1168 nrjTransf21 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1169 nrjTransf22 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1203 std::vector<G4double>::iterator
k2 = std::upper_bound(
pTdummyVec.begin(),
1207 std::vector<G4double>::iterator
k1 = k2 - 1;
1225 std::vector<G4double>::iterator prob12 =
1226 std::upper_bound(
pProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
1230 std::vector<G4double>::iterator prob11 = prob12 - 1;
1232 std::vector<G4double>::iterator prob22 =
1233 std::upper_bound(
pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1237 std::vector<G4double>::iterator prob21 = prob22 - 1;
1241 valuePROB21 = *prob21;
1242 valuePROB22 = *prob22;
1243 valuePROB12 = *prob12;
1244 valuePROB11 = *prob11;
1251 nrjTransf11 =
pNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
1252 nrjTransf12 =
pNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
1253 nrjTransf21 =
pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1254 nrjTransf22 =
pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1269 std::vector<G4double>::iterator prob22 =
1270 std::upper_bound(
pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1274 std::vector<G4double>::iterator prob21 = prob22 - 1;
1278 valuePROB21 = *prob21;
1279 valuePROB22 = *prob22;
1283 nrjTransf21 =
pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1284 nrjTransf22 =
pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1311 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21
1315 if (nrjTransfProduct != 0.)