59 G4cout <<
"Born ionisation model is constructed " <<
G4endl;
64 fAtomDeexcitation = 0;
66 fpMolWaterDensity = 0;
75 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
76 for (pos = tableData.begin(); pos != tableData.end(); ++pos)
96 G4cout <<
"Calling G4DNABornIonisationModel::Initialise()" <<
G4endl;
100 G4String fileElectron(
"dna/sigma_ionisation_e_born");
101 G4String fileProton(
"dna/sigma_ionisation_p_born");
109 G4double scaleFactor = (1.e-22 / 3.343) * m*m;
111 char *path = getenv(
"G4LEDATA");
117 tableFile[electron] = fileElectron;
119 lowEnergyLimit[electron] = 11. * eV;
120 highEnergyLimit[electron] = 1. * MeV;
127 tableData[electron] = tableE;
131 std::ostringstream eFullFileName;
132 eFullFileName << path <<
"/dna/sigmadiff_ionisation_e_born.dat";
133 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
135 if (!eDiffCrossSection)
137 G4Exception(
"G4DNABornIonisationModel::Initialise",
"em0003",
138 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_e_born.dat");
141 eTdummyVec.push_back(0.);
142 while(!eDiffCrossSection.eof())
146 eDiffCrossSection>>tDummy>>eDummy;
147 if (tDummy != eTdummyVec.back()) eTdummyVec.push_back(tDummy);
148 for (
int j=0; j<5; j++)
150 eDiffCrossSection>>eDiffCrossSectionData[j][tDummy][eDummy];
153 if (!eDiffCrossSection.eof()) eDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
155 eVecm[tDummy].push_back(eDummy);
164 tableFile[proton] = fileProton;
166 lowEnergyLimit[proton] = 500. * keV;
167 highEnergyLimit[proton] = 100. * MeV;
174 tableData[proton] = tableP;
178 std::ostringstream pFullFileName;
179 pFullFileName << path <<
"/dna/sigmadiff_ionisation_p_born.dat";
180 std::ifstream pDiffCrossSection(pFullFileName.str().c_str());
182 if (!pDiffCrossSection)
184 G4Exception(
"G4DNABornIonisationModel::Initialise",
"em0003",
185 FatalException,
"Missing data file:/dna/sigmadiff_ionisation_p_born.dat");
188 pTdummyVec.push_back(0.);
189 while(!pDiffCrossSection.eof())
193 pDiffCrossSection>>tDummy>>eDummy;
194 if (tDummy != pTdummyVec.back()) pTdummyVec.push_back(tDummy);
195 for (
int j=0; j<5; j++)
197 pDiffCrossSection>>pDiffCrossSectionData[j][tDummy][eDummy];
200 if (!pDiffCrossSection.eof()) pDiffCrossSectionData[j][tDummy][eDummy]*=scaleFactor;
202 pVecm[tDummy].push_back(eDummy);
208 if (particle==electronDef)
214 if (particle==protonDef)
222 G4cout <<
"Born ionisation model is initialized " <<
G4endl
236 if (isInitialised) {
return; }
238 isInitialised =
true;
249 if (verboseLevel > 3)
250 G4cout <<
"Calling CrossSectionPerVolume() of G4DNABornIonisationModel" <<
G4endl;
268 if(waterDensity!= 0.0)
273 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
274 pos1 = lowEnergyLimit.find(particleName);
275 if (pos1 != lowEnergyLimit.end())
277 lowLim = pos1->second;
280 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
281 pos2 = highEnergyLimit.find(particleName);
282 if (pos2 != highEnergyLimit.end())
284 highLim = pos2->second;
287 if (ekin >= lowLim && ekin < highLim)
289 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
290 pos = tableData.find(particleName);
292 if (pos != tableData.end())
302 G4Exception(
"G4DNABornIonisationModel::CrossSectionPerVolume",
"em0002",
307 if (verboseLevel > 2)
309 G4cout <<
"__________________________________" <<
G4endl;
310 G4cout <<
"°°° G4DNABornIonisationModel - XS INFO START" <<
G4endl;
311 G4cout <<
"°°° Kinetic energy(eV)=" << ekin/eV <<
" particle : " << particleName <<
G4endl;
312 G4cout <<
"°°° Cross section per water molecule (cm^2)=" << sigma/cm/cm <<
G4endl;
313 G4cout <<
"°°° Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) <<
G4endl;
315 G4cout <<
"°°° G4DNABornIonisationModel - XS INFO END" <<
G4endl;
321 return sigma*waterDensity;
333 if (verboseLevel > 3)
334 G4cout <<
"Calling SampleSecondaries() of G4DNABornIonisationModel" <<
G4endl;
343 std::map< G4String,G4double,std::less<G4String> >::iterator pos1;
344 pos1 = lowEnergyLimit.find(particleName);
346 if (pos1 != lowEnergyLimit.end())
348 lowLim = pos1->second;
351 std::map< G4String,G4double,std::less<G4String> >::iterator pos2;
352 pos2 = highEnergyLimit.find(particleName);
354 if (pos2 != highEnergyLimit.end())
356 highLim = pos2->second;
359 if (k >= lowLim && k < highLim)
363 G4double totalEnergy = k + particleMass;
364 G4double pSquare = k * (totalEnergy + particleMass);
365 G4double totalMomentum = std::sqrt(pSquare);
367 G4int ionizationShell = RandomSelect(k,particleName);
373 G4int secNumberInit = 0;
374 G4int secNumberFinal = 0;
379 if(fAtomDeexcitation) {
383 if (ionizationShell <5 && ionizationShell >1)
387 else if (ionizationShell <2)
402 secNumberInit = fvect->size();
404 secNumberFinal = fvect->size();
407 G4double secondaryKinetic = RandomizeEjectedElectronEnergy(particle->
GetDefinition(),k,ionizationShell);
411 RandomizeEjectedElectronDirection(particle->
GetDefinition(), k,secondaryKinetic, cosTheta, phi);
413 G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta);
414 G4double dirX = sinTheta*std::cos(phi);
415 G4double dirY = sinTheta*std::sin(phi);
418 deltaDirection.
rotateUz(primaryDirection);
422 G4double deltaTotalMomentum = std::sqrt(secondaryKinetic*(secondaryKinetic + 2.*electron_mass_c2 ));
424 G4double finalPx = totalMomentum*primaryDirection.
x() - deltaTotalMomentum*deltaDirection.
x();
425 G4double finalPy = totalMomentum*primaryDirection.
y() - deltaTotalMomentum*deltaDirection.
y();
426 G4double finalPz = totalMomentum*primaryDirection.
z() - deltaTotalMomentum*deltaDirection.
z();
427 G4double finalMomentum = std::sqrt(finalPx*finalPx + finalPy*finalPy + finalPz*finalPz);
428 finalPx /= finalMomentum;
429 finalPy /= finalMomentum;
430 finalPz /= finalMomentum;
433 direction.
set(finalPx,finalPy,finalPz);
441 G4double scatteredEnergy = k-bindingEnergy-secondaryKinetic;
443 for (
G4int j=secNumberInit; j < secNumberFinal; j++) {
445 deexSecEnergy = deexSecEnergy + (*fvect)[j]->GetKineticEnergy();
453 fvect->push_back(dp);
472 if ((k+waterStructure.
IonisationEnergy(shell))/2. > k) maximumEnergyTransfer=k;
491 G4double maxEnergy = maximumEnergyTransfer;
492 G4int nEnergySteps = 50;
495 G4double stpEnergy(std::pow(maxEnergy/value, 1./
static_cast<G4double>(nEnergySteps-1)));
496 G4int step(nEnergySteps);
501 if(differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection;
506 G4double secondaryElectronKineticEnergy=0.;
513 return secondaryElectronKineticEnergy;
519 G4double maximumKineticEnergyTransfer = 4.* (electron_mass_c2 / proton_mass_c2) * k;
527 if (differentialCrossSection >= crossSectionMaximum) crossSectionMaximum = differentialCrossSection;
530 G4double secondaryElectronKineticEnergy = 0.;
533 secondaryElectronKineticEnergy =
G4UniformRand() * maximumKineticEnergyTransfer;
537 return secondaryElectronKineticEnergy;
545void G4DNABornIonisationModel::RandomizeEjectedElectronDirection(
G4ParticleDefinition* particleDefinition,
555 else if (secKinetic <= 200.*eV)
562 G4double sin2O = (1.-secKinetic/k) / (1.+secKinetic/(2.*electron_mass_c2));
563 cosTheta = std::sqrt(1.-sin2O);
569 G4double maxSecKinetic = 4.* (electron_mass_c2 / proton_mass_c2) * k;
576 if (secKinetic>100*eV) cosTheta = std::sqrt(secKinetic / maxSecKinetic);
587 G4int ionizationLevelIndex)
591 if (energyTransfer >= waterStructure.
IonisationEnergy(ionizationLevelIndex))
609 std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
611 std::vector<double>::iterator t1 = t2-1;
614 if (energyTransfer <= eVecm[(*t1)].back() && energyTransfer <= eVecm[(*t2)].back() )
616 std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), energyTransfer);
617 std::vector<double>::iterator e11 = e12-1;
619 std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), energyTransfer);
620 std::vector<double>::iterator e21 = e22-1;
629 xs11 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
630 xs12 = eDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
631 xs21 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
632 xs22 = eDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
640 std::vector<double>::iterator t2 = std::upper_bound(pTdummyVec.begin(),pTdummyVec.end(), k);
641 std::vector<double>::iterator t1 = t2-1;
643 std::vector<double>::iterator e12 = std::upper_bound(pVecm[(*t1)].begin(),pVecm[(*t1)].end(), energyTransfer);
644 std::vector<double>::iterator e11 = e12-1;
646 std::vector<double>::iterator e22 = std::upper_bound(pVecm[(*t2)].begin(),pVecm[(*t2)].end(), energyTransfer);
647 std::vector<double>::iterator e21 = e22-1;
656 xs11 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE11];
657 xs12 = pDiffCrossSectionData[ionizationLevelIndex][valueT1][valueE12];
658 xs21 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE21];
659 xs22 = pDiffCrossSectionData[ionizationLevelIndex][valueT2][valueE22];
663 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
666 sigma = QuadInterpolator( valueE11, valueE12,
687 G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(e2)-std::log10(e1));
688 G4double b = std::log10(xs2) - a*std::log10(e2);
689 G4double sigma = a*std::log10(e) + b;
690 G4double value = (std::pow(10.,sigma));
703 G4double interpolatedvalue1 = LogLogInterpolate(e11, e12, e, xs11, xs12);
704 G4double interpolatedvalue2 = LogLogInterpolate(e21, e22, e, xs21, xs22);
705 G4double value = LogLogInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
715 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator pos;
716 pos = tableData.find(particle);
718 if (pos != tableData.end())
733 value += valuesBuffer[i];
744 if (valuesBuffer[i] > value)
746 delete[] valuesBuffer;
749 value -= valuesBuffer[i];
752 if (valuesBuffer)
delete[] valuesBuffer;
758 G4Exception(
"G4DNABornIonisationModel::RandomSelect",
"em0002",
G4DLLIMPORT std::ostream G4cout
void set(double x, double y, double z)
Hep3Vector & rotateUz(const Hep3Vector &)
virtual ~G4DNABornIonisationModel()
G4DNABornIonisationModel(const G4ParticleDefinition *p=0, const G4String &nam="DNABornIonisationModel")
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
double DifferentialCrossSection(G4ParticleDefinition *aParticleDefinition, G4double k, G4double energyTransfer, G4int shell)
G4ParticleChangeForGamma * fParticleChangeForGamma
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector()))
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
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()
const std::vector< double > * GetNumMolPerVolTableFor(const G4Material *) const
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()
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
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)
void SetDeexcitationFlag(G4bool val)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)