Geant4-11
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4ElectroNuclearCrossSection Class Reference

#include <G4ElectroNuclearCrossSection.hh>

Inheritance diagram for G4ElectroNuclearCrossSection:
G4VCrossSectionDataSet

Public Member Functions

virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
bool ForAllAtomsAndEnergies () const
 
 G4ElectroNuclearCrossSection ()
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat)
 
G4double GetEquivalentPhotonEnergy ()
 
G4double GetEquivalentPhotonQ2 (G4double nu)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
G4double GetMaxKinEnergy () const
 
G4double GetMinKinEnergy () const
 
const G4StringGetName () const
 
virtual G4int GetVerboseLevel () const
 
G4double GetVirtualFactor (G4double nu, G4double Q2)
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
void SetForAllAtomsAndEnergies (G4bool val)
 
void SetMaxKinEnergy (G4double value)
 
void SetMinKinEnergy (G4double value)
 
void SetName (const G4String &nam)
 
virtual void SetVerboseLevel (G4int value)
 
virtual ~G4ElectroNuclearCrossSection ()
 

Static Public Member Functions

static const char * Default_Name ()
 

Protected Attributes

G4String name
 
G4int verboseLevel
 

Private Member Functions

G4double DFun (G4double x)
 
G4double Fun (G4double x)
 
G4int GetFunctions (G4double a, G4double *x, G4double *y, G4double *z)
 
G4double HighEnergyJ1 (G4double lE)
 
G4double HighEnergyJ2 (G4double lE, G4double E)
 
G4double HighEnergyJ3 (G4double lE, G4double E2)
 
G4double SolveTheEquation (G4double f)
 
G4double ThresholdEnergy (G4int Z, G4int N)
 

Private Attributes

std::vector< cacheEl_t * > cache
 
G4int currentN
 
G4int currentZ
 
G4bool isForAllAtomsAndEnergies
 
G4double lastE
 
G4double lastG
 
G4int lastL
 
G4double lastSig
 
cacheEl_tlastUsedCacheEl
 
G4int lastZ
 
G4double maxKinEnergy
 
G4double minKinEnergy
 
const G4double mNeut
 
const G4double mProt
 
G4NistManagernistmngr
 
G4CrossSectionDataSetRegistryregistry
 

Detailed Description

Definition at line 58 of file G4ElectroNuclearCrossSection.hh.

Constructor & Destructor Documentation

◆ G4ElectroNuclearCrossSection()

G4ElectroNuclearCrossSection::G4ElectroNuclearCrossSection ( )

Definition at line 2180 of file G4ElectroNuclearCrossSection.cc.

2181currentN(0), currentZ(0), lastZ(0),lastE(0), lastSig(0), lastG(0), lastL(0),
2183{
2185 //Initialize caches
2186 lastUsedCacheEl = new cacheEl_t();
2188
2189 for (G4int i=0;i<120;i++)
2190 {
2191 cache.push_back(nullptr);
2192 }
2193
2194}
int G4int
Definition: G4Types.hh:85
static G4NistManager * Instance()
G4VCrossSectionDataSet(const G4String &nam="")
void SetForAllAtomsAndEnergies(G4bool val)
float proton_mass_c2
Definition: hepunit.py:274
float neutron_mass_c2
Definition: hepunit.py:275

References cache, G4NistManager::Instance(), lastUsedCacheEl, nistmngr, and G4VCrossSectionDataSet::SetForAllAtomsAndEnergies().

◆ ~G4ElectroNuclearCrossSection()

G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection ( )
virtual

Definition at line 2196 of file G4ElectroNuclearCrossSection.cc.

2197{
2198 std::vector<cacheEl_t*>::iterator it = cache.begin();
2199 while ( it != cache.end() ) /* Loop checking, 08.01.2016, W. Pokorski */
2200 {
2201 if ( *it ) {
2202 delete[] (*it)->J1; (*it)->J1 = 0;
2203 delete[] (*it)->J2; (*it)->J2 = 0;
2204 delete[] (*it)->J3; (*it)->J3 = 0;
2205 delete *it;
2206 }
2207 ++it;
2208 }
2209 cache.clear();
2210 delete lastUsedCacheEl;
2211}

References cache, and lastUsedCacheEl.

Member Function Documentation

◆ BuildPhysicsTable()

void G4VCrossSectionDataSet::BuildPhysicsTable ( const G4ParticleDefinition )
virtualinherited

◆ ComputeCrossSection()

G4double G4VCrossSectionDataSet::ComputeCrossSection ( const G4DynamicParticle part,
const G4Element elm,
const G4Material mat = nullptr 
)
inherited

Definition at line 81 of file G4VCrossSectionDataSet.cc.

