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

#include <G4QMuonNuclearCrossSection.hh>

+ Inheritance diagram for G4QMuonNuclearCrossSection:

Public Member Functions

 ~G4QMuonNuclearCrossSection ()
 
G4double ThresholdEnergy (G4int Z, G4int N, G4int PDG=13)
 
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

 G4QMuonNuclearCrossSection ()
 
- 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 56 of file G4QMuonNuclearCrossSection.hh.

Constructor & Destructor Documentation

◆ G4QMuonNuclearCrossSection()

G4QMuonNuclearCrossSection::G4QMuonNuclearCrossSection ( )
inlineprotected

Definition at line 60 of file G4QMuonNuclearCrossSection.hh.

60{};

◆ ~G4QMuonNuclearCrossSection()

G4QMuonNuclearCrossSection::~G4QMuonNuclearCrossSection ( )

Definition at line 83 of file G4QMuonNuclearCrossSection.cc.

84{
85 G4int lens=J1->size();
86 for(G4int i=0; i<lens; ++i) delete[] (*J1)[i];
87 delete J1;
88 G4int hens=J2->size();
89 for(G4int i=0; i<hens; ++i) delete[] (*J2)[i];
90 delete J2;
91 G4int pens=J3->size();
92 for(G4int i=0; i<pens; ++i) delete[] (*J3)[i];
93 delete J3;
94}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ CalculateCrossSection()

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

Implements G4VQCrossSection.

Definition at line 322 of file G4QMuonNuclearCrossSection.cc.

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

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

◆ GetExchangeEnergy()

G4double G4QMuonNuclearCrossSection::GetExchangeEnergy ( )
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2618 of file G4QMuonNuclearCrossSection.cc.

2619{
2620 // @@ All constants are copy of that from GetCrossSection funct. => Make them general.
2621 static const G4int nE=336; // !! If change this, change it in GetFunctions() (*.hh) !!
2622 static const G4int mL=nE-1;
2623 static const G4double EMi=2.0612; // Minimum Energy
2624 static const G4double EMa=50000.; // Maximum Energy
2625 static const G4double lEMi=std::log(EMi); // Minimum logarithmic Energy
2626 static const G4double lEMa=std::log(EMa); // Maximum logarithmic Energy
2627 static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in Energy
2628 static const G4double mmu=105.65839; // Mass of muon in MeV
2629 static const G4double lmmu=std::log(mmu); // Log of muon mass
2630 G4double phLE=0.; // Prototype of the log(nu=E_gamma)
2631 G4double Y[nE]; // Prepare the array for randomization
2632#ifdef debug
2633 G4cout<<"G4QMuonNuclCrossSect::GetExchanEn:B="<<lastF<<",l="<<lastL<<",1="<<lastJ1[lastL]
2634 <<",2="<<lastJ2[lastL]<<",3="<<lastJ3[lastL]<<",S="<<lastSig<<",E="<<lastE<<G4endl;
2635#endif
2636 G4double lastLE=lastG+lmmu; // recover log(eE) from the gamma (lastG)
2637 G4double dlg1=lastG+lastG-1.;
2638 G4double lgoe=lastG/lastE;
2639 for(G4int i=lastF;i<=lastL;i++)
2640 Y[i]=dlg1*lastJ1[i]-lgoe*(lastJ2[i]+lastJ2[i]-lastJ3[i]/lastE);
2641 G4double ris=lastSig*G4UniformRand(); // Sig can be > Y[lastL=mL], then it is funct. reg.
2642#ifdef debug
2643 G4cout<<"G4QMuonNuclearCrossSection::GetExchangeEnergy: "<<ris<<",Y="<<Y[lastL]<<G4endl;
2644#endif
2645 if(ris<Y[lastL]) // Search in the table
2646 {
2647 G4int j=lastF;
2648 G4double Yj=Y[j]; // It mast be 0 (some times just very small)
2649 while (ris>Yj && j<lastL) // Associative search
2650 {
2651 j++;
2652 Yj=Y[j]; // High value
2653 }
2654 G4int j1=j-1;
2655 G4double Yi=Y[j1]; // Low value
2656 phLE=lEMi+(j1+(ris-Yi)/(Yj-Yi))*dlnE;
2657#ifdef debug
2658 G4cout<<"G4QMuNuclearCS::E="<<phLE<<",l="<<lEMi<<",j="<<j<<",ris="<<ris<<",Yi="<<Yi
2659 <<",Y="<<Yj<<G4endl;
2660#endif
2661 }
2662 else // Search with the function
2663 {
2664 if(lastL<mL)
2665 G4cerr<<"**G4QMuonNucCS::GetExEn:L="<<lastL<<",S="<<lastSig<<",Y="<<Y[lastL]<<G4endl;
2666 G4double f=(ris-Y[lastL])/lastH; // ScaledResidualValue of the cross-sec. integral
2667#ifdef pdebug
2668 G4cout<<"G4QMuNucCS::GetExEn:HighEnergy f="<<f<<",ris="<<ris<<",lastH="<<lastH<<G4endl;
2669#endif
2670 phLE=SolveTheEquation(f); // Solve equation to find theLog(phE) (comp lastLE)
2671#ifdef pdebug
2672 G4cout<<"G4QMuonNuclearCrossSection::GetExchangeEnergy:HighEnergy lphE="<<phLE<<G4endl;
2673#endif
2674 }
2675 if(phLE>lastLE)
2676 {
2677 G4cerr<<"***G4QMuNuclearCS::GetExEnergy: N="<<lastN<<",Z="<<lastZ<<",lpE"<<phLE<<">leE"
2678 <<lastLE<<",Sig="<<lastSig<<",rndSig="<<ris<<",Beg="<<lastF<<",End="<<lastL
2679 <<",Y="<<Y[lastL]<<G4endl;
2680 if(lastLE<7.2) phLE=std::log(std::exp(lastLE)-mmu);
2681 else phLE=7.;
2682 }
2683 return std::exp(phLE);
2684}
#define G4UniformRand()
Definition: Randomize.hh:53

