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

#include <G4QIonIonCrossSection.hh>

+ Inheritance diagram for G4QIonIonCrossSection:

Public Member Functions

 ~G4QIonIonCrossSection ()
 
virtual G4double GetCrossSection (G4bool fCS, G4double pMom, G4int Z, G4int N, G4int PDG)
 
G4double CalculateCrossSection (G4bool fCS, G4int F, G4int I, G4int PDG, G4int tZ, G4int tN, G4double Momentum)
 
G4double ThresholdMomentum (G4int pZ, G4int pN, G4int tZ, G4int tN)
 
- 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

 G4QIonIonCrossSection ()
 
- 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 59 of file G4QIonIonCrossSection.hh.

Constructor & Destructor Documentation

◆ G4QIonIonCrossSection()

G4QIonIonCrossSection::G4QIonIonCrossSection ( )
inlineprotected

Definition at line 63 of file G4QIonIonCrossSection.hh.

63{}

◆ ~G4QIonIonCrossSection()

G4QIonIonCrossSection::~G4QIonIonCrossSection ( )
inline

Definition at line 67 of file G4QIonIonCrossSection.hh.

67{}

Member Function Documentation

◆ CalculateCrossSection()

G4double G4QIonIonCrossSection::CalculateCrossSection ( G4bool  fCS,
G4int  F,
G4int  I,
G4int  PDG,
G4int  tZ,
G4int  tN,
G4double  Momentum 
)
virtual

Implements G4VQCrossSection.

Definition at line 252 of file G4QIonIonCrossSection.cc.

