59 G4cout <<
"Born ionisation model is constructed " <<
G4endl;
82 std::map<G4String, G4DNACrossSectionDataSet*, std::less<G4String> >::iterator
pos;
102 G4cout <<
"Calling G4DNABornIonisationModel::Initialise()" <<
G4endl;
106 G4String fileElectron(
"dna/sigma_ionisation_e_born");
107 G4String fileProton(
"dna/sigma_ionisation_p_born");
115 G4double scaleFactor = (1.e-22 / 3.343) *
m*
m;
117 char *path = getenv(
"G4LEDATA");
137 std::ostringstream eFullFileName;
139 if (
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat";
140 if (!
fasterCode) eFullFileName << path <<
"/dna/sigmadiff_ionisation_e_born.dat";
142 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
144 if (!eDiffCrossSection)
147 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_e_born_hp.dat");
150 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_born.dat");
164 for (
int j=0; j<5; j++)
178 while(!eDiffCrossSection.eof())
182 eDiffCrossSection>>tDummy>>eDummy;
186 for (
int j=0; j<5; j++)
188 eDiffCrossSection>> tmp;
195 eProbaShellMap[j][tDummy].push_back(eDiffCrossSectionData[j][tDummy][eDummy]);
224 std::ostringstream pFullFileName;
226 if (
fasterCode) pFullFileName << path <<
"/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat";
228 if (!
fasterCode) pFullFileName << path <<
"/dna/sigmadiff_ionisation_p_born.dat";
230 std::ifstream pDiffCrossSection(pFullFileName.str().c_str());
232 if (!pDiffCrossSection)
235 FatalException,
"Missing data file:/dna/sigmadiff_cumulated_ionisation_p_born_hp.dat");
238 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_p_born.dat");
242 while(!pDiffCrossSection.eof())
246 pDiffCrossSection>>tDummy>>eDummy;
248 for (
int j=0; j<5; j++)
254 pNrjTransfData[j][tDummy][pDiffCrossSectionData[j][tDummy][eDummy]]=eDummy;
255 pProbaShellMap[j][tDummy].push_back(pDiffCrossSectionData[j][tDummy][eDummy]);
259 if (!pDiffCrossSection.eof() && !
fasterCode) pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
267 if (particle==electronDef)
273 if (particle==protonDef)
281 G4cout <<
"Born ionisation model is initialized " << G4endl
311 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornIonisationModel"
330 if(waterDensity!= 0.0)
335 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
339 lowLim = pos1->second;
342 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
346 highLim = pos2->second;
349 if (ekin >= lowLim && ekin < highLim)
351 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
364 G4Exception(
"G4DNABornIonisationModel::CrossSectionPerVolume",
"em0002",
371 G4cout <<
"__________________________________" <<
G4endl;
372 G4cout <<
"G4DNABornIonisationModel - XS INFO START" <<
G4endl;
373 G4cout <<
"Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << particleName <<
G4endl;
374 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
375 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
376 G4cout <<
"G4DNABornIonisationModel - XS INFO END" <<
G4endl;
380 return sigma*waterDensity;
393 G4cout <<
"Calling SampleSecondaries() of G4DNABornIonisationModel" <<
G4endl;
402 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
407 lowLim = pos1->second;
410 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
415 highLim = pos2->second;
418 if (k >= lowLim && k < highLim)
422 G4double totalEnergy = k + particleMass;
423 G4double pSquare = k * (totalEnergy + particleMass);
424 G4double totalMomentum = std::sqrt(pSquare);
426 G4int ionizationShell = 0;
446 G4int secNumberInit = 0;
447 G4int secNumberFinal = 0;
457 if (ionizationShell <5 && ionizationShell >1)
461 else if (ionizationShell <2)
476 secNumberInit = fvect->size();
478 secNumberFinal = fvect->size();
501 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
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);
520 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
522 for (
G4int j=secNumberInit; j < secNumberFinal; j++)
524 deexSecEnergy = deexSecEnergy + (*fvect)[j]->GetKineticEnergy();
531 if (secondaryKinetic>0)
534 fvect->push_back(dp);
555 G4double maximumEnergyTransfer = 0.;
575 G4double maxEnergy = maximumEnergyTransfer;
576 G4int nEnergySteps = 50;
580 std::pow(maxEnergy / value,
581 1. / static_cast<G4double>(nEnergySteps - 1)));
582 G4int step(nEnergySteps);
587 particleDefinition, k /
eV, value /
eV, shell);
588 if (differentialCrossSection >= crossSectionMaximum) crossSectionMaximum =
589 differentialCrossSection;
594 G4double secondaryElectronKineticEnergy = 0.;
602 return secondaryElectronKineticEnergy;
608 G4double maximumKineticEnergyTransfer = 4.
609 * (electron_mass_c2 / proton_mass_c2) * k;
616 particleDefinition, k /
eV, value /
eV, shell);
617 if (differentialCrossSection >= crossSectionMaximum) crossSectionMaximum =
618 differentialCrossSection;
621 G4double secondaryElectronKineticEnergy = 0.;
624 secondaryElectronKineticEnergy =
G4UniformRand()* maximumKineticEnergyTransfer;
629 return secondaryElectronKineticEnergy;
684 G4int ionizationLevelIndex)
706 std::vector<double>::iterator t2 = std::upper_bound(
eTdummyVec.begin(),
709 std::vector<double>::iterator t1 = t2 - 1;
712 if (energyTransfer <=
eVecm[(*t1)].back() && energyTransfer
713 <=
eVecm[(*t2)].back())
715 std::vector<double>::iterator e12 = std::upper_bound(
716 eVecm[(*t1)].begin(),
eVecm[(*t1)].end(), energyTransfer);
717 std::vector<double>::iterator e11 = e12 - 1;
719 std::vector<double>::iterator e22 = std::upper_bound(
720 eVecm[(*t2)].begin(),
eVecm[(*t2)].end(), energyTransfer);
721 std::vector<double>::iterator e21 = e22 - 1;
742 std::vector<double>::iterator t2 = std::upper_bound(
pTdummyVec.begin(),
744 std::vector<double>::iterator t1 = t2 - 1;
746 std::vector<double>::iterator e12 = std::upper_bound(
pVecm[(*t1)].begin(),
749 std::vector<double>::iterator e11 = e12 - 1;
751 std::vector<double>::iterator e22 = std::upper_bound(
pVecm[(*t2)].begin(),
754 std::vector<double>::iterator e21 = e22 - 1;
770 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
774 xs12, xs21, xs22, valueT1, valueT2, k,
794 if (e1!=0 && e2!=0 && (std::log10(e2)-std::log10(e1)) !=0 && !
fasterCode)
796 G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(e2)-std::log10(e1));
797 G4double b = std::log10(xs2) - a*std::log10(e2);
798 G4double sigma = a*std::log10(e) + b;
799 value = (std::pow(10.,sigma));
814 if ((e2-e1)!=0 && xs1 !=0 && xs2 !=0 &&
fasterCode )
818 value = std::pow(10.,(d1 + (d2 - d1)*(e - e1)/ (e2 - e1)) );
824 if ((e2-e1)!=0 && (xs1 ==0 || xs2 ==0) &&
fasterCode )
828 value = (d1 + (d2 -
d1)*(e - e1)/ (e2 -
e1));
867 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
885 value += valuesBuffer[i];
896 if (valuesBuffer[i] > value)
898 delete[] valuesBuffer;
901 value -= valuesBuffer[i];
904 if (valuesBuffer)
delete[] valuesBuffer;
910 G4Exception(
"G4DNABornIonisationModel::RandomSelect",
"em0002",
924 G4double secondaryElectronKineticEnergy = 0.;
926 secondaryElectronKineticEnergy=
927 RandomTransferedEnergy(particleDefinition, k/
eV, shell)*
eV-waterStructure.IonisationEnergy(shell);
931 if (secondaryElectronKineticEnergy<0.)
return 0.;
934 return secondaryElectronKineticEnergy;
961 std::vector<double>::iterator k2 = std::upper_bound(eTdummyVec.begin(),
964 std::vector<double>::iterator k1 = k2-1;
978 if ( random <= eProbaShellMap[ionizationLevelIndex][(*k1)].back()
979 && random <= eProbaShellMap[ionizationLevelIndex][(*k2)].back() )
981 std::vector<double>::iterator prob12 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
982 eProbaShellMap[ionizationLevelIndex][(*k1)].end(), random);
984 std::vector<double>::iterator prob11 = prob12-1;
986 std::vector<double>::iterator prob22 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
987 eProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
989 std::vector<double>::iterator prob21 = prob22-1;
993 valuePROB21 =*prob21;
994 valuePROB22 =*prob22;
995 valuePROB12 =*prob12;
996 valuePROB11 =*prob11;
1003 nrjTransf11 = eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
1004 nrjTransf12 = eNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
1005 nrjTransf21 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1006 nrjTransf22 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1018 if ( random > eProbaShellMap[ionizationLevelIndex][(*k1)].back() )
1020 std::vector<double>::iterator prob22 = std::upper_bound(eProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1021 eProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
1023 std::vector<double>::iterator prob21 = prob22-1;
1027 valuePROB21 =*prob21;
1028 valuePROB22 =*prob22;
1032 nrjTransf21 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1033 nrjTransf22 = eNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1035 G4double interpolatedvalue2 = Interpolate(valuePROB21, valuePROB22, random, nrjTransf21, nrjTransf22);
1039 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
1059 std::vector<double>::iterator k2 = std::upper_bound(pTdummyVec.begin(),pTdummyVec.end(), k);
1061 std::vector<double>::iterator k1 = k2-1;
1076 if ( random <= pProbaShellMap[ionizationLevelIndex][(*k1)].back()
1077 && random <= pProbaShellMap[ionizationLevelIndex][(*k2)].back() )
1079 std::vector<double>::iterator prob12 = std::upper_bound(pProbaShellMap[ionizationLevelIndex][(*k1)].begin(),
1080 pProbaShellMap[ionizationLevelIndex][(*k1)].end(), random);
1082 std::vector<double>::iterator prob11 = prob12-1;
1084 std::vector<double>::iterator prob22 = std::upper_bound(pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1085 pProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
1087 std::vector<double>::iterator prob21 = prob22-1;
1091 valuePROB21 =*prob21;
1092 valuePROB22 =*prob22;
1093 valuePROB12 =*prob12;
1094 valuePROB11 =*prob11;
1101 nrjTransf11 = pNrjTransfData[ionizationLevelIndex][valueK1][valuePROB11];
1102 nrjTransf12 = pNrjTransfData[ionizationLevelIndex][valueK1][valuePROB12];
1103 nrjTransf21 = pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1104 nrjTransf22 = pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1117 if ( random > pProbaShellMap[ionizationLevelIndex][(*k1)].back() )
1119 std::vector<double>::iterator prob22 = std::upper_bound(pProbaShellMap[ionizationLevelIndex][(*k2)].begin(),
1120 pProbaShellMap[ionizationLevelIndex][(*k2)].end(), random);
1122 std::vector<double>::iterator prob21 = prob22-1;
1126 valuePROB21 =*prob21;
1127 valuePROB22 =*prob22;
1131 nrjTransf21 = pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB21];
1132 nrjTransf22 = pNrjTransfData[ionizationLevelIndex][valueK2][valuePROB22];
1134 G4double interpolatedvalue2 = Interpolate(valuePROB21, valuePROB22, random, nrjTransf21, nrjTransf22);
1138 G4double value = Interpolate(valueK1, valueK2, k, 0., interpolatedvalue2);
1155 G4double nrjTransfProduct = nrjTransf11 * nrjTransf12 * nrjTransf21 * nrjTransf22;
1158 if (nrjTransfProduct != 0.)
1160 nrj = QuadInterpolator( valuePROB11, valuePROB12,
1161 valuePROB21, valuePROB22,
1162 nrjTransf11, nrjTransf12,
1163 nrjTransf21, nrjTransf22,
static G4Electron * ElectronDefinition()
G4double RandomizeEjectedElectronEnergyFromCumulatedDcs(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
G4double LowEnergyLimit() const
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
static G4LossTableManager * Instance()
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
G4double HighEnergyLimit() const
const std::vector< G4double > * fpMolWaterDensity
virtual const G4VEMDataSet * GetComponent(G4int componentId) const
G4double RandomizeEjectedElectronEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
static G4Proton * ProtonDefinition()
G4VEmAngularDistribution * GetAngularDistribution()
std::map< G4String, G4double, std::less< G4String > > lowEnergyLimit
std::vector< double > eTdummyVec
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
virtual G4bool LoadData(const G4String &argFileName)
G4ParticleDefinition * GetDefinition() const
std::vector< double > pTdummyVec
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)
G4VAtomDeexcitation * fAtomDeexcitation
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
virtual ~G4DNABornIonisationModel()
void SetHighEnergyLimit(G4double)
virtual G4ThreeVector & SampleDirectionForShell(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, G4int shellID, const G4Material *)
TriDimensionMap pDiffCrossSectionData[6]
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4DNABornIonisationModel(const G4ParticleDefinition *p=0, const G4String &nam="DNABornIonisationModel")
virtual G4double FindValue(G4double e, G4int componentId=0) const
G4int RandomSelect(G4double energy, const G4String &particle)
virtual size_t NumberOfComponents(void) const
G4double IonisationEnergy(G4int level)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4DNAWaterIonisationStructure waterStructure
TriDimensionMap eNrjTransfData[6]
static G4DNAChemistryManager * Instance()
static G4DNAMolecularMaterial * Instance()
G4double RandomTransferedEnergy(G4ParticleDefinition *aParticleDefinition, G4double incomingParticleEnergy, G4int shell)
G4double GetPDGMass() const
void CreateWaterMolecule(ElectronicModification, G4int, const G4Track *)
Method used by DNA physics model to create a water molecule.
void SetAngularDistribution(G4VEmAngularDistribution *)
TriDimensionMap pNrjTransfData[6]
G4ParticleChangeForGamma * fParticleChangeForGamma
G4double Interpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
const G4Track * GetCurrentTrack() const
static G4Electron * Electron()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
TriDimensionMap eDiffCrossSectionData[6]
G4VAtomDeexcitation * AtomDeexcitation()
std::map< G4String, G4double, std::less< G4String > > highEnergyLimit
void SetLowEnergyLimit(G4double)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
void SetDeexcitationFlag(G4bool val)
G4ThreeVector G4ParticleMomentum
G4double bindingEnergy(G4int A, G4int Z)
static const G4double pos
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &=*(new G4DataVector()))
G4ParticleChangeForGamma * GetParticleChangeForGamma()
const G4Material * GetMaterial() const