59 G4cout <<
"Born ionisation model is constructed " <<
G4endl;
65 fAtomDeexcitation = 0;
67 fpMolWaterDensity = 0;
110 if (verboseLevel > 3)
112 G4cout <<
"Calling G4DNABornIonisationModel2::Initialise()" <<
G4endl;
115 if(fParticleDef != 0 && particle != fParticleDef)
118 description <<
"You are trying to initialized G4DNABornIonisationModel2 "
122 description <<
"G4DNABornIonisationModel2 was already initialised "
124 G4Exception(
"G4DNABornIonisationModel2::Initialise",
"bornIonInit",
128 fParticleDef = particle;
131 char *path = getenv(
"G4LEDATA");
136 std::ostringstream fullFileName;
137 fullFileName << path;
139 if(particleName ==
"e-")
141 fTableFile =
"dna/sigma_ionisation_e_born";
142 fLowEnergyLimit = 11.*eV;
143 fHighEnergyLimit = 1.*MeV;
147 fullFileName <<
"/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat";
151 fullFileName <<
"/dna/sigmadiff_ionisation_e_born.dat";
154 else if(particleName ==
"proton")
156 fTableFile =
"dna/sigma_ionisation_p_born";
157 fLowEnergyLimit = 500. * keV;
158 fHighEnergyLimit = 100. * MeV;
162 fullFileName <<
"/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat";
166 fullFileName <<
"/dna/sigmadiff_ionisation_p_born.dat";
172 G4double scaleFactor = (1.e-22 / 3.343) * m*m;
178 std::ifstream diffCrossSection(fullFileName.str().c_str());
180 if (!diffCrossSection)
183 description <<
"Missing data file:" <<
G4endl << fullFileName.str() <<
G4endl;
184 G4Exception(
"G4DNABornIonisationModel2::Initialise",
"em0003",
194 for (
int j=0; j<5; j++)
196 fProbaShellMap[j].clear();
197 fDiffCrossSectionData[j].clear();
198 fNrjTransfData[j].clear();
203 fTdummyVec.push_back(0.);
204 while(!diffCrossSection.eof())
208 diffCrossSection>>tDummy>>eDummy;
209 if (tDummy != fTdummyVec.back()) fTdummyVec.push_back(tDummy);
212 for (
int j=0; j<5; j++)
214 diffCrossSection>> tmp;
216 fDiffCrossSectionData[j][tDummy][eDummy] = tmp;
220 fNrjTransfData[j][tDummy][fDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
221 fProbaShellMap[j][tDummy].push_back(fDiffCrossSectionData[j][tDummy][eDummy]);
225 if (!diffCrossSection.eof() && !fasterCode) fDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
227 if (!fasterCode) fVecm[tDummy].push_back(eDummy);
238 G4cout <<
"Born ionisation model is initialized " <<
G4endl
258 isInitialised =
true;
269 if (verboseLevel > 3)
271 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornIonisationModel2"
275 if (particleDefinition != fParticleDef)
return 0;
283 if (ekin >= fLowEnergyLimit && ekin <= fHighEnergyLimit)
291 G4double A = 1.39241700556072800000E-009 ;
292 G4double B = -8.52610412942622630000E-002 ;
293 sigma = sigma *
G4Exp(
A*(ekin/eV)+
B);
298 if (verboseLevel > 2)
300 G4cout <<
"__________________________________" <<
G4endl;
301 G4cout <<
"G4DNABornIonisationModel2 - XS INFO START" <<
G4endl;
303 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/cm/cm <<
G4endl;
304 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) <<
G4endl;
305 G4cout <<
"G4DNABornIonisationModel2 - XS INFO END" <<
G4endl;
308 return sigma*waterDensity;
320 if (verboseLevel > 3)
322 G4cout <<
"Calling SampleSecondaries() of G4DNABornIonisationModel2"
328 if (k >= fLowEnergyLimit && k <= fHighEnergyLimit)
332 G4double totalEnergy = k + particleMass;
333 G4double pSquare = k * (totalEnergy + particleMass);
334 G4double totalMomentum = std::sqrt(pSquare);
336 G4int ionizationShell = 0;
338 if (!fasterCode) ionizationShell = RandomSelect(k);
349 ionizationShell = RandomSelect(k);
354 if (fasterCode ==
false)
356 secondaryKinetic = RandomizeEjectedElectronEnergy(particle->
GetDefinition(),k,ionizationShell);
360 secondaryKinetic = RandomizeEjectedElectronEnergyFromCumulatedDcs(particle->
GetDefinition(),k,ionizationShell);
370 if (secondaryKinetic>0)
373 fvect->push_back(dp);
378 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
380 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.
x();
381 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.
y();
382 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.
z();
383 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
384 finalPx /= finalMomentum;
385 finalPy /= finalMomentum;
386 finalPz /= finalMomentum;
389 direction.
set(finalPx,finalPy,finalPz);
400 size_t secNumberInit = 0;
401 size_t secNumberFinal = 0;
407 if (k<bindingEnergy)
return;
410 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
413 if(fAtomDeexcitation && ionizationShell == 4)
417 secNumberInit = fvect->size();
419 secNumberFinal = fvect->size();
421 if(secNumberFinal > secNumberInit)
423 for (
size_t i=secNumberInit; i<secNumberFinal; ++i)
426 if (bindingEnergy >= ((*fvect)[i])->GetKineticEnergy())
429 bindingEnergy -= ((*fvect)[i])->GetKineticEnergy();
444 if(bindingEnergy < 0.0)
445 G4Exception(
"G4DNAEmfietzoglouIonisatioModel1::SampleSecondaries()",
485 G4double maximumEnergyTransfer = 0.;
487 maximumEnergyTransfer = k;
505 G4double maxEnergy = maximumEnergyTransfer;
506 G4int nEnergySteps = 50;
509 G4double stpEnergy(std::pow(maxEnergy / value,
510 1. /
static_cast<G4double>(nEnergySteps - 1)));
511 G4int step(nEnergySteps);
520 if (differentialCrossSection >= crossSectionMaximum)
521 crossSectionMaximum = differentialCrossSection;
526 G4double secondaryElectronKineticEnergy = 0.;
532 (secondaryElectronKineticEnergy+waterStructure.
IonisationEnergy(shell))/eV,shell));
534 return secondaryElectronKineticEnergy;
540 G4double maximumKineticEnergyTransfer = 4.
541 * (electron_mass_c2 / proton_mass_c2) * k;
552 if (differentialCrossSection >= crossSectionMaximum)
553 crossSectionMaximum = differentialCrossSection;
556 G4double secondaryElectronKineticEnergy = 0.;
559 secondaryElectronKineticEnergy =
G4UniformRand()* maximumKineticEnergyTransfer;
562 (secondaryElectronKineticEnergy+waterStructure.
IonisationEnergy(shell))/eV,shell));
564 return secondaryElectronKineticEnergy;
618 G4int ionizationLevelIndex)
622 if (energyTransfer >= waterStructure.
IonisationEnergy(ionizationLevelIndex)/eV)
637 if (k==fTdummyVec.back()) k=k*(1.-1e-12);
642 std::vector<G4double>::iterator t2 = std::upper_bound(fTdummyVec.begin(),
646 std::vector<G4double>::iterator t1 = t2 - 1;
650 if (energyTransfer <= fVecm[(*t1)].back()
651 && energyTransfer <= fVecm[(*t2)].back())
653 std::vector<G4double>::iterator e12 = std::upper_bound(fVecm[(*t1)].begin(),
656 std::vector<G4double>::iterator e11 = e12 - 1;
658 std::vector<G4double>::iterator e22 = std::upper_bound(fVecm[(*t2)].begin(),
661 std::vector<G4double>::iterator e21 = e22 - 1;
670 xs11 = fDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
671 xs12 = fDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
672 xs21 = fDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
673 xs22 = fDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
677 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
680 sigma = QuadInterpolator(valueE11,
710 if (e1 != 0 && e2 != 0 && (std::log10(e2) - std::log10(e1)) != 0
713 G4double a = (std::log10(xs2) - std::log10(xs1))
714 / (std::log10(e2) - std::log10(e1));
715 G4double b = std::log10(xs2) - a * std::log10(e2);
716 G4double sigma = a * std::log10(e) + b;
717 value = (std::pow(10., sigma));
731 if ((e2 - e1) != 0 && xs1 != 0 && xs2 != 0 && fasterCode)
735 value = std::pow(10., (d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
741 if ((e2 - e1) != 0 && (xs1 == 0 || xs2 == 0) && fasterCode)
745 value = (d1 + (d2 - d1) * (e - e1) / (e2 - e1));
777 G4double interpolatedvalue1 = Interpolate(e11, e12, e, xs11, xs12);
778 G4double interpolatedvalue2 = Interpolate(e21, e22, e, xs21, xs22);
813 value += valuesBuffer[i];
824 if (valuesBuffer[i] > value)
826 delete[] valuesBuffer;
829 value -= valuesBuffer[i];
833 delete[] valuesBuffer;
846 G4double secondaryElectronKineticEnergy = 0.;
857 if (secondaryElectronKineticEnergy < 0.)
861 return secondaryElectronKineticEnergy;
868 G4int ionizationLevelIndex,
887 if (k==fTdummyVec.back()) k=k*(1.-1e-12);
891 std::vector<G4double>::iterator k2 = std::upper_bound(fTdummyVec.begin(),
894 std::vector<G4double>::iterator k1 = k2 - 1;
908 if (random <= fProbaShellMap[ionizationLevelIndex][(*k1)].back()
909 && random <= fProbaShellMap[ionizationLevelIndex][(*k2)].back())
911 std::vector<G4double>::iterator prob12 =
912 std::upper_bound(fProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
913 fProbaShellMap[ionizationLevelIndex][(*k1)].end(),
916 std::vector<G4double>::iterator prob11 = prob12 - 1;
918 std::vector<G4double>::iterator prob22 =
919 std::upper_bound(fProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
920 fProbaShellMap[ionizationLevelIndex][(*k2)].end(),
923 std::vector<G4double>::iterator prob21 = prob22 - 1;
927 valuePROB21 = *prob21;
928 valuePROB22 = *prob22;
929 valuePROB12 = *prob12;
930 valuePROB11 = *prob11;
937 nrjTransf11 = fNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
938 nrjTransf12 = fNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
939 nrjTransf21 = fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
940 nrjTransf22 = fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
952 if (random > fProbaShellMap[ionizationLevelIndex][(*k1)].back())
954 std::vector<G4double>::iterator prob22 =
955 std::upper_bound(fProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
956 fProbaShellMap[ionizationLevelIndex][(*k2)].end(),
959 std::vector<G4double>::iterator prob21 = prob22 - 1;
963 valuePROB21 = *prob21;
964 valuePROB22 = *prob22;
968 nrjTransf21 = fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
969 nrjTransf22 = fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
971 G4double interpolatedvalue2 = Interpolate(valuePROB21,
979 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
996 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21
1000 if (nrjTransfProduct != 0.)
1002 nrj = QuadInterpolator(valuePROB11,
double B(double temperature)
double A(double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL std::ostream G4cout
void set(double x, double y, double z)
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
G4ParticleChangeForGamma * fParticleChangeForGamma
virtual G4double GetPartialCrossSection(const G4Material *, G4int, const G4ParticleDefinition *, G4double)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
virtual ~G4DNABornIonisationModel2()
G4DNABornIonisationModel2(const G4ParticleDefinition *p=0, const G4String &nam="DNABornIonisationModel")
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector()))
G4double TransferedEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell, G4double random)
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)