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

#include <G4QElectronNuclearCrossSection.hh>

+ Inheritance diagram for G4QElectronNuclearCrossSection:

Public Member Functions

 ~G4QElectronNuclearCrossSection ()
 
G4double ThresholdEnergy (G4int Z, G4int N, G4int PDG=11)
 
virtual G4double GetCrossSection (G4bool fCS, G4double pMom, G4int tgZ, G4int tgN, G4int pPDG=0)
 
G4double CalculateCrossSection (G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
 
G4int GetExchangePDGCode ()
 
G4double GetExchangeEnergy ()
 
G4double GetVirtualFactor (G4double nu, G4double Q2)
 
G4double GetExchangeQ2 (G4double nu)
 
- Public Member Functions inherited from G4VQCrossSection
virtual ~G4VQCrossSection ()
 
virtual G4double GetCrossSection (G4bool, G4double, G4int, G4int, G4int pPDG=0)
 
virtual G4double ThresholdEnergy (G4int Z, G4int N, G4int PDG=0)
 
virtual G4double CalculateCrossSection (G4bool CS, G4int F, G4int I, G4int PDG, G4int tgZ, G4int tgN, G4double pMom)=0
 
virtual G4double GetLastTOTCS ()
 
virtual G4double GetLastQELCS ()
 
virtual G4double GetDirectPart (G4double Q2)
 
virtual G4double GetNPartons (G4double Q2)
 
virtual G4double GetExchangeEnergy ()
 
virtual G4double GetExchangeT (G4int tZ, G4int tN, G4int pPDG)
 
virtual G4double GetSlope (G4int tZ, G4int tN, G4int pPDG)
 
virtual G4double GetHMaxT ()
 
virtual G4double GetExchangeQ2 (G4double nu=0)
 
virtual G4double GetVirtualFactor (G4double nu, G4double Q2)
 
virtual G4double GetQEL_ExchangeQ2 ()
 
virtual G4double GetNQE_ExchangeQ2 ()
 
virtual G4int GetExchangePDGCode ()
 

Static Public Member Functions

static G4VQCrossSectionGetPointer ()
 
- Static Public Member Functions inherited from G4VQCrossSection
static void setTolerance (G4double tol)
 

Protected Member Functions

 G4QElectronNuclearCrossSection ()
 
- Protected Member Functions inherited from G4VQCrossSection
 G4VQCrossSection ()
 
G4double LinearFit (G4double X, G4int N, G4double *XN, G4double *YN)
 
G4double EquLinearFit (G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
 

Additional Inherited Members

- Static Protected Attributes inherited from G4VQCrossSection
static G4double tolerance =.001
 

Detailed Description

Definition at line 46 of file G4QElectronNuclearCrossSection.hh.

Constructor & Destructor Documentation

◆ G4QElectronNuclearCrossSection()

G4QElectronNuclearCrossSection::G4QElectronNuclearCrossSection ( )
inlineprotected

Definition at line 50 of file G4QElectronNuclearCrossSection.hh.

50{} // Constructor

◆ ~G4QElectronNuclearCrossSection()

G4QElectronNuclearCrossSection::~G4QElectronNuclearCrossSection ( )

Definition at line 78 of file G4QElectronNuclearCrossSection.cc.

79{
80 G4int lens=J1->size();
81 for(G4int i=0; i<lens; ++i) delete[] (*J1)[i];
82 delete J1;
83 G4int hens=J2->size();
84 for(G4int i=0; i<hens; ++i) delete[] (*J2)[i];
85 delete J2;
86 G4int pens=J3->size();
87 for(G4int i=0; i<pens; ++i) delete[] (*J3)[i];
88 delete J3;
89}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ CalculateCrossSection()

G4double G4QElectronNuclearCrossSection::CalculateCrossSection ( G4bool  CS,
G4int  F,
G4int  I,
G4int  PDG,
G4int  Z,
G4int  N,
G4double  Momentum 
)
virtual

Implements G4VQCrossSection.

Definition at line 318 of file G4QElectronNuclearCrossSection.cc.

320{
321 static const G4int nE=336; // !! If change this, change it in GetFunctions() (*.hh) !!
322 static const G4int mL=nE-1;
323 static const G4double EMi=2.0612; // Minimum tabulated Energy of the Electron
324 static const G4double EMa=50000.; // Maximum tabulated Energy of the Electron
325 static const G4double lEMi=std::log(EMi); // Min tabulated logarithmic Energy of Electron
326 static const G4double lEMa=std::log(EMa); // Max tabulated logarithmic Energy of Electron
327 static const G4double dlnE=(lEMa-lEMi)/mL; // Log step in the table for electron Energy
328 static const G4double alop=1./137.036/3.14159265; //coefficient for Ee>50000 calculations
329 static const G4double mel=0.5109989; // Mass of the electron in MeV
330 static const G4double mel2=mel*mel;// Squared Mass of the electron in MeV
331 static const G4double lmel=std::log(mel); // Log of the electron mass
332 // *** Begin of the Associative memory for acceleration of the cross section calculations
333 static std::vector <G4int> colF; // Vector of LastStartPosition in Ji-function tables
334 static std::vector <G4double> colH;// Vector of HighEnergyCoefficients (functional)
335#ifdef pdebug
336 G4cout<<"G4QElectronNucCrossSection::CalculateCrossSection: ***Called*** "<<J3->size();
337 if(J3->size()) G4cout<<", p="<<(*J3)[0];
338 G4cout<<G4endl;
339#endif
340 // *** End of Static Definitions (Associative Memory) ***
341 //const G4double Energy = aPart->GetKineticEnergy()/MeV; // Energy of the Electron
342 onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
343 G4double TotEnergy2=Momentum*Momentum+mel2;
344 G4double TotEnergy=std::sqrt(TotEnergy2); // Total energy of the electron
345 lastE=TotEnergy-mel; // Kinetic energy of the electron
346#ifdef pdebug
347 G4cout<<"G4QElectronNucCS::CalcCS: P="<<Momentum<<", F="<<F<<", I="<<I<<", Z="<<targZ;
348 if(J3->size()) G4cout<<", p="<<(*J3)[0];
349 G4cout<<", N="<<targN<<", onlyCS="<<CS<<",E="<<lastE<<",th="<<EMi<<G4endl;
350#endif
351 G4double A=targN+targZ; // New A (can differ from G4double targetAtomicNumber)
352 if(F<=0) // This isotope was not the last used isotop
353 {
354 if(F<0) // This isotope was found in DAMDB =-------=> RETRIEVE
355 { // ...........................................=------=
356 if (lastE<=EMi) // Energy is below the minimum energy in the table
357 {
358 lastE=0.;
359 lastG=0.;
360 lastSig=0.;
361#ifdef pdebug
362 G4cout<<"G4QElectronNucCS::CalcCS: Old CS=0 as lastE="<<lastE<<" < "<<EMi<<G4endl;
363#endif
364 return 0.;
365 }
366 lastJ1 =(*J1)[I]; // Pointer to the prepared J1 function
367 lastJ2 =(*J2)[I]; // Pointer to the prepared J2 function
368 lastJ3 =(*J3)[I]; // Pointer to the prepared J3 function
369 lastF =colF[I]; // Last ZeroPosition in the J-functions
370 lastH =colH[I]; // Last High Energy Coefficient (A-dependent)
371 }
372 else // This isotope wasn't calculated previously => CREATE
373 {
374 lastJ1 = new G4double[nE]; // Allocate memory for the new J1 function
375 lastJ2 = new G4double[nE]; // Allocate memory for the new J2 function
376 lastJ3 = new G4double[nE]; // Allocate memory for the new J3 function
377 lastF = GetFunctions(A,lastJ1,lastJ2,lastJ3);//newZeroPos and J-functions filling
378 lastH = alop*A*(1.-.072*std::log(A)); // like lastSP of G4PhotonuclearCrossSection
379#ifdef pdebug
380 G4cout<<"==>G4QElNCS::CalcCS: pJ1="<<lastJ1<<",pJ2="<<lastJ2<<",pJ3="<<lastJ3;
381 if(lastJ1) G4cout<<", J1="<<lastJ1[0]<<",J2="<<lastJ2[0]<<",J3="<<lastJ3[0];
382 G4cout<<G4endl;
383#endif
384 // *** The synchronization check ***
385 G4int sync=J1->size();
386 if(sync!=I) G4cerr<<"***G4QElectNuclearCS::CalcCS: PDG=11 ,S="<<sync<<"#"<<I<<G4endl;
387 J1->push_back(lastJ1);
388 J2->push_back(lastJ2);
389 J3->push_back(lastJ3);
390 colF.push_back(lastF);
391 colH.push_back(lastH);
392 } // End of creation of the new set of parameters
393 } // End of parameters udate
394 // =----------------= NOW Calculate the Cross Section =--------------------=
395 if (lastE<=lastTH || lastE<=EMi) // Check that muKiE is higher than ThreshE
396 {
397 lastE=0.;
398 lastG=0.;
399 lastSig=0.;
400#ifdef pdebug
401 G4cout<<"G4QElectronNucCS::CalcCS:CS=0 as T="<<lastE<<"<"<<EMi<<" || "<<lastTH<<G4endl;
402#endif
403 return 0.;
404 }
405 G4double lE=std::log(lastE); // log(muE) (it is necessary for the fit)
406 lastG=lE-lmel; // Gamma of the electron (used to recover log(eE))
407 G4double dlg1=lastG+lastG-1.;
408 G4double lgoe=lastG/lastE;
409 if(lE<lEMa) // Log fit is made explicitly to fix the last bin for the randomization
410 {
411 G4double shift=(lE-lEMi)/dlnE;
412 G4int blast=static_cast<int>(shift);
413#ifdef pdebug
414 G4cout<<"-->G4QElectronNuclearCS::CalcCrossSect:LOGfit b="<<blast<<",max="<<mL<<",lJ1="
415 <<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<",lEmin="<<lEMi<<",d="<<dlnE<<G4endl;
416#endif
417 if(blast<0) blast=0;
418 if(blast>=mL) blast=mL-1;
419 shift-=blast;
420 lastL=blast+1;
421 G4double YNi=dlg1*lastJ1[blast]
422 -lgoe*(lastJ2[blast]+lastJ2[blast]-lastJ3[blast]/lastE);
423 G4double YNj=dlg1*lastJ1[lastL]
424 -lgoe*(lastJ2[lastL]+lastJ2[lastL]-lastJ3[lastL]/lastE);
425 lastSig= YNi+shift*(YNj-YNi);
426 if(lastSig>YNj)lastSig=YNj;
427#ifdef pdebug
428 G4cout<<"G4QElectNucCS::CalcCS:S="<<lastSig<<",lE="<<lE<<",Yi="<<YNi<<",Yj="<<YNj
429 <<",J1="<<lastJ1[blast]<<",J2="<<lastJ2[blast]<<",J3="<<lastJ3[blast]<<G4endl;
430 G4cout<<"G4QElectNucCS::CalcCS:s="<<shift<<",Jb="<<lastJ1[blast]<<",J="<<lastJ1[lastL];
431 if(J3->size()) G4cout<<", p="<<(*J3)[0];
432 G4cout<<",b="<<blast<<",lEmax="<<lEMa<<",lgoe="<<lgoe<<G4endl;
433#endif
434 }
435 else
436 {
437#ifdef pdebug
438 G4cout<<"->G4QElecNucCS::CCS:LOGex="<<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<G4endl;
439#endif
440 lastL=mL;
441 G4double term1=lastJ1[mL]+lastH*HighEnergyJ1(lE);
442 G4double term2=lastJ2[mL]+lastH*HighEnergyJ2(lE);
443 G4double term3=lastJ3[mL]+lastH*HighEnergyJ3(lE);
444 lastSig=dlg1*term1-lgoe*(term2+term2-term3/lastE);
445#ifdef pdebug
446 G4cout<<"G4QElNucCS::CalculateCrossSection:S="<<lastSig<<",lE="<<lE<<",J1="
447 <<lastH*HighEnergyJ1(lE)<<",Pm="<<lastJ1[mL]<<",Fm="<<lastJ2[mL]<<",Fh=";
448 if(J3->size()) G4cout<<", p="<<(*J3)[0];
449 G4cout<<lastH*HighEnergyJ2(lE)<<",EM="<<lEMa<<G4endl;
450#endif
451 }
452 if(lastSig<0.) lastSig = 0.;
453#ifdef pdebug
454 if(J3->size()) G4cout<<"-->>->> G4QElNucCS::CalculateCrossSection: p="<<(*J3)[0]<<G4endl;
455#endif
456 return lastSig;
457}
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout

Referenced by GetCrossSection().

◆ GetCrossSection()

G4double G4QElectronNuclearCrossSection::GetCrossSection ( G4bool  fCS,
G4double  pMom,
G4int  tgZ,
G4int  tgN,
G4int  pPDG = 0 
)
virtual

!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)

Reimplemented from G4VQCrossSection.

Definition at line 93 of file G4QElectronNuclearCrossSection.cc.

95{
96 static const G4double mel=0.5109989; // Mass of the electron in MeV
97 static const G4double mel2=mel*mel; // Squared Mass of the electron in MeV
98 static G4int j; // A#0f records found in DB for this projectile
99 static std::vector <G4int> colPDG;// Vector of the projectile PDG code
100 static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
101 static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
102 static std::vector <G4double> colP; // Vector of last momenta for the reaction
103 static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
104 static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
105 // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
106 G4double pEn=std::sqrt(pMom*pMom+mel2)-mel; // ==> electron/positron kinEnergy
107#ifdef pdebug
108 G4cout<<"G4QENCS::GetCS:->> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
109 <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
110 <<colN.size()<<G4endl;
111 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
112#endif
113 if(std::abs(pPDG)!=11)
114 {
115#ifdef pdebug
116 G4cout<<"G4QENCS::GetCS: *** Found pPDG="<<pPDG<<" =--=> CS=0"<<G4endl;
117 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
118#endif
119 return 0.; // projectile PDG=0 is a mistake (?!) @@
120 }
121 G4bool in=false; // By default the isotope must be found in the AMDB
122 if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
123 {
124 in = false; // By default the isotope haven't be found in AMDB
125 lastP = 0.; // New momentum history (nothing to compare with)
126 lastPDG = pPDG; // The last PDG of the projectile
127 lastN = tgN; // The last N of the calculated nucleus
128 lastZ = tgZ; // The last Z of the calculated nucleus
129 lastI = colN.size(); // Size of the Associative Memory DB in the heap
130 j = 0; // A#0f records found in DB for this projectile
131 if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
132 { // The nucleus with projPDG is found in AMDB
133 if(colN[i]==tgN && colZ[i]==tgZ)
134 {
135 lastI=i;
136 lastTH =colTH[i]; // Last THreshold (A-dependent)
137#ifdef pdebug
138 G4cout<<"G4QENCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
139 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
140#endif
141 if(pEn<=lastTH)
142 {
143#ifdef pdebug
144 G4cout<<"G4QENCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
145 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
146#endif
147 return 0.; // Energy is below the Threshold value
148 }
149 lastP =colP [i]; // Last Momentum (A-dependent)
150 lastCS =colCS[i]; // Last CrossSect (A-dependent)
151 // if(std::fabs(lastP/pMom-1.)<tolerance) // VI (do not use tolerance)
152 if(lastP == pMom)
153 {
154#ifdef pdebug
155 G4cout<<"G4QENCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
156#endif
157 CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // Update param's only
158 return lastCS*millibarn; // Use theLastCS
159 }
160 in = true; // This is the case when the isotop is found in DB
161 // Momentum pMom is in IU ! @@ Units
162#ifdef pdebug
163 G4cout<<"G4QENCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
164#endif
165 lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
166#ifdef pdebug
167 G4cout<<"G4QENCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
168 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
169#endif
170 if(lastCS<=0. && pEn>lastTH) // Correct the threshold
171 {
172#ifdef pdebug
173 G4cout<<"G4QENCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
174#endif
175 lastTH=pEn;
176 }
177 break; // Go out of the LOOP
178 }
179#ifdef pdebug
180 G4cout<<"---G4QENCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
181 <<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
182 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
183#endif
184 j++; // Increment a#0f records found in DB for this pPDG
185 }
186 if(!in) // This nucleus has not been calculated previously
187 {
188#ifdef pdebug
189 G4cout<<"G4QENCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
190#endif
191 //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
192 lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
193 if(lastCS<=0.)
194 {
195 lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
196#ifdef pdebug
197 G4cout<<"G4QENCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
198#endif
199 if(pEn>lastTH)
200 {
201#ifdef pdebug
202 G4cout<<"G4QENCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
203#endif
204 lastTH=pEn;
205 }
206 }
207#ifdef pdebug
208 G4cout<<"G4QENCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
209 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
210#endif
211 colN.push_back(tgN);
212 colZ.push_back(tgZ);
213 colPDG.push_back(pPDG);
214 colP.push_back(pMom);
215 colTH.push_back(lastTH);
216 colCS.push_back(lastCS);
217#ifdef pdebug
218 G4cout<<"G4QENCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
219 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
220#endif
221 return lastCS*millibarn;
222 } // End of creation of the new set of parameters
223 else
224 {
225#ifdef pdebug
226 G4cout<<"G4QENCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
227#endif
228 colP[lastI]=pMom;
229 colPDG[lastI]=pPDG;
230 colCS[lastI]=lastCS;
231 }
232 } // End of parameters udate
233 else if(pEn<=lastTH)
234 {
235#ifdef pdebug
236 G4cout<<"G4QENCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
237 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
238#endif
239 return 0.; // Momentum is below the Threshold Value -> CS=0
240 }
241 // else if(std::fabs(lastP/pMom-1.)<tolerance) // VI (do not use tolerance)
242 else if(lastP == pMom)
243 {
244#ifdef pdebug
245 G4cout<<"G4QENCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
246 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
247#endif
248 return lastCS*millibarn; // Use theLastCS
249 }
250 else
251 {
252#ifdef pdebug
253 G4cout<<"G4QENCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
254#endif
255 lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
256 lastP=pMom;
257 }
258#ifdef pdebug
259 G4cout<<"G4QENCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
260 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
261#endif
262 return lastCS*millibarn;
263}
bool G4bool
Definition: G4Types.hh:67
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=11)

