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

#include <G4QTauNuclearCrossSection.hh>

+ Inheritance diagram for G4QTauNuclearCrossSection:

Public Member Functions

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

 G4QTauNuclearCrossSection ()
 
- 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 57 of file G4QTauNuclearCrossSection.hh.

Constructor & Destructor Documentation

◆ G4QTauNuclearCrossSection()

G4QTauNuclearCrossSection::G4QTauNuclearCrossSection ( )
inlineprotected

Definition at line 61 of file G4QTauNuclearCrossSection.hh.

61{};

◆ ~G4QTauNuclearCrossSection()

G4QTauNuclearCrossSection::~G4QTauNuclearCrossSection ( )

Definition at line 84 of file G4QTauNuclearCrossSection.cc.

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

Member Function Documentation

◆ CalculateCrossSection()

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

Implements G4VQCrossSection.

Definition at line 321 of file G4QTauNuclearCrossSection.cc.

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

101{
102 static const G4double mtu=1777.; // Mass of a tau lepton in MeV
103 static const G4double mtu2=mtu*mtu; // Squared Mass of a tau-lepton in MeV^2
104 static G4int j; // A#0f records found in DB for this projectile
105 static std::vector <G4int> colPDG;// Vector of the projectile PDG code
106 static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
107 static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
108 static std::vector <G4double> colP; // Vector of last momenta for the reaction
109 static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
110 static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
111 // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
112 G4double pEn=std::sqrt(pMom*pMom+mtu2)-mtu; // ==> tau-/tau+ kinEnergy
113#ifdef pdebug
114 G4cout<<"G4QTNCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
115 <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
116 <<colN.size()<<G4endl;
117 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
118#endif
119 if(std::abs(pPDG)!=15)
120 {
121#ifdef pdebug
122 G4cout<<"G4QTNCS::GetCS: *** Found pPDG="<<pPDG<<" =--=> CS=0"<<G4endl;
123 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
124#endif
125 return 0.; // projectile PDG=0 is a mistake (?!) @@
126 }
127 G4bool in=false; // By default the isotope must be found in the AMDB
128 if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
129 {
130 in = false; // By default the isotope haven't be found in AMDB
131 lastP = 0.; // New momentum history (nothing to compare with)
132 lastPDG = pPDG; // The last PDG of the projectile
133 lastN = tgN; // The last N of the calculated nucleus
134 lastZ = tgZ; // The last Z of the calculated nucleus
135 lastI = colN.size(); // Size of the Associative Memory DB in the heap
136 j = 0; // A#0f records found in DB for this projectile
137 if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
138 { // The nucleus with projPDG is found in AMDB
139 if(colN[i]==tgN && colZ[i]==tgZ)
140 {
141 lastI=i;
142 lastTH =colTH[i]; // Last THreshold (A-dependent)
143#ifdef pdebug
144 G4cout<<"G4QTNCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
145 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
146#endif
147 if(pEn<=lastTH)
148 {
149#ifdef pdebug
150 G4cout<<"G4QTNCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
151 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
152#endif
153 return 0.; // Energy is below the Threshold value
154 }
155 lastP =colP [i]; // Last Momentum (A-dependent)
156 lastCS =colCS[i]; // Last CrossSect (A-dependent)
157 if(std::fabs(lastP/pMom-1.)<tolerance)
158 {
159#ifdef pdebug
160 G4cout<<"G4QTNCS::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<<"G4QTNCS::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<<"G4QTNCS::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<<"G4QTNCS::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<<"---G4QTNCrossSec::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<<"G4QTNCS::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<<"G4QTNCrossSection::GetCrossSect: NewThresh="<<lastTH<<", T="<<pEn<<G4endl;
203#endif
204 if(pEn>lastTH)
205 {
206#ifdef pdebug
207 G4cout<<"G4QTNCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
208#endif
209 lastTH=pEn;
210 }
211 }
212#ifdef pdebug
213 G4cout<<"G4QTNCS::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<<"G4QTNCS::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<<"G4QTNCS::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<<"G4QTNCS::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 {
248#ifdef pdebug
249 G4cout<<"G4QTNCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
250 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
251#endif
252 return lastCS*millibarn; // Use theLastCS
253 }
254 else
255 {
256#ifdef pdebug
257 G4cout<<"G4QTNCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
258#endif
259 lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
260 lastP=pMom;
261 }
262#ifdef pdebug
263 G4cout<<"G4QTNCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
264 //CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
265#endif
266 return lastCS*millibarn;
267}
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=15)
static G4double tolerance

◆ GetExchangeEnergy()

G4double G4QTauNuclearCrossSection::GetExchangeEnergy ( )
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2622 of file G4QTauNuclearCrossSection.cc.

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

◆ GetExchangePDGCode()

G4int G4QTauNuclearCrossSection::GetExchangePDGCode ( )
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2791 of file G4QTauNuclearCrossSection.cc.

2791{return 22;}

◆ GetExchangeQ2()

G4double G4QTauNuclearCrossSection::GetExchangeQ2 ( G4double  nu)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 2737 of file G4QTauNuclearCrossSection.cc.

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

◆ GetPointer()

G4VQCrossSection * G4QTauNuclearCrossSection::GetPointer ( )
static

Definition at line 78 of file G4QTauNuclearCrossSection.cc.

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

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

◆ GetVirtualFactor()

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

Reimplemented from G4VQCrossSection.

Definition at line 2793 of file G4QTauNuclearCrossSection.cc.

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

◆ ThresholdEnergy()

G4double G4QTauNuclearCrossSection::ThresholdEnergy ( G4int  Z,
G4int  N,
G4int  PDG = 15 
)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 275 of file G4QTauNuclearCrossSection.cc.

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