64 path = getenv(
"G4LEDATA");
67 G4Exception(
"G4ecpssrBaseKxsModel::G4ecpssrBaseKxsModel()",
"em0006",
FatalException,
"G4LEDATA environment variable not set" );
71 std::ostringstream fileName;
72 fileName << path <<
"/pixe/uf/FK.dat";
73 std::ifstream FK(fileName.str().c_str());
78 dummyVec.push_back(0.);
88 if (x != dummyVec.back())
90 dummyVec.push_back(x);
91 aVecMap[x].push_back(-1.);
96 if (y != aVecMap[x].back()) aVecMap[x].push_back(y);
143 const G4int maxit= 100;
147 if (n<0 || x<0.0 || (x==0.0 && (n==0 || n==1))) {
148 G4cout <<
"*** WARNING in G4ecpssrBaseKxsModel::ExpIntFunction: bad arguments in ExpIntFunction" <<
G4endl;
152 if (n==0) ans=
G4Exp(-x)/x;
154 if (x==0.0) ans=1.0/nm1;
161 for (i=1;i<=maxit;i++) {
168 if (std::fabs(del-1.0) <
eps) {
174 ans = (nm1!=0 ? 1.0/nm1 : -std::log(x)-euler);
176 for (i=1;i<=maxit;i++) {
178 if (i !=nm1) del = -fact/(i-nm1);
181 for (ii=1;ii<=nm1;ii++) psi +=1.0/ii;
182 del=fact*(-std::log(x)+psi);
185 if (std::fabs(del) < std::fabs(ans)*
eps)
return ans;
223 G4cout <<
"*** WARNING in G4ecpssrBaseKxsModel::CalculateCrossSection : we can treat only Proton or Alpha incident particles " <<
G4endl;
228 if (verboseLevel>0)
G4cout <<
" massIncident=" << massIncident<<
G4endl;
232 if (verboseLevel>0)
G4cout <<
" kBindingEnergy=" << kBindingEnergy/
eV<<
G4endl;
236 if (verboseLevel>0)
G4cout <<
" massTarget=" << massTarget<<
G4endl;
240 if (verboseLevel>0)
G4cout <<
" systemMass=" << systemMass<<
G4endl;
245 G4double screenedzTarget = zTarget-zkshell;
248 const G4double rydbergMeV= 13.6056923e-6;
250 G4double tetaK = kBindingEnergy/((screenedzTarget*screenedzTarget)*rydbergMeV);
253 if (verboseLevel>0)
G4cout <<
" tetaK=" << tetaK<<
G4endl;
255 G4double velocity =(2./(tetaK*screenedzTarget))*std::pow(((energyIncident*
electron_mass_c2)/(massIncident*rydbergMeV)),0.5);
260 if (verboseLevel>0)
G4cout <<
" velocity=" << velocity<<
G4endl;
264 if (verboseLevel>0)
G4cout <<
" bohrPow2Barn=" << bohrPow2Barn<<
G4endl;
266 G4double sigma0 = 8.*
pi*(zIncident*zIncident)*bohrPow2Barn*std::pow(screenedzTarget,-4.);
270 if (verboseLevel>0)
G4cout <<
" sigma0=" << sigma0<<
G4endl;
272 const G4double kAnalyticalApproximation= 1.5;
273 G4double x = kAnalyticalApproximation/velocity;
284 if ((0.< x) && (x <= 0.035))
286 electrIonizationEnergy= 0.75*
pi*(std::log(1./(x*x))-1.);
290 if ( (0.035 < x) && (x <=3.))
292 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));
297 if ( (3.< x) && (x<=11.))
299 electrIonizationEnergy =2.*
G4Exp(-2.*x)/std::pow(x,1.6);
302 else electrIonizationEnergy =0.;
306 if (verboseLevel>0)
G4cout <<
" electrIonizationEnergy=" << electrIonizationEnergy<<
G4endl;
308 G4double hFunction =(electrIonizationEnergy*2.)/(tetaK*std::pow(velocity,3));
311 if (verboseLevel>0)
G4cout <<
" hFunction=" << hFunction<<
G4endl;
313 G4double gFunction = (1.+(9.*velocity)+(31.*velocity*velocity)+(98.*std::pow(velocity,3.))+(12.*std::pow(velocity,4.))+(25.*std::pow(velocity,5.))
314 +(4.2*std::pow(velocity,6.))+(0.515*std::pow(velocity,7.)))/std::pow(1.+velocity,9.);
317 if (verboseLevel>0)
G4cout <<
" gFunction=" << gFunction<<
G4endl;
321 G4double sigmaPSS = 1.+(((2.*zIncident)/(screenedzTarget*tetaK))*(gFunction-hFunction));
326 if (verboseLevel>0)
G4cout <<
" sigmaPSS=" << sigmaPSS<<
G4endl;
328 if (verboseLevel>0)
G4cout <<
" sigmaPSS*tetaK=" << sigmaPSS*tetaK<<
G4endl;
334 if (verboseLevel>0)
G4cout <<
" cNaturalUnit=" << cNaturalUnit<<
G4endl;
336 G4double ykFormula=0.4*(screenedzTarget/cNaturalUnit)*(screenedzTarget/cNaturalUnit)/(velocity/sigmaPSS);
341 if (verboseLevel>0)
G4cout <<
" ykFormula=" << ykFormula<<
G4endl;
343 G4double relativityCorrection = std::pow((1.+(1.1*ykFormula*ykFormula)),0.5)+ykFormula;
347 if (verboseLevel>0)
G4cout <<
" relativityCorrection=" << relativityCorrection<<
G4endl;
349 G4double reducedVelocity = velocity*std::pow(relativityCorrection,0.5);
354 if (verboseLevel>0)
G4cout <<
" reducedVelocity=" << reducedVelocity<<
G4endl;
356 G4double etaOverTheta2 = (energyIncident*
electron_mass_c2)/(massIncident*rydbergMeV*screenedzTarget*screenedzTarget)
357 /(sigmaPSS*tetaK)/(sigmaPSS*tetaK);
361 if (verboseLevel>0)
G4cout <<
" etaOverTheta2=" << etaOverTheta2<<
G4endl;
374 if (verboseLevel>0)
G4cout <<
" Notice : FK is computed from low velocity formula" <<
G4endl;
376 universalFunction = (std::pow(2.,9.)/45.)*std::pow(reducedVelocity/sigmaPSS,8.)*std::pow((1.+(1.72*(reducedVelocity/sigmaPSS)*(reducedVelocity/sigmaPSS))),-4.);
379 if (verboseLevel>0)
G4cout <<
" universalFunction by Brandt 1981 =" << universalFunction<<
G4endl;
387 if ( etaOverTheta2 > 86.6 && (sigmaPSS*tetaK) > 0.4 && (sigmaPSS*tetaK) < 2.9996 )
391 if (verboseLevel>0)
G4cout <<
" Notice : FK is computed from high velocity formula" <<
G4endl;
393 if (verboseLevel>0)
G4cout <<
" sigmaPSS*tetaK=" << sigmaPSS*tetaK <<
G4endl;
406 if (verboseLevel>0)
G4cout <<
" etaK=" << etaK <<
G4endl;
408 G4double etaT = (sigmaPSS*tetaK)*(sigmaPSS*tetaK)*(86.6);
411 if (verboseLevel>0)
G4cout <<
" etaT=" << etaT <<
G4endl;
413 G4double fKT = FunctionFK((sigmaPSS*tetaK),86.6)*(etaT/(sigmaPSS*tetaK));
416 if (FunctionFK((sigmaPSS*tetaK),86.6)<=0.)
419 "*** WARNING in G4ecpssrBaseKxsModel::CalculateCrossSection : unable to interpolate FK function in high velocity region ! ***" <<
G4endl;
423 if (verboseLevel>0)
G4cout <<
" FunctionFK=" << FunctionFK((sigmaPSS*tetaK),86.6) <<
G4endl;
427 G4double GK = C2/(4*etaK) + C3/(32*etaK*etaK);
431 G4double GT = C2/(4*etaT) + C3/(32*etaT*etaT);
439 G4double fKK = C1*std::log(etaK) + DT - GK;
443 G4double universalFunction3= fKK/(etaK/tetaK);
446 if (verboseLevel>0)
G4cout <<
" universalFunction3=" << universalFunction3 <<
G4endl;
448 universalFunction=universalFunction3;
452 else if ( etaOverTheta2 >= 1.e-3 && etaOverTheta2 <= 86.6 && (sigmaPSS*tetaK) >= 0.4 && (sigmaPSS*tetaK) <= 2.9996 )
457 if (verboseLevel>0)
G4cout <<
" Notice : FK is computed from INTERPOLATED data" <<
G4endl;
459 G4double universalFunction2 = FunctionFK((sigmaPSS*tetaK),etaOverTheta2);
461 if (universalFunction2<=0)
464 "*** WARNING : G4ecpssrBaseKxsModel::CalculateCrossSection is unable to interpolate FK function in medium velocity region ! ***" <<
G4endl;
468 if (verboseLevel>0)
G4cout <<
" universalFunction2=" << universalFunction2 <<
" for theta=" << sigmaPSS*tetaK <<
" and etaOverTheta2=" << etaOverTheta2 <<
G4endl;
470 universalFunction=universalFunction2;
477 G4double sigmaPSSR = (sigma0/(sigmaPSS*tetaK))*universalFunction;
480 if (verboseLevel>0)
G4cout <<
" sigmaPSSR=" << sigmaPSSR<<
G4endl;
484 G4double pssDeltaK = (4./(systemMass*sigmaPSS*tetaK))*(sigmaPSS/velocity)*(sigmaPSS/velocity);
488 if (verboseLevel>0)
G4cout <<
" pssDeltaK=" << pssDeltaK<<
G4endl;
490 if (pssDeltaK>1)
return 0.;
492 G4double energyLoss = std::pow(1-pssDeltaK,0.5);
496 if (verboseLevel>0)
G4cout <<
" energyLoss=" << energyLoss<<
G4endl;
498 G4double energyLossFunction = (std::pow(2.,-9)/8.)*((((9.*energyLoss)-1.)*std::pow(1.+energyLoss,9.))+(((9.*energyLoss)+1.)*std::pow(1.-energyLoss,9.)));
502 if (verboseLevel>0)
G4cout <<
" energyLossFunction=" << energyLossFunction<<
G4endl;
506 G4double coulombDeflection = (4.*
pi*zIncident/systemMass)*std::pow(tetaK*sigmaPSS,-2.)*std::pow(velocity/sigmaPSS,-3.)*(zTarget/screenedzTarget);
509 if (verboseLevel>0)
G4cout <<
" cParameter-short=" << coulombDeflection<<
G4endl;
511 G4double cParameter = 2.*coulombDeflection/(energyLoss*(energyLoss+1.));
514 if (verboseLevel>0)
G4cout <<
" cParameter-full=" << cParameter<<
G4endl;
521 if (verboseLevel>0)
G4cout <<
" coulombDeflectionFunction =" << coulombDeflectionFunction <<
G4endl;
527 crossSection = energyLossFunction* coulombDeflectionFunction*sigmaPSSR;
533 if (crossSection >= 0) {
534 return crossSection *
barn;
578 std::vector<double>::iterator t2 = std::upper_bound(dummyVec.begin(),dummyVec.end(), k);
579 std::vector<double>::iterator t1 = t2-1;
581 std::vector<double>::iterator e12 = std::upper_bound(aVecMap[(*t1)].begin(),aVecMap[(*t1)].end(), theta);
582 std::vector<double>::iterator e11 = e12-1;
584 std::vector<double>::iterator e22 = std::upper_bound(aVecMap[(*t2)].begin(),aVecMap[(*t2)].end(), theta);
585 std::vector<double>::iterator e21 = e22-1;
594 xs11 = FKData[valueT1][valueE11];
595 xs12 = FKData[valueT1][valueE12];
596 xs21 = FKData[valueT2][valueE21];
597 xs22 = FKData[valueT2][valueE22];
627 G4double xsProduct = xs11 * xs12 * xs21 * xs22;
629 if (xs11==0 || xs12==0 ||xs21==0 ||xs22==0)
return (0.);
633 sigma = QuadInterpolator( valueE11, valueE12,
666 G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(e2)-std::log10(e1));
667 G4double b = std::log10(xs2) - a*std::log10(e2);
668 G4double sigma = a*std::log10(e) + b;
669 G4double value = (std::pow(10.,sigma));
683 G4double interpolatedvalue1 = LogLogInterpolate(e11, e12, e, xs11, xs12);
684 G4double interpolatedvalue2 = LogLogInterpolate(e21, e22, e, xs21, xs22);
685 G4double value = LogLogInterpolate(t1, t2, t, interpolatedvalue1, interpolatedvalue2);
static constexpr double Bohr_radius
static const G4double eps
G4double BindingEnergy() const
static G4NistManager * Instance()
static constexpr double electron_mass_c2
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
static constexpr double eplus
virtual G4double FindValue(G4double e, G4int componentId=0) const
static G4Proton * Proton()
static constexpr double eV
static constexpr double amu_c2
G4double CalculateCrossSection(G4int, G4double, G4double)
G4double ExpIntFunction(G4int n, G4double x)
void print(G4double elem)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double GetPDGMass() const
G4double GetAtomicMassAmu(const G4String &symb) const
static constexpr double pi
static constexpr double fine_structure_const
static constexpr double barn
G4double GetPDGCharge() const
static G4AtomicTransitionManager * Instance()
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
virtual G4bool LoadData(const G4String &argFileName)