60 G4cout <<
"Born ionisation model is constructed " <<
G4endl;
113 G4cout <<
"Calling G4DNABornIonisationModel2::Initialise()" <<
G4endl;
119 description <<
"You are trying to initialized G4DNABornIonisationModel2 "
123 description <<
"G4DNABornIonisationModel2 was already initiliased "
125 G4Exception(
"G4DNABornIonisationModel2::Initialise",
"bornIonInit",
132 char *path = getenv(
"G4LEDATA");
137 std::ostringstream fullFileName;
138 fullFileName << path;
140 if(particleName ==
"e-")
148 fullFileName <<
"/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat";
152 fullFileName <<
"/dna/sigmadiff_ionisation_e_born.dat";
155 else if(particleName ==
"proton")
163 fullFileName <<
"/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat";
167 fullFileName <<
"/dna/sigmadiff_ionisation_p_born.dat";
173 G4double scaleFactor = (1.e-22 / 3.343) *
m*
m;
179 std::ifstream diffCrossSection(fullFileName.str().c_str());
181 if (!diffCrossSection)
184 description <<
"Missing data file:" <<
G4endl << fullFileName.str() <<
G4endl;
185 G4Exception(
"G4DNABornIonisationModel2::Initialise",
"em0003",
195 for (
int j=0; j<5; j++)
205 while(!diffCrossSection.eof())
209 diffCrossSection>>tDummy>>eDummy;
213 for (
int j=0; j<5; j++)
215 diffCrossSection>>
tmp;
222 fProbaShellMap[j][tDummy].push_back(fDiffCrossSectionData[j][tDummy][eDummy]);
239 G4cout <<
"Born ionisation model is initialized " <<
G4endl
272 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornIonisationModel2"
284 if(waterDensity!= 0.0)
294 G4double A = 1.39241700556072800000E-009 ;
295 G4double B = -8.52610412942622630000E-002 ;
296 sigma = sigma *
G4Exp(A*(ekin/
eV)+B);
303 G4cout <<
"__________________________________" <<
G4endl;
304 G4cout <<
"G4DNABornIonisationModel2 - XS INFO START" <<
G4endl;
306 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
307 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
308 G4cout <<
"G4DNABornIonisationModel2 - XS INFO END" <<
G4endl;
312 return sigma*waterDensity;
326 G4cout <<
"Calling SampleSecondaries() of G4DNABornIonisationModel2"
336 G4double totalEnergy = k + particleMass;
337 G4double pSquare = k * (totalEnergy + particleMass);
338 G4double totalMomentum = std::sqrt(pSquare);
340 G4int ionizationShell = 0;
374 if (secondaryKinetic>0)
377 fvect->push_back(dp);
384 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.
x();
385 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.
y();
386 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.
z();
387 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
388 finalPx /= finalMomentum;
389 finalPy /= finalMomentum;
390 finalPz /= finalMomentum;
393 direction.
set(finalPx,finalPy,finalPz);
404 G4int secNumberInit = 0;
405 G4int secNumberFinal = 0;
411 if (k<bindingEnergy)
return;
418 if (ionizationShell <5 && ionizationShell >1)
422 else if (ionizationShell <2)
437 secNumberInit = fvect->size();
439 secNumberFinal = fvect->size();
444 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
446 for (
G4int j=secNumberInit; j < secNumberFinal; j++)
448 deexSecEnergy = deexSecEnergy + (*fvect)[j]->GetKineticEnergy();
486 G4double maximumEnergyTransfer = 0.;
488 maximumEnergyTransfer = k;
506 G4double maxEnergy = maximumEnergyTransfer;
507 G4int nEnergySteps = 50;
510 G4double stpEnergy(std::pow(maxEnergy / value,
511 1. / static_cast<G4double>(nEnergySteps - 1)));
512 G4int step(nEnergySteps);
521 if (differentialCrossSection >= crossSectionMaximum)
522 crossSectionMaximum = differentialCrossSection;
527 G4double secondaryElectronKineticEnergy = 0.;
535 return secondaryElectronKineticEnergy;
541 G4double maximumKineticEnergyTransfer = 4.
553 if (differentialCrossSection >= crossSectionMaximum)
554 crossSectionMaximum = differentialCrossSection;
557 G4double secondaryElectronKineticEnergy = 0.;
560 secondaryElectronKineticEnergy =
G4UniformRand()* maximumKineticEnergyTransfer;
565 return secondaryElectronKineticEnergy;
619 G4int ionizationLevelIndex)
639 std::vector<G4double>::iterator
t2 = std::upper_bound(
fTdummyVec.begin(),
643 std::vector<G4double>::iterator
t1 = t2 - 1;
647 if (energyTransfer <=
fVecm[(*t1)].back()
648 && energyTransfer <=
fVecm[(*t2)].back())
650 std::vector<G4double>::iterator e12 = std::upper_bound(
fVecm[(*t1)].begin(),
653 std::vector<G4double>::iterator e11 = e12 - 1;
655 std::vector<G4double>::iterator e22 = std::upper_bound(
fVecm[(*t2)].begin(),
658 std::vector<G4double>::iterator e21 = e22 - 1;
674 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
707 if (e1 != 0 && e2 != 0 && (std::log10(e2) - std::log10(e1)) != 0
710 G4double a = (std::log10(xs2) - std::log10(xs1))
711 / (std::log10(e2) - std::log10(e1));
712 G4double b = std::log10(xs2) - a * std::log10(e2);
713 G4double sigma = a * std::log10(e) + b;
714 value = (std::pow(10., sigma));
728 if ((e2 - e1) != 0 && xs1 != 0 && xs2 != 0 &&
fasterCode)
732 value = std::pow(10., (d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
738 if ((e2 - e1) != 0 && (xs1 == 0 || xs2 == 0) &&
fasterCode)
742 value = (d1 + (d2 -
d1) * (e - e1) / (e2 - e1));
810 value += valuesBuffer[i];
821 if (valuesBuffer[i] > value)
823 delete[] valuesBuffer;
826 value -= valuesBuffer[i];
830 delete[] valuesBuffer;
843 G4double secondaryElectronKineticEnergy = 0.;
854 if (secondaryElectronKineticEnergy < 0.)
858 return secondaryElectronKineticEnergy;
865 G4int ionizationLevelIndex,
884 std::vector<G4double>::iterator k2 = std::upper_bound(
fTdummyVec.begin(),
887 std::vector<G4double>::iterator k1 = k2 - 1;
904 std::vector<G4double>::iterator prob12 =
905 std::upper_bound(
fProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
909 std::vector<G4double>::iterator prob11 = prob12 - 1;
911 std::vector<G4double>::iterator prob22 =
912 std::upper_bound(
fProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
916 std::vector<G4double>::iterator prob21 = prob22 - 1;
920 valuePROB21 = *prob21;
921 valuePROB22 = *prob22;
922 valuePROB12 = *prob12;
923 valuePROB11 = *prob11;
930 nrjTransf11 =
fNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
931 nrjTransf12 =
fNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
932 nrjTransf21 =
fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
933 nrjTransf22 =
fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
947 std::vector<G4double>::iterator prob22 =
948 std::upper_bound(
fProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
952 std::vector<G4double>::iterator prob21 = prob22 - 1;
956 valuePROB21 = *prob21;
957 valuePROB22 = *prob22;
961 nrjTransf21 =
fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
962 nrjTransf22 =
fNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
989 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21
993 if (nrjTransfProduct != 0.)
void set(double x, double y, double z)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
virtual G4bool LoadData(const G4String &argFileName)
std::ostringstream G4ExceptionDescription
std::vector< ExP01TrackerHit * > a
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4VAtomDeexcitation * AtomDeexcitation()
static constexpr double MeV
virtual ~G4DNABornIonisationModel2()
G4double fHighEnergyLimit
void SetHighEnergyLimit(G4double)
virtual size_t NumberOfComponents(void) const
TriDimensionMap fDiffCrossSectionData[6]
static constexpr double keV
const G4ThreeVector & GetMomentumDirection() const
G4DNACrossSectionDataSet * fTableData
const G4String & GetParticleName() const
G4double TransferedEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell, G4double random)
G4ParticleChangeForGamma * fParticleChangeForGamma
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4double GetPDGMass() const
G4double IonisationEnergy(G4int level)
G4double LowEnergyLimit() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &=*(new G4DataVector()))
static constexpr double proton_mass_c2
std::vector< G4double > fTdummyVec
static constexpr double m
void SetDeexcitationFlag(G4bool val)
G4double Interpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
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()
static constexpr double electron_mass_c2
static G4DNAMolecularMaterial * Instance()
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4int RandomSelect(G4double energy)
G4DNABornIonisationModel2(const G4ParticleDefinition *p=0, const G4String &nam="DNABornIonisationModel")
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, G4int shellID, const G4Material *)
double A(double temperature)
static constexpr double eV
virtual G4double GetPartialCrossSection(const G4Material *, G4int, const G4ParticleDefinition *, G4double)
void SetAngularDistribution(G4VEmAngularDistribution *)
const G4Track * GetCurrentTrack() const
TriDimensionMap fNrjTransfData[6]
G4VAtomDeexcitation * fAtomDeexcitation
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
static G4Electron * Electron()
static G4Electron * ElectronDefinition()
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
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)
void SetLowEnergyLimit(G4double)
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()
const G4ParticleDefinition * fParticleDef
G4VEmAngularDistribution * GetAngularDistribution()
const G4Material * GetMaterial() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4DNAWaterIonisationStructure waterStructure
const std::vector< G4double > * fpMolWaterDensity
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
G4double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
G4double RandomizeEjectedElectronEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
G4double RandomizeEjectedElectronEnergyFromCumulatedDcs(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)