Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ElectroNuclearCrossSection Class Reference

#include <G4ElectroNuclearCrossSection.hh>

Inheritance diagram for G4ElectroNuclearCrossSection:
Collaboration diagram for G4ElectroNuclearCrossSection:

Public Member Functions

 G4ElectroNuclearCrossSection ()
 
virtual ~G4ElectroNuclearCrossSection ()
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat)
 
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 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 GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4Isotope * SelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4String & GetName () const
 

Static Public Member Functions

static const char * Default_Name ()
 

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 58 of file G4ElectroNuclearCrossSection.hh.

Constructor & Destructor Documentation

G4ElectroNuclearCrossSection::G4ElectroNuclearCrossSection ( )

Definition at line 2180 of file G4ElectroNuclearCrossSection.cc.

2181 currentN(0), currentZ(0), lastZ(0),
2182 lastE(0), lastSig(0), lastG(0), lastL(0), mNeut(G4NucleiProperties::GetNuclearMass(1,0)), mProt(G4NucleiProperties::GetNuclearMass(1,1))
2183 {
2184  //Initialize caches
2185  lastUsedCacheEl = new cacheEl_t;
2186  nistmngr = G4NistManager::Instance();
2187 
2188  for (G4int i=0;i<120;i++)
2189  {
2190  cache.push_back(0);
2191  }
2192 
2193 }
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4VCrossSectionDataSet(const G4String &nam="")
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()

Here is the call graph for this function:

G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection ( )
virtual

Definition at line 2195 of file G4ElectroNuclearCrossSection.cc.

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

Member Function Documentation

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 2243 of file G4ElectroNuclearCrossSection.cc.

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

Definition at line 65 of file G4ElectroNuclearCrossSection.hh.

65 {return "ElectroNuclearXS";}

Here is the caller graph for this function:

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 2261 of file G4ElectroNuclearCrossSection.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonEnergy ( )

Definition at line 2428 of file G4ElectroNuclearCrossSection.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4ElectroNuclearCrossSection::GetEquivalentPhotonQ2 ( G4double  nu)

Definition at line 2507 of file G4ElectroNuclearCrossSection.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2551 of file G4ElectroNuclearCrossSection.cc.

2552 {
2553  if(nu <= 0.0 || Q2 <= 0.0) { return 0.0; }
2554  //G4double x=Q2/dM/nu; // Direct x definition
2555  G4double K=nu-Q2/dM; // K=nu*(1-x)
2556  if(K <= 0.) // VI
2557  {
2558  return 0.;
2559  }
2560  G4double lK=G4Log(K); // ln(K)
2561  G4double x=1.-K/nu; // This definitin saves one div.
2562  G4double GD=1.+Q2/Q02; // Reversed nucleonic form-factor
2563  G4double b=G4Exp(bp*(lK-blK0)); // b-factor
2564  G4double c=G4Exp(cp*(lK-clK0)); // c-factor
2565  G4double r=.5*G4Log(Q2+nu*nu)-lK; // r=.5*G4Log((Q^2+nu^2)/K^2)
2566  G4double ef=G4Exp(r*(b-c*r*r)); // exponential factor
2567  return (1.-x)*ef/GD/GD;
2568 }
static const G4double dM
static const G4double clK0
static const G4double blK0
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
static const G4double Q02
static const G4double bp
double G4double
Definition: G4Types.hh:76
static const G4double cp

Here is the call graph for this function:

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 2255 of file G4ElectroNuclearCrossSection.cc.

2256 {
2257  return true;
2258 }

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