Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ElectroNuclearCrossSection Class Reference

#include <G4ElectroNuclearCrossSection.hh>

+ Inheritance diagram for G4ElectroNuclearCrossSection:

Public Member Functions

 G4ElectroNuclearCrossSection (const G4String &name="ElectroNuclearXS")
 
virtual ~G4ElectroNuclearCrossSection ()
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *aParticle, G4int, G4int, const G4Element *, const G4Material *)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *aParticle, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *)
 
G4double GetEquivalentPhotonEnergy ()
 
G4double GetVirtualFactor (G4double nu, G4double Q2)
 
G4double GetEquivalentPhotonQ2 (G4double nu)
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 45 of file G4ElectroNuclearCrossSection.hh.

Constructor & Destructor Documentation

◆ G4ElectroNuclearCrossSection()

G4ElectroNuclearCrossSection::G4ElectroNuclearCrossSection ( const G4String name = "ElectroNuclearXS")

◆ ~G4ElectroNuclearCrossSection()

G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection ( )
virtual

Definition at line 79 of file G4ElectroNuclearCrossSection.cc.

80{
81 std::vector<G4double*>::iterator pos;
82 for(pos=J1.begin(); pos<J1.end(); pos++)
83 { delete [] *pos; }
84 J1.clear();
85 for(pos=J2.begin(); pos<J2.end(); pos++)
86 { delete [] *pos; }
87 J2.clear();
88 for(pos=J3.begin(); pos<J3.end(); pos++)
89 { delete [] *pos; }
90 J3.clear();
91}

Member Function Documentation

◆ CrossSectionDescription()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 94 of file G4ElectroNuclearCrossSection.cc.

95{
96 outFile << "G4ElectroNuclearCrossSection provides the total inelastic\n"
97 << "cross section for e- and e+ interactions with nuclei. The\n"
98 << "cross sections are retrieved from a table which is\n"
99 << "generated using the equivalent photon approximation. In\n"
100 << "this approximation real gammas are produced from the virtual\n"
101 << "ones generated at the electromagnetic vertex. This cross\n"
102 << "section set is valid for incident electrons and positrons at\n"
103 << "all energies.\n";
104}

◆ GetEquivalentPhotonEnergy()

G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy ( )

Definition at line 2394 of file G4ElectroNuclearCrossSection.cc.