◆ GetExchangePDGCode()

G4int G4QMuonNuclearCrossSection::GetExchangePDGCode ( )
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2787 of file G4QMuonNuclearCrossSection.cc.

2787{return 22;}

◆ GetExchangeQ2()

G4double G4QMuonNuclearCrossSection::GetExchangeQ2 ( G4double  nu)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2733 of file G4QMuonNuclearCrossSection.cc.

2734{
2735 static const G4double mmu=105.65839; // Mass of muon in MeV
2736 static const G4double mmu2=mmu*mmu; // Squared Mass of muon in MeV
2737 G4double y=nu/lastE; // Part of energy carried by the equivalent pfoton
2738 if(y>=1.-1./(lastG+lastG)) return 0.; // The region where the method does not work
2739 G4double y2=y*y; // Squared photonic part of energy
2740 G4double ye=1.-y; // Part of energy carried by the secondary muon
2741 G4double Qi2=mmu2*y2/ye; // Minimum Q2
2742 G4double Qa2=4*lastE*lastE*ye; // Maximum Q2
2743 G4double iar=Qi2/Qa2; // Q2min/Q2max ratio
2744 G4double Dy=ye+.5*y2; // D(y) function
2745 G4double Py=ye/Dy; // P(y) function
2746 G4double ePy=1.-std::exp(Py); // 1-exp(P(y)) part
2747 G4double Uy=Py*(1.-iar); // U(y) function
2748 G4double Fy=(ye+ye)*(1.+ye)*iar/y2; // F(y) function
2749 G4double fr=iar/(1.-ePy*iar); // Q-fraction
2750 if(Fy<=-fr)
2751 {
2752#ifdef edebug
2753 G4cerr<<"***G4QMuonNucCS::GetExchQ2: Fy="<<Fy<<"+fr="<<fr<<" <0"<<",iar="<<iar<<G4endl;
2754#endif
2755 return 0.;
2756 }
2757 G4double LyQa2=std::log(Fy+fr); // L(y,Q2max) function
2758 G4bool cond=true;
2759 G4int maxTry=3;
2760 G4int cntTry=0;
2761 G4double Q2=Qi2;
2762 while(cond&&cntTry<maxTry) // The loop to avoid x>1.
2763 {
2764 G4double R=G4UniformRand(); // Random number (0,1)
2765 Q2=Qi2*(ePy+1./(std::exp(R*LyQa2-(1.-R)*Uy)-Fy));
2766 cntTry++;
2767 cond = Q2>1878.*nu;
2768 }
2769 if(Q2<Qi2)
2770 {
2771#ifdef edebug
2772 G4cerr<<"***G4QMuonNuclearCrossSect::GetExchangeQ2: Q2="<<Q2<<" < Q2min="<<Qi2<<G4endl;
2773#endif
2774 return Qi2;
2775 }
2776 if(Q2>Qa2)
2777 {
2778#ifdef edebug
2779 G4cerr<<"***G4QMuonNuclearCrossSect::GetExchangeQ2: Q2="<<Q2<<" > Q2max="<<Qi2<<G4endl;
2780#endif
2781 return Qa2;
2782 }
2783 return Q2;
2784}