◆ GetExchangeEnergy()

G4double G4QElectronNuclearCrossSection::GetExchangeEnergy ( )
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2636 of file G4QElectronNuclearCrossSection.cc.

2637{
2638 // @@ All constants are copy of that from PhotonCrossSection funct. => Make them general.
2639 static const G4int nE=336; // !! If change this, change it in GetFunctions() (*.hh) !!
2640 static const G4int mL=nE-1;
2641 static const G4double EMi=2.0612; // Minimum Energy
2642 static const G4double EMa=50000.; // Maximum Energy
2643 static const G4double lEMi=std::log(EMi); // Minimum logarithmic Energy
2644 static const G4double lEMa=std::log(EMa); // Maximum logarithmic Energy
2645 static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in Energy
2646 static const G4double mel=0.5109989; // Mass of electron in MeV
2647 static const G4double lmel=std::log(mel); // Log of electron mass
2648 G4double phLE=0.; // Prototype of the log(nu=E_gamma)
2649 G4double Y[nE]; // Prepare the array for randomization
2650#ifdef debug
2651 G4cout<<"G4QElectronNuclearCroSect::GetExEn:"<<lastF<<",L="<<lastL<<",1="<<lastJ1[lastL]
2652 <<",2="<<lastJ2[lastL]<<",3="<<lastJ3[lastL]<<",S="<<lastSig<<",E="<<lastE<<G4endl;
2653#endif
2654 G4double lastLE=lastG+lmel; // recover log(eE) from the gamma (lastG)
2655 G4double dlg1=lastG+lastG-1.;
2656 G4double lgoe=lastG/lastE;
2657 for(G4int i=lastF;i<=lastL;i++)
2658 Y[i]=dlg1*lastJ1[i]-lgoe*(lastJ2[i]+lastJ2[i]-lastJ3[i]/lastE);
2659 G4double ris=lastSig*G4UniformRand(); // If Sig > Y[lastL=mL] -> it is in functRegion
2660#ifdef debug
2661 G4cout<<"G4QElectronNuclearCrossSection::GetExchEnergy: "<<ris<<",Y="<<Y[lastL]<<G4endl;
2662#endif
2663 if(ris<Y[lastL]) // Search in the table
2664 {
2665 G4int j=lastF;
2666 G4double Yj=Y[j]; // It mast be 0 (some times just very small)
2667 while (ris>Yj && j<lastL) // Associative search
2668 {
2669 j++;
2670 Yj=Y[j]; // High value
2671 }
2672 G4int j1=j-1;
2673 G4double Yi=Y[j1]; // Low value
2674 phLE=lEMi+(j1+(ris-Yi)/(Yj-Yi))*dlnE;
2675#ifdef debug
2676 G4cout<<"G4QElectronNucCS::GetExchEn="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="
2677 <<Yi<<",Y="<<Yj<<G4endl;
2678#endif
2679 }
2680 else // Search with the function
2681 {
2682 if(lastL<mL)G4cerr<<"G4QElNCS::GEE:L="<<lastL<<",S="<<lastSig<<",Y="<<Y[lastL]<<G4endl;
2683 G4double f=(ris-Y[lastL])/lastH; // ScaledResidualValue of the CrossSection integral
2684#ifdef pdebug
2685 G4cout<<"G4QElNucCS::GetExEn:HighEnergy f="<<f<<",ris="<<ris<<",lastH="<<lastH<<G4endl;
2686#endif
2687 phLE=SolveTheEquation(f); // Solve equation to find Log(phE) (compare with lastLE)
2688#ifdef pdebug
2689 G4cout<<"G4QElectronNuclearCS::GetExchangeEnergy: HighEnergy lphE="<<phLE<<G4endl;
2690#endif
2691 }
2692 if(phLE>lastLE)
2693 {
2694 G4cerr<<"***G4QElNucCS::GetExEn:N="<<lastN<<",Z="<<lastZ<<", lpE"<<phLE<<">leE"<<lastLE
2695 <<",S="<<lastSig<<",rS="<<ris<<",B="<<lastF<<",E="<<lastL<<",Y="<<Y[lastL]<<G4endl;
2696 if(lastLE<7.2) phLE=std::log(std::exp(lastLE)-.511);
2697 else phLE=7.;
2698 }
2699#ifdef pdebug
2700 G4cout<<"G4QElectronNuclearCS::GetExchangeEnergy: *** DONE ***, lphE="<<phLE<<G4endl;
2701#endif
2702 return std::exp(phLE);
2703} // End of GetExchangeEnergy
#define G4UniformRand()
Definition: Randomize.hh:53

◆ GetExchangePDGCode()

G4int G4QElectronNuclearCrossSection::GetExchangePDGCode ( )
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2806 of file G4QElectronNuclearCrossSection.cc.

2806{return 22;}

◆ GetExchangeQ2()

G4double G4QElectronNuclearCrossSection::GetExchangeQ2 ( G4double  nu)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2752 of file G4QElectronNuclearCrossSection.cc.

2753{
2754 static const G4double mel=0.5109989; // Mass of electron in MeV
2755 static const G4double mel2=mel*mel; // Squared Mass of electron in MeV
2756 G4double y=nu/lastE; // Part of energy carried by the equivalent pfoton
2757 if(y>=1.-1./(lastG+lastG)) return 0.; // The region where the method does not work
2758 G4double y2=y*y; // Squared photonic part of energy
2759 G4double ye=1.-y; // Part of energy carried by secondary electron
2760 G4double Qi2=mel2*y2/ye; // Minimum Q2
2761 G4double Qa2=4*lastE*lastE*ye; // Maximum Q2
2762 G4double iar=Qi2/Qa2; // Q2min/Q2max ratio
2763 G4double Dy=ye+.5*y2; // D(y) function
2764 G4double Py=ye/Dy; // P(y) function
2765 G4double ePy=1.-std::exp(Py); // 1-exp(P(y)) part
2766 G4double Uy=Py*(1.-iar); // U(y) function
2767 G4double Fy=(ye+ye)*(1.+ye)*iar/y2; // F(y) function
2768 G4double fr=iar/(1.-ePy*iar); // Q-fraction
2769 if(Fy<=-fr)
2770 {
2771#ifdef edebug
2772 G4cerr<<"**G4QElNucCrossSec::GetExQ2:Fy="<<Fy<<"+fr="<<fr<<" <0"<<",iar="<<iar<<G4endl;
2773#endif
2774 return 0.;
2775 }
2776 G4double LyQa2=std::log(Fy+fr); // L(y,Q2max) function
2777 G4bool cond=true;
2778 G4int maxTry=3;
2779 G4int cntTry=0;
2780 G4double Q2=Qi2;
2781 while(cond&&cntTry<maxTry) // The loop to avoid x>1.
2782 {
2783 G4double R=G4UniformRand(); // Random number (0,1)
2784 Q2=Qi2*(ePy+1./(std::exp(R*LyQa2-(1.-R)*Uy)-Fy));
2785 cntTry++;
2786 cond = Q2>1878.*nu;
2787 }
2788 if(Q2<Qi2)
2789 {
2790#ifdef edebug
2791 G4cerr<<"*G4QElectronNuclearCrossSec::GetExchangeQ2:Q2="<<Q2<<" < Q2min="<<Qi2<<G4endl;
2792#endif
2793 return Qi2;
2794 }
2795 if(Q2>Qa2)
2796 {
2797#ifdef edebug
2798 G4cerr<<"*G4QElectronNucCrossSection::GetExchangeQ2:Q2="<<Q2<<" > Q2max="<<Qi2<<G4endl;
2799#endif
2800 return Qa2;
2801 }
2802 return Q2;
2803}

