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

#include <G4QPhotonNuclearCrossSection.hh>

+ Inheritance diagram for G4QPhotonNuclearCrossSection:

Public Member Functions

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

 G4QPhotonNuclearCrossSection ()
 
- 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 51 of file G4QPhotonNuclearCrossSection.hh.

Constructor & Destructor Documentation

◆ G4QPhotonNuclearCrossSection()

G4QPhotonNuclearCrossSection::G4QPhotonNuclearCrossSection ( )
inlineprotected

Definition at line 55 of file G4QPhotonNuclearCrossSection.hh.

55{}

◆ ~G4QPhotonNuclearCrossSection()

G4QPhotonNuclearCrossSection::~G4QPhotonNuclearCrossSection ( )

Definition at line 76 of file G4QPhotonNuclearCrossSection.cc.

77{
78 G4int lens=GDR->size();
79 for(G4int i=0; i<lens; ++i) delete[] (*GDR)[i];
80 delete GDR;
81 G4int hens=HEN->size();
82 for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
83 delete HEN;
84}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ CalculateCrossSection()

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

Implements G4VQCrossSection.

Definition at line 308 of file G4QPhotonNuclearCrossSection.cc.

310{
311#ifdef debug
312 G4cout<<"G4QPhotonNucCrossSection::CalculateCrossSection: ***Called***"<<G4endl;
313#endif
314 static const G4double THmin=2.; // minimum Energy Threshold
315 static const G4double dE=1.; // step for the GDR table
316 static const G4int nL=105; // A#of GDResonance points in E (1 MeV from 2 to 106)
317 static const G4double Emin=THmin+(nL-1)*dE; // minE for the HighE part
318 static const G4double Emax=50000.; // maxE for the HighE part
319 static const G4int nH=224; // A#of HResonance points in lnE
320 static const G4double milE=std::log(Emin); // Low logarithm energy for the HighE part
321 static const G4double malE=std::log(Emax); // High logarithm energy (each 2.75 %)
322 static const G4double dlE=(malE-milE)/(nH-1); // Step in log energy in the HighE part
323 //
324 //static const G4double shd=1.075-.0023*log(2.); // HE PomShadowing(D)
325 static const G4double shd=1.0734; // HE PomShadowing(D)
326 static const G4double shc=0.072; // HE Shadowing constant
327 static const G4double poc=0.0375; // HE Pomeron coefficient
328 static const G4double pos=16.5; // HE Pomeron shift
329 static const G4double reg=.11; // HE Reggeon slope
330 static const G4double shp=1.075; // HE PomShadowing(P)
331 //
332 // Associative memory for acceleration
333 static std::vector <G4double> spA; // shadowing coefficients (A-dependent)
334 //
335 onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
336#ifdef pdebug
337 G4cout<<"G4QPhotonNucCS::CalcCS: P="<<Energy<<", F="<<F<<", I="<<I<<", Z="<<targZ
338 <<", N="<<targN<<", onlyCS="<<CS<<",E="<<Energy<<",th="<<THmin<<G4endl;
339 if(F==-27) return 0.;
340#endif
341 //if (Energy<THmin)
342 //{
343 // lastE=0.;
344 // lastSig=0.;
345#ifdef debug
346 // G4cout<<"---> G4QMuonNucCS::CalcCS: CS=0 as E="<<Energy<<" < "<<THmin<<G4endl;
347#endif
348 // return 0.; // @@ This can be dangerouse for the heaviest nuc.!
349 //}
350 G4double sigma=0.;
351 G4double A=targN+targZ;
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 lastGDR=(*GDR)[I]; // Pointer to prepared GDR cross sections
357 lastHEN=(*HEN)[I]; // Pointer to prepared High Energy cross sections
358 lastSP =spA[I]; // Shadowing coefficient for UHE
359 }
360 else // This isotope wasn't calculated previously => CREATE
361 {
362 G4double lnA=std::log(A); // The nucleus is not found in DB. It is new.
363 if(A==1.) lastSP=1.; // The Reggeon shadowing (A=1)
364 else lastSP=A*(1.-shc*lnA); // The Reggeon shadowing
365#ifdef debug
366 G4cout<<">>>G4QPhotonNuclearCrossSect::CalcCS:lnA="<<lnA<<",lastSP="<<lastSP<<G4endl;
367#endif
368#ifdef debug3
369 if(A==3) G4cout<<"G4QPhotonNuclearCrossSection::CalcCS: lastSP="<<lastSP<<G4endl;
370#endif
371 lastGDR = new G4double[nL]; // Allocate memory for the new GDR cross sections
372 lastHEN = new G4double[nH]; // Allocate memory for the new HEN cross sections
373 G4int er=GetFunctions(A,lastGDR,lastHEN);// set newZeroPosition and fill theFunctions
374 if(er<1) G4cerr<<"***G4QPhotNucCrosSec::CalcCrossSection: A="<<A<<" failed"<<G4endl;
375#ifdef pdebug
376 G4cout<<">>G4QPhotNucCS::CalcCS:**GDR/HEN're made for A="<<A<<"** GFEr="<<er<<G4endl;
377#endif
378 // *** The synchronization check ***
379 G4int sync=GDR->size();
380 if(sync!=I) G4cerr<<"***G4QPhotoNuclearCS::CalcCS: PDG=22, S="<<sync<<"#"<<I<<G4endl;
381 GDR->push_back(lastGDR); // added GDR, found by AH 10/7/02
382 HEN->push_back(lastHEN); // added HEN, found by AH 10/7/02
383 spA.push_back(lastSP); // Pomeron Shadowing
384 } // End of creation of the new set of parameters
385 } // End of parameters udate
386 // =-------------------= NOW the Magic Formula =--------------------------=
387 if (Energy<lastTH) return 0.; // It must be already checked in the interface
388 else if (Energy<=Emin) // GDR region (approximated in E, not in lnE)
389 {
390#ifdef debug
391 G4cout<<"G4QPhNCS::CalcCS:bGDR A="<<A<<", nL="<<nL<<",TH="<<THmin<<",dE="<<dE<<G4endl;
392#endif
393 if(A<=1. || dE <= THmin) sigma=0.; // No GDR for A=1
394 else sigma=EquLinearFit(Energy,nL,THmin,dE,lastGDR);
395#ifdef debugn
396 if(sigma<0.)
397 G4cout<<"G4QPhoNucCS::CalcCS:A="<<A<<",E="<<Energy<<",T="<<THmin<<",dE="<<dE<<G4endl;
398#endif
399 }
400 else if (Energy<Emax) // High Energy region
401 {
402 G4double lE=std::log(Energy);
403#ifdef pdebug
404 G4cout<<"G4QPhotNucCS::CalcCS:lE="<<milE<<",n="<<nH<<",iE="<<milE<<",dE="<<dlE<<",HEN="
405 <<lastHEN<<",A="<<A<<G4endl;
406#endif
407 if(lE > milE) sigma=EquLinearFit(lE,nH,milE,dlE,lastHEN);
408 else sigma=0.;
409 }
410 else // UHE region (calculation, not frequent)
411 {
412 G4double lE=std::log(Energy);
413 G4double sh=shd;
414 if(A==1.)sh=shp;
415 sigma=lastSP*(poc*(lE-pos)+sh*std::exp(-reg*lE));
416 }
417#ifdef debug
418 G4cout<<"G4QPhotonNuclearCrossSection::CalcCS: sigma="<<sigma<<G4endl;
419#endif
420#ifdef debug
421 if(Energy>45000.&&Energy<60000.)
422 G4cout<<"G4QPhotoNucCS::GetCS: A="<<A<<", E="<<Energy<<",CS="<<sigma<<G4endl;
423#endif
424 if(sigma<0.) return 0.;
425 return sigma;
426}
double G4double
Definition: G4Types.hh:64
#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 G4QPhotonNuclearCrossSection::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 88 of file G4QPhotonNuclearCrossSection.cc.

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