◆ GetPointer()

G4VQCrossSection * G4QMuonNuclearCrossSection::GetPointer ( )
static

Definition at line 77 of file G4QMuonNuclearCrossSection.cc.

78{
79 static G4QMuonNuclearCrossSection theCrossSection; //**Static body of the Cross Section**
80 return &theCrossSection;
81}

Referenced by G4QInelastic::GetMeanFreePath(), G4QAtomicElectronScattering::PostStepDoIt(), and G4QInelastic::PostStepDoIt().

◆ GetVirtualFactor()

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

Reimplemented from G4VQCrossSection.

Definition at line 2789 of file G4QMuonNuclearCrossSection.cc.

2790{
2791 static const G4double dM=938.27+939.57;// Mean double nucleon mass = m_n+m_p (no binding)
2792 static const G4double Q0=843.; // Coefficient of the dipole nucleonic form-factor
2793 static const G4double Q02=Q0*Q0; // Squared coefficient of theDipoleNuclFormFactor
2794 static const G4double blK0=std::log(185.); // Coefficient of the b-function
2795 static const G4double bp=0.85; // Power of the b-function
2796 static const G4double clK0=std::log(1390.); // Coefficient of the c-function
2797 static const G4double cp=3.; // Power of the c-function
2798 //G4double x=Q2/dM/nu; // Direct x definition
2799 G4double K=nu-Q2/dM; // K=nu*(1-x)
2800 if(K<0.)
2801 {
2802#ifdef edebug
2803 G4cerr<<"**G4QMuonNucCS::GetVirtFact:K="<<K<<",nu="<<nu<<",Q2="<<Q2<<",d="<<dM<<G4endl;
2804#endif
2805 return 0.;
2806 }
2807 G4double lK=std::log(K); // ln(K)
2808 G4double x=1.-K/nu; // This definitin saves one div.
2809 G4double GD=1.+Q2/Q02; // Reversed nucleonic form-factor
2810 G4double b=std::exp(bp*(lK-blK0)); // b-factor
2811 G4double c=std::exp(cp*(lK-clK0)); // c-factor
2812 G4double r=.5*std::log(Q2+nu*nu)-lK; // r=.5*log((Q^2+nu^2)/K^2)
2813 G4double ef=std::exp(r*(b-c*r*r)); // exponential factor
2814 return (1.-x)*ef/GD/GD;
2815}

◆ ThresholdEnergy()

G4double G4QMuonNuclearCrossSection::ThresholdEnergy ( G4int  Z,
G4int  N,
G4int  PDG = 13 
)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 276 of file G4QMuonNuclearCrossSection.cc.

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