109 G4cout <<
"MicroElec Elastic model is constructed " <<
G4endl
128 TCSMap::iterator pos2;
130 MapData* tableData = pos2->second;
131 std::map< G4String, G4MicroElecCrossSectionDataSet_new*, std::less<G4String> >::iterator
pos;
132 for (
pos = tableData->begin();
pos != tableData->end(); ++
pos)
142 ThetaMap::iterator iterator_angle;
145 eDiffCrossSectionData->clear();
146 delete eDiffCrossSectionData;
149 energyMap::iterator iterator_energy;
151 std::vector<G4double>* eTdummyVec = iterator_energy->second;
156 ProbaMap::iterator iterator_proba;
158 VecMap* eVecm = iterator_proba->second;
173 G4cout <<
"Calling G4MicroElecElasticModel_new::Initialise()" <<
G4endl;
183 for (
G4int i = 0; i < numOfCouples; ++i) {
189 G4cout <<
"MicroElasticModel, Material " << i + 1 <<
" / " << numOfCouples <<
" : " <<
material->GetName() <<
G4endl;
190 if (
material->GetName() ==
"Vacuum")
continue;
203 G4String fileElectron =
"Elastic/elsepa_elastic_cross_e_" + matName;
204 G4cout <<
"Elastic Total Cross file : " << fileElectron <<
G4endl;
214 tableData->insert(make_pair(
electron, tableE));
218 char *path = std::getenv(
"G4LEDATA");
226 std::ostringstream eFullFileName;
227 eFullFileName << path <<
"/microelec/Elastic/elsepa_elastic_cumulated_diffcross_e_" + matName +
".dat";
228 G4cout <<
"Elastic Cumulated Diff Cross : " << eFullFileName.str().c_str() <<
G4endl;
229 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
231 if (!eDiffCrossSection)
232 G4Exception(
"G4MicroElecElasticModel_new::Initialise",
"em0003",
FatalException,
"Missing data file: /microelec/sigmadiff_cumulated_elastic_e_Si.dat");
238 std::vector<G4double>* eTdummyVec =
new std::vector<G4double>;
241 eTdummyVec->push_back(0.);
243 while (!eDiffCrossSection.eof())
247 eDiffCrossSection >> tDummy >> eProb;
250 if (tDummy != eTdummyVec->back())
252 eTdummyVec->push_back(tDummy);
253 (*eProbVec)[tDummy].push_back(0.);
256 eDiffCrossSection >> (*eDiffCrossSectionData)[tDummy][eProb];
258 if (eProb != (*eProbVec)[tDummy].back()) {
259 (*eProbVec)[tDummy].push_back(eProb);
272 G4cout <<
"Loaded cross section files for MicroElec Elastic model" <<
G4endl;
276 G4cout <<
"MicroElec Elastic model is initialized " <<
G4endl
298 G4cout <<
"Calling CrossSectionPerVolume() of G4MicroElecElasticModel" <<
G4endl;
305 MapEnergy::iterator lowEPos;
308 MapEnergy::iterator highEPos;
311 MapEnergy::iterator killEPos;
358 TCSMap::iterator tablepos;
363 MapData* tableData = tablepos->second;
367 std::map< G4String, G4MicroElecCrossSectionDataSet_new*, std::less<G4String> >::iterator
pos;
368 pos = tableData->find(particleName);
370 if (
pos != tableData->end())
380 G4Exception(
"G4MicroElecElasticModel_new::ComputeCrossSectionPerVolume",
"em0002",
FatalException,
"Model not applicable to particle type.");
395 G4cout <<
" - Cross section per Si atom (cm^2)=" << sigma /
cm /
cm <<
G4endl;
396 G4cout <<
" - Cross section per Si atom (cm^-1)=" << sigma*density / (1. /
cm) <<
G4endl;
398 return sigma*density;
419 G4double D = (2 / (std::sqrt(2) * std::pow(
pi, 2) * std::pow(h, 3))) * (1 + 2 * E) * std::pow(m0, 1.5) * std::sqrt(E);
423 Ebz = (std::pow(h, 2) * std::pow(kbz, 2)) / (2 * m0),
425 nbz = 1.0 / (exp(hwbz / (kb * T)) - 1),
430 Pac = ((
pi * kb * T) / (h * std::pow(cs, 2) * rho)) * (std::pow(Eac, 2) *
D) / (1 + (E / Aac));
435 Pac = ((2 *
pi * m0 * (2 * nbz + 1)) / (h * rho * hwbz)) * std::pow(Eac, 2) *
D * E * 2 * std::pow((Aac / E), 2) * (((-E / Aac) / (1 + (E / Aac))) + log(1 + (E / Aac)));
439 G4double fEbz = ((2 *
pi * m0 * (2 * nbz + 1)) / (h * rho * hwbz)) * std::pow(Eac, 2) *
D * Ebz * 2 * std::pow((Aac / Ebz), 2) * (((-Ebz / Aac) / (1 + (Ebz / Aac))) + log(1 + (Ebz / Aac)));
440 G4double fEbz4 = ((
pi * kb * T) / (h * std::pow(cs, 2) * rho)) * (std::pow(Eac, 2) *
D) / (1 + ((Ebz / 4) / Aac));
445 G4double MFP = (std::sqrt(2 * E / m0) / (prefactor * Pac)) *
m;
461 G4cout <<
"Calling SampleSecondaries() of G4MicroElecElasticModel" <<
G4endl;
491 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
493 xDir *= std::cos(phi);
494 yDir *= std::sin(phi);
496 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
515 k_d=0.1334*std::pow(Z2,(2./3.))*std::pow(M2,(-1./2.));
516 epsilon_d=0.01014*std::pow(Z2,(-7./3.))*(T/
eV);
517 g_epsilon_d= epsilon_d+0.40244*std::pow(epsilon_d,(3./4.))+3.4008*std::pow(epsilon_d,(1./6.));
519 E_nu=1./(1.+ k_d*g_epsilon_d);
544 ThetaMap::iterator iterator_angle;
547 energyMap::iterator iterator_energy;
550 ProbaMap::iterator iterator_proba;
556 std::vector<G4double>* eTdummyVec = iterator_energy->second;
557 VecMap* eVecm = iterator_proba->second;
559 auto t2 = std::upper_bound(eTdummyVec->begin(), eTdummyVec->end(), k);
561 auto e12 = std::upper_bound((*eVecm)[(*t1)].begin(), (*eVecm)[(*t1)].end(), integrDiff);
563 auto e22 = std::upper_bound((*eVecm)[(*t2)].begin(), (*eVecm)[(*t2)].end(), integrDiff);
573 xs11 = (*eDiffCrossSectionData)[valueT1][valueE11];
574 xs12 = (*eDiffCrossSectionData)[valueT1][valueE12];
575 xs21 = (*eDiffCrossSectionData)[valueT2][valueE21];
576 xs22 = (*eDiffCrossSectionData)[valueT2][valueE22];
587 if (xs11==0 || xs12==0 ||xs21==0 ||xs22==0)
return (0.);
635 G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(
e2)-std::log10(
e1));
636 G4double b = std::log10(xs2) - a*std::log10(
e2);
637 G4double sigma = a*std::log10(e) + b;
638 G4double value = (std::pow(10.,sigma));
673 cosTheta= std::cos(theta*
pi/180.);
687 G4Exception (
"*** WARNING : the G4MicroElecElasticModel class is not validated below 5 eV !",
"",
JustWarning,
"") ;
static const G4double e1[44]
static const G4double e2[44]
G4double D(G4double temp)
static const G4double pos
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
static const G4double alpha
static constexpr double m
static constexpr double keV
static constexpr double eV
static constexpr double MeV
static constexpr double pi
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * ElectronDefinition()
const G4Material * GetMaterial() const
G4bool LoadData(const G4String &argFileName) override
G4double FindValue(G4double e, G4int componentId=0) const override
MapEnergy highEnergyLimitTable
std::map< G4double, std::map< G4double, G4double > > TriDimensionMap
ThetaMap thetaDataStorage
G4bool acousticModelEnabled
MapEnergy workFunctionTable
G4double AcousticCrossSectionPerVolume(G4double ekin, G4double kbz, G4double rho, G4double cs, G4double Aac, G4double Eac, G4double prefactor)
void SetKillBelowThreshold(G4double threshold)
~G4MicroElecElasticModel_new() override
G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4MicroElecElasticModel_new(const G4ParticleDefinition *p=0, const G4String &nam="MicroElecElasticModel")
std::map< G4double, std::vector< G4double > > VecMap
void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4bool isOkToBeInitialised
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4double DamageEnergy(G4double T, G4double A, G4double Z)
std::map< G4String, G4MicroElecCrossSectionDataSet_new *, std::less< G4String > > MapData
G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax) override
G4double RandomizeCosTheta(G4double k)
MapEnergy lowEnergyLimitTable
G4String currentMaterialName
G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
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)
G4MicroElecMaterialStructure * currentMaterialStructure
G4double Theta(G4ParticleDefinition *aParticleDefinition, G4double k, G4double integrDiff)
G4ParticleChangeForGamma * fParticleChangeForGamma
G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4double lowEnergyLimitOfModel
energyMap eIncidentEnergyStorage
G4double GetElasticModelHighLimit()
G4double GetElasticModelLowLimit()
G4double GetWorkFunction()
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
static constexpr double eV