2395{
2396 if(lastSig <= 0.0) { return 0.0; } // VI
2397
2398 // All constants are the copy of that from GetCrossSection funct.
2399 // => Make them general.
2400 static const G4int nE=336; // !! If you change this, change it in
2401 // GetFunctions() (*.hh) !!
2402 static const G4int mL=nE-1;
2403 static const G4double EMi=2.0612; // Minimum Energy
2404 static const G4double EMa=50000.; // Maximum Energy
2405 static const G4double lEMi=std::log(EMi); // Minimum logarithmic Energy
2406 static const G4double lEMa=std::log(EMa); // Maximum logarithmic Energy
2407 static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in Energy
2408 static const G4double mel=0.5109989; // Mass of electron in MeV
2409 static const G4double lmel=std::log(mel); // Log of electron mass
2410 G4double phLE=0.; // Prototype of the std::log(nu=E_gamma)
2411 G4double Y[nE]; // Prepare the array for randomization
2412
2413#ifdef debug
2414 G4cout << "G4ElectroNuclearCrossSection::GetEguPhotE:B="
2415 << lastF<<",l=" << lastL << ",J1=" << lastJ1[lastL]
2416 << ",J2=" << lastJ2[lastL] << ",J3=" << lastJ3[lastL] << ",S="
2417 << lastSig << ",E=" << lastE << G4endl;
2418#endif
2419
2420 G4double lastLE=lastG+lmel; // recover std::log(eE) from the gamma (lastG)
2421 G4double dlg1=lastG+lastG-1.;
2422 G4double lgoe=lastG/lastE;
2423 for (G4int i=lastF;i<=lastL;i++) {
2424 Y[i] = dlg1*lastJ1[i]-lgoe*(lastJ2[i]+lastJ2[i]-lastJ3[i]/lastE);
2425 if(Y[i] < 0.0) { Y[i] = 0.0; }
2426 }
2427 // Tempory IF of H.P.: delete it if the *HP* err message does not
2428 // show up M.K.
2429 if(lastSig>0.99*Y[lastL] && lastL<mL && Y[lastL]<1.E-30)
2430 {
2431 G4cerr << "*HP*G4ElNucCS::GetEqPhotE:S=" << lastSig <<">" << Y[lastL]
2432 << ",l=" << lastL << ">" << mL << G4endl;
2433 if(lastSig <= 0.0) { return 0.0; } // VI
2434
2435 //return 3.0*MeV; // quick and dirty workaround @@@ HP.
2436 // (now can be not necessary M.K.)
2437 }
2438 G4double ris=lastSig*G4UniformRand(); // Sig can be > Y[lastL=mL], then it
2439 // is in the funct. region
2440#ifdef debug
2441 G4cout<<"G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy: "<<ris<<",Y="<<Y[lastL]<<G4endl;
2442#endif
2443 if(ris<Y[lastL]) // Search in the table
2444 {
2445 G4int j=lastF;
2446 G4double Yj=Y[j]; // It mast be 0 (some times just very small)
2447 while (ris>Yj && j<lastL) // Associative search
2448 {
2449 j++;
2450 Yj=Y[j]; // High value
2451 }
2452 G4int j1=j-1;
2453 G4double Yi=Y[j1]; // Low value
2454 phLE=lEMi+(j1+(ris-Yi)/(Yj-Yi))*dlnE;
2455#ifdef debug
2456 G4cout<<"G4EleNucCS::E="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="<<Yi<<",Y="<<Yj<<G4endl;
2457#endif
2458 }
2459 else // Search with the function
2460 {
2461 if(lastL<mL)G4cerr<<"**G4EleNucCS::GetEfPhE:L="<<lastL<<",S="<<lastSig<<",Y="<<Y[lastL]<<G4endl;
2462 G4double f=(ris-Y[lastL])/lastH; // The scaled residual value of the cross-section integral
2463#ifdef pdebug
2464 G4cout<<"G4EleNucCS::GetEfPhE:HighEnergy f="<<f<<",ris="<<ris<<",lastH="<<lastH<<G4endl;
2465#endif
2466 phLE=SolveTheEquation(f); // Solve the equation to find theLog(phE) (compare with lastLE)
2467#ifdef pdebug
2468 G4cout<<"G4EleNucCS::GetEfPhE:HighEnergy lphE="<<phLE<<G4endl;
2469#endif
2470 }
2471 if(phLE>lastLE)
2472 {
2473 G4cerr<<"***G4ElectroNuclearCS::GetEquPhotE:N="<<lastN<<",Z="<<lastZ<<", lpE"<<phLE<<">leE"<<lastLE
2474 <<",Sig="<<lastSig<<",rndSig="<<ris<<",Beg="<<lastF<<",End="<<lastL<<",Y="<<Y[lastL]<<G4endl;
2475 if(lastLE<7.2) phLE=std::log(std::exp(lastLE)-.511);
2476 else phLE=7.;
2477 }
2478 return std::exp(phLE);
2479}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:53

Referenced by G4ElectroNuclearReaction::ApplyYourself(), and G4ElectroVDNuclearModel::ApplyYourself().

◆ GetEquivalentPhotonQ2()

G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2 ( G4double  nu)

Definition at line 2526 of file G4ElectroNuclearCrossSection.cc.