254{
255 //static const G4double third=1./3.; // power for A^P->R conversion [R=1.1*A^(1/3)]
256 //static const G4double conv=38.; // coeff. R2->sig=c*(pR+tR)^2, c=pi*10(mb/fm^2)*1.21
257 // If change the following, please change in ::GetFunctions:
258 static const G4double THmin=0.; // @@ start from threshold (?) minimum Energy Threshold
259 static const G4double dP=10.; // step for the LEN table
260 static const G4int nL=100; // A#of LENesonance points in E (each MeV from 2 to 106)
261 static const G4double Pmin=THmin+(nL-1)*dP; // minE for the HighE part
262 static const G4double Pmax=300000.; // maxE for the HighE part
263 static const G4int nH=100; // A#of HResonance points in lnE
264 static const G4double milP=std::log(Pmin); // Low logarithm energy for the HighE part
265 static const G4double malP=std::log(Pmax); // High logarithm energy (each 2.75 percent)
266 static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HighE part
267 //
268 // Associative memory for acceleration
269 static std::vector <G4double*> LENI; // Vector of pointers: LowEnIneIonIonCrossSection
270 static std::vector <G4double*> HENI; // Vector of pointers: HighEnIneIonIonCrossSection
271 static std::vector <G4double*> LENE; // Vector of pointers: LowEnElaIonIonCrossSection
272 static std::vector <G4double*> HENE; // Vector of pointers: HighEnElaIonIonCrossSection
273#ifdef debug
274 G4cout<<"G4QIonIonCrossSection::CalcCS: Z="<<tZ<<", N="<<tN<<", P="<<TotMom<<G4endl;
275#endif
276 G4int dPDG=pPDG/10; // 10SZZZAAA
277 G4int zPDG=dPDG/1000; // 10SZZZ (?)
278 G4int zA=dPDG%1000; // proj A
279 G4int pZ=zPDG%1000; // proj Z (?)
280 G4int pN=zA-pZ; // proj N (?)
281 G4double Momentum=TotMom/zA; // Momentum per nucleon
282 if (Momentum<THmin) return 0.; // @@ This can be dangerouse for the heaviest nuc.!
283 G4double sigma=0.;
284 if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
285 G4double tA=tN+tZ; // Target weight
286 G4double pA=zA; // Projectile weight
287 if(F<=0) // This isotope was not the last used isotop
288 {
289 if(F<0 || !XS) // This isotope was found in DAMDB or Elast =>RETRIEVE
290 {
291 lastLENI=LENI[I]; // Pointer to Low Energy inelastic cross sections
292 lastHENI=HENI[I]; // Pointer to High Energy inelastic cross sections
293 lastLENE=LENE[I]; // Pointer to Low Energy inelastic cross sections
294 lastHENE=HENE[I]; // Pointer to High Energy inelastic cross sections
295 }
296 else // This isotope wasn't calculated previously => CREATE
297 {
298 lastLENI = new G4double[nL]; // Allocate memory for the new LEN cross sections
299 lastHENI = new G4double[nH]; // Allocate memory for the new HEN cross sections
300 lastLENE = new G4double[nL]; // Allocate memory for the new LEN cross sections
301 lastHENE = new G4double[nH]; // Allocate memory for the new HEN cross sections
302 G4int er=GetFunctions(pZ,pN,tZ,tN,lastLENI,lastHENI,lastLENE,lastHENE);
303 if(er<1) G4cerr<<"*W*G4QIonIonCroSec::CalcCrossSection: pA="<<tA<<",tA="<<tA<<G4endl;
304#ifdef debug
305 G4cout<<"G4QIonIonCrossSection::CalcCS: GetFunctions er="<<er<<",pA="<<pA<<",tA="<<tA
306 <<G4endl;
307#endif
308 // *** The synchronization check ***
309 G4int sync=LENI.size();
310 if(sync!=I) G4cout<<"*W*G4IonIonCrossSec::CalcCrossSect:Sync="<<sync<<"#"<<I<<G4endl;
311 LENI.push_back(lastLENI); // added LEN Inelastic
312 HENI.push_back(lastHENI); // added HEN Inelastic
313 LENE.push_back(lastLENE); // added LEN Elastic
314 HENE.push_back(lastHENE); // added HEN Elastic
315 } // End of creation of the new set of parameters
316 } // End of parameters udate
317 // =------------= NOW the Magic Formula =--------------------------=
318 if (Momentum<lastTH) return 0.; // It must be already checked in the interface class
319 else if (Momentum<Pmin) // LEN region (approximated in E, not in lnE)
320 {
321#ifdef debug
322 G4cout<<"G4QIICS::CalCS:p="<<pA<<",t="<<tA<<",n="<<nL<<",T="<<THmin<<",d="<<dP<<G4endl;
323#endif
324 if(tA<1. || pA<1.)
325 {
326 G4cout<<"-Warning-G4QIICS::CalcCS: pA="<<pA<<" or tA="<<tA<<" aren't nuclei"<<G4endl;
327 sigma=0.;
328 }
329 else
330 {
331 G4double dPp=dP*pA;
332 if(XS) sigma=EquLinearFit(Momentum,nL,THmin,dPp,lastLENI);
333 else sigma=EquLinearFit(Momentum,nL,THmin,dPp,lastLENE);
334 }
335#ifdef debugn
336 if(sigma<0.) G4cout<<"-Warning-G4QIICS::CalcCS:pA="<<pA<<",tA="<<tA<<",XS="<<XS<<",P="
337 <<Momentum<<", Th="<<THmin<<", dP="<<dP<<G4endl;
338#endif
339 }
340 else if (Momentum<Pmax*pA) // High Energy region
341 {
342 G4double lP=std::log(Momentum);
343#ifdef debug
344 G4cout<<"G4QIonIonCS::CalcCS:before HEN nH="<<nH<<",iE="<<milP<<",dlP="<<dlP<<G4endl;
345#endif
346 if(tA<1. || pA<1.)
347 {
348 G4cout<<"-Warning-G4QIICS::CalCS:pA="<<pA<<" or tA="<<tA<<" aren't composit"<<G4endl;
349 sigma=0.;
350 }
351 else
352 {
353 G4double milPp=milP+std::log(pA);
354 if(XS) sigma=EquLinearFit(lP,nH,milPp,dlP,lastHENI);
355 else sigma=EquLinearFit(lP,nH,milPp,dlP,lastHENE);
356 }
357 }
358 else // UltraHighE region (not frequent)
359 {
360 std::pair<G4double, G4double> inelel = CalculateXS(pZ, pN, tZ, tN, Momentum);
361 if(XS) sigma=inelel.first;
362 else sigma=inelel.second;
363 }
364#ifdef debug
365 G4cout<<"G4IonIonCrossSection::CalculateCrossSection: sigma="<<sigma<<G4endl;
366#endif
367 if(sigma<0.) return 0.;
368 return sigma;
369}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double *Y)