◆ GetPointer()

G4VQCrossSection * G4QPhotonNuclearCrossSection::GetPointer ( )
static

Definition at line 70 of file G4QPhotonNuclearCrossSection.cc.

71{
72 static G4QPhotonNuclearCrossSection theCrossSection; //**Static body of Cross Section**
73 return &theCrossSection;
74}

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

◆ ThresholdEnergy()

G4double G4QPhotonNuclearCrossSection::ThresholdEnergy ( G4int  Z,
G4int  N,
G4int  PDG = 22 
)
virtual

Reimplemented from G4VQCrossSection.

Definition at line 263 of file G4QPhotonNuclearCrossSection.cc.

264{
265 // CHIPS - Direct GEANT
266 //static const G4double mNeut = G4QPDGCode(2112).GetMass();
267 //static const G4double mProt = G4QPDGCode(2212).GetMass();
268 static const G4double mNeut = G4NucleiProperties::GetNuclearMass(1,0)/MeV;
269 static const G4double mProt = G4NucleiProperties::GetNuclearMass(1,1)/MeV;
270 static const G4double mAlph = G4NucleiProperties::GetNuclearMass(4,2)/MeV;
271 // ---------
272 static const G4double infEn = 9.e27;
273
274 G4int A=Z+N;
275 if(A<1) return infEn;
276 else if(A==1) return 134.9766; // Pi0 threshold for the nucleon
277 // CHIPS - Direct GEANT
278 //G4double mT= G4QPDGCode(111).GetNuclMass(Z,N,0);
279 G4double mT= 0.;
282 else return 0.; // If it is not in the Table of Stable Nuclei, then the Threshold=0
283 G4double mP= infEn;
284 if(A>1&&Z&&G4NucleiProperties::IsInStableTable(A-1,Z-1))
285 mP = G4NucleiProperties::GetNuclearMass(A-1,Z-1)/MeV;// ResNucMass for a proton
286
287 G4double mN= infEn;
289 mN = G4NucleiProperties::GetNuclearMass(A-1,Z)/MeV; // ResNucMass for a neutron
290
291 G4double mA= infEn;
292 if(A>4&&Z>1&&G4NucleiProperties::IsInStableTable(A-4,Z-2))
293 mA=G4NucleiProperties::GetNuclearMass(A-4,Z-2)/MeV; // ResNucMass for an alpha
294
295 G4double dP= mP +mProt - mT;
296 G4double dN= mN +mNeut - mT;
297 G4double dA= mA +mAlph - mT;
298#ifdef debug
299 G4cout<<"G4QPhotoNucCS::ThreshEn: mP="<<mP<<",dP="<<dP<<",mN="<<mN<<",dN="<<dN<<",mA="
300 <<mA<<",dA="<<dA<<",mT="<<mT<<",A="<<A<<",Z="<<Z<<G4endl;
301#endif
302 if(dP<dN)dN=dP;
303 if(dA<dN)dN=dA;
304 return dN;
305}
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: