66 G4cout <<
"Emfietzoglou ionisation model is constructed " <<
G4endl;
96 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
117 G4cout <<
"Calling G4DNAEmfietzoglouIonisationModel::Initialise()" <<
G4endl;
122 G4String fileElectron(
"dna/sigma_ionisation_e_emfietzoglou");
128 G4double scaleFactor = (1.e-22 / 3.343) *
m*
m;
130 char *path = getenv(
"G4LEDATA");
150 std::ostringstream eFullFileName;
152 if (
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_e_emfietzoglou.dat";
153 if (!
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_ionisation_e_emfietzoglou.dat";
155 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
157 if (!eDiffCrossSection)
160 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_emfietzoglou.dat");
163 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_emfietzoglou.dat");
184 while(!eDiffCrossSection.eof())
188 eDiffCrossSection>>tDummy>>eDummy;
190 for (
G4int j=0; j<5; j++)
196 eNrjTransfData[j][tDummy][eDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
197 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
203 eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
213 if (particle==electronDef)
221 G4cout <<
"Emfietzoglou ionisation model is initialized " <<
G4endl
257 <<
"Calling CrossSectionPerVolume() of G4DNAEmfietzoglouIonisationModel"
271 if(waterDensity!= 0.0)
276 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
280 lowLim = pos1->second;
283 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
287 highLim = pos2->second;
290 if (ekin >= lowLim && ekin < highLim)
292 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
305 G4Exception(
"G4DNAEmfietzoglouIonisationModel::CrossSectionPerVolume",
"em0002",
312 G4cout <<
"__________________________________" <<
G4endl;
313 G4cout <<
"G4DNAEmfietzoglouIonisationModel - XS INFO START" <<
G4endl;
314 G4cout <<
"Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << particleName <<
G4endl;
315 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
316 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
317 G4cout <<
"G4DNAEmfietzoglouIonisationModel - XS INFO END" <<
G4endl;
321 return sigma*waterDensity;
336 G4cout <<
"Calling SampleSecondaries() of G4DNAEmfietzoglouIonisationModel"
347 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
352 lowLim = pos1->second;
355 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
360 highLim = pos2->second;
363 if (k >= lowLim && k < highLim)
367 G4double totalEnergy = k + particleMass;
368 G4double pSquare = k * (totalEnergy + particleMass);
369 G4double totalMomentum = std::sqrt(pSquare);
371 G4int ionizationShell = 0;
379 if (k<bindingEnergy)
return;
398 if (secondaryKinetic>0)
401 fvect->push_back(dp);
406 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.
x();
407 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.
y();
408 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.
z();
409 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
410 finalPx /= finalMomentum;
411 finalPy /= finalMomentum;
412 finalPz /= finalMomentum;
415 direction.
set(finalPx,finalPy,finalPz);
423 G4int secNumberInit = 0;
424 G4int secNumberFinal = 0;
430 if (ionizationShell <5 && ionizationShell >1)
434 else if (ionizationShell <2)
449 secNumberInit = fvect->size();
451 secNumberFinal = fvect->size();
456 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
458 for (
G4int j=secNumberInit; j < secNumberFinal; j++)
460 deexSecEnergy = deexSecEnergy + (*fvect)[j]->GetKineticEnergy();
502 G4double maximumEnergyTransfer = 0.;
504 maximumEnergyTransfer = k;
522 G4double maxEnergy = maximumEnergyTransfer;
523 G4int nEnergySteps = 50;
526 G4double stpEnergy(std::pow(maxEnergy / value,
527 1. / static_cast<G4double>(nEnergySteps - 1)));
528 G4int step(nEnergySteps);
537 if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum =
538 differentialCrossSection;
543 G4double secondaryElectronKineticEnergy = 0.;
551 return secondaryElectronKineticEnergy;
606 G4int ionizationLevelIndex)
628 std::vector<G4double>::iterator
t2 = std::upper_bound(
eTdummyVec.begin(),
632 std::vector<G4double>::iterator
t1 = t2 - 1;
636 if(energyTransfer <
eVecm[(*t1)].back() &&
637 energyTransfer <
eVecm[(*t2)].back())
639 std::vector<G4double>::iterator e12 =
640 std::upper_bound(
eVecm[(*t1)].begin(),
643 std::vector<G4double>::iterator e11 = e12 - 1;
645 std::vector<G4double>::iterator e22 =
646 std::upper_bound(
eVecm[(*t2)].begin(),
649 std::vector<G4double>::iterator e21 = e22 - 1;
677 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
712 if(e1 != 0 && e2 != 0 && (std::log10(e2) - std::log10(e1)) != 0
715 G4double a = (std::log10(xs2) - std::log10(xs1))
716 / (std::log10(e2) - std::log10(e1));
717 G4double b = std::log10(xs2) - a * std::log10(e2);
718 G4double sigma = a * std::log10(e) + b;
719 value = (std::pow(10., sigma));
733 if((e2 - e1) != 0 && xs1 != 0 && xs2 != 0 &&
fasterCode)
737 value = std::pow(10., (d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
743 if((e2 - e1) != 0 && (xs1 == 0 || xs2 == 0) &&
fasterCode)
747 value = (d1 + (d2 -
d1) * (e - e1) / (e2 - e1));
797 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
815 value += valuesBuffer[i];
826 if(valuesBuffer[i] > value)
828 delete[] valuesBuffer;
831 value -= valuesBuffer[i];
834 if(valuesBuffer)
delete[] valuesBuffer;
840 G4Exception(
"G4DNAEmfietzoglouIonisationModel::RandomSelect",
843 "Model not applicable to particle type.");
857 G4double secondaryElectronKineticEnergy = 0.;
866 if(secondaryElectronKineticEnergy < 0.)
return 0.;
868 return secondaryElectronKineticEnergy;
875 G4int ionizationLevelIndex)
899 std::vector<G4double>::iterator k1 = k2-1;
917 std::vector<G4double>::iterator prob12 = std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
920 std::vector<G4double>::iterator prob11 = prob12-1;
922 std::vector<G4double>::iterator prob22 = std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
925 std::vector<G4double>::iterator prob21 = prob22-1;
929 valuePROB21 =*prob21;
930 valuePROB22 =*prob22;
931 valuePROB12 =*prob12;
932 valuePROB11 =*prob11;
939 nrjTransf11 =
eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
940 nrjTransf12 =
eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
941 nrjTransf21 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
942 nrjTransf22 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
956 if ( random >
eProbaShellMap[ionizationLevelIndex][(*k1)].back() )
959 std::vector<G4double>::iterator prob22 = std::upper_bound(
eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
962 std::vector<G4double>::iterator prob21 = prob22-1;
966 valuePROB21 =*prob21;
967 valuePROB22 =*prob22;
971 nrjTransf21 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
972 nrjTransf22 =
eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
974 G4double interpolatedvalue2 =
Interpolate(valuePROB21, valuePROB22, random, nrjTransf21, nrjTransf22);
997 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21 * nrjTransf22;
1001 if (nrjTransfProduct != 0.)
1004 valuePROB21, valuePROB22,
1005 nrjTransf11, nrjTransf12,
1006 nrjTransf21, nrjTransf22,
void set(double x, double y, double z)
virtual G4bool LoadData(const G4String &argFileName)
std::vector< ExP01TrackerHit * > a
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
static const G4double pos
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4VAtomDeexcitation * AtomDeexcitation()
void SetHighEnergyLimit(G4double)
virtual size_t NumberOfComponents(void) const
static constexpr double keV
const G4ThreeVector & GetMomentumDirection() const
virtual ~G4DNAEmfietzoglouIonisationModel()
const G4String & GetParticleName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4int RandomSelect(G4double energy, const G4String &particle)
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)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4double GetPDGMass() const
TriDimensionMap eDiffCrossSectionData[6]
G4double LowEnergyLimit() const
G4double Interpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4double RandomTransferedEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
G4ParticleChangeForGamma * fParticleChangeForGamma
static constexpr double m
void SetDeexcitationFlag(G4bool val)
G4ParticleDefinition * GetDefinition() const
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
std::vector< G4double > eTdummyVec
const XML_Char int const XML_Char * value
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
static constexpr double electron_mass_c2
static G4DNAMolecularMaterial * Instance()
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
G4double RandomizeEjectedElectronEnergyFromCumulatedDcs(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, G4int shellID, const G4Material *)
TriDimensionMap eNrjTransfData[6]
G4DNAEmfietzoglouWaterIonisationStructure waterStructure
static constexpr double eV
void SetAngularDistribution(G4VEmAngularDistribution *)
const G4Track * GetCurrentTrack() const
static G4Electron * Electron()
std::map< G4String, G4double, std::less< G4String > > highEnergyLimit
static G4Electron * ElectronDefinition()
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &=*(new G4DataVector()))
std::map< G4String, G4double, std::less< G4String > > lowEnergyLimit
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4VAtomDeexcitation * fAtomDeexcitation
G4double RandomizeEjectedElectronEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
void SetLowEnergyLimit(G4double)
const std::vector< G4double > * fpMolWaterDensity
G4double GetKineticEnergy() const
virtual G4double FindValue(G4double e, G4int componentId=0) const
G4DNAEmfietzoglouIonisationModel(const G4ParticleDefinition *p=0, const G4String &nam="DNAEmfietzoglouIonisationModel")
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
static G4LossTableManager * Instance()
G4VEmAngularDistribution * GetAngularDistribution()
G4double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
const G4Material * GetMaterial() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double IonisationEnergy(G4int level)
G4double bindingEnergy(G4int A, G4int Z)
G4double HighEnergyLimit() const
static G4DNAChemistryManager * Instance()
virtual G4double FindValue(G4double x, G4int componentId=0) const =0