62 G4Exception(
"G4ecpssrBaseKxsModel::G4ecpssrBaseKxsModel()",
"em0006",
FatalException,
"G4LEDATA environment variable not set" );
66 std::ostringstream fileName;
67 fileName << path <<
"/pixe/uf/FK.dat";
68 std::ifstream FK(fileName.str().c_str());
73 dummyVec.push_back(0.);
83 if (x != dummyVec.back())
85 dummyVec.push_back(x);
86 aVecMap[x].push_back(-1.);
91 if (y != aVecMap[x].back()) aVecMap[x].push_back(y);
135 const G4int maxit= 100;
139 if (n<0 || x<0.0 || (x==0.0 && (n==0 || n==1))) {
140 G4cout <<
"*** WARNING in G4ecpssrBaseKxsModel::ExpIntFunction: bad arguments in ExpIntFunction" <<
G4endl;
144 if (n==0) ans=
G4Exp(-x)/x;
146 if (x==0.0) ans=1.0/nm1;
153 for (i=1;i<=maxit;i++) {
160 if (std::fabs(del-1.0) < eps) {
166 ans = (nm1!=0 ? 1.0/nm1 : -std::log(x)-euler);
168 for (i=1;i<=maxit;i++) {
170 if (i !=nm1) del = -fact/(i-nm1);
173 for (ii=1;ii<=nm1;ii++) psi +=1.0/ii;
174 del=fact*(-std::log(x)+psi);
177 if (std::fabs(del) < std::fabs(ans)*eps)
return ans;
212 G4cout <<
"*** WARNING in G4ecpssrBaseKxsModel::CalculateCrossSection : we can treat only Proton or Alpha incident particles " <<
G4endl;
217 if (verboseLevel>0)
G4cout <<
" massIncident=" << massIncident<<
G4endl;
221 if (verboseLevel>0)
G4cout <<
" kBindingEnergy=" << kBindingEnergy/eV<<
G4endl;
225 if (verboseLevel>0)
G4cout <<
" massTarget=" << massTarget<<
G4endl;
227 G4double systemMass =((massIncident*massTarget)/(massIncident+massTarget))/electron_mass_c2;
229 if (verboseLevel>0)
G4cout <<
" systemMass=" << systemMass<<
G4endl;
234 G4double screenedzTarget = zTarget-zkshell;
237 constexpr G4double rydbergMeV= 13.6056923e-6;
239 G4double tetaK = kBindingEnergy/((screenedzTarget*screenedzTarget)*rydbergMeV);
242 if (verboseLevel>0)
G4cout <<
" tetaK=" << tetaK<<
G4endl;
244 G4double velocity =(2./(tetaK*screenedzTarget))*std::pow(((energyIncident*electron_mass_c2)/(massIncident*rydbergMeV)),0.5);
249 if (verboseLevel>0)
G4cout <<
" velocity=" << velocity<<
G4endl;
251 const G4double bohrPow2Barn=(Bohr_radius*Bohr_radius)/barn ;
253 if (verboseLevel>0)
G4cout <<
" bohrPow2Barn=" << bohrPow2Barn<<
G4endl;
255 G4double sigma0 = 8.*pi*(zIncident*zIncident)*bohrPow2Barn*std::pow(screenedzTarget,-4.);
259 if (verboseLevel>0)
G4cout <<
" sigma0=" << sigma0<<
G4endl;
261 const G4double kAnalyticalApproximation= 1.5;
262 G4double x = kAnalyticalApproximation/velocity;
273 if ((0.< x) && (x <= 0.035))
275 electrIonizationEnergy= 0.75*pi*(std::log(1./(x*x))-1.);
279 if ( (0.035 < x) && (x <=3.))
281 electrIonizationEnergy =
G4Exp(-2.*x)/(0.031+(0.213*std::pow(x,0.5))+(0.005*x)-(0.069*std::pow(x,3./2.))+(0.324*x*x));
286 if ( (3.< x) && (x<=11.))
288 electrIonizationEnergy =2.*
G4Exp(-2.*x)/std::pow(x,1.6);
291 else electrIonizationEnergy =0.;
295 if (verboseLevel>0)
G4cout <<
" electrIonizationEnergy=" << electrIonizationEnergy<<
G4endl;
297 G4double hFunction =(electrIonizationEnergy*2.)/(tetaK*std::pow(velocity,3));
300 if (verboseLevel>0)
G4cout <<
" hFunction=" << hFunction<<
G4endl;
302 G4double gFunction = (1.+(9.*velocity)+(31.*velocity*velocity)+(98.*std::pow(velocity,3.))+(12.*std::pow(velocity,4.))+(25.*std::pow(velocity,5.))
303 +(4.2*std::pow(velocity,6.))+(0.515*std::pow(velocity,7.)))/std::pow(1.+velocity,9.);
306 if (verboseLevel>0)
G4cout <<
" gFunction=" << gFunction<<
G4endl;
310 G4double sigmaPSS = 1.+(((2.*zIncident)/(screenedzTarget*tetaK))*(gFunction-hFunction));
315 if (verboseLevel>0)
G4cout <<
" sigmaPSS=" << sigmaPSS<<
G4endl;
317 if (verboseLevel>0)
G4cout <<
" sigmaPSS*tetaK=" << sigmaPSS*tetaK<<
G4endl;
321 const G4double cNaturalUnit= 1/fine_structure_const;
323 if (verboseLevel>0)
G4cout <<
" cNaturalUnit=" << cNaturalUnit<<
G4endl;
325 G4double ykFormula=0.4*(screenedzTarget/cNaturalUnit)*(screenedzTarget/cNaturalUnit)/(velocity/sigmaPSS);
330 if (verboseLevel>0)
G4cout <<
" ykFormula=" << ykFormula<<
G4endl;
332 G4double relativityCorrection = std::pow((1.+(1.1*ykFormula*ykFormula)),0.5)+ykFormula;
336 if (verboseLevel>0)
G4cout <<
" relativityCorrection=" << relativityCorrection<<
G4endl;
338 G4double reducedVelocity = velocity*std::pow(relativityCorrection,0.5);
343 if (verboseLevel>0)
G4cout <<
" reducedVelocity=" << reducedVelocity<<
G4endl;
345 G4double etaOverTheta2 = (energyIncident*electron_mass_c2)/(massIncident*rydbergMeV*screenedzTarget*screenedzTarget)
346 /(sigmaPSS*tetaK)/(sigmaPSS*tetaK);
350 if (verboseLevel>0)
G4cout <<
" etaOverTheta2=" << etaOverTheta2<<
G4endl;
363 if (verboseLevel>0)
G4cout <<
" Notice : FK is computed from low velocity formula" <<
G4endl;
365 universalFunction = (std::pow(2.,9.)/45.)*std::pow(reducedVelocity/sigmaPSS,8.)*std::pow((1.+(1.72*(reducedVelocity/sigmaPSS)*(reducedVelocity/sigmaPSS))),-4.);
368 if (verboseLevel>0)
G4cout <<
" universalFunction by Brandt 1981 =" << universalFunction<<
G4endl;
374 if ( etaOverTheta2 > 86.6 && (sigmaPSS*tetaK) > 0.4 && (sigmaPSS*tetaK) < 2.9996 )
378 if (verboseLevel>0)
G4cout <<
" Notice : FK is computed from high velocity formula" <<
G4endl;
380 if (verboseLevel>0)
G4cout <<
" sigmaPSS*tetaK=" << sigmaPSS*tetaK <<
G4endl;
390 G4double etaK = (energyIncident*electron_mass_c2)/(massIncident*rydbergMeV*screenedzTarget*screenedzTarget);
393 if (verboseLevel>0)
G4cout <<
" etaK=" << etaK <<
G4endl;
395 G4double etaT = (sigmaPSS*tetaK)*(sigmaPSS*tetaK)*(86.6);
398 if (verboseLevel>0)
G4cout <<
" etaT=" << etaT <<
G4endl;
400 G4double fKT = FunctionFK((sigmaPSS*tetaK),86.6)*(etaT/(sigmaPSS*tetaK));
403 if (FunctionFK((sigmaPSS*tetaK),86.6)<=0.)
406 "*** WARNING in G4ecpssrBaseKxsModel::CalculateCrossSection : unable to interpolate FK function in high velocity region ! ***" <<
G4endl;
410 if (verboseLevel>0)
G4cout <<
" FunctionFK=" << FunctionFK((sigmaPSS*tetaK),86.6) <<
G4endl;
430 G4double universalFunction3= fKK/(etaK/tetaK);
433 if (verboseLevel>0)
G4cout <<
" universalFunction3=" << universalFunction3 <<
G4endl;
435 universalFunction=universalFunction3;
438 else if ( etaOverTheta2 >= 1.e-3 && etaOverTheta2 <= 86.6 && (sigmaPSS*tetaK) >= 0.4 && (sigmaPSS*tetaK) <= 2.9996 )
442 if (verboseLevel>0)
G4cout <<
" Notice : FK is computed from INTERPOLATED data" <<
G4endl;
444 G4double universalFunction2 = FunctionFK((sigmaPSS*tetaK),etaOverTheta2);
446 if (universalFunction2<=0)
449 "*** WARNING : G4ecpssrBaseKxsModel::CalculateCrossSection is unable to interpolate FK function in medium velocity region ! ***" <<
G4endl;
453 if (verboseLevel>0)
G4cout <<
" universalFunction2=" << universalFunction2 <<
" for theta=" << sigmaPSS*tetaK <<
" and etaOverTheta2=" << etaOverTheta2 <<
G4endl;
455 universalFunction=universalFunction2;
462 G4double sigmaPSSR = (sigma0/(sigmaPSS*tetaK))*universalFunction;
465 if (verboseLevel>0)
G4cout <<
" sigmaPSSR=" << sigmaPSSR<<
G4endl;
469 G4double pssDeltaK = (4./(systemMass*sigmaPSS*tetaK))*(sigmaPSS/velocity)*(sigmaPSS/velocity);
473 if (verboseLevel>0)
G4cout <<
" pssDeltaK=" << pssDeltaK<<
G4endl;
475 if (pssDeltaK>1)
return 0.;
477 G4double energyLoss = std::pow(1-pssDeltaK,0.5);
481 if (verboseLevel>0)
G4cout <<
" energyLoss=" << energyLoss<<
G4endl;
483 G4double energyLossFunction = (std::pow(2.,-9)/8.)*((((9.*energyLoss)-1.)*std::pow(1.+energyLoss,9.))+(((9.*energyLoss)+1.)*std::pow(1.-energyLoss,9.)));
487 if (verboseLevel>0)
G4cout <<
" energyLossFunction=" << energyLossFunction<<
G4endl;
491 G4double coulombDeflection = (4.*pi*zIncident/systemMass)*std::pow(tetaK*sigmaPSS,-2.)*std::pow(velocity/sigmaPSS,-3.)*(zTarget/screenedzTarget);
494 if (verboseLevel>0)
G4cout <<
" cParameter-short=" << coulombDeflection<<
G4endl;
496 G4double cParameter = 2.*coulombDeflection/(energyLoss*(energyLoss+1.));
499 if (verboseLevel>0)
G4cout <<
" cParameter-full=" << cParameter<<
G4endl;
506 if (verboseLevel>0)
G4cout <<
" coulombDeflectionFunction =" << coulombDeflectionFunction <<
G4endl;
512 crossSection = energyLossFunction* coulombDeflectionFunction*sigmaPSSR;
518 if (crossSection >= 0) {
519 return crossSection * barn;
563 auto t2 = std::upper_bound(dummyVec.begin(),dummyVec.end(), k);
566 auto e12 = std::upper_bound(aVecMap[(*t1)].begin(),aVecMap[(*t1)].end(), theta);
569 auto e22 = std::upper_bound(aVecMap[(*t2)].begin(),aVecMap[(*t2)].end(), theta);
579 xs11 = FKData[valueT1][valueE11];
580 xs12 = FKData[valueT1][valueE12];
581 xs21 = FKData[valueT2][valueE21];
582 xs22 = FKData[valueT2][valueE22];
584 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
586 if (xs11==0 || xs12==0 ||xs21==0 ||xs22==0)
return (0.);
590 sigma = QuadInterpolator( valueE11, valueE12,
623 G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(e2)-std::log10(e1));
624 G4double b = std::log10(xs2) - a*std::log10(e2);
625 G4double sigma = a*std::log10(e) + b;
626 G4double value = (std::pow(10.,sigma));
640 G4double interpolatedvalue1 = LogLogInterpolate(e11, e12, e, xs11, xs12);
641 G4double interpolatedvalue2 = LogLogInterpolate(e21, e22, e, xs21, xs22);
642 G4double value = LogLogInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
void print(G4double elem)
G4GLOB_DLL std::ostream G4cout
G4double BindingEnergy() const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
static G4AtomicTransitionManager * Instance()
virtual G4bool LoadData(const G4String &argFileName)
virtual G4double FindValue(G4double e, G4int componentId=0) const
static G4NistManager * Instance()
G4double GetAtomicMassAmu(const G4String &symb) const
G4double GetPDGMass() const
G4double GetPDGCharge() const
static G4Proton * Proton()
G4double CalculateCrossSection(G4int, G4double, G4double) override
G4double ExpIntFunction(G4int n, G4double x)