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;
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++)
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 ;
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;
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;
533 secNumberInit = fvect->size();
535 secNumberFinal = fvect->size();
541 if(secNumberFinal > secNumberInit)
543 for (
size_t i=secNumberInit; i<secNumberFinal; ++i)
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.;
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);
887 G4double sigma = a * std::log10(e) + b;
888 value = (std::pow(10., sigma));
906 value = std::pow(10., (
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.)
static const G4double e1[44]
static const G4double e2[44]
G4double B(G4double temperature)
static const G4double pos
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static constexpr double m
static constexpr double keV
static constexpr double eV
static constexpr double MeV
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
void set(double x, double y, double z)
std::map< G4String, G4double, std::less< G4String > > highEnergyLimit
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector()))
G4VAtomDeexcitation * fAtomDeexcitation
TriDimensionMap pNrjTransfData[6]
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
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)
std::map< G4String, G4double, std::less< G4String > > lowEnergyLimit
virtual G4double GetPartialCrossSection(const G4Material *, G4int, const G4ParticleDefinition *, G4double)
const std::vector< G4double > * fpMolWaterDensity
TriDimensionMap eDiffCrossSectionData[6]
std::vector< G4double > eTdummyVec
G4double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
std::vector< G4double > pTdummyVec
TriDimensionMap eNrjTransfData[6]
G4double RandomizeEjectedElectronEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
TriDimensionMap pDiffCrossSectionData[6]
G4double Interpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4DNAWaterIonisationStructure waterStructure
virtual ~G4DNABornIonisationModel1()
G4double RandomizeEjectedElectronEnergyFromCumulatedDcs(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
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
G4int RandomSelect(G4double energy, const G4String &particle)
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)
G4double bindingEnergy(G4int A, G4int Z)