84{
85 G4int Z = elm->GetZasInt();
86
87 if (IsElementApplicable(part, Z, mat)) {
88 return GetElementCrossSection(part, Z, mat);
89 }
90
91 // isotope-wise cross section making sum over available
92 // isotope cross sections, which may be incomplete, so
93 // the result is corrected
94 size_t nIso = elm->GetNumberOfIsotopes();
95 G4double fact = 0.0;
96 G4double xsec = 0.0;
97
98 // user-defined isotope abundances
99 const G4IsotopeVector* isoVector = elm->GetIsotopeVector();
100 const G4double* abundVector = elm->GetRelativeAbundanceVector();
101
102 for (size_t j=0; j<nIso; ++j) {
103 const G4Isotope* iso = (*isoVector)[j];
104 G4int A = iso->GetN();
105 if(abundVector[j] > 0.0 && IsIsoApplicable(part, Z, A, elm, mat)) {
106 fact += abundVector[j];
107 xsec += abundVector[j]*GetIsoCrossSection(part, Z, A, iso, elm, mat);
108 }
109 }
110 return (fact > 0.0) ? xsec/fact : 0.0;
111}
std::vector< G4Isotope * > G4IsotopeVector
double G4double
Definition: G4Types.hh:83
const G4int Z[17]
const G4double A[17]
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
G4int GetZasInt() const
Definition: G4Element.hh:132
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:163
G4int GetN() const
Definition: G4Isotope.hh:93
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
virtual G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)

References A, G4VCrossSectionDataSet::GetElementCrossSection(), G4VCrossSectionDataSet::GetIsoCrossSection(), G4Element::GetIsotopeVector(), G4Isotope::GetN(), G4Element::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), G4Element::GetZasInt(), G4VCrossSectionDataSet::IsElementApplicable(), G4VCrossSectionDataSet::IsIsoApplicable(), and Z.

Referenced by G4VCrossSectionDataSet::GetCrossSection().

◆ CrossSectionDescription()

void G4ElectroNuclearCrossSection::CrossSectionDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 2245 of file G4ElectroNuclearCrossSection.cc.

2246{
2247 outFile << "G4ElectroNuclearCrossSection provides the total inelastic\n"
2248 << "cross section for e- and e+ interactions with nuclei. The\n"
2249 << "cross sections are retrieved from a table which is\n"
2250 << "generated using the equivalent photon approximation. In\n"
2251 << "this approximation real gammas are produced from the virtual\n"
2252 << "ones generated at the electromagnetic vertex. This cross\n"
2253 << "section set is valid for incident electrons and positrons at\n"
2254 << "all energies.\n";
2255}

◆ Default_Name()

static const char * G4ElectroNuclearCrossSection::Default_Name ( )
inlinestatic

Definition at line 65 of file G4ElectroNuclearCrossSection.hh.

65{return "ElectroNuclearXS";}

Referenced by G4ElectroVDNuclearModel::G4ElectroVDNuclearModel().

◆ DFun()

G4double G4ElectroNuclearCrossSection::DFun ( G4double  x)
private

Definition at line 2228 of file G4ElectroNuclearCrossSection.cc.

2229{
2230 G4double y=G4Exp(x-lastG-lmel); // y for the x
2231 G4double flux=lastG*(2.-y*(2.-y))-1.; // flux factor
2232 return (poc*(x-pos)+shd*G4Exp(-reg*x))*flux;
2233}
static const G4double pos
static const G4double lmel
static const G4double reg
static const G4double shd
static const G4double poc
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179

References G4Exp(), lastG, lmel, poc, pos, reg, and shd.

Referenced by SolveTheEquation().

◆ DumpPhysicsTable()

void G4VCrossSectionDataSet::DumpPhysicsTable ( const G4ParticleDefinition )
virtualinherited

◆ ForAllAtomsAndEnergies()

bool G4VCrossSectionDataSet::ForAllAtomsAndEnergies ( ) const
inlineinherited

◆ Fun()

G4double G4ElectroNuclearCrossSection::Fun ( G4double  x)
private

Definition at line 2235 of file G4ElectroNuclearCrossSection.cc.

2236{
2237 // Integrated PhoNuc cross section
2238 G4double dlg1=lastG+lastG-1.;
2239 G4double lgoe=lastG/lastE;
2240 G4double HE2=HighEnergyJ2(x, G4Exp(x));
2241 return dlg1*HighEnergyJ1(x)-lgoe*(HE2+HE2-HighEnergyJ3(x, G4Exp(2*x))/lastE);
2242}
G4double HighEnergyJ2(G4double lE, G4double E)
G4double HighEnergyJ3(G4double lE, G4double E2)

References G4Exp(), HighEnergyJ1(), HighEnergyJ2(), HighEnergyJ3(), lastE, and lastG.

Referenced by SolveTheEquation().

◆ GetCrossSection()

G4double G4VCrossSectionDataSet::GetCrossSection ( const G4DynamicParticle dp,
const G4Element elm,
const G4Material mat = nullptr 
)
inlineinherited

Definition at line 187 of file G4VCrossSectionDataSet.hh.

190{
191 return ComputeCrossSection(dp, elm, mat);
192}
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)

References G4VCrossSectionDataSet::ComputeCrossSection().

◆ GetElementCrossSection()

G4double G4ElectroNuclearCrossSection::GetElementCrossSection ( const G4DynamicParticle aPart,
G4int  Z,
const G4Material mat 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 2263 of file G4ElectroNuclearCrossSection.cc.

2264{
2265 const G4double Energy = aPart->GetKineticEnergy()/MeV; // Energy of the electron
2266
2267 if (Energy<=EMi) return 0.; // Energy is below the minimum energy in the table
2268
2269 if(ZZ!=lastZ) // This nucleus was not the last used element
2270 {
2271 lastE = 0.; // New history in the electron Energy
2272 lastG = 0.; // New history in the photon Energy
2273 lastZ = ZZ;
2274
2275 //key to search in cache
2276 if(!cache[ZZ]){
2277 lastUsedCacheEl->J1 = new G4double[nE]; // Allocate memory for the new J1 function
2278 lastUsedCacheEl->J2 = new G4double[nE]; // Allocate memory for the new J2 function
2279 lastUsedCacheEl->J3 = new G4double[nE]; // Allocate memory for the new J3 function
2280 G4double Aa = nistmngr->GetAtomicMassAmu(ZZ); // average A
2281 G4int N = (G4int)Aa - ZZ;
2282 lastUsedCacheEl->F = GetFunctions(Aa,lastUsedCacheEl->J1,lastUsedCacheEl->J2,lastUsedCacheEl->J3); // new ZeroPos and filling of J-functions
2283 lastUsedCacheEl->H = alop*Aa*(1.-.072*G4Log(Aa));// corresponds to lastSP from G4PhotonuclearCrossSection
2284 lastUsedCacheEl->TH = ThresholdEnergy(ZZ, N); // The last Threshold Energy
2285 cacheEl_t* new_el = new cacheEl_t(*lastUsedCacheEl);
2286 cache[ZZ] = new_el;
2287 }
2288 else
2289 { //found in cache
2290 const cacheEl_t& el = *(cache[ZZ]);
2291 lastUsedCacheEl->F = el.F;
2292 lastUsedCacheEl->TH = el.TH;
2293 lastUsedCacheEl->H = el.H;
2294 lastUsedCacheEl->J1 = el.J1;
2295 lastUsedCacheEl->J2 = el.J2;
2296 lastUsedCacheEl->J3 = el.J3;
2297 }
2298 }
2299 else
2300 { //current isotope is the same as previous one
2301 if ( lastE == Energy ) return lastSig*millibarn; // Don't calc. same CS twice
2302 }
2303 //End of optimization: now lastUsedCacheEl structure contains the correct data for this isotope
2304
2305 // ============================== NOW Calculate the Cross Section ==========================
2306 lastE=Energy; // lastE - the electron energy
2307
2308 if ( Energy <= lastUsedCacheEl->TH ) // check that the eE is higher than the ThreshE
2309 {
2310 lastSig=0.;
2311 return 0.;
2312 }
2313
2314 G4double lE=G4Log(Energy); // G4Log(eE) (it is necessary at this point for the fit)
2315
2316 lastG=lE-lmel; // Gamma of the electron (used to recover G4Log(eE))
2317 G4double dlg1=lastG+lastG-1.;
2318 G4double lgoe=lastG/lastE;
2319 if(lE<lEMa) // Linear fit is made explicitly to fix the last bin for the randomization
2320 {
2321 G4double shift=(lE-lEMi)/dlnE;
2322 G4int blast=static_cast<G4int>(shift);
2323 if(blast<0) blast=0;
2324 if(blast>=mLL) blast=mLL-1;
2325 shift-=blast;
2326 lastL=blast+1;
2327 G4double YNi=dlg1*lastUsedCacheEl->J1[blast]-lgoe*(lastUsedCacheEl->J2[blast]+lastUsedCacheEl->J2[blast]-lastUsedCacheEl->J3[blast]/lastE);
2329 lastSig= YNi+shift*(YNj-YNi);
2330 if(lastSig>YNj)lastSig=YNj;
2331 }
2332 else
2333 {
2334 lastL=mLL;
2335
2337
2339
2340 G4double En2 = Energy*Energy;
2342
2343 lastSig=dlg1*term1-lgoe*(term2+term2-term3/lastE);
2344 }
2345
2346 if(lastSig<0.) lastSig = 0.;
2347
2348 return lastSig*millibarn;
2349}
static const G4int nE
static const G4double lEMi
static const G4double EMi
static const G4double dlnE
static const G4double alop
static const G4double lEMa
static const G4int mLL
G4double G4Log(G4double x)
Definition: G4Log.hh:226
static constexpr double millibarn
Definition: G4SIunits.hh:86
static constexpr double MeV
Definition: G4SIunits.hh:200
G4double GetKineticEnergy() const
G4double ThresholdEnergy(G4int Z, G4int N)
G4int GetFunctions(G4double a, G4double *x, G4double *y, G4double *z)
G4double GetAtomicMassAmu(const G4String &symb) const

References alop, cache, dlnE, EMi, cacheEl_t::F, G4Log(), G4NistManager::GetAtomicMassAmu(), GetFunctions(), G4DynamicParticle::GetKineticEnergy(), cacheEl_t::H, HighEnergyJ1(), HighEnergyJ2(), HighEnergyJ3(), cacheEl_t::J1, cacheEl_t::J2, cacheEl_t::J3, lastE, lastG, lastL, lastSig, lastUsedCacheEl, lastZ, lEMa, lEMi, lmel, MeV, millibarn, mLL, nE, nistmngr, cacheEl_t::TH, and ThresholdEnergy().

Referenced by G4ElectroVDNuclearModel::ApplyYourself(), and G4ElNucleusSFcs::GetIsoCrossSection().

◆ GetEquivalentPhotonEnergy()

G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy ( )

Definition at line 2433 of file G4ElectroNuclearCrossSection.cc.

2434{
2435 if(lastSig <= 0.0) { return 0.0; } // VI
2436 G4double phLE = 0.; // Prototype of the G4Log(nu=E_gamma)
2437 G4double Y[nE] = {0.0}; // Prepare the array for randomization
2438
2439 G4double lastLE=lastG+lmel; // recover G4Log(eE) from the gamma (lastG)
2440 G4double dlg1=lastG+lastG-1.;
2441 G4double lgoe=lastG/lastE;
2442 for (G4int i=lastUsedCacheEl->F;i<=lastL;i++) {
2444 if(Y[i] < 0.0) { Y[i] = 0.0; }
2445 }
2446 // Tempory IF of H.P.: delete it if the *HP* err message does not
2447 // show up M.K.
2448 if(lastSig>0.99*Y[lastL] && lastL<mLL && Y[lastL]<1.E-30)
2449 {
2450 G4cerr << "*HP*G4ElNucCS::GetEqPhotE:S=" << lastSig <<">" << Y[lastL]
2451 << ",l=" << lastL << ">" << mLL << G4endl;
2452 if(lastSig <= 0.0) { return 0.0; } // VI
2453 }
2454 G4double ris = lastSig*G4UniformRand(); // Sig can be > Y[lastL = mLL], then it
2455 // is in the funct. region
2456
2457 if (ris < Y[lastL]) { // Search the table
2458 G4int j = lastUsedCacheEl->F;
2459 G4double Yj = Y[j]; // It must be 0 (sometimes just very small)
2460 while (ris > Yj && j < lastL) { // Associative search /* Loop checking, 08.01.2016, W. Pokorski */
2461 j++;
2462 Yj = Y[j]; // Yj is first value above ris
2463 }
2464 G4int j1 = j-1;
2465 G4double Yi = Y[j1]; // Previous value is below ris
2466 phLE = lEMi + (j1 + (ris-Yi)/(Yj-Yi) )*dlnE;
2467 } else { // Search with the function
2468 if (lastL < mLL) G4cerr << "**G4EleNucCS::GetEfPhE:L=" << lastL << ",S="
2469 << lastSig << ",Y=" << Y[lastL] << G4endl;
2470 G4double f = (ris-Y[lastL])/lastUsedCacheEl->H; // The scaled residual value of the cross-section integral
2471 phLE=SolveTheEquation(f); // Solve the equation to find theLog(phE) (compare with lastLE)
2472 }
2473
2474 if (phLE>lastLE) {
2475 G4cerr << "***G4ElectroNuclearCS::GetEquPhotE:N=" << currentN << ",Z="
2476 << currentZ << ", lpE" << phLE << ">leE" << lastLE << ",Sig="
2477 << lastSig << ",rndSig=" << ris << ",Beg=" << lastUsedCacheEl->F << ",End="
2478 << lastL << ",Y=" << Y[lastL] << G4endl;
2479 if(lastLE<7.2) phLE=G4Log(G4Exp(lastLE)-.511);
2480 else phLE=7.;
2481 }
2482 return G4Exp(phLE);
2483}
G4double Y(G4double density)
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
#define G4UniformRand()
Definition: Randomize.hh:52

References currentN, currentZ, dlnE, cacheEl_t::F, G4cerr, G4endl, G4Exp(), G4Log(), G4UniformRand, cacheEl_t::H, cacheEl_t::J1, cacheEl_t::J2, cacheEl_t::J3, lastE, lastG, lastL, lastSig, lastUsedCacheEl, lEMi, lmel, mLL, nE, SolveTheEquation(), and Y().

Referenced by G4ElectroVDNuclearModel::ApplyYourself().

◆ GetEquivalentPhotonQ2()

G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2 ( G4double  nu)

Definition at line 2512 of file G4ElectroNuclearCrossSection.cc.

2513{
2514 if(lastG <= 0.0 || lastE <= 0.0) { return 0.; } // VI
2515 if(lastSig <= 0.0) { return 0.0; } // VI
2516 G4double y=nu/lastE; // Part of energy carried by the equivalent pfoton
2517 if(y>=1.-1./(lastG+lastG)) return 0.; // The region where the method does not work
2518 G4double y2=y*y; // Squared photonic part of energy
2519 G4double ye=1.-y; // Part of energy carried by the secondary electron
2520 G4double Qi2=mel2*y2/ye; // Minimum Q2
2521 G4double Qa2=4*lastE*lastE*ye; // Maximum Q2
2522 G4double iar=Qi2/Qa2; // Q2min/Q2max ratio
2523 G4double Dy=ye+.5*y2; // D(y) function
2524 G4double Py=ye/Dy; // P(y) function
2525 G4double ePy=1.-G4Exp(Py); // 1-std::exp(P(y)) part
2526 G4double Uy=Py*(1.-iar); // U(y) function
2527 G4double Fy=(ye+ye)*(1.+ye)*iar/y2; // F(y) function
2528 G4double fr=iar/(1.-ePy*iar); // Q-fraction
2529 if(Fy<=-fr)
2530 {
2531 return 0.;
2532 }
2533 G4double LyQa2=G4Log(Fy+fr); // L(y,Q2max) function
2534 G4bool cond=true;
2535 G4int maxTry=3;
2536 G4int cntTry=0;
2537 G4double Q2=Qi2;
2538 while(cond&&cntTry<maxTry) // The loop to avoid x>1. /* Loop checking, 08.01.2016, W. Pokorski */
2539 {
2540 G4double R=G4UniformRand(); // Random number (0,1)
2541 Q2=Qi2*(ePy+1./(G4Exp(R*LyQa2-(1.-R)*Uy)-Fy));
2542 cntTry++;
2543 cond = Q2>1878.*nu;
2544 }
2545 if(Q2<Qi2)
2546 {
2547 return Qi2;
2548 }
2549 if(Q2>Qa2)
2550 {
2551 return Qa2;
2552 }
2553 return Q2;
2554}
static const G4double mel2
bool G4bool
Definition: G4Types.hh:86

References G4Exp(), G4Log(), G4UniformRand, lastE, lastG, lastSig, and mel2.

Referenced by G4ElectroVDNuclearModel::ApplyYourself().

◆ GetFunctions()

G4int G4ElectroNuclearCrossSection::GetFunctions ( G4double  a,
G4double x,
G4double y,
G4double z 
)
private

Definition at line 2381 of file G4ElectroNuclearCrossSection.cc.

2382{
2383 // --------------------------------
2384 G4int r=-1; // Low channel for J-functions
2385
2386 //AR-24Apr2018 Switch to allow transuranic elements
2387 const G4bool isHeavyElementAllowed = true;
2388 if(a<=.9999 || ( !isHeavyElementAllowed && a>238.49))
2389 {
2390 G4cout<<"***G4ElectroNuclearCrossSection::GetFunctions: A="<<a<<"(?). No CS returned!"<<G4endl;
2391 return r;
2392 }
2393 G4int iA=static_cast<G4int>(a+.499); // Make the round integer of the atomic number
2394 G4double ai=iA;
2395 if(a!=ai) a=ai;
2396 for(G4int i=0; i<nN; i++)
2397 {
2398 if(std::abs(a-A[i])<.0005) // A coincide with one of the basic A's -> get from Tab
2399 {
2400 for(G4int k=0; k<nE; k++)
2401 {
2402 xx[k]=P0[i][k]; // J0
2403 yy[k]=P1[i][k]; // J1
2404 zz[k]=P2[i][k]; // J2
2405 }
2406 r=LL[i]; // Low channel for the J-functions
2407 }
2408 if(r<0) // Not the basic A-value -> must be calculated
2409 {
2410 G4int k=0; // !! To be good for different compilers !!
2411 for(k=1; k<nN; k++)if(a<A[k]) break;// Find the top basic A-value
2412 if(k<1) k=1; // Extrapolation from the first bin (D)
2413 if(k>=nN) k=nN-1; // Extrapolation from the last bin (U)
2414 G4int k1=k-1;
2415 G4double xi=A[k1];
2416 G4double b=(a-xi)/(A[k]-xi);
2417 for(G4int q=0; q<nE; q++)
2418 {
2419 xi=P0[k1][q];
2420 xx[q]=xi+(P0[k][q]-xi)*b;
2421 G4double yi=P1[k1][q];
2422 yy[q]=yi+(P1[k][q]-yi)*b;
2423 G4double zi=P2[k1][q];
2424 zz[q]=zi+(P2[k][q]-zi)*b;
2425 }
2426 r=LL[k];
2427 if(LL[k1]<r) r=LL[k1];
2428 }
2429 }
2430 return r;
2431}
static const G4double A[nN]
static const G4double * P0[nN]
static const G4int nN
static const G4double * P1[nN]
static const G4int LL[nN]
static const G4double * P2[nN]
G4GLOB_DLL std::ostream G4cout

References A, G4cout, G4endl, LL, nE, nN, P0, P1, and P2.

Referenced by GetElementCrossSection().

◆ GetIsoCrossSection()

G4double G4VCrossSectionDataSet::GetIsoCrossSection ( const G4DynamicParticle dynPart,
G4int  Z,
G4int  A,
const G4Isotope iso = nullptr,
const G4Element elm = nullptr,
const G4Material mat = nullptr 
)
virtualinherited

Reimplemented in G4ChipsAntiBaryonElasticXS, G4ChipsAntiBaryonInelasticXS, G4ChipsHyperonElasticXS, G4ChipsHyperonInelasticXS, G4ChipsKaonMinusElasticXS, G4ChipsKaonMinusInelasticXS, G4ChipsKaonPlusElasticXS, G4ChipsKaonPlusInelasticXS, G4ChipsKaonZeroElasticXS, G4ChipsKaonZeroInelasticXS, G4ChipsNeutronElasticXS, G4ChipsNeutronInelasticXS, G4ChipsPionMinusElasticXS, G4ChipsPionMinusInelasticXS, G4ChipsPionPlusElasticXS, G4ChipsPionPlusInelasticXS, G4ChipsProtonElasticXS, G4ChipsProtonInelasticXS, G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticXS, G4IonsShenCrossSection, G4ElNucleusSFcs, G4BGGNucleonElasticXS, G4BGGPionElasticXS, G4BGGPionInelasticXS, G4GammaNuclearXS, G4ParticleInelasticXS, G4BGGNucleonInelasticXS, G4LENDCombinedCrossSection, G4LENDCrossSection, G4LENDGammaCrossSection, G4ParticleHPCaptureData, G4ParticleHPElasticData, G4ParticleHPFissionData, G4ParticleHPInelasticData, G4ParticleHPThermalScatteringData, G4MuNeutrinoNucleusTotXsc, G4ElNeutrinoNucleusTotXsc, and G4PhotoNuclearCrossSection.

Definition at line 130 of file G4VCrossSectionDataSet.cc.

135{
137 ed << "GetIsoCrossSection is not implemented in <" << name << ">\n"
138 << "Particle: " << dynPart->GetDefinition()->GetParticleName()
139 << " Ekin(MeV)= " << dynPart->GetKineticEnergy()/MeV;
140 if(mat) { ed << " material: " << mat->GetName(); }
141 if(elm) { ed << " element: " << elm->GetName(); }
142 ed << " target Z= " << Z << " A= " << A << G4endl;
143 G4Exception("G4VCrossSectionDataSet::GetIsoCrossSection", "had001",
144 FatalException, ed);
145 return 0.0;
146}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
G4ParticleDefinition * GetDefinition() const
const G4String & GetName() const
Definition: G4Element.hh:127
const G4String & GetName() const
Definition: G4Material.hh:173
const G4String & GetParticleName() const

References A, FatalException, G4endl, G4Exception(), G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4Element::GetName(), G4Material::GetName(), G4ParticleDefinition::GetParticleName(), MeV, G4VCrossSectionDataSet::name, and Z.

Referenced by G4VCrossSectionDataSet::ComputeCrossSection(), G4GammaNuclearXS::GetIsoCrossSection(), and G4GammaNuclearXS::Initialise().

◆ GetMaxKinEnergy()

G4double G4VCrossSectionDataSet::GetMaxKinEnergy ( ) const
inlineinherited

◆ GetMinKinEnergy()

G4double G4VCrossSectionDataSet::GetMinKinEnergy ( ) const
inlineinherited

◆ GetName()

const G4String & G4VCrossSectionDataSet::GetName ( ) const
inlineinherited

◆ GetVerboseLevel()

G4int G4VCrossSectionDataSet::GetVerboseLevel ( ) const
inlinevirtualinherited

◆ GetVirtualFactor()

G4double G4ElectroNuclearCrossSection::GetVirtualFactor ( G4double  nu,
G4double  Q2 
)

Definition at line 2556 of file G4ElectroNuclearCrossSection.cc.

2557{
2558 if(nu <= 0.0 || Q2 <= 0.0) { return 0.0; }
2559 //G4double x=Q2/dM/nu; // Direct x definition
2560 G4double K=nu-Q2/dM; // K=nu*(1-x)
2561 if(K <= 0.) // VI
2562 {
2563 return 0.;
2564 }
2565 G4double lK=G4Log(K); // ln(K)
2566 G4double x=1.-K/nu; // This definitin saves one div.
2567 G4double GD=1.+Q2/Q02; // Reversed nucleonic form-factor
2568 G4double b=G4Exp(bp*(lK-blK0)); // b-factor
2569 G4double c=G4Exp(cp*(lK-clK0)); // c-factor
2570 G4double r=.5*G4Log(Q2+nu*nu)-lK; // r=.5*G4Log((Q^2+nu^2)/K^2)
2571 G4double ef=G4Exp(r*(b-c*r*r)); // exponential factor
2572 return (1.-x)*ef/GD/GD;
2573}
static const G4double cp
static const G4double bp
static const G4double dM
static const G4double Q02
static const G4double clK0
static const G4double blK0

References blK0, bp, clK0, cp, dM, G4Exp(), G4Log(), and Q02.

Referenced by G4ElectroVDNuclearModel::CalculateEMVertex().

◆ HighEnergyJ1()

G4double G4ElectroNuclearCrossSection::HighEnergyJ1 ( G4double  lE)
private

Definition at line 2213 of file G4ElectroNuclearCrossSection.cc.

2214{
2215 return ha*(lE*lE-lEMa2)-ab*(lE-lEMa)-cd*(G4Exp(-reg*lE)-ele);
2216}
static const G4double lEMa2
static const G4double cd
static const G4double ab
static const G4double ha
static const G4double ele

References ab, cd, ele, G4Exp(), ha, lEMa, lEMa2, and reg.

Referenced by Fun(), and GetElementCrossSection().

◆ HighEnergyJ2()

G4double G4ElectroNuclearCrossSection::HighEnergyJ2 ( G4double  lE,
G4double  E 
)
private

Definition at line 2218 of file G4ElectroNuclearCrossSection.cc.

2219{
2220 return poc*((lE-1.)*E-le1)-ab*(E-EMa)+cd1*(G4Exp(d1*lE)-ele1);
2221}
static const G4double d1
static const G4double ele1
static const G4double cd1
static const G4double EMa
static const G4double le1

References ab, cd1, d1, ele1, EMa, G4Exp(), le1, and poc.

Referenced by Fun(), and GetElementCrossSection().

◆ HighEnergyJ3()

G4double G4ElectroNuclearCrossSection::HighEnergyJ3 ( G4double  lE,
G4double  E2 
)
private

Definition at line 2223 of file G4ElectroNuclearCrossSection.cc.

2224{
2225 return ha*((lE-.5)*E2-leh)-hab*(E2-EMa2)+cd2*(G4Exp(d2*lE)-ele2);
2226}
static const G4double EMa2
static const G4double cd2
static const G4double hab
static const G4double d2
static const G4double ele2
static const G4double leh

References cd2, d2, ele2, EMa2, G4Exp(), ha, hab, and leh.

Referenced by Fun(), and GetElementCrossSection().

◆ IsElementApplicable()

G4bool G4ElectroNuclearCrossSection::IsElementApplicable ( const G4DynamicParticle ,
G4int  Z,
const G4Material  
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 2257 of file G4ElectroNuclearCrossSection.cc.

2258{
2259 return (Z>0 && Z<120);
2260}

References Z.

◆ IsIsoApplicable()

G4bool G4VCrossSectionDataSet::IsIsoApplicable ( const G4DynamicParticle ,
G4int  Z,
G4int  A,
const G4Element elm = nullptr,
const G4Material mat = nullptr 
)
virtualinherited

◆ SelectIsotope()

const G4Isotope * G4VCrossSectionDataSet::SelectIsotope ( const G4Element anElement,
G4double  kinEnergy,
G4double  logE 
)
virtualinherited

Reimplemented in G4GammaNuclearXS, G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticXS, and G4ParticleInelasticXS.

Definition at line 149 of file G4VCrossSectionDataSet.cc.

151{
152 size_t nIso = anElement->GetNumberOfIsotopes();
153 const G4Isotope* iso = anElement->GetIsotope(0);
154
155 // more than 1 isotope
156 if(1 < nIso) {
157 const G4double* abundVector = anElement->GetRelativeAbundanceVector();
158 G4double sum = 0.0;
160 for (size_t j=0; j<nIso; ++j) {
161 sum += abundVector[j];
162 if(q <= sum) {
163 iso = anElement->GetIsotope(j);
164 break;
165 }
166 }
167 }
168 return iso;
169}
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170

References G4UniformRand, G4Element::GetIsotope(), G4Element::GetNumberOfIsotopes(), and G4Element::GetRelativeAbundanceVector().

◆ SetForAllAtomsAndEnergies()

void G4VCrossSectionDataSet::SetForAllAtomsAndEnergies ( G4bool  val)
inlineinherited

◆ SetMaxKinEnergy()

void G4VCrossSectionDataSet::SetMaxKinEnergy ( G4double  value)
inlineinherited

◆ SetMinKinEnergy()

void G4VCrossSectionDataSet::SetMinKinEnergy ( G4double  value)
inlineinherited

◆ SetName()

void G4VCrossSectionDataSet::SetName ( const G4String nam)
inlineinherited

Definition at line 240 of file G4VCrossSectionDataSet.hh.

241{
242 name = nam;
243}

References G4VCrossSectionDataSet::name.

Referenced by G4ParticleHPInelasticData::G4ParticleHPInelasticData().

◆ SetVerboseLevel()

void G4VCrossSectionDataSet::SetVerboseLevel ( G4int  value)
inlinevirtualinherited

◆ SolveTheEquation()

G4double G4ElectroNuclearCrossSection::SolveTheEquation ( G4double  f)
private

Definition at line 2486 of file G4ElectroNuclearCrossSection.cc.

2487{
2488 G4double lastLE=lastG+lmel; // recover G4Log(eE) from the gamma (lastG)
2489 G4double topLim=lastLE-.001; // maximum G4Log(phE) for equivalent photons
2490 G4double rE=EMa/G4Exp(lastLE); // r=EMa/Eel to make the firs guess
2491 G4double x=lEMa+f/phte/(lastG*(2.-rE*(2.-rE))-1.); // First guess (the first step from the edge)
2492 if(x>topLim) x=topLim;
2493 for(G4int i=0; i<imax; i++)
2494 {
2495 G4double fx=Fun(x);
2496 G4double df=DFun(x);
2497 G4double d=(f-fx)/df;
2498 x=x+d;
2499 if(x>=lastLE)
2500 {
2501 G4cerr<<"*G4ElNCS::SolveTheEq:*Correction*"<<i<<",d="<<d<<",x="<<x<<">lE="<<lastLE<<",f="<<f
2502 <<",fx="<<fx<<",df="<<df<<",A(Z="<<currentZ<<",N="<<currentN<<")"<<G4endl;
2503 x=topLim;
2504 }
2505 if(std::abs(d)<eps) break;
2506 if(i+1>=imax) G4cerr<<"*G4ElNucCS::SolveTheEq:"<<i+2<<">"<<imax<<"->Use bigger max. ln(eE)="
2507 <<lastLE<<",Z="<<currentZ<<", N="<<currentN<<G4endl;
2508 }
2509 return x;
2510}
static const G4int imax
static const G4double eps
static const G4double phte

References currentN, currentZ, DFun(), EMa, eps, Fun(), G4cerr, G4endl, G4Exp(), imax, lastG, lEMa, lmel, and phte.

Referenced by GetEquivalentPhotonEnergy().

◆ ThresholdEnergy()

G4double G4ElectroNuclearCrossSection::ThresholdEnergy ( G4int  Z,
G4int  N 
)
private

Definition at line 2352 of file G4ElectroNuclearCrossSection.cc.

2353{
2354 // ---------
2355
2356 G4int Aa=Z+N;
2357 if(Aa<1) return infEn;
2358 else if(Aa==1) return 134.9766; // Pi0 threshold for the nucleon
2359
2360 G4double mT= 0.;
2362 // If it is not in the Table of Stable Nuclei, then the Threshold=inf
2363 else return infEn;
2364 // ---------
2365 G4double mP= infEn;
2366 //if(Z) mP= G4QPDGCode(111).GetNuclMass(Z-1,N,0);
2368 else return infEn;
2369 G4double mN= infEn;
2370 //if(N) mN= G4QPDGCode(111).GetNuclMass(Z,N-1,0);
2372 else return infEn;
2373 G4double dP= mP+mProt-mT;
2374 G4double dN= mN+mNeut-mT;
2375 if(dP<dN)dN=dP;
2376 return dN;
2377}
static const G4double infEn
static G4bool IsInStableTable(const G4double A, const G4double Z)
static G4double GetNuclearMass(const G4double A, const G4double Z)

References anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::dP, G4NucleiProperties::GetNuclearMass(), infEn, G4NucleiProperties::IsInStableTable(), mNeut, mProt, and Z.

Referenced by GetElementCrossSection().

Field Documentation

◆ cache

std::vector<cacheEl_t*> G4ElectroNuclearCrossSection::cache
private

◆ currentN

G4int G4ElectroNuclearCrossSection::currentN
private

Definition at line 94 of file G4ElectroNuclearCrossSection.hh.

Referenced by GetEquivalentPhotonEnergy(), and SolveTheEquation().

◆ currentZ

G4int G4ElectroNuclearCrossSection::currentZ
private

Definition at line 95 of file G4ElectroNuclearCrossSection.hh.

Referenced by GetEquivalentPhotonEnergy(), and SolveTheEquation().

◆ isForAllAtomsAndEnergies

G4bool G4VCrossSectionDataSet::isForAllAtomsAndEnergies
privateinherited

◆ lastE

G4double G4ElectroNuclearCrossSection::lastE
private

◆ lastG

G4double G4ElectroNuclearCrossSection::lastG
private

◆ lastL

G4int G4ElectroNuclearCrossSection::lastL
private

◆ lastSig

G4double G4ElectroNuclearCrossSection::lastSig
private

◆ lastUsedCacheEl

cacheEl_t* G4ElectroNuclearCrossSection::lastUsedCacheEl
private

◆ lastZ

G4int G4ElectroNuclearCrossSection::lastZ
private

Definition at line 98 of file G4ElectroNuclearCrossSection.hh.

Referenced by GetElementCrossSection().

◆ maxKinEnergy

G4double G4VCrossSectionDataSet::maxKinEnergy
privateinherited

◆ minKinEnergy

G4double G4VCrossSectionDataSet::minKinEnergy
privateinherited

◆ mNeut

const G4double G4ElectroNuclearCrossSection::mNeut
private

Definition at line 109 of file G4ElectroNuclearCrossSection.hh.

Referenced by ThresholdEnergy().

◆ mProt

const G4double G4ElectroNuclearCrossSection::mProt
private

Definition at line 110 of file G4ElectroNuclearCrossSection.hh.

Referenced by ThresholdEnergy().

◆ name

G4String G4VCrossSectionDataSet::name
protectedinherited

◆ nistmngr

G4NistManager* G4ElectroNuclearCrossSection::nistmngr
private

◆ registry

G4CrossSectionDataSetRegistry* G4VCrossSectionDataSet::registry
privateinherited

◆ verboseLevel

G4int G4VCrossSectionDataSet::verboseLevel
protectedinherited

Definition at line 168 of file G4VCrossSectionDataSet.hh.

Referenced by G4BGGNucleonElasticXS::BuildPhysicsTable(), G4BGGPionElasticXS::BuildPhysicsTable(), G4BGGPionInelasticXS::BuildPhysicsTable(), G4GammaNuclearXS::BuildPhysicsTable(), G4NeutronCaptureXS::BuildPhysicsTable(), G4NeutronElasticXS::BuildPhysicsTable(), G4NeutronInelasticXS::BuildPhysicsTable(), G4ParticleInelasticXS::BuildPhysicsTable(), G4BGGNucleonInelasticXS::BuildPhysicsTable(), G4LENDCrossSection::create_used_target_map(), G4BGGNucleonElasticXS::G4BGGNucleonElasticXS(), G4BGGNucleonInelasticXS::G4BGGNucleonInelasticXS(), G4BGGPionElasticXS::G4BGGPionElasticXS(), G4BGGPionInelasticXS::G4BGGPionInelasticXS(), G4GammaNuclearXS::G4GammaNuclearXS(), G4NeutronCaptureXS::G4NeutronCaptureXS(), G4NeutronElasticXS::G4NeutronElasticXS(), G4NeutronInelasticXS::G4NeutronInelasticXS(), G4ParticleInelasticXS::G4ParticleInelasticXS(), G4NeutronCaptureXS::GetElementCrossSection(), G4NeutronElasticXS::GetElementCrossSection(), G4NeutronInelasticXS::GetElementCrossSection(), G4BGGNucleonElasticXS::GetElementCrossSection(), G4BGGPionElasticXS::GetElementCrossSection(), G4BGGPionInelasticXS::GetElementCrossSection(), G4BGGNucleonInelasticXS::GetElementCrossSection(), G4GammaNuclearXS::GetElementCrossSection(), G4ParticleInelasticXS::GetElementCrossSection(), G4BGGNucleonElasticXS::GetIsoCrossSection(), G4BGGPionElasticXS::GetIsoCrossSection(), G4BGGPionInelasticXS::GetIsoCrossSection(), G4GammaNuclearXS::GetIsoCrossSection(), G4BGGNucleonInelasticXS::GetIsoCrossSection(), G4VCrossSectionDataSet::GetVerboseLevel(), G4NeutronElasticXS::Initialise(), G4ParticleInelasticXS::IsoCrossSection(), G4NeutronCaptureXS::IsoCrossSection(), G4NeutronInelasticXS::IsoCrossSection(), G4GammaNuclearXS::RetrieveVector(), G4NeutronCaptureXS::RetrieveVector(), G4NeutronInelasticXS::RetrieveVector(), G4ParticleInelasticXS::RetrieveVector(), and G4VCrossSectionDataSet::SetVerboseLevel().


The documentation for this class was generated from the following files: