66 G4cout <<
"Emfietzoglou ionisation model is constructed " <<
G4endl;
71 fAtomDeexcitation = 0;
73 fpMolWaterDensity = 0;
96 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
97 for(pos = tableData.begin(); pos != tableData.end(); ++
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)
159 if (fasterCode)
G4Exception(
"G4DNAEmfietzoglouIonisationModel::Initialise",
"em0003",
160 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_emfietzoglou.dat");
162 if (!fasterCode)
G4Exception(
"G4DNAEmfietzoglouIonisationModel::Initialise",
"em0003",
163 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_emfietzoglou.dat");
175 eProbaShellMap->clear();
177 eDiffCrossSectionData->clear();
179 eNrjTransfData->clear();
183 eTdummyVec.push_back(0.);
184 while(!eDiffCrossSection.eof())
188 eDiffCrossSection>>tDummy>>eDummy;
189 if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy);
190 for (
int j=0; j<5; j++)
192 eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy];
196 eNrjTransfData[j][tDummy][eDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
197 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
201 if (!eDiffCrossSection.eof() && !fasterCode)
203 eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
206 if (!fasterCode) eVecm[tDummy].push_back(eDummy);
213 if (particle==electronDef)
221 G4cout <<
"Emfietzoglou ionisation model is initialized " <<
G4endl
240 isInitialised =
true;
255 <<
"Calling CrossSectionPerVolume() of G4DNAEmfietzoglouIonisationModel"
269 if(waterDensity!= 0.0)
274 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
275 pos1 = lowEnergyLimit.find(particleName);
276 if (pos1 != lowEnergyLimit.end())
278 lowLim = pos1->second;
281 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
282 pos2 = highEnergyLimit.find(particleName);
283 if (pos2 != highEnergyLimit.end())
285 highLim = pos2->second;
288 if (ekin >= lowLim && ekin < highLim)
290 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
291 pos = tableData.find(particleName);
293 if (pos != tableData.end())
303 G4Exception(
"G4DNAEmfietzoglouIonisationModel::CrossSectionPerVolume",
"em0002",
308 if (verboseLevel > 2)
310 G4cout <<
"__________________________________" <<
G4endl;
311 G4cout <<
"G4DNAEmfietzoglouIonisationModel - XS INFO START" <<
G4endl;
312 G4cout <<
"Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << particleName <<
G4endl;
313 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
314 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
315 G4cout <<
"G4DNAEmfietzoglouIonisationModel - XS INFO END" <<
G4endl;
319 return sigma*waterDensity;
334 G4cout <<
"Calling SampleSecondaries() of G4DNAEmfietzoglouIonisationModel"
345 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
346 pos1 = lowEnergyLimit.find(particleName);
348 if (pos1 != lowEnergyLimit.end())
350 lowLim = pos1->second;
353 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
354 pos2 = highEnergyLimit.find(particleName);
356 if (pos2 != highEnergyLimit.end())
358 highLim = pos2->second;
361 if (k >= lowLim && k < highLim)
365 G4double totalEnergy = k + particleMass;
366 G4double pSquare = k * (totalEnergy + particleMass);
367 G4double totalMomentum = std::sqrt(pSquare);
369 G4int ionizationShell = 0;
371 ionizationShell = RandomSelect(k,particleName);
377 G4int secNumberInit = 0;
378 G4int secNumberFinal = 0;
384 if (k<bindingEnergy)
return;
388 if(fAtomDeexcitation)
392 if (ionizationShell <5 && ionizationShell >1)
396 else if (ionizationShell <2)
411 secNumberInit = fvect->size();
413 secNumberFinal = fvect->size();
418 if (!fasterCode) secondaryKinetic = RandomizeEjectedElectronEnergy(particle->
GetDefinition(),k,ionizationShell);
422 secondaryKinetic = RandomizeEjectedElectronEnergyFromCumulatedDcs(particle->
GetDefinition(),k,ionizationShell);
432 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.x();
433 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.y();
434 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.z();
435 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
436 finalPx /= finalMomentum;
437 finalPy /= finalMomentum;
438 finalPz /= finalMomentum;
441 direction.
set(finalPx,finalPy,finalPz);
446 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
448 for (
G4int j=secNumberInit; j < secNumberFinal; j++)
450 deexSecEnergy = deexSecEnergy + (*fvect)[j]->GetKineticEnergy();
465 if (secondaryKinetic>0)
468 fvect->push_back(dp);
483 G4DNAEmfietzoglouIonisationModel::
493 G4double maximumEnergyTransfer = 0.;
495 maximumEnergyTransfer = k;
513 G4double maxEnergy = maximumEnergyTransfer;
514 G4int nEnergySteps = 50;
518 1. / static_cast<G4double>(nEnergySteps - 1)));
519 G4int step(nEnergySteps);
528 if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum =
529 differentialCrossSection;
534 G4double secondaryElectronKineticEnergy = 0.;
542 return secondaryElectronKineticEnergy;
597 G4int ionizationLevelIndex)
619 std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),
623 std::vector<double>::iterator t1 = t2 - 1;
626 if(energyTransfer <= eVecm[(*t1)].back() && energyTransfer
627 <= eVecm[(*t2)].back())
629 std::vector<double>::iterator e12 =
630 std::upper_bound(eVecm[(*t1)].begin(),
633 std::vector<double>::iterator e11 = e12 - 1;
635 std::vector<double>::iterator e22 =
636 std::upper_bound(eVecm[(*t2)].begin(),
639 std::vector<double>::iterator e21 = e22 - 1;
648 xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
649 xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
650 xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
651 xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
667 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
670 sigma = QuadInterpolator(valueE11,
702 if(e1 != 0 && e2 != 0 && (std::log10(e2) - std::log10(e1)) != 0
705 G4double a = (std::log10(xs2) - std::log10(xs1))
706 / (std::log10(e2) - std::log10(e1));
707 G4double b = std::log10(xs2) - a * std::log10(e2);
708 G4double sigma = a * std::log10(e) + b;
709 value = (std::pow(10., sigma));
723 if((e2 - e1) != 0 && xs1 != 0 && xs2 != 0 && fasterCode)
727 value = std::pow(10., (d1 + (d2 - d1) * (e - e1) / (e2 - e1)));
733 if((e2 - e1) != 0 && (xs1 == 0 || xs2 == 0) && fasterCode)
737 value = (d1 + (d2 -
d1) * (e - e1) / (e2 - e1));
769 G4double interpolatedvalue1 = Interpolate(e11, e12, e, xs11, xs12);
770 G4double interpolatedvalue2 = Interpolate(e21, e22, e, xs21, xs22);
782 G4int G4DNAEmfietzoglouIonisationModel::RandomSelect(
G4double k,
787 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
788 pos = tableData.find(particle);
790 if(pos != tableData.end())
805 value += valuesBuffer[i];
816 if(valuesBuffer[i] > value)
818 delete[] valuesBuffer;
821 value -= valuesBuffer[i];
824 if(valuesBuffer)
delete[] valuesBuffer;
830 G4Exception(
"G4DNAEmfietzoglouIonisationModel::RandomSelect",
833 "Model not applicable to particle type.");
847 G4double secondaryElectronKineticEnergy = 0.;
849 secondaryElectronKineticEnergy = RandomTransferedEnergy(particleDefinition,
857 if(secondaryElectronKineticEnergy < 0.)
return 0.;
860 return secondaryElectronKineticEnergy;
867 G4int ionizationLevelIndex)
889 std::vector<double>::iterator k2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
891 std::vector<double>::iterator k1 = k2-1;
905 if ( random <= eProbaShellMap[ionizationLevelIndex][(*k1)].back()
906 && random <= eProbaShellMap[ionizationLevelIndex][(*k2)].back() )
909 std::vector<double>::iterator prob12 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
910 eProbaShellMap[ionizationLevelIndex][(*k1)].end(), random);
912 std::vector<double>::iterator prob11 = prob12-1;
914 std::vector<double>::iterator prob22 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
915 eProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
917 std::vector<double>::iterator prob21 = prob22-1;
921 valuePROB21 =*prob21;
922 valuePROB22 =*prob22;
923 valuePROB12 =*prob12;
924 valuePROB11 =*prob11;
931 nrjTransf11 = eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
932 nrjTransf12 = eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
933 nrjTransf21 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
934 nrjTransf22 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
948 if ( random > eProbaShellMap[ionizationLevelIndex][(*k1)].back() )
951 std::vector<double>::iterator prob22 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
952 eProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
954 std::vector<double>::iterator prob21 = prob22-1;
958 valuePROB21 =*prob21;
959 valuePROB22 =*prob22;
963 nrjTransf21 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
964 nrjTransf22 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
966 G4double interpolatedvalue2 = Interpolate(valuePROB21, valuePROB22, random, nrjTransf21, nrjTransf22);
970 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
989 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21 * nrjTransf22;
993 if (nrjTransfProduct != 0.)
995 nrj = QuadInterpolator( valuePROB11, valuePROB12,
996 valuePROB21, valuePROB22,
997 nrjTransf11, nrjTransf12,
998 nrjTransf21, nrjTransf22,
void set(double x, double y, double z)
G4DNAEmfietzoglouIonisationModel(const G4ParticleDefinition *p=0, const G4String &nam="DNAEmfietzoglouIonisationModel")
static G4Electron * ElectronDefinition()
G4double LowEnergyLimit() const
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
G4ParticleChangeForGamma * fParticleChangeForGamma
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
static G4LossTableManager * Instance()
G4double GetKineticEnergy() const
G4double HighEnergyLimit() const
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4VEmAngularDistribution * GetAngularDistribution()
virtual G4bool LoadData(const G4String &argFileName)
virtual ~G4DNAEmfietzoglouIonisationModel()
G4ParticleDefinition * GetDefinition() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double electron_mass_c2
void SetHighEnergyLimit(G4double)
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, G4int shellID, const G4Material *)
double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4GLOB_DLL std::ostream G4cout
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
static constexpr double m
const XML_Char int const XML_Char * value
const G4ThreeVector & GetMomentumDirection() const
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &=*(new G4DataVector()))
static constexpr double cm
static constexpr double eV
virtual G4double FindValue(G4double e, G4int componentId=0) const
virtual size_t NumberOfComponents(void) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4DNAChemistryManager * Instance()
static G4DNAMolecularMaterial * Instance()
G4double GetPDGMass() const
G4double IonisationEnergy(G4int level)
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
void SetAngularDistribution(G4VEmAngularDistribution *)
const G4Track * GetCurrentTrack() const
static G4Electron * Electron()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4VAtomDeexcitation * AtomDeexcitation()
void SetLowEnergyLimit(G4double)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
void SetDeexcitationFlag(G4bool val)
G4double bindingEnergy(G4int A, G4int Z)
static constexpr double keV
static const G4double pos
G4ParticleChangeForGamma * GetParticleChangeForGamma()
const G4Material * GetMaterial() const