69 G4cout <<
"CPA100 ionisation model is constructed " <<
G4endl;
105 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
125 G4cout <<
"Calling G4DNACPA100IonisationModel::Initialise()" <<
G4endl;
131 G4String fileElectron(
"dna/sigma_ionisation_e_cpa100_form_rel");
139 char *path = getenv(
"G4LEDATA");
166 std::ostringstream eFullFileName;
168 if (
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_e_cpa100_rel.dat";
170 if (!
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_ionisation_e_cpa100_rel.dat";
172 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
174 if (!eDiffCrossSection)
177 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_cpa100_rel.dat");
180 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_cpa100_rel.dat");
195 while(!eDiffCrossSection.eof())
199 eDiffCrossSection>>tDummy>>eDummy;
201 for (
G4int j=0; j<5; j++)
207 eNrjTransfData[j][tDummy][eDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
208 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
213 eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
230 G4cout <<
"CPA100 ionisation model is initialized " << G4endl
259 G4cout <<
"Calling CrossSectionPerVolume() of G4DNACPA100IonisationModel" <<
G4endl;
273 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
279 if (table != 0) sigma = table->
FindValue(ekin);
283 G4Exception(
"G4DNACPA100IonisationModel::CrossSectionPerVolume",
"em0002",
290 G4cout <<
"__________________________________" <<
G4endl;
291 G4cout <<
"G4DNACPA100IonisationModel - XS INFO START" <<
G4endl;
292 G4cout <<
"Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << particleName <<
G4endl;
293 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
294 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
295 G4cout <<
"G4DNACPA100IonisationModel - XS INFO END" <<
G4endl;
298 return sigma*waterDensity;
310 G4cout <<
"Calling SampleSecondaries() of G4DNACPA100IonisationModel" <<
G4endl;
320 G4double totalEnergy = k + particleMass;
321 G4double pSquare = k * (totalEnergy + particleMass);
322 G4double totalMomentum = std::sqrt(pSquare);
324 G4int ionizationShell = -1;
357 G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta);
358 G4double dirX = sinTheta*std::cos(phi);
359 G4double dirY = sinTheta*std::sin(phi);
362 deltaDirection.
rotateUz(primaryDirection);
365 if (secondaryKinetic>0)
368 fvect->push_back(dp);
376 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.
x();
377 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.
y();
378 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.
z();
379 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
380 finalPx /= finalMomentum;
381 finalPy /= finalMomentum;
382 finalPz /= finalMomentum;
385 direction.
set(finalPx,finalPy,finalPz);
398 size_t secNumberInit = 0;
399 size_t secNumberFinal = 0;
401 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
409 secNumberInit = fvect->size();
411 secNumberFinal = fvect->size();
413 if(secNumberFinal > secNumberInit)
415 for (
size_t i=secNumberInit; i<secNumberFinal; ++i)
418 if (bindingEnergy >= ((*fvect)[i])->GetKineticEnergy())
421 bindingEnergy -= ((*fvect)[i])->GetKineticEnergy();
436 if(bindingEnergy < 0.0)
437 G4Exception(
"G4DNACPA100IonisatioModel1::SampleSecondaries()",
497 G4double maxEnergy = maximumEnergyTransfer;
500 G4int nEnergySteps = 50;
521 G4double stpEnergy(std::pow(maxEnergy/value, 1./static_cast<G4double>(nEnergySteps-1)));
523 G4double differentialCrossSection = 0.;
528 if(differentialCrossSection >0)
530 crossSectionMaximum=differentialCrossSection;
538 G4double secondaryElectronKineticEnergy=0.;
546 return secondaryElectronKineticEnergy;
564 cosTheta = std::sqrt(1.-sin2O);
573 G4int ionizationLevelIndex)
601 std::vector<G4double>::iterator
t1 = t2-1;
605 if (energyTransfer <=
eVecm[(*t1)].back() && energyTransfer <=
eVecm[(*t2)].back() )
607 std::vector<G4double>::iterator e12 = std::upper_bound(
eVecm[(*t1)].begin(),
eVecm[(*t1)].end(), energyTransfer);
608 std::vector<G4double>::iterator e11 = e12-1;
610 std::vector<G4double>::iterator e22 = std::upper_bound(
eVecm[(*t2)].begin(),
eVecm[(*t2)].end(), energyTransfer);
611 std::vector<G4double>::iterator e21 = e22-1;
629 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
657 if (e1!=0 && e2!=0 && (std::log10(e2)-std::log10(e1)) !=0 && !
fasterCode &&
useDcs)
659 G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(e2)-std::log10(e1));
660 G4double b = std::log10(xs2) - a*std::log10(e2);
662 value = (std::pow(10.,sigma));
681 value = std::pow(10.,(d1 + (d2 - d1)*(e - e1)/ (e2 - e1)) );
691 value = (d1 + (d2 -
d1)*(e - e1)/ (e2 -
e1));
730 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
812 value += valuesBuffer[i];
822 if (valuesBuffer[i] > value)
824 delete[] valuesBuffer;
828 value -= valuesBuffer[i];
831 if (valuesBuffer)
delete[] valuesBuffer;
837 G4Exception(
"G4DNACPA100IonisationModel::RandomSelect",
"em0002",
851 G4double secondaryElectronKineticEnergy = 0.;
853 secondaryElectronKineticEnergy=
854 RandomTransferedEnergy(particleDefinition, k/
eV, shell)*
eV-waterStructure.IonisationEnergy(shell);
857 if (secondaryElectronKineticEnergy<0.)
return 0.;
860 return secondaryElectronKineticEnergy;
889 if (k==eTdummyVec.back()) k=k*(1.-1
e-12);
894 std::vector<G4double>::iterator
k2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(),
k);
896 std::vector<G4double>::iterator
k1 = k2-1;
911 if ( random <= eProbaShellMap[ionizationLevelIndex][(*k1)].back()
912 && random <= eProbaShellMap[ionizationLevelIndex][(*k2)].back() )
916 std::vector<G4double>::iterator prob12 =
917 std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
918 eProbaShellMap[ionizationLevelIndex][(*k1)].end(), random);
920 std::vector<G4double>::iterator prob11 = prob12-1;
923 std::vector<G4double>::iterator prob22 =
924 std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
925 eProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
927 std::vector<G4double>::iterator prob21 = prob22-1;
931 valuePROB21 =*prob21;
932 valuePROB22 =*prob22;
933 valuePROB12 =*prob12;
934 valuePROB11 =*prob11;
942 nrjTransf11 = eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
943 nrjTransf12 = eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
944 nrjTransf21 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
945 nrjTransf22 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
960 if ( random > eProbaShellMap[ionizationLevelIndex][(*k1)].back() )
963 std::vector<G4double>::iterator prob22 =
965 std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
966 eProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
968 std::vector<G4double>::iterator prob21 = prob22-1;
972 valuePROB21 =*prob21;
973 valuePROB22 =*prob22;
977 nrjTransf21 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
978 nrjTransf22 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
980 G4double interpolatedvalue2 = Interpolate(valuePROB21, valuePROB22, random, nrjTransf21, nrjTransf22);
984 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
1003 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21 * nrjTransf22;
1007 if (nrjTransfProduct != 0.)
1009 nrj = QuadInterpolator( valuePROB11, valuePROB12,
1010 valuePROB21, valuePROB22,
1011 nrjTransf11, nrjTransf12,
1012 nrjTransf21, nrjTransf22,
1174 G4double bb = waterStructure.IonisationEnergy(shell);
1175 G4double uu = waterStructure.UEnergy(shell);
1177 if (tt<=bb)
return 0.;
1187 G4double a1 = t * tm1 / tu1 / tp12;
1188 G4double a2 = tm1 / tu1 / t / tp1 / deux;
1189 G4double a3 = dlt * (tp12 - deux * deux ) / tu1 / tp12;
1214 else if ((r1>A1) && (r1< A2))
1233 gx=deux*(un-(t-wx)/tp1);
1239 fx=un-r2*(tp12-deux*deux)/tp12;
1242 gx=(un+gg*gg*gg)/deux;