Referenced by GetCrossSection().

◆ GetCrossSection()

G4double G4QIonIonCrossSection::GetCrossSection ( G4bool  fCS,
G4double  pMom,
G4int  Z,
G4int  N,
G4int  PDG 
)
virtual

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

Reimplemented from G4VQCrossSection.

Definition at line 73 of file G4QIonIonCrossSection.cc.

75{
76 static G4int j; // A#0f records found in DB for this projectile
77 static std::vector <G4int> colPDG;// Vector of the projectile PDG code
78 static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
79 static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
80 static std::vector <G4double> colP; // Vector of last momenta for the reaction
81 static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
82 static std::vector <G4double> colICS;// Vector of last inelastic cross-sections
83 static std::vector <G4double> colECS;// Vector of last elastic cross-sections
84 // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
85#ifdef pdebug
86 G4cout<<"G4QIICS::GetCS:>>> f="<<fCS<<", Z="<<tZ<<"("<<lastZ<<"), N="<<tN<<"("<<lastN
87 <<"),PDG="<<pPDG<<"("<<lastPDG<<"), p="<<pMom<<"("<<lastTH<<")"<<",Sz="
88 <<colN.size()<<G4endl;
89#endif
90 if(!pPDG)
91 {
92#ifdef pdebug
93 G4cout<<"G4QIonIonCS::GetCS: *** Found pPDG="<<pPDG<<" =--=> CS=0"<<G4endl;
94#endif
95 return 0.; // projectile PDG=0 is a mistake (?!) @@
96 }
97 G4bool in=false; // By default the isotope must be found in the AMDB
98 if(tN!=lastN || tZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
99 {
100 in = false; // By default the isotope haven't be found in AMDB
101 lastP = 0.; // New momentum history (nothing to compare with)
102 lastPDG = pPDG; // The last PDG of the projectile
103 lastN = tN; // The last N of the calculated nucleus
104 lastZ = tZ; // The last Z of the calculated nucleus
105 lastI = colN.size(); // Size of the Associative Memory DB in the heap
106 j = 0; // A#0f records found in DB for this projectile
107#ifdef pdebug
108 G4cout<<"G4QIICS::GetCS:FindI="<<lastI<<",pPDG="<<pPDG<<",tN="<<tN<<",tZ="<<tZ<<G4endl;
109#endif
110 if(lastI) for(G4int i=0; i<lastI; i++) // Loop over all DB
111 { // The nucleus with projPDG is found in AMDB
112#ifdef pdebug
113 G4cout<<"G4QII::GCS:P="<<colPDG[i]<<",N="<<colN[i]<<",Z="<<colZ[i]<<",j="<<j<<G4endl;
114#endif
115 if(colPDG[i]==pPDG && colN[i]==tN && colZ[i]==tZ)
116 {
117 lastI=i;
118 lastTH =colTH[i]; // Last THreshold (A-dependent)
119#ifdef pdebug
120 G4cout<<"G4QIICS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
121#endif
122 if(pMom<=lastTH)
123 {
124#ifdef pdebug
125 G4cout<<"G4QIICS::GetCS:Found P="<<pMom<<"<Threshold="<<lastTH<<"->XS=0"<<G4endl;
126#endif
127 return 0.; // Energy is below the Threshold value
128 }
129 lastP =colP [i]; // Last Momentum (A-dependent)
130 lastICS=colICS[i]; // Last Inelastic Cross-Section (A-dependent)
131 lastECS=colECS[i]; // Last Elastic Cross-Section (A-dependent)
132 if(std::fabs(lastP/pMom-1.)<tolerance)
133 {
134#ifdef pdebug
135 G4cout<<"G4QIonIonCS::GetCS:P="<<pMom<<",InXS="<<lastICS*millibarn<<",ElXS="
136 <<lastECS*millibarn<<G4endl;
137#endif
138 CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // Update param's only
139 if(fCS) return lastICS*millibarn; // Use theLastInelasticCS
140 return lastECS*millibarn; // Use theLastElasticCS
141 }
142 in = true; // This is the case when the isotop is found in DB
143 // Momentum pMom is in IU ! @@ Units
144#ifdef pdebug
145 G4cout<<"G4QIICS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
146#endif
147 lastICS=CalculateCrossSection( true,-1,j,lastPDG,lastZ,lastN,pMom);// read & update
148 lastECS=CalculateCrossSection(false,-1,j,lastPDG,lastZ,lastN,pMom);// read & update
149#ifdef pdebug
150 G4cout<<"G4QIonIonCS::GetCS:=>New(inDB) InCS="<<lastICS<<",ElCS="<<lastECS<<G4endl;
151#endif
152 if((lastICS<=0. || lastECS<=0.) && pMom>lastTH) // Correct the threshold
153 {
154#ifdef pdebug
155 G4cout<<"G4QIonIonCS::GetCS:New,T="<<pMom<<"(CS=0) > Threshold="<<lastTH<<G4endl;
156#endif
157 lastTH=pMom;
158 }
159 break; // Go out of the LOOP
160 }
161#ifdef pdebug
162 G4cout<<"--->G4QIonIonCrossSec::GetCrosSec: pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
163 <<",Z["<<i<<"]="<<colZ[i]<<",PDG="<<colPDG[i]<<G4endl;
164#endif
165 j++; // Increment a#0f records found in DB for this pPDG
166 }
167 if(!in) // This nucleus has not been calculated previously
168 {
169#ifdef pdebug
170 G4cout<<"G4QIICS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
171#endif
172 //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
173 lastICS=CalculateCrossSection(true ,0,j,lastPDG,lastZ,lastN,pMom); //calculate&create
174 lastECS=CalculateCrossSection(false,0,j,lastPDG,lastZ,lastN,pMom); //calculate&create
175 if(lastICS<=0. || lastECS<=0.)
176 {
177 lastTH = ThresholdEnergy(tZ, tN); // Threshold Energy=Mom=0 which is now the last
178#ifdef pdebug
179 G4cout<<"G4QIonIonCrossSect::GetCrossSect:NewThresh="<<lastTH<<",P="<<pMom<<G4endl;
180#endif
181 if(pMom>lastTH)
182 {
183#ifdef pdebug
184 G4cout<<"G4QIonIonCS::GetCS:1-st,P="<<pMom<<">Thresh="<<lastTH<<"->XS=0"<<G4endl;
185#endif
186 lastTH=pMom;
187 }
188 }
189#ifdef pdebug
190 G4cout<<"G4QIICS::GetCS: *New* ICS="<<lastICS<<", ECS="<<lastECS<<",N="<<lastN<<",Z="
191 <<lastZ<<G4endl;
192#endif
193 colN.push_back(tN);
194 colZ.push_back(tZ);
195 colPDG.push_back(pPDG);
196 colP.push_back(pMom);
197 colTH.push_back(lastTH);
198 colICS.push_back(lastICS);
199 colECS.push_back(lastECS);
200#ifdef pdebug
201 G4cout<<"G4QIICS::GetCS:*1st*, P="<<pMom<<"(MeV), InCS="<<lastICS*millibarn
202 <<", ElCS="<<lastECS*millibarn<<"(mb)"<<G4endl;
203#endif
204 if(fCS) return lastICS*millibarn; // Use theLastInelasticCS
205 return lastECS*millibarn; // Use theLastElasticCS
206 } // End of creation of the new set of parameters
207 else
208 {
209#ifdef pdebug
210 G4cout<<"G4QIICS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
211#endif
212 colP[lastI]=pMom;
213 colPDG[lastI]=pPDG;
214 colICS[lastI]=lastICS;
215 colECS[lastI]=lastECS;
216 }
217 } // End of parameters udate
218 else if(pMom<=lastTH)
219 {
220#ifdef pdebug
221 G4cout<<"G4QIICS::GetCS: Current T="<<pMom<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
222#endif
223 return 0.; // Momentum is below the Threshold Value -> CS=0
224 }
225 else if(std::fabs(lastP/pMom-1.)<tolerance)
226 {
227#ifdef pdebug
228 G4cout<<"G4QIICS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", InCS="<<lastICS*millibarn
229 <<", ElCS="<<lastECS*millibarn<<"(mb)"<<G4endl;
230#endif
231 if(fCS) return lastICS*millibarn; // Use theLastInelasticCS
232 return lastECS*millibarn; // Use theLastElasticCS
233 }
234 else
235 {
236#ifdef pdebug
237 G4cout<<"G4QIICS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
238#endif
239 lastICS=CalculateCrossSection( true,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
240 lastECS=CalculateCrossSection(false,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
241 lastP=pMom;
242 }
243#ifdef pdebug
244 G4cout<<"G4QIICS::GetCroSec:*End*,P="<<pMom<<"(MeV), InCS="<<lastICS*millibarn<<", ElCS="
245 <<lastECS*millibarn<<"(mb)"<<G4endl;
246#endif
247 if(fCS) return lastICS*millibarn; // Use theLastInelasticCS
248 return lastECS*millibarn; // Use theLastElasticCS
249}
bool G4bool
Definition: G4Types.hh:67
G4double CalculateCrossSection(G4bool fCS, G4int F, G4int I, G4int PDG, G4int tZ, G4int tN, G4double Momentum)
virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0)
static G4double tolerance

◆ GetPointer()

G4VQCrossSection * G4QIonIonCrossSection::GetPointer ( )
static

Definition at line 65 of file G4QIonIonCrossSection.cc.

66{
67 static G4QIonIonCrossSection theCrossSection; //**Static body of Cross Section**
68 return &theCrossSection;
69}

Referenced by G4QIonIonElastic::GetMeanFreePath(), G4QLowEnergy::GetMeanFreePath(), and G4QIonIonElastic::PostStepDoIt().

◆ ThresholdMomentum()

G4double G4QIonIonCrossSection::ThresholdMomentum ( G4int  pZ,
G4int  pN,
G4int  tZ,
G4int  tN 
)

Definition at line 519 of file G4QIonIonCrossSection.cc.

520{
521 static const G4double third=1./3.;
522 static const G4double pM = G4QPDGCode(2212).GetMass(); // Proton mass in MeV
523 static const G4double tpM= pM+pM; // Doubled proton mass (MeV)
524 if(pZ<.99 || pN<0. || tZ<.99 || tN<0.) return 0.;
525 G4double tA=tZ+tN;
526 G4double pA=pZ+pN;
527 //G4double dE=1.263*tZ/(1.+std::pow(tA,third));
528 G4double dE=pZ*tZ/(std::pow(pA,third)+std::pow(tA,third))/pA; // dE/pA (per projNucleon)
529 return std::sqrt(dE*(tpM+dE));
530}
G4double GetMass()
Definition: G4QPDGCode.cc:693

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