64G4VEmModel(nam), isInitialised(false),statCode(false),fasterCode(true)
79 G4cout <<
"Relativistic Ionisation Model is constructed " <<
G4endl;
99 "Calling G4DNARelativisticIonisationModel::Initialise()"
106 G4Exception(
"G4DNARelativisticIonisationModel::Initialise",
"em0001",
107 FatalException,
"Model already initialized for another particle type.");
112 if(particle == electronDef)
117 std::ostringstream eFullFileNameZ;
119 char *path = getenv(
"G4LEDATA");
122 G4Exception(
"G4DNARelativisticIonisationModel::Initialise",
"em0006",
131 for(
G4int i=0;i<Ncouple;i++)
138 if(
material->GetNumberOfElements()>1)
continue;
158 eFullFileNameZ.str(
"");
159 eFullFileNameZ.clear(stringstream::goodbit);
163 <<
"/dna/sigmadiff_cumulated_ionisation_e_RBEBV_Z"
165 std::ifstream eDiffCrossSectionZ(eFullFileNameZ.str().c_str());
166 if (!eDiffCrossSectionZ)
167 G4Exception(
"G4DNARelativisticIonisationModel::Initialise",
"em0003",
169 "Missing data file for cumulated DCS");
172 while(!eDiffCrossSectionZ.eof())
176 eDiffCrossSectionZ>>tDummy>>eDummy;
177 if (tDummy !=
eVecEZ[
Z].back())
204 "Error : No particle Definition is found in G4DNARelativisticIonisationModel"
211 G4cout <<
"Relativistic Ionisation model is initialized " <<
G4endl
242 "Calling CrossSectionPerVolume() of G4DNARelativisticIonisationModel"
251 if(
material->GetNumberOfElements()>1)
return 0.;
255 if(atomicNDensity!= 0.0)
264 G4cout <<
"__________________________________" <<
G4endl;
265 G4cout <<
"=== G4DNARelativisticIonisationModel - XS INFO START" <<
G4endl;
266 G4cout <<
"=== Kinetic energy (eV)=" << ekin/
eV <<
" particle : "
268 G4cout <<
"=== Cross section per atom for Z="<<z<<
" is (cm^2)"
270 G4cout <<
"=== Cross section per atom for Z="<<z<<
" is (cm^-1)="
271 << sigma*atomicNDensity/(1./
cm) <<
G4endl;
272 G4cout <<
"=== G4DNARelativisticIonisationModel - XS INFO END" <<
G4endl;
275 return sigma*atomicNDensity;
281 std::vector<G4DynamicParticle*>* fvect,
289 "Calling SampleSecondaries() of G4DNARelativisticIonisationModel"
303 G4double totalEnergy = k+particleMass;
304 G4double pSquare = k*(totalEnergy+particleMass);
305 G4double totalMomentum = std::sqrt(pSquare);
313 G4int NumSecParticlesInit =0;
314 G4int NumSecParticlesFinal=0;
319 NumSecParticlesInit = fvect->size();
321 NumSecParticlesFinal = fvect->size();
336 = totalMomentum*primaryDir.
x()- secondaryTotMomentum*ejectedDir.
x();
338 = totalMomentum*primaryDir.
y()- secondaryTotMomentum*ejectedDir.
y();
340 = totalMomentum*primaryDir.
z()- secondaryTotMomentum*ejectedDir.
z();
342 G4ThreeVector scatteredDir(finalMomentumX,finalMomentumY,finalMomentumZ);
353 for(
G4int iparticle=NumSecParticlesInit;
354 iparticle<NumSecParticlesFinal;iparticle++)
357 G4double Edeex = (*fvect)[iparticle]->GetKineticEnergy();
358 if(restEproduction>=Edeex){
359 restEproduction -= Edeex;
362 delete (*fvect)[iparticle];
363 (*fvect)[iparticle]=0;
366 if(restEproduction < 0.0){
367 G4Exception(
"G4DNARelativisticIonisationModel::SampleSecondaries()",
389 fvect->push_back(ejectedelectron);
395 G4int z,
const char* path)
401 "Calling LoadAtomicStates() of G4DNARelativisticIonisationModel"
404 const char *datadir = path;
407 datadir = getenv(
"G4LEDATA");
410 G4Exception(
"G4DNARelativisticIonisationModel::LoadAtomicStates()",
411 "em0002",
FatalException,
"Enviroment variable G4LEDATA not defined");
416 std::ostringstream targetfile;
417 targetfile << datadir <<
"/dna/atomicstate_Z"<< z <<
".dat";
418 std::ifstream fin(targetfile.str().c_str());
421 G4cout<<
" Error : "<< targetfile.str() <<
" is not found "<<
G4endl;
422 G4Exception(
"G4DNARelativisticIonisationModel::LoadAtomicStates()",
"em0002",
427 G4String buff0,buff1,buff2,buff3,buff4,buff5,buff6;
428 fin >> buff0 >>buff1>>buff2>>buff3>>buff4>>buff5>>buff6;
431 fin >> buff0 >>buff1>>buff2>>buff3>>buff4>>buff5>>buff6;
434 iState [z].push_back(stoi(buff0));
435 iShell [z].push_back(stoi(buff1));
438 Ebinding [z].push_back(stod(buff4));
450 Ekinetic [z].push_back(stod(buff5));
470 if(z!=79){
return 0.;}
472 size_t N=
iState[z].size();
493 if(particle==electronDef){
499 G4double beta_t2 = 1.-1./std::pow(1.+tdash,2);
500 G4double beta_u2 = 1.-1./std::pow(1.+udash,2);
501 G4double beta_b2 = 1.-1./std::pow(1.+bdash,2);
504 /(beta_t2+beta_b2))*
G4Log(beta_t2/beta_b2));
508 if(
Ebinding[z].at(level)<=kineticEnergy)
510 value =constS/((beta_t2+(beta_u2+beta_b2)/
iShell[z].at(level))*2.*bdash)
511 *(1./2.*(
G4Log(beta_t2/(1.-beta_t2))-beta_t2-
G4Log(2.*bdash))
512 *(1.-1./std::pow(t,2.))
513 +1.-1./t-
G4Log(t)/(t+1.)*(1.+2.*tdash)/(std::pow(1.+tdash/2.,2.))
514 *phi+std::pow(bdash,2)/(std::pow(1+tdash/2.,2))*(t-1)/2.);
536 if(particle==electronDef){
542 G4double beta_t2 = 1.-1./std::pow(1.+tdash,2);
543 G4double beta_u2 = 1.-1./std::pow(1.+udash,2);
544 G4double beta_b2 = 1.-1./std::pow(1.+bdash,2);
546 G4double phi = std::cos(std::sqrt(std::pow(
alpha,2)/(beta_t2+beta_b2))
547 *
G4Log(beta_t2/beta_b2));
551 if(secondaryEnergy<=((kineticEnergy-
Ebinding[z].at(level))/2.))
553 value = constS/((beta_t2+(beta_u2+beta_b2)/
iShell[z].at(level))*2.*bdash)
554 *(-phi/(t+1.)*(1./std::pow(w+1.,1.)+1./std::pow(t-w,1.))
555 *(1.+2*tdash)/std::pow(1.+tdash/2.,2.)
556 +1./std::pow(w+1.,2.)+1./std::pow(t-w,2.)
557 +std::pow(bdash,2)/std::pow(1+tdash/2.,2)
558 +(1./std::pow(w+1.,3.)+1./std::pow(t-w,3.))
559 *(
G4Log(beta_t2/(1.-beta_t2))-beta_t2-
G4Log(2*bdash)));
575 const size_t n(
iShell[z].size());
585 value += valuesBuffer[i];
595 if (valuesBuffer[i] > value)
597 delete[] valuesBuffer;
600 value -= valuesBuffer[i];
603 if (valuesBuffer)
delete[] valuesBuffer;
621 if(particle==electronDef){
623 if(maximumsecondaryEnergy<0.)
return 0.;
653 std::vector<G4double>::iterator k2
655 std::vector<G4double>::iterator k1 = k2-1;
660 std::vector<G4double>::iterator xs12 =
663 std::vector<G4double>::iterator xs11 = xs12-1;
665 std::vector<G4double>::iterator xs22 =
668 std::vector<G4double>::iterator xs21 = xs22-1;
683 valueXS21, valueXS22,
693 if(secondaryEnergy<0) secondaryEnergy=0;
694 return secondaryEnergy;
707 G4double dirX = sintheta*std::cos(phi);
708 G4double dirY = sintheta*std::sin(phi);
709 G4double dirZ = std::sqrt(1.-sintheta*sintheta);
726 if((xs1!=0)&&(
e1!=0)){
728 G4double a = (std::log10(xs2)-std::log10(xs1))
729 / (std::log10(
e2)-std::log10(
e1));
730 G4double b = std::log10(xs2) - a*std::log10(
e2);
731 G4double sigma = a*std::log10(e) + b;
732 value = (std::pow(10.,sigma));
757 =
Interpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
static const G4double e1[44]
static const G4double e2[44]
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static const G4double alpha
G4double G4Log(G4double x)
static constexpr double keV
static constexpr double eV
static constexpr double GeV
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
const std::vector< G4double > * GetNumMolPerVolTableFor(const G4Material *) const
Retrieve a table of molecular densities (number of molecules per unit volume) in the G4 unit system f...
static G4DNAMolecularMaterial * Instance()
DeauxDimensionVecMapZ eVecEjeEZ
std::vector< G4int > iShell[99]
std::map< G4int, std::vector< G4double > > eVecEZ
G4int RandomSelect(const G4Material *material, const G4ParticleDefinition *, G4double kineticEnergy)
QuadDimensionMapZ eDiffCrossSectionDataZ
G4double Interpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &= *(new G4DataVector()))
std::vector< G4int > iState[99]
virtual void LoadAtomicStates(G4int z, const char *path)
virtual ~G4DNARelativisticIonisationModel()
virtual G4double GetTotalCrossSection(const G4Material *material, const G4ParticleDefinition *, G4double kineticEnergy)
G4VAtomDeexcitation * fAtomDeexcitation
G4DNARelativisticIonisationModel(const G4ParticleDefinition *p=0, const G4String &nam="DNARelativisticIonisationModel")
TriDimensionVecMapZ eProbaShellMapZ
const G4ParticleDefinition * fParticleDefinition
const std::vector< G4double > * fMaterialDensity
G4ThreeVector GetEjectedElectronDirection(const G4ParticleDefinition *, G4double energy, G4double secondaryenergy)
std::vector< G4int > iSubShell[99]
std::vector< G4double > Nelectrons[99]
G4double fHighEnergyLimit
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
std::vector< G4double > Ekinetic[99]
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)
virtual G4double GetPartialCrossSection(const G4Material *material, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
virtual G4double GetDifferentialCrossSection(const G4Material *material, const G4ParticleDefinition *particle, G4double kineticEnergy, G4double secondaryEnergy, G4int level)
G4double GetEjectedElectronEnergy(const G4Material *material, const G4ParticleDefinition *, G4double energy, G4int shell)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
std::vector< G4double > Ebinding[99]
G4ParticleChangeForGamma * fParticleChangeForGamma
QuadDimensionMapZ eEjectedEnergyDataZ
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * ElectronDefinition()
static G4Electron * Electron()
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
const G4Material * GetMaterial() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4double GetPDGMass() const
const G4String & GetParticleName() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetDeexcitationFlag(G4bool val)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double electron_mass_c2
static constexpr double hbar_Planck
static constexpr double Bohr_radius
static constexpr double epsilon0
static constexpr double pi
G4double energy(const ThreeVector &p, const G4double m)