59 G4cout <<
"Born ionisation model is constructed " <<
G4endl;
64 fAtomDeexcitation = 0;
66 fpMolWaterDensity = 0;
90 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator pos;
91 for (pos = tableData.begin(); pos != tableData.end(); ++pos)
109 if (verboseLevel > 3)
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");
133 tableFile[electron] = fileElectron;
135 lowEnergyLimit[electron] = 11. * eV;
136 highEnergyLimit[electron] = 1. * MeV;
143 tableData[electron] = tableE;
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)
156 if (fasterCode)
G4Exception(
"G4DNABornIonisationModel1::Initialise",
"em0003",
157 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat");
159 if (!fasterCode)
G4Exception(
"G4DNABornIonisationModel1::Initialise",
"em0003",
160 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_born.dat");
172 for (
G4int j=0; j<5; j++)
174 eProbaShellMap[j].clear();
175 pProbaShellMap[j].clear();
177 eDiffCrossSectionData[j].clear();
178 pDiffCrossSectionData[j].clear();
180 eNrjTransfData[j].clear();
181 pNrjTransfData[j].clear();
186 eTdummyVec.push_back(0.);
187 while(!eDiffCrossSection.eof())
191 eDiffCrossSection>>tDummy>>eDummy;
192 if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy);
195 for (
G4int j=0; j<5; j++)
197 eDiffCrossSection>> tmp;
199 eDiffCrossSectionData[j][tDummy][eDummy] = tmp;
203 eNrjTransfData[j][tDummy][eDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
204 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
208 if (!eDiffCrossSection.eof() && !fasterCode) eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
210 if (!fasterCode) eVecm[tDummy].push_back(eDummy);
219 tableFile[proton] = fileProton;
221 lowEnergyLimit[proton] = 500. * keV;
222 highEnergyLimit[proton] = 100. * MeV;
229 tableData[proton] = tableP;
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)
243 if (fasterCode)
G4Exception(
"G4DNABornIonisationModel1::Initialise",
"em0003",
244 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat");
246 if (!fasterCode)
G4Exception(
"G4DNABornIonisationModel1::Initialise",
"em0003",
247 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_p_born.dat");
250 pTdummyVec.push_back(0.);
251 while(!pDiffCrossSection.eof())
255 pDiffCrossSection>>tDummy>>eDummy;
256 if (tDummy != pTdummyVec.back()) pTdummyVec.push_back(tDummy);
257 for (
G4int j=0; j<5; j++)
259 pDiffCrossSection>>pDiffCrossSectionData[j][tDummy][eDummy];
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;
270 if (!fasterCode) pVecm[tDummy].push_back(eDummy);
276 if (particle==electronDef)
282 if (particle==protonDef)
290 G4cout <<
"Born ionisation model is initialized " <<
G4endl
312 isInitialised =
true;
323 if (verboseLevel > 3)
325 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornIonisationModel1"
347 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
348 pos1 = lowEnergyLimit.find(particleName);
349 if (pos1 != lowEnergyLimit.end())
351 lowLim = pos1->second;
354 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
355 pos2 = highEnergyLimit.find(particleName);
356 if (pos2 != highEnergyLimit.end())
358 highLim = pos2->second;
361 if (ekin >= lowLim && ekin <= highLim)
363 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
364 pos = tableData.find(particleName);
366 if (pos != tableData.end())
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",
392 if (verboseLevel > 2)
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;
414 if (verboseLevel > 3)
416 G4cout <<
"Calling SampleSecondaries() of G4DNABornIonisationModel1"
427 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
428 pos1 = lowEnergyLimit.find(particleName);
430 if (pos1 != lowEnergyLimit.end())
432 lowLim = pos1->second;
435 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
436 pos2 = highEnergyLimit.find(particleName);
438 if (pos2 != highEnergyLimit.end())
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;
453 if (!fasterCode) ionizationShell = RandomSelect(k,particleName);
464 ionizationShell = RandomSelect(k,particleName);
471 if (k<bindingEnergy)
return;
476 if (fasterCode ==
false)
478 secondaryKinetic = RandomizeEjectedElectronEnergy(particle->
GetDefinition(),k,ionizationShell);
482 secondaryKinetic = RandomizeEjectedElectronEnergyFromCumulatedDcs(particle->
GetDefinition(),k,ionizationShell);
493 if (secondaryKinetic>0)
496 fvect->push_back(dp);
501 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
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;
529 if(fAtomDeexcitation && ionizationShell == 4)
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)));
640 G4int step(nEnergySteps);
649 if (differentialCrossSection >= crossSectionMaximum)
650 crossSectionMaximum = differentialCrossSection;
655 G4double secondaryElectronKineticEnergy = 0.;
661 (secondaryElectronKineticEnergy+waterStructure.
IonisationEnergy(shell))/eV,shell));
663 return secondaryElectronKineticEnergy;
669 G4double maximumKineticEnergyTransfer = 4.
670 * (electron_mass_c2 / proton_mass_c2) * k;
681 if (differentialCrossSection >= crossSectionMaximum)
682 crossSectionMaximum = differentialCrossSection;
685 G4double secondaryElectronKineticEnergy = 0.;
688 secondaryElectronKineticEnergy =
G4UniformRand()* maximumKineticEnergyTransfer;
691 (secondaryElectronKineticEnergy+waterStructure.
IonisationEnergy(shell))/eV,shell));
693 return secondaryElectronKineticEnergy;
747 G4int ionizationLevelIndex)
751 if (energyTransfer >= waterStructure.
IonisationEnergy(ionizationLevelIndex)/eV)
769 if (k==eTdummyVec.back()) k=k*(1.-1e-12);
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;
803 xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
804 xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
805 xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
806 xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
815 if (k==pTdummyVec.back()) k=k*(1.-1e-12);
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;
841 xs11 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
842 xs12 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
843 xs21 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
844 xs22 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
848 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
851 sigma = QuadInterpolator(valueE11,
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);
887 G4double sigma = a * std::log10(e) + b;
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));
948 G4double interpolatedvalue1 = Interpolate(e11, e12, e, xs11, xs12);
949 G4double interpolatedvalue2 = Interpolate(e21, e22, e, xs21, xs22);
964 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator pos;
967 if (pos != tableData.end())
983 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator pos;
984 pos = tableData.find(particle);
986 if (pos != tableData.end())
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,
1086 if (k==eTdummyVec.back()) k=k*(1.-1e-12);
1090 std::vector<G4double>::iterator k2 = std::upper_bound(eTdummyVec.begin(),
1093 std::vector<G4double>::iterator k1 = k2 - 1;
1107 if (random <= eProbaShellMap[ionizationLevelIndex][(*k1)].back()
1108 && random <= eProbaShellMap[ionizationLevelIndex][(*k2)].back())
1110 std::vector<G4double>::iterator prob12 =
1111 std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
1112 eProbaShellMap[ionizationLevelIndex][(*k1)].end(),
1115 std::vector<G4double>::iterator prob11 = prob12 - 1;
1117 std::vector<G4double>::iterator prob22 =
1118 std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1119 eProbaShellMap[ionizationLevelIndex][(*k2)].end(),
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];
1152 if (random > eProbaShellMap[ionizationLevelIndex][(*k1)].back())
1154 std::vector<G4double>::iterator prob22 =
1155 std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1156 eProbaShellMap[ionizationLevelIndex][(*k2)].end(),
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];
1171 G4double interpolatedvalue2 = Interpolate(valuePROB21,
1179 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
1198 if (k==pTdummyVec.back()) k=k*(1.-1e-12);
1203 std::vector<G4double>::iterator k2 = std::upper_bound(pTdummyVec.begin(),
1207 std::vector<G4double>::iterator k1 = k2 - 1;
1222 if (random <= pProbaShellMap[ionizationLevelIndex][(*k1)].back()
1223 && random <= pProbaShellMap[ionizationLevelIndex][(*k2)].back())
1225 std::vector<G4double>::iterator prob12 =
1226 std::upper_bound(pProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
1227 pProbaShellMap[ionizationLevelIndex][(*k1)].end(),
1230 std::vector<G4double>::iterator prob11 = prob12 - 1;
1232 std::vector<G4double>::iterator prob22 =
1233 std::upper_bound(pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1234 pProbaShellMap[ionizationLevelIndex][(*k2)].end(),
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];
1267 if (random > pProbaShellMap[ionizationLevelIndex][(*k1)].back())
1269 std::vector<G4double>::iterator prob22 =
1270 std::upper_bound(pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1271 pProbaShellMap[ionizationLevelIndex][(*k2)].end(),
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];
1286 G4double interpolatedvalue2 = Interpolate(valuePROB21,
1294 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
1311 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21
1315 if (nrjTransfProduct != 0.)
1317 nrj = QuadInterpolator(valuePROB11,
double B(double temperature)
double A(double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL std::ostream G4cout
void set(double x, double y, double z)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector()))
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
virtual G4double GetPartialCrossSection(const G4Material *, G4int, const G4ParticleDefinition *, G4double)
G4double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
virtual ~G4DNABornIonisationModel1()
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4DNABornIonisationModel1(const G4ParticleDefinition *p=0, const G4String &nam="DNABornIonisationModel")
G4double TransferedEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell, G4double random)
G4ParticleChangeForGamma * fParticleChangeForGamma
static G4DNAChemistryManager * Instance()
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
virtual G4double FindValue(G4double e, G4int componentId=0) const
virtual size_t NumberOfComponents(void) const
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
virtual G4bool LoadData(const G4String &argFileName)
static G4DNAMolecularMaterial * Instance()
G4double IonisationEnergy(G4int level)
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
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
const G4Track * GetCurrentTrack() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetPDGMass() const
const G4String & GetParticleName() const
static G4Proton * ProtonDefinition()
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 *)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)