◆ GetPointer()

G4VQCrossSection * G4QElectronNuclearCrossSection::GetPointer ( )
static

◆ GetVirtualFactor()

G4double G4QElectronNuclearCrossSection::GetVirtualFactor ( G4double  nu,
G4double  Q2 
)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2808 of file G4QElectronNuclearCrossSection.cc.

2809{
2810 static const G4double dM=938.27+939.57;// MeanDoubleNucleonMass = m_n+m_p(@@ no binding)
2811 static const G4double Q0=843.; // Coefficient of the dipole nucleonic form-factor
2812 static const G4double Q02=Q0*Q0; // SquaredCoefficient of dipoleNucleonicFormFactor
2813 static const G4double blK0=std::log(185.); // Coefficient of the b-function
2814 static const G4double bp=0.85; // Power of the b-function
2815 static const G4double clK0=std::log(1390.);// Coefficient of the c-function
2816 static const G4double cp=3.; // Power of the c-function
2817 //G4double x=Q2/dM/nu; // Direct x definition
2818 G4double K=nu-Q2/dM; // K=nu*(1-x)
2819 if(K<0.)
2820 {
2821#ifdef edebug
2822 G4cerr<<"**G4QEleNucCS::GetVirtFact:K="<<K<<",nu="<<nu<<",Q2="<<Q2<<",dM="<<dM<<G4endl;
2823#endif
2824 return 0.;
2825 }
2826 G4double lK=std::log(K); // ln(K)
2827 G4double x=1.-K/nu; // This definitin saves one div.
2828 G4double GD=1.+Q2/Q02; // Reversed nucleonic form-factor
2829 G4double b=std::exp(bp*(lK-blK0)); // b-factor
2830 G4double c=std::exp(cp*(lK-clK0)); // c-factor
2831 G4double r=.5*std::log(Q2+nu*nu)-lK; // r=.5*log((Q^2+nu^2)/K^2)
2832 G4double ef=std::exp(r*(b-c*r*r)); // exponential factor
2833 return (1.-x)*ef/GD/GD;
2834}