2527{
2528 if(lastG <= 0.0 || lastE <= 0.0) { return 0.; } // VI
2529 if(lastSig <= 0.0) { return 0.0; } // VI
2530 static const G4double mel=0.5109989; // Mass of electron in MeV
2531 static const G4double mel2=mel*mel; // Squared Mass of electron in MeV
2532 G4double y=nu/lastE; // Part of energy carried by the equivalent pfoton
2533 if(y>=1.-1./(lastG+lastG)) return 0.; // The region where the method does not work
2534 G4double y2=y*y; // Squared photonic part of energy
2535 G4double ye=1.-y; // Part of energy carried by the secondary electron
2536 G4double Qi2=mel2*y2/ye; // Minimum Q2
2537 G4double Qa2=4*lastE*lastE*ye; // Maximum Q2
2538 G4double iar=Qi2/Qa2; // Q2min/Q2max ratio
2539 G4double Dy=ye+.5*y2; // D(y) function
2540 G4double Py=ye/Dy; // P(y) function
2541 G4double ePy=1.-std::exp(Py); // 1-std::exp(P(y)) part
2542 G4double Uy=Py*(1.-iar); // U(y) function
2543 G4double Fy=(ye+ye)*(1.+ye)*iar/y2; // F(y) function
2544 G4double fr=iar/(1.-ePy*iar); // Q-fraction
2545 if(Fy<=-fr)
2546 {
2547#ifdef edebug
2548 G4cerr<<"***G4ElectroNucCrossSec::GetEquPhQ2:Fy="<<Fy<<"+fr="<<fr<<" <0"<<",iar="<<iar<<G4endl;
2549#endif
2550 return 0.;
2551 }
2552 G4double LyQa2=std::log(Fy+fr); // L(y,Q2max) function
2553 G4bool cond=true;
2554 G4int maxTry=3;
2555 G4int cntTry=0;
2556 G4double Q2=Qi2;
2557 while(cond&&cntTry<maxTry) // The loop to avoid x>1.
2558 {
2559 G4double R=G4UniformRand(); // Random number (0,1)
2560 Q2=Qi2*(ePy+1./(std::exp(R*LyQa2-(1.-R)*Uy)-Fy));
2561 cntTry++;
2562 cond = Q2>1878.*nu;
2563 }
2564 if(Q2<Qi2)
2565 {
2566#ifdef edebug
2567 G4cerr<<"***G4ElectroNucCrossSec::GetEquPhQ2:Q2="<<Q2<<" < Q2min="<<Qi2<<G4endl;
2568#endif
2569 return Qi2;
2570 }
2571 if(Q2>Qa2)
2572 {
2573#ifdef edebug
2574 G4cerr<<"***G4ElectroNucCrossSec::GetEquPhQ2:Q2="<<Q2<<" > Q2max="<<Qi2<<G4endl;
2575#endif
2576 return Qa2;
2577 }
2578 return Q2;
2579}
bool G4bool
Definition: G4Types.hh:67

Referenced by G4ElectroNuclearReaction::ApplyYourself(), and G4ElectroVDNuclearModel::ApplyYourself().

◆ GetIsoCrossSection()

G4double G4ElectroNuclearCrossSection::GetIsoCrossSection ( const G4DynamicParticle aParticle,
G4int  ZZ,
G4int  AA,
const G4Isotope ,
const G4Element ,
const G4Material  
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 120 of file G4ElectroNuclearCrossSection.cc.

124{
125 static const G4int nE=336; // !! If you change this, change it in GetFunctions() (*.hh) !!
126 static const G4int mL=nE-1;
127 static const G4double EMi=2.0612; // Minimum tabulated Energy of the Electron
128 static const G4double EMa=50000.; // Maximum tabulated Energy of the Electron
129 static const G4double lEMi=std::log(EMi); // Minimum tabulated logarithmic Energy of the Electron
130 static const G4double lEMa=std::log(EMa); // Maximum tabulated logarithmic Energy of the Electron
131 static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in the table for the electron Energy
132 static const G4double alop=1./137.036/3.14159265; //coef. for the calculated functions (Ee>50000.)
133 static const G4double mel=0.5109989; // Mass of the electron in MeV
134 static const G4double lmel=std::log(mel); // Log of the electron mass
135 // *** Begin of the Associative memory for acceleration of the cross section calculations
136 static std::vector <G4int> colN; // Vector of N for calculated nucleus (isotop)
137 static std::vector <G4int> colZ; // Vector of Z for calculated nucleus (isotop)
138 static std::vector <G4int> colF; // Vector of Last StartPosition in the Ji-function tables
139 static std::vector <G4double> colTH; // Vector of the energy thresholds for the eA->eX reactions
140 static std::vector <G4double> colH; // Vector of HighEnergyCoefficients (functional calculations)
141 // *** End of Static Definitions (Associative Memory) ***
142
143 const G4double Energy = aPart->GetKineticEnergy()/MeV; // Energy of the electron
144 const G4int targetAtomicNumber = AA;
145 const G4int targZ = ZZ;
146 const G4int targN = targetAtomicNumber-targZ; // @@ Get isotops (can change initial A)
147 if (Energy<=EMi) return 0.; // Energy is below the minimum energy in the table
148
149 G4int PDG=aPart->GetDefinition()->GetPDGEncoding();
150 if (PDG == 11 || PDG == -11) // @@ Now only for electrons, but can be fo muons
151 {
152 G4double A = targN + targZ; // New A (can differ from G4double targetAtomicNumber)
153 if(targN!=lastN || targZ!=lastZ) // This nucleus was not the last used isotop
154 {
155 lastE = 0.; // New history in the electron Energy
156 lastG = 0.; // New history in the photon Energy
157 lastN = targN; // The last N of calculated nucleus
158 lastZ = targZ; // The last Z of calculated nucleus
159 G4int n=colN.size(); // Size of the Associative Memory DB in the heap
160 G4bool in=false; // "Found in AMDB" flag
161 if(n) for(G4int i=0; i<n; i++) if(colN[i]==targN && colZ[i]==targZ) // Calculated nuclei
162 { // The nucleus is found in AMDB
163 in=true; // Rais the "Found in AMDB" flag
164 lastTH =colTH[i]; // Last Energy threshold (A-dependent)
165 lastF =colF[i]; // Last ZeroPosition in the J-functions
166 lastH =colH[i]; // Last High Energy Coefficient (A-dependent)
167 lastJ1 =J1[i]; // Pointer to the prepared J1 function
168 lastJ2 =J2[i]; // Pointer to the prepared J2 function
169 lastJ3 =J3[i]; // Pointer to the prepared J3 function
170 }
171 if(!in) // This nucleus has not been calculated previously
172 {
173 lastJ1 = new G4double[nE]; // Allocate memory for the new J1 function
174 lastJ2 = new G4double[nE]; // Allocate memory for the new J2 function
175 lastJ3 = new G4double[nE]; // Allocate memory for the new J3 function
176 lastF = GetFunctions(A,lastJ1,lastJ2,lastJ3); // new ZeroPos and filling of J-functions
177 lastH = alop*A*(1.-.072*std::log(A));// corresponds to lastSP from G4PhotonuclearCrossSection
178 lastTH = ThresholdEnergy(targZ, targN); // The last Threshold Energy
179#ifdef pdebug
180 G4cout<<"G4ElNucCS::GetCrossSection: lastH="<<lastH<<",A="<<A<<G4endl;
181#endif
182 colN.push_back(targN);
183 colZ.push_back(targZ);
184 colF.push_back(lastF);
185 J1.push_back(lastJ1);
186 J2.push_back(lastJ2);
187 J3.push_back(lastJ3);
188 colH.push_back(lastH);
189 colTH.push_back(lastTH);
190 } // End of creation of the new set of parameters
191 } // End of parameters udate
192
193 // else if(std::abs((lastE-Energy)/Energy)<.001) return lastSig*millibarn; // Don't calc. same CS twice
194 else if(lastE == Energy) return lastSig*millibarn; // Don't calc. same CS twice
195 // ============================== NOW Calculate the Cross Section ==========================
196 lastE=Energy; // lastE - the electron energy
197 if (Energy<=lastTH) // Once more check that the eE is higher than the ThreshE
198 {
199 lastSig=0.;
200 return 0.;
201 }
202 G4double lE=std::log(Energy); // std::log(eE) (it is necessary at this point for the fit)
203 lastG=lE-lmel; // Gamma of the electron (used to recover std::log(eE))
204 G4double dlg1=lastG+lastG-1.;
205 G4double lgoe=lastG/lastE;
206 if(lE<lEMa) // Linear fit is made explicitly to fix the last bin for the randomization
207 {
208 G4double shift=(lE-lEMi)/dlnE;
209 G4int blast=static_cast<int>(shift);
210 if(blast<0) blast=0;
211 if(blast>=mL) blast=mL-1;
212 shift-=blast;
213 lastL=blast+1;
214 G4double YNi=dlg1*lastJ1[blast]-lgoe*(lastJ2[blast]+lastJ2[blast]-lastJ3[blast]/lastE);
215 G4double YNj=dlg1*lastJ1[lastL]-lgoe*(lastJ2[lastL]+lastJ2[lastL]-lastJ3[lastL]/lastE);
216 lastSig= YNi+shift*(YNj-YNi);
217 if(lastSig>YNj)lastSig=YNj;
218#ifdef pdebug
219 G4cout<<"G4ElNucCS::GetCS:S="<<lastSig<<",E="<<lE<<",Yi="<<YNi<<",Yj="<<YNj<<",M="<<lEMa<<G4endl;
220 G4cout<<"G4EN::GCS:s="<<shift<<",Jb="<<lastJ1[blast]<<",J="<<lastJ1[lastL]<<",b="<<blast<<G4endl;
221#endif
222 }
223 else
224 {
225 lastL=mL;
226 G4double term1=lastJ1[mL]+lastH*HighEnergyJ1(lE);
227 G4double term2=lastJ2[mL]+lastH*HighEnergyJ2(lE);
228 G4double term3=lastJ3[mL]+lastH*HighEnergyJ3(lE);
229 lastSig=dlg1*term1-lgoe*(term2+term2-term3/lastE);
230#ifdef pdebug
231 G4cout<<"G4ElNucCS::GetCrossSec:S="<<lastSig<<",lE="<<lE<<",J1="<<lastH*HighEnergyJ1(lE)<<",Pm="
232 <<lastJ1[mL]<<",Fm="<<lastJ2[mL]<<",Fh="<<lastH*HighEnergyJ2(lE)<<",EM="<<lEMa<<G4endl;
233#endif
234 }
235 } // End of "sigma" calculation
236 else return 0.;
237 if(lastSig<0.) lastSig = 0.;
238 lastE=Energy;
239 return lastSig*millibarn;
240}

Referenced by G4ElectroVDNuclearModel::ApplyYourself().

◆ GetVirtualFactor()

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

Definition at line 2581 of file G4ElectroNuclearCrossSection.cc.

2582{
2583 if(nu <= 0.0 || Q2 <= 0.0) { return 0.0; }
2584 static const G4double dM=938.27+939.57; // Mean double nucleon mass = m_n+m_p (@@ no binding)
2585 static const G4double Q0=843.; // Coefficient of the dipole nucleonic form-factor
2586 static const G4double Q02=Q0*Q0; // Squared coefficient of the dipole nucleonic form-factor
2587 static const G4double blK0=std::log(185.); // Coefficient of the b-function
2588 static const G4double bp=0.85; // Power of the b-function
2589 static const G4double clK0=std::log(1390.); // Coefficient of the c-function
2590 static const G4double cp=3.; // Power of the c-function
2591 //G4double x=Q2/dM/nu; // Direct x definition
2592 G4double K=nu-Q2/dM; // K=nu*(1-x)
2593 if(K <= 0.) // VI
2594 {
2595#ifdef edebug
2596 G4cerr<<"**G4ElectroNucCrossSec::GetVirtFact:K="<<K<<",nu="<<nu<<",Q2="<<Q2<<",dM="<<dM<<G4endl;
2597#endif
2598 return 0.;
2599 }
2600 G4double lK=std::log(K); // ln(K)
2601 G4double x=1.-K/nu; // This definitin saves one div.
2602 G4double GD=1.+Q2/Q02; // Reversed nucleonic form-factor
2603 G4double b=std::exp(bp*(lK-blK0)); // b-factor
2604 G4double c=std::exp(cp*(lK-clK0)); // c-factor
2605 G4double r=.5*std::log(Q2+nu*nu)-lK; // r=.5*std::log((Q^2+nu^2)/K^2)
2606 G4double ef=std::exp(r*(b-c*r*r)); // exponential factor
2607 return (1.-x)*ef/GD/GD;
2608}

Referenced by G4ElectroNuclearReaction::ApplyYourself().

◆ IsIsoApplicable()

G4bool G4ElectroNuclearCrossSection::IsIsoApplicable ( const G4DynamicParticle aParticle,
G4int  ,
G4int  ,
const G4Element ,
const G4Material  
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 107 of file G4ElectroNuclearCrossSection.cc.

110{
111 G4bool result = false;
112 if (aParticle->GetDefinition() == G4Electron::ElectronDefinition())
113 result = true;
114 if (aParticle->GetDefinition() == G4Positron::PositronDefinition())
115 result = true;
116 return result;
117}
G4ParticleDefinition * GetDefinition() const
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89

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