60 G4cout <<
"Born ionisation model is constructed " <<
G4endl;
91 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
112 G4cout <<
"Calling G4DNABornIonisationModel1::Initialise()" <<
G4endl;
117 G4String fileElectron(
"dna/sigma_ionisation_e_born");
118 G4String fileProton(
"dna/sigma_ionisation_p_born");
126 G4double scaleFactor = (1.e-22 / 3.343) *
m*
m;
128 char *path = getenv(
"G4LEDATA");
148 std::ostringstream eFullFileName;
150 if (
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat";
151 if (!
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_ionisation_e_born.dat";
153 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
155 if (!eDiffCrossSection)
158 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat");
161 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_born.dat");
173 for (
G4int j=0; j<5; j++)
188 while(!eDiffCrossSection.eof())
192 eDiffCrossSection>>tDummy>>eDummy;
196 for (
G4int j=0; j<5; j++)
198 eDiffCrossSection>>
tmp;
205 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
234 std::ostringstream pFullFileName;
236 if (
fasterCode) pFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat";
238 if (!
fasterCode) pFullFileName << path <<
"/dna/sigmadiff_ionisation_p_born.dat";
240 std::ifstream pDiffCrossSection(pFullFileName.str().c_str());
242 if (!pDiffCrossSection)
245 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat");
248 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_p_born.dat");
252 while(!pDiffCrossSection.eof())
256 pDiffCrossSection>>tDummy>>eDummy;
258 for (
G4int j=0; j<5; j++)
264 pNrjTransfData[j][tDummy][pDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
265 pProbaShellMap[j][tDummy].push_back(pDiffCrossSectionData[j][tDummy][eDummy]);
269 if (!pDiffCrossSection.eof() && !
fasterCode) pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
277 if (particle==electronDef)
283 if (particle==protonDef)
291 G4cout <<
"Born ionisation model is initialized " <<
G4endl
326 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornIonisationModel1"
346 if(waterDensity!= 0.0)
351 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
355 lowLim = pos1->second;
358 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
362 highLim = pos2->second;
365 if (ekin >= lowLim && ekin < highLim)
367 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
381 G4double A = 1.39241700556072800000E-009 ;
382 G4double B = -8.52610412942622630000E-002 ;
383 sigma = sigma *
G4Exp(A*(ekin/
eV)+B);
391 G4Exception(
"G4DNABornIonisationModel1::CrossSectionPerVolume",
"em0002",
398 G4cout <<
"__________________________________" <<
G4endl;
399 G4cout <<
"G4DNABornIonisationModel1 - XS INFO START" <<
G4endl;
400 G4cout <<
"Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << particleName <<
G4endl;
401 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
402 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
403 G4cout <<
"G4DNABornIonisationModel1 - XS INFO END" <<
G4endl;
407 return sigma*waterDensity;
421 G4cout <<
"Calling SampleSecondaries() of G4DNABornIonisationModel1"
432 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
437 lowLim = pos1->second;
440 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
445 highLim = pos2->second;
448 if (k >= lowLim && k < highLim)
452 G4double totalEnergy = k + particleMass;
453 G4double pSquare = k * (totalEnergy + particleMass);
454 G4double totalMomentum = std::sqrt(pSquare);
456 G4int ionizationShell = 0;
476 if (k<bindingEnergy)
return;
498 if (secondaryKinetic>0)
501 fvect->push_back(dp);
508 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.
x();
509 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.
y();
510 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.
z();
511 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
512 finalPx /= finalMomentum;
513 finalPy /= finalMomentum;
514 finalPz /= finalMomentum;
517 direction.
set(finalPx,finalPy,finalPz);
528 G4int secNumberInit = 0;
529 G4int secNumberFinal = 0;
535 if (ionizationShell <5 && ionizationShell >1)
539 else if (ionizationShell <2)
554 secNumberInit = fvect->size();
556 secNumberFinal = fvect->size();
561 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
563 for (
G4int j=secNumberInit; j < secNumberFinal; j++)
565 deexSecEnergy = deexSecEnergy + (*fvect)[j]->GetKineticEnergy();
603 G4double maximumEnergyTransfer = 0.;
605 maximumEnergyTransfer = k;
623 G4double maxEnergy = maximumEnergyTransfer;
624 G4int nEnergySteps = 50;
627 G4double stpEnergy(std::pow(maxEnergy / value,
628 1. / static_cast<G4double>(nEnergySteps - 1)));
629 G4int step(nEnergySteps);
638 if (differentialCrossSection >= crossSectionMaximum)
639 crossSectionMaximum = differentialCrossSection;
644 G4double secondaryElectronKineticEnergy = 0.;
652 return secondaryElectronKineticEnergy;
658 G4double maximumKineticEnergyTransfer = 4.
670 if (differentialCrossSection >= crossSectionMaximum)
671 crossSectionMaximum = differentialCrossSection;
674 G4double secondaryElectronKineticEnergy = 0.;
677 secondaryElectronKineticEnergy =
G4UniformRand()* maximumKineticEnergyTransfer;
682 return secondaryElectronKineticEnergy;
736 G4int ionizationLevelIndex)
758 std::vector<G4double>::iterator
t2 = std::upper_bound(
eTdummyVec.begin(),
762 std::vector<G4double>::iterator
t1 = t2 - 1;
765 if (energyTransfer <=
eVecm[(*t1)].back()
766 && energyTransfer <=
eVecm[(*t2)].back())
768 std::vector<G4double>::iterator e12 =
769 std::upper_bound(
eVecm[(*t1)].begin(),
772 std::vector<G4double>::iterator e11 = e12 - 1;
774 std::vector<G4double>::iterator e22 =
775 std::upper_bound(
eVecm[(*t2)].begin(),
778 std::vector<G4double>::iterator e21 = e22 - 1;
799 std::vector<G4double>::iterator
t2 = std::upper_bound(
pTdummyVec.begin(),
802 std::vector<G4double>::iterator
t1 = t2 - 1;
804 std::vector<G4double>::iterator e12 = std::upper_bound(
pVecm[(*t1)].begin(),
807 std::vector<G4double>::iterator e11 = e12 - 1;
809 std::vector<G4double>::iterator e22 = std::upper_bound(
pVecm[(*t2)].begin(),
812 std::vector<G4double>::iterator e21 = e22 - 1;
828 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
861 if (e1 != 0 && e2 != 0 && (std::log10(e2) - std::log10(e1)) != 0
864 G4double a = (std::log10(xs2) - std::log10(xs1))
865 / (std::log10(e2) - std::log10(e1));
866 G4double b = std::log10(xs2) - a * std::log10(e2);
867 G4double sigma = a * std::log10(e) + b;
868 value = (std::pow(10., sigma));
882 if ((e2 - e1) != 0 && xs1 != 0 && xs2 != 0 &&
fasterCode)
886 value = std::pow(10., (d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
892 if ((e2 - e1) != 0 && (xs1 == 0 || xs2 == 0) &&
fasterCode)
896 value = (d1 + (d2 -
d1) * (e - e1) / (e2 - e1));
944 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
963 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
981 value += valuesBuffer[i];
992 if (valuesBuffer[i] > value)
994 delete[] valuesBuffer;
997 value -= valuesBuffer[i];
1001 delete[] valuesBuffer;
1006 G4Exception(
"G4DNABornIonisationModel1::RandomSelect",
1009 "Model not applicable to particle type.");
1023 G4double secondaryElectronKineticEnergy = 0.;
1034 if (secondaryElectronKineticEnergy < 0.)
1038 return secondaryElectronKineticEnergy;
1045 G4int ionizationLevelIndex,
1065 std::vector<G4double>::iterator k2 = std::upper_bound(
eTdummyVec.begin(),
1068 std::vector<G4double>::iterator k1 = k2 - 1;
1085 std::vector<G4double>::iterator prob12 =
1086 std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
1090 std::vector<G4double>::iterator prob11 = prob12 - 1;
1092 std::vector<G4double>::iterator prob22 =
1093 std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1097 std::vector<G4double>::iterator prob21 = prob22 - 1;
1101 valuePROB21 = *prob21;
1102 valuePROB22 = *prob22;
1103 valuePROB12 = *prob12;
1104 valuePROB11 = *prob11;
1111 nrjTransf11 =
eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
1112 nrjTransf12 =
eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
1113 nrjTransf21 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1114 nrjTransf22 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1128 std::vector<G4double>::iterator prob22 =
1129 std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1133 std::vector<G4double>::iterator prob21 = prob22 - 1;
1137 valuePROB21 = *prob21;
1138 valuePROB22 = *prob22;
1142 nrjTransf21 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1143 nrjTransf22 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1173 std::vector<G4double>::iterator k2 = std::upper_bound(
pTdummyVec.begin(),
1177 std::vector<G4double>::iterator k1 = k2 - 1;
1195 std::vector<G4double>::iterator prob12 =
1196 std::upper_bound(
pProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
1200 std::vector<G4double>::iterator prob11 = prob12 - 1;
1202 std::vector<G4double>::iterator prob22 =
1203 std::upper_bound(
pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1207 std::vector<G4double>::iterator prob21 = prob22 - 1;
1211 valuePROB21 = *prob21;
1212 valuePROB22 = *prob22;
1213 valuePROB12 = *prob12;
1214 valuePROB11 = *prob11;
1221 nrjTransf11 =
pNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
1222 nrjTransf12 =
pNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
1223 nrjTransf21 =
pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1224 nrjTransf22 =
pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1239 std::vector<G4double>::iterator prob22 =
1240 std::upper_bound(
pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1244 std::vector<G4double>::iterator prob21 = prob22 - 1;
1248 valuePROB21 = *prob21;
1249 valuePROB22 = *prob22;
1253 nrjTransf21 =
pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1254 nrjTransf22 =
pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1281 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21
1285 if (nrjTransfProduct != 0.)
void set(double x, double y, double z)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
TriDimensionMap eNrjTransfData[6]
virtual G4bool LoadData(const G4String &argFileName)
std::vector< ExP01TrackerHit * > a
static const G4double pos
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
virtual ~G4DNABornIonisationModel1()
G4VAtomDeexcitation * AtomDeexcitation()
static constexpr double MeV
void SetHighEnergyLimit(G4double)
std::vector< G4double > pTdummyVec
virtual size_t NumberOfComponents(void) const
static constexpr double keV
const G4ThreeVector & GetMomentumDirection() const
std::map< G4String, G4double, std::less< G4String > > lowEnergyLimit
const G4String & GetParticleName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
TriDimensionMap pNrjTransfData[6]
G4double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &=*(new G4DataVector()))
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4double GetPDGMass() const
G4double IonisationEnergy(G4int level)
G4double LowEnergyLimit() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4DNABornIonisationModel1(const G4ParticleDefinition *p=0, const G4String &nam="DNABornIonisationModel")
static constexpr double proton_mass_c2
TriDimensionMap pDiffCrossSectionData[6]
static constexpr double m
void SetDeexcitationFlag(G4bool val)
G4ParticleDefinition * GetDefinition() const
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
const XML_Char int const XML_Char * value
static G4Proton * ProtonDefinition()
G4double QuadInterpolator(G4double e11, G4double e12, G4double e21, G4double e22, G4double x11, G4double x12, G4double x21, G4double x22, G4double t1, G4double t2, G4double t, G4double e)
G4ParticleChangeForGamma * fParticleChangeForGamma
static constexpr double electron_mass_c2
static G4DNAMolecularMaterial * Instance()
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, G4int shellID, const G4Material *)
double A(double temperature)
G4double Interpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
static constexpr double eV
void SetAngularDistribution(G4VEmAngularDistribution *)
TriDimensionMap eDiffCrossSectionData[6]
const G4Track * GetCurrentTrack() const
static G4Electron * Electron()
static G4Electron * ElectronDefinition()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double RandomizeEjectedElectronEnergyFromCumulatedDcs(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
void SetLowEnergyLimit(G4double)
G4double RandomizeEjectedElectronEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
const std::vector< G4double > * fpMolWaterDensity
virtual G4double GetPartialCrossSection(const G4Material *, G4int, const G4ParticleDefinition *, G4double)
G4int RandomSelect(G4double energy, const G4String &particle)
G4double GetKineticEnergy() const
virtual G4double FindValue(G4double e, G4int componentId=0) const
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
static G4LossTableManager * Instance()
G4double TransferedEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell, G4double random)
G4DNAWaterIonisationStructure waterStructure
G4VEmAngularDistribution * GetAngularDistribution()
const G4Material * GetMaterial() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4VAtomDeexcitation * fAtomDeexcitation
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
std::map< G4String, G4double, std::less< G4String > > highEnergyLimit
G4double bindingEnergy(G4int A, G4int Z)
G4double HighEnergyLimit() const
double B(double temperature)
static G4DNAChemistryManager * Instance()
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
std::vector< G4double > eTdummyVec