◆ ThresholdEnergy()

G4double G4QElectronNuclearCrossSection::ThresholdEnergy ( G4int  Z,
G4int  N,
G4int  PDG = 11 
)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 271 of file G4QElectronNuclearCrossSection.cc.

272{
273 // CHIPS - Direct GEANT
274 //static const G4double mNeut = G4QPDGCode(2112).GetMass();
275 //static const G4double mProt = G4QPDGCode(2212).GetMass();
276 static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1,0)/MeV;
277 static const G4double mProt = G4NucleiProperties::GetNuclearMass(1,1)/MeV;
278 static const G4double mAlph = G4NucleiProperties::GetNuclearMass(4,2)/MeV;
279 // ---------
280 static const G4double infEn = 9.e27;
281
282 G4int A=Z+N;
283 if(A<1) return infEn;
284 else if(A==1) return 144.76; // Pi0 threshold in MeV for the proton: T>m+(m^2+2lm)/2M
285 // CHIPS - Direct GEANT
286 //G4double mT= G4QPDGCode(111).GetNuclMass(Z,N,0);
287 G4double mT= 0.;
290 else return 0.; // If it is not in the Table of Stable Nuclei, then the Threshold=0
291 // ---------
292 G4double mP= infEn;
293 //if(Z) mP= G4QPDGCode(111).GetNuclMass(Z-1,N,0);
294 if(A>1&&Z&&G4NucleiProperties::IsInStableTable(A-1,Z-1))
295 mP = G4NucleiProperties::GetNuclearMass(A-1,Z-1)/MeV; // ResNucMass for a proton
296 G4double mN= infEn;
297 //if(N) mN= G4QPDGCode(111).GetNuclMass(Z,N-1,0);
299 mN = G4NucleiProperties::GetNuclearMass(A-1,Z)/MeV; // ResNucMass for a neutron
300
301 G4double mA= infEn;
302 if(A>4&&Z>1&&G4NucleiProperties::IsInStableTable(A-4,Z-2))
303 mA = G4NucleiProperties::GetNuclearMass(A-4.,Z-2.)/MeV;// ResNucMass for an alpha
304
305 G4double dP= mP +mProt - mT;
306 G4double dN= mN +mNeut - mT;
307 G4double dA= mA +mAlph - mT;
308#ifdef pdebug
309 G4cout<<"G4QElectronNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
310 <<mA<<",dA="<<dA<<",mT="<<mT<<",A="<<A<<",Z="<<Z<<G4endl;
311#endif
312 if(dP<dN)dN=dP;
313 if(dA<dN)dN=dA;
314 return dN;
315}
static bool IsInStableTable(const G4double A, const G4double Z)
static G4double GetNuclearMass(const G4double A, const G4double Z)

Referenced by GetCrossSection().


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