Geant4-11
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4ChipsProtonInelasticXS Class Reference

#include <G4ChipsProtonInelasticXS.hh>

Inheritance diagram for G4ChipsProtonInelasticXS:
G4VCrossSectionDataSet

Public Member Functions

virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
bool ForAllAtomsAndEnergies () const
 
 G4ChipsProtonInelasticXS ()
 
virtual G4double GetChipsCrossSection (G4double momentum, G4int Z, G4int N, G4int pdg)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int tgZ, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
G4double GetMaxKinEnergy () const
 
G4double GetMinKinEnergy () const
 
const G4StringGetName () const
 
virtual G4int GetVerboseLevel () const
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *Pt, G4int Z, G4int A, const G4Element *elm, const G4Material *mat)
 
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
void SetForAllAtomsAndEnergies (G4bool val)
 
void SetMaxKinEnergy (G4double value)
 
void SetMinKinEnergy (G4double value)
 
void SetName (const G4String &nam)
 
virtual void SetVerboseLevel (G4int value)
 
 ~G4ChipsProtonInelasticXS ()
 

Static Public Member Functions

static const char * Default_Name ()
 

Protected Attributes

G4String name
 
G4int verboseLevel
 

Private Member Functions

G4double CalculateCrossSection (G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
 
G4double CrossSectionFormula (G4int targZ, G4int targN, G4double P, G4double lP)
 
G4double CrossSectionLin (G4int targZ, G4int targN, G4double P)
 
G4double CrossSectionLog (G4int targZ, G4int targN, G4double lP)
 
G4double EquLinearFit (G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
 
G4double ThresholdMomentum (G4int targZ, G4int targN)
 

Private Attributes

std::vector< G4doublecolCS
 
std::vector< G4intcolN
 
std::vector< G4doublecolP
 
std::vector< G4doublecolTH
 
std::vector< G4intcolZ
 
std::vector< G4double * > * HEN
 
G4bool isForAllAtomsAndEnergies
 
G4int j =0
 
G4double lastCS
 
G4doublelastHEN
 
G4int lastI
 
G4doublelastLEN
 
G4int lastN
 
G4double lastP
 
G4double lastTH
 
G4int lastZ
 
std::vector< G4double * > * LEN
 
G4double maxKinEnergy
 
G4double minKinEnergy
 
G4CrossSectionDataSetRegistryregistry
 

Detailed Description

Definition at line 44 of file G4ChipsProtonInelasticXS.hh.

Constructor & Destructor Documentation

◆ G4ChipsProtonInelasticXS()

G4ChipsProtonInelasticXS::G4ChipsProtonInelasticXS ( )

Definition at line 57 of file G4ChipsProtonInelasticXS.cc.

58{
59 // Initialization of the
60 lastLEN=0; // Pointer to the lastArray of LowEn CS
61 lastHEN=0; // Pointer to the lastArray of HighEn CS
62 lastN=0; // The last N of calculated nucleus
63 lastZ=0; // The last Z of calculated nucleus
64 lastP=0.; // Last used in cross section Momentum
65 lastTH=0.; // Last threshold momentum
66 lastCS=0.; // Last value of the Cross Section
67 lastI=0; // The last position in the DAMDB
68
69 LEN = new std::vector<G4double*>;
70 HEN = new std::vector<G4double*>;
71}
std::vector< G4double * > * LEN
static const char * Default_Name()
std::vector< G4double * > * HEN
G4VCrossSectionDataSet(const G4String &nam="")

References HEN, lastCS, lastHEN, lastI, lastLEN, lastN, lastP, lastTH, lastZ, and LEN.

◆ ~G4ChipsProtonInelasticXS()

G4ChipsProtonInelasticXS::~G4ChipsProtonInelasticXS ( )

Definition at line 73 of file G4ChipsProtonInelasticXS.cc.

74{
75 G4int lens=LEN->size();
76 for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
77 delete LEN;
78 G4int hens=HEN->size();
79 for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
80 delete HEN;
81}
int G4int
Definition: G4Types.hh:85

References HEN, and LEN.

Member Function Documentation

◆ BuildPhysicsTable()

void G4VCrossSectionDataSet::BuildPhysicsTable ( const G4ParticleDefinition )
virtualinherited

◆ CalculateCrossSection()

G4double G4ChipsProtonInelasticXS::CalculateCrossSection ( G4int  F,
G4int  I,
G4int  PDG,
G4int  Z,
G4int  N,
G4double  Momentum 
)
private

Definition at line 184 of file G4ChipsProtonInelasticXS.cc.

186{
187 static const G4double THmin=27.; // default minimum Momentum (MeV/c) Threshold
188 static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
189 static const G4double dP=10.; // step for the LEN (Low ENergy) table MeV/c
190 static const G4double dPG=dP*.001; // step for the LEN (Low ENergy) table GeV/c
191 static const G4int nL=105; // A#of LEN points in E (step 10 MeV/c)
192 static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
193 static const G4double Pmax=227000.; // maxP for the HEN (High ENergy) part 227 GeV
194 static const G4int nH=224; // A#of HEN points in lnE
195 static const G4double milP=G4Log(Pmin);// Low logarithm energy for the HEN part
196 static const G4double malP=G4Log(Pmax);// High logarithm energy (each 2.75 percent)
197 static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
198 static const G4double milPG=G4Log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
199 G4double sigma=0.;
200 if(F&&I) sigma=0.; // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
201 //G4double A=targN+targZ; // A of the target
202 if(F<=0) // This isotope was not the last used isotop
203 {
204 if(F<0) // This isotope was found in DAMDB =-----=> RETRIEVE
205 {
206 G4int sync=LEN->size();
207 if(sync<=I) G4cout<<"*!*G4QProtonNuclCS::CalcCrossSect:Sync="<<sync<<"<="<<I<<G4endl;
208 lastLEN=(*LEN)[I]; // Pointer to prepared LowEnergy cross sections
209 lastHEN=(*HEN)[I]; // Pointer to prepared High Energy cross sections
210 }
211 else // This isotope wasn't calculated before => CREATE
212 {
213 lastLEN = new G4double[nL]; // Allocate memory for the new LEN cross sections
214 lastHEN = new G4double[nH]; // Allocate memory for the new HEN cross sections
215 // --- Instead of making a separate function ---
216 G4double P=THmiG; // Table threshold in GeV/c
217 for(G4int k=0; k<nL; k++)
218 {
219 lastLEN[k] = CrossSectionLin(targZ, targN, P);
220 P+=dPG;
221 }
222 G4double lP=milPG;
223 for(G4int n=0; n<nH; n++)
224 {
225 lastHEN[n] = CrossSectionLog(targZ, targN, lP);
226 lP+=dlP;
227 }
228 // --- End of possible separate function
229 // *** The synchronization check ***
230 G4int sync=LEN->size();
231 if(sync!=I)
232 {
233 G4cout<<"***G4ChipsProtonNuclCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
234 <<", N="<<targN<<", F="<<F<<G4endl;
235 //G4Exception("G4ProtonNuclearCS::CalculateCS:","39",FatalException,"overflow DB");
236 }
237 LEN->push_back(lastLEN); // remember the Low Energy Table
238 HEN->push_back(lastHEN); // remember the High Energy Table
239 } // End of creation of the new set of parameters
240 } // End of parameters udate
241 // =------------------= NOW the Magic Formula =-----------------------=
242 if (Momentum<lastTH) return 0.; // It must be already checked in the interface class
243 else if (Momentum<Pmin) // High Energy region
244 {
245 sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
246 }
247 else if (Momentum<Pmax) // High Energy region
248 {
249 G4double lP=G4Log(Momentum);
250 sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
251 }
252 else // UHE region (calculation, not frequent)
253 {
254 G4double P=0.001*Momentum; // Approximation formula is for P in GeV/c
255 sigma=CrossSectionFormula(targZ, targN, P, G4Log(P));
256 }
257 if(sigma<0.) return 0.;
258 return sigma;
259}
G4double G4Log(G4double x)
Definition: G4Log.hh:226
static const G4int nL
static const G4double THmin
static const G4int nH
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double CrossSectionFormula(G4int targZ, G4int targN, G4double P, G4double lP)
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double *Y)
G4double CrossSectionLog(G4int targZ, G4int targN, G4double lP)
G4double CrossSectionLin(G4int targZ, G4int targN, G4double P)
static double P[]

References CrossSectionFormula(), CrossSectionLin(), CrossSectionLog(), anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::dlP, anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::dP, anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::dPG, EquLinearFit(), G4cout, G4endl, G4Log(), HEN, lastHEN, lastLEN, lastTH, LEN, anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::malP, anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::milP, anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::milPG, CLHEP::detail::n, nH, nL, P, anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::Pmax, anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::Pmin, anonymous_namespace{G4ChipsKaonMinusInelasticXS.cc}::THmiG, and THmin.

Referenced by GetChipsCrossSection().

◆ ComputeCrossSection()

G4double G4VCrossSectionDataSet::ComputeCrossSection ( const G4DynamicParticle part,
const G4Element elm,
const G4Material mat = nullptr 
)
inherited

Definition at line 81 of file G4VCrossSectionDataSet.cc.

84{
85 G4int Z = elm->GetZasInt();
86
87 if (IsElementApplicable(part, Z, mat)) {
88 return GetElementCrossSection(part, Z, mat);
89 }
90
91 // isotope-wise cross section making sum over available
92 // isotope cross sections, which may be incomplete, so
93 // the result is corrected
94 size_t nIso = elm->GetNumberOfIsotopes();
95 G4double fact = 0.0;
96 G4double xsec = 0.0;
97
98 // user-defined isotope abundances
99 const G4IsotopeVector* isoVector = elm->GetIsotopeVector();
100 const G4double* abundVector = elm->GetRelativeAbundanceVector();
101
102 for (size_t j=0; j<nIso; ++j) {
103 const G4Isotope* iso = (*isoVector)[j];
104 G4int A = iso->GetN();
105 if(abundVector[j] > 0.0 && IsIsoApplicable(part, Z, A, elm, mat)) {
106 fact += abundVector[j];
107 xsec += abundVector[j]*GetIsoCrossSection(part, Z, A, iso, elm, mat);
108 }
109 }
110 return (fact > 0.0) ? xsec/fact : 0.0;
111}
std::vector< G4Isotope * > G4IsotopeVector
const G4int Z[17]
const G4double A[17]
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
G4int GetZasInt() const
Definition: G4Element.hh:132
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:163
G4int GetN() const
Definition: G4Isotope.hh:93
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
virtual G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)

References A, G4VCrossSectionDataSet::GetElementCrossSection(), G4VCrossSectionDataSet::GetIsoCrossSection(), G4Element::GetIsotopeVector(), G4Isotope::GetN(), G4Element::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), G4Element::GetZasInt(), G4VCrossSectionDataSet::IsElementApplicable(), G4VCrossSectionDataSet::IsIsoApplicable(), and Z.

Referenced by G4VCrossSectionDataSet::GetCrossSection().

◆ CrossSectionDescription()

void G4ChipsProtonInelasticXS::CrossSectionDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 84 of file G4ChipsProtonInelasticXS.cc.

85{
86 outFile << "G4ChipsProtonInelasticXS provides the inelastic cross\n"
87 << "section for proton nucleus scattering as a function of incident\n"
88 << "momentum. The cross section is calculated using M. Kossov's\n"
89 << "CHIPS parameterization of cross section data.\n";
90}

◆ CrossSectionFormula()

G4double G4ChipsProtonInelasticXS::CrossSectionFormula ( G4int  targZ,
G4int  targN,
G4double  P,
G4double  lP 
)
private

Definition at line 358 of file G4ChipsProtonInelasticXS.cc.

360{
361 G4double sigma=0.;
362 if(tZ==1 && !tN) // pp interaction (from G4QuasiElasticRatios)
363 {
364 G4double El(0.),To(0.); // Uzhi
365 if(P<0.1) // Copied from G4QuasiElasticRatios Uzhi / start
366 {
367 G4double p2=P*P;
368 El=1./(0.00012+p2*0.2);
369 To=El;
370 }
371 else if(P>1000.)
372 {
373 G4double lp=G4Log(P)-3.5;
374 G4double lp2=lp*lp;
375 El=0.0557*lp2+6.72;
376 To=0.3*lp2+38.2;
377 }
378 else
379 {
380 G4double p2=P*P;
381 G4double LE=1./(0.00012+p2*0.2);
382 G4double lp=G4Log(P)-3.5;
383 G4double lp2=lp*lp;
384 G4double rp2=1./p2;
385 El=LE+(0.0557*lp2+6.72+32.6/P)/(1.+rp2/P);
386 To=LE+(0.3 *lp2+38.2+52.7*rp2)/(1.+2.72*rp2*rp2);
387 } // Copied from G4QuasiElasticRatios Uzhi / end
388
389/* // Uzhi 4.03.2013
390 G4double p2=P*P;
391 G4double lp=lP-3.5;
392 G4double lp2=lp*lp;
393 G4double rp2=1./p2;
394 G4double El=(.0557*lp2+6.72+30./P)/(1.+.49*rp2/P);
395 G4double To=(.3*lp2+38.2)/(1.+.54*rp2*rp2);
396*/ // Uzhi 4.03.2013
397
398 sigma=To-El;
399 }
400 else if(tZ<97 && tN<152) // General solution
401 {
402 //G4double lP=G4Log(P); // Already calculated
403 G4double d=lP-4.2;
404 G4double p2=P*P;
405 G4double p4=p2*p2;
406 G4double a=tN+tZ; // A of the target
407 G4double al=G4Log(a);
408 G4double sa=std::sqrt(a);
409 G4double a2=a*a;
410 G4double a2s=a2*sa;
411 G4double a4=a2*a2;
412 G4double a8=a4*a4;
413 G4double a12=a8*a4;
414 G4double a16=a8*a8;
415 G4double c=(170.+3600./a2s)/(1.+65./a2s);
416 G4double dl=al-3.;
417 G4double dl2=dl*dl;
418 G4double r=.21+.62*dl2/(1.+.5*dl2);
419 G4double gg=40.*G4Exp(al*0.712)/(1.+12.2/a)/(1.+34./a2);
420 G4double e=318.+a4/(1.+.0015*a4/G4Exp(al*0.09))/(1.+4.e-28*a12)+
421 8.e-18/(1./a16+1.3e-20)/(1.+1.e-21*a12);
422 G4double ss=3.57+.009*a2/(1.+.0001*a2*a);
423 G4double h=(.01/a4+2.5e-6/a)*(1.+6.e-6*a2*a)/(1.+6.e7/a12/a2);
424 sigma=(c+d*d)/(1.+r/p4)+(gg+e*G4Exp(-ss*P))/(1.+h/p4/p4);
425 }
426 else
427 {
428 G4cerr<<"-Warning-G4QProtonNuclearCroSect::CSForm:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
429 sigma=0.;
430 }
431 if(sigma<0.) return 0.;
432 return sigma;
433}
@ LE
Definition: Evaluator.cc:65
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179
G4GLOB_DLL std::ostream G4cerr
const G4double al
Mysterious coefficient that appears in the wavefunctions.

References G4INCL::DeuteronDensity::anonymous_namespace{G4INCLDeuteronDensity.cc}::al, G4cerr, G4endl, G4Exp(), G4Log(), LE, and P.

Referenced by CalculateCrossSection(), CrossSectionLin(), and CrossSectionLog().

◆ CrossSectionLin()

G4double G4ChipsProtonInelasticXS::CrossSectionLin ( G4int  targZ,
G4int  targN,
G4double  P 
)
private

Definition at line 279 of file G4ChipsProtonInelasticXS.cc.

280{
281 G4double sigma=0.;
282 if(P<ThresholdMomentum(tZ,tN)*.001) return sigma;
283 G4double lP=G4Log(P);
284 if(tZ==1&&!tN){if(P>.35) sigma=CrossSectionFormula(tZ,tN,P,lP);}// s(pp)=0 below 350Mev/c
285 else if(tZ<97 && tN<152) // General solution
286 {
287 G4double pex=0.;
288 G4double pos=0.;
289 G4double wid=1.;
290 if(tZ==13 && tN==14) // Excited metastable states
291 {
292 pex=230.;
293 pos=.13;
294 wid=8.e-5;
295 }
296 else if(tZ<7)
297 {
298 if(tZ==6 && tN==6)
299 {
300 pex=320.;
301 pos=.14;
302 wid=7.e-6;
303 }
304 else if(tZ==5 && tN==6)
305 {
306 pex=270.;
307 pos=.17;
308 wid=.002;
309 }
310 else if(tZ==4 && tN==5)
311 {
312 pex=600.;
313 pos=.132;
314 wid=.005;
315 }
316 else if(tZ==3 && tN==4)
317 {
318 pex=280.;
319 pos=.19;
320 wid=.0025;
321 }
322 else if(tZ==3 && tN==3)
323 {
324 pex=370.;
325 pos=.171;
326 wid=.006;
327 }
328 else if(tZ==2 && tN==1)
329 {
330 pex=30.;
331 pos=.22;
332 wid=.0005;
333 }
334 }
335 sigma=CrossSectionFormula(tZ,tN,P,lP);
336 if(pex>0.)
337 {
338 G4double dp=P-pos;
339 sigma+=pex*G4Exp(-dp*dp/wid);
340 }
341 }
342 else
343 {
344 G4cerr<<"-Warning-G4ChipsProtonNuclearXS::CSLin:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
345 sigma=0.;
346 }
347 if(sigma<0.) return 0.;
348 return sigma;
349}
static const G4double pos
G4double ThresholdMomentum(G4int targZ, G4int targN)

References CrossSectionFormula(), G4cerr, G4endl, G4Exp(), G4Log(), P, pos, and ThresholdMomentum().

Referenced by CalculateCrossSection().

◆ CrossSectionLog()

G4double G4ChipsProtonInelasticXS::CrossSectionLog ( G4int  targZ,
G4int  targN,
G4double  lP 
)
private

Definition at line 352 of file G4ChipsProtonInelasticXS.cc.

353{
354 G4double P=G4Exp(lP);
355 return CrossSectionFormula(tZ, tN, P, lP);
356}

References CrossSectionFormula(), G4Exp(), and P.

Referenced by CalculateCrossSection().

◆ Default_Name()

static const char * G4ChipsProtonInelasticXS::Default_Name ( )
inlinestatic

Definition at line 53 of file G4ChipsProtonInelasticXS.hh.

53{return "ChipsProtonInelasticXS";}

Referenced by G4ChipsComponentXS::G4ChipsComponentXS().

◆ DumpPhysicsTable()

void G4VCrossSectionDataSet::DumpPhysicsTable ( const G4ParticleDefinition )
virtualinherited

◆ EquLinearFit()

G4double G4ChipsProtonInelasticXS::EquLinearFit ( G4double  X,
G4int  N,
G4double  X0,
G4double  DX,
G4double Y 
)
private

Definition at line 435 of file G4ChipsProtonInelasticXS.cc.

436{
437 if(DX<=0. || N<2)
438 {
439 G4cerr<<"***G4ChipsProtonInelasticXS::EquLinearFit: DX="<<DX<<", N="<<N<<G4endl;
440 return Y[0];
441 }
442
443 G4int N2=N-2;
444 G4double d=(X-X0)/DX;
445 G4int jj=static_cast<int>(d);
446 if (jj<0) jj=0;
447 else if(jj>N2) jj=N2;
448 d-=jj; // excess
449 G4double yi=Y[jj];
450 G4double sigma=yi+(Y[jj+1]-yi)*d;
451
452 return sigma;
453}
G4double Y(G4double density)

References G4cerr, G4endl, and Y().

Referenced by CalculateCrossSection().

◆ ForAllAtomsAndEnergies()

bool G4VCrossSectionDataSet::ForAllAtomsAndEnergies ( ) const
inlineinherited

◆ GetChipsCrossSection()

G4double G4ChipsProtonInelasticXS::GetChipsCrossSection ( G4double  momentum,
G4int  Z,
G4int  N,
G4int  pdg 
)
virtual

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

Definition at line 113 of file G4ChipsProtonInelasticXS.cc.

114{
115
116 G4bool in=false; // By default the isotope must be found in the AMDB
117 if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
118 {
119 in = false; // By default the isotope haven't been found in AMDB
120 lastP = 0.; // New momentum history (nothing to compare with)
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++) // AMDB exists, try to find the (Z,N) isotope
126 {
127 if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
128 {
129 lastI=i; // Remember the index for future fast/last use
130 lastTH =colTH[i]; // The last THreshold (A-dependent)
131 if(pMom<=lastTH)
132 {
133 return 0.; // Energy is below the Threshold value
134 }
135 lastP =colP [i]; // Last Momentum (A-dependent)
136 lastCS =colCS[i]; // Last CrossSect (A-dependent)
137 in = true; // This is the case when the isotop is found in DB
138 // Momentum pMom is in IU ! @@ Units
139 lastCS=CalculateCrossSection(-1,j,2212,lastZ,lastN,pMom); // read & update
140 if(lastCS<=0. && pMom>lastTH) // Correct the threshold (@@ No intermediate Zeros)
141 {
142 lastCS=0.;
143 lastTH=pMom;
144 }
145 break; // Go out of the LOOP
146 }
147 j++; // Increment a#0f records found in DB
148 }
149 if(!in) // This isotope has not been calculated previously
150 {
152 lastCS=CalculateCrossSection(0,j,2212,lastZ,lastN,pMom); //calculate & create
153 //if(lastCS>0.) // It means that the AMBD was initialized
154 //{
155
156 lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
157 colN.push_back(tgN);
158 colZ.push_back(tgZ);
159 colP.push_back(pMom);
160 colTH.push_back(lastTH);
161 colCS.push_back(lastCS);
162 //} // M.K. Presence of H1 with high threshold breaks the syncronization
163 return lastCS*millibarn;
164 } // End of creation of the new set of parameters
165 else
166 {
167 colP[lastI]=pMom;
169 }
170 } // End of parameters udate
171 else if(pMom<=lastTH)
172 {
173 return 0.; // Momentum is below the Threshold Value -> CS=0
174 }
175 else // It is the last used -> use the current tables
176 {
177 lastCS=CalculateCrossSection(1,j,2212,lastZ,lastN,pMom); // Only read and UpdateDB
178 lastP=pMom;
179 }
180 return lastCS*millibarn;
181}
static constexpr double millibarn
Definition: G4SIunits.hh:86
bool G4bool
Definition: G4Types.hh:86
G4double CalculateCrossSection(G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
std::vector< G4double > colTH
std::vector< G4double > colP
std::vector< G4double > colCS

References CalculateCrossSection(), colCS, colN, colP, colTH, colZ, j, lastCS, lastI, lastN, lastP, lastTH, lastZ, and millibarn.

Referenced by G4ChipsComponentXS::GetInelasticElementCrossSection(), GetIsoCrossSection(), and G4ChipsComponentXS::GetTotalElementCrossSection().

◆ GetCrossSection()

G4double G4VCrossSectionDataSet::GetCrossSection ( const G4DynamicParticle dp,
const G4Element elm,
const G4Material mat = nullptr 
)
inlineinherited

Definition at line 187 of file G4VCrossSectionDataSet.hh.

190{
191 return ComputeCrossSection(dp, elm, mat);
192}
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)

References G4VCrossSectionDataSet::ComputeCrossSection().

◆ GetElementCrossSection()

G4double G4VCrossSectionDataSet::GetElementCrossSection ( const G4DynamicParticle dynPart,
G4int  Z,
const G4Material mat = nullptr 
)
virtualinherited

Reimplemented in G4EMDissociationCrossSection, G4IonsShenCrossSection, G4NeutrinoElectronCcXsc, G4NeutrinoElectronNcXsc, G4NeutrinoElectronTotXsc, G4NeutronElectronElXsc, G4PhotoNuclearCrossSection, G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticXS, G4ElectroNuclearCrossSection, G4BGGNucleonElasticXS, G4BGGPionElasticXS, G4BGGPionInelasticXS, G4BGGNucleonInelasticXS, G4CrossSectionElastic, G4CrossSectionInelastic, G4GammaNuclearXS, G4ParticleInelasticXS, G4ZeroXS, G4NucleonNuclearCrossSection, G4MuNeutrinoNucleusTotXsc, and G4KokoulinMuonNuclearXS.

Definition at line 114 of file G4VCrossSectionDataSet.cc.

117{
119 ed << "GetElementCrossSection is not implemented in <" << name << ">\n"
120 << "Particle: " << dynPart->GetDefinition()->GetParticleName()
121 << " Ekin(MeV)= " << dynPart->GetKineticEnergy()/MeV;
122 if(mat) { ed << " material: " << mat->GetName(); }
123 ed << " target Z= " << Z << G4endl;
124 G4Exception("G4VCrossSectionDataSet::GetElementCrossSection", "had001",
125 FatalException, ed);
126 return 0.0;
127}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
static constexpr double MeV
Definition: G4SIunits.hh:200
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4String & GetName() const
Definition: G4Material.hh:173
const G4String & GetParticleName() const

References FatalException, G4endl, G4Exception(), G4DynamicParticle::GetDefinition(), G4DynamicParticle::GetKineticEnergy(), G4Material::GetName(), G4ParticleDefinition::GetParticleName(), MeV, G4VCrossSectionDataSet::name, and Z.

Referenced by G4QMDReaction::ApplyYourself(), G4VCrossSectionDataSet::ComputeCrossSection(), G4GammaNuclearXS::GetElementCrossSection(), G4GammaNuclearXS::GetIsoCrossSection(), and G4GammaNuclearXS::Initialise().

◆ GetIsoCrossSection()

G4double G4ChipsProtonInelasticXS::GetIsoCrossSection ( const G4DynamicParticle Pt,
G4int  tgZ,
G4int  A,
const G4Isotope iso = 0,
const G4Element elm = 0,
const G4Material mat = 0 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 102 of file G4ChipsProtonInelasticXS.cc.

106{
107 G4double pMom=Pt->GetTotalMomentum();
108 G4int tgN = A - tgZ;
109
110 return GetChipsCrossSection(pMom, tgZ, tgN, 2212);
111}
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
G4double GetTotalMomentum() const

References A, GetChipsCrossSection(), and G4DynamicParticle::GetTotalMomentum().

◆ GetMaxKinEnergy()

G4double G4VCrossSectionDataSet::GetMaxKinEnergy ( ) const
inlineinherited

◆ GetMinKinEnergy()

G4double G4VCrossSectionDataSet::GetMinKinEnergy ( ) const
inlineinherited

◆ GetName()

const G4String & G4VCrossSectionDataSet::GetName ( ) const
inlineinherited

◆ GetVerboseLevel()

G4int G4VCrossSectionDataSet::GetVerboseLevel ( ) const
inlinevirtualinherited

◆ IsElementApplicable()

G4bool G4VCrossSectionDataSet::IsElementApplicable ( const G4DynamicParticle ,
G4int  Z,
const G4Material mat = nullptr 
)
virtualinherited

◆ IsIsoApplicable()

G4bool G4ChipsProtonInelasticXS::IsIsoApplicable ( const G4DynamicParticle Pt,
G4int  Z,
G4int  A,
const G4Element elm,
const G4Material mat 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 92 of file G4ChipsProtonInelasticXS.cc.

95{
96 return true;
97}

◆ SelectIsotope()

const G4Isotope * G4VCrossSectionDataSet::SelectIsotope ( const G4Element anElement,
G4double  kinEnergy,
G4double  logE 
)
virtualinherited

Reimplemented in G4GammaNuclearXS, G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticXS, and G4ParticleInelasticXS.

Definition at line 149 of file G4VCrossSectionDataSet.cc.

151{
152 size_t nIso = anElement->GetNumberOfIsotopes();
153 const G4Isotope* iso = anElement->GetIsotope(0);
154
155 // more than 1 isotope
156 if(1 < nIso) {
157 const G4double* abundVector = anElement->GetRelativeAbundanceVector();
158 G4double sum = 0.0;
160 for (size_t j=0; j<nIso; ++j) {
161 sum += abundVector[j];
162 if(q <= sum) {
163 iso = anElement->GetIsotope(j);
164 break;
165 }
166 }
167 }
168 return iso;
169}
#define G4UniformRand()
Definition: Randomize.hh:52
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170

References G4UniformRand, G4Element::GetIsotope(), G4Element::GetNumberOfIsotopes(), and G4Element::GetRelativeAbundanceVector().

◆ SetForAllAtomsAndEnergies()

void G4VCrossSectionDataSet::SetForAllAtomsAndEnergies ( G4bool  val)
inlineinherited

◆ SetMaxKinEnergy()

void G4VCrossSectionDataSet::SetMaxKinEnergy ( G4double  value)
inlineinherited

◆ SetMinKinEnergy()

void G4VCrossSectionDataSet::SetMinKinEnergy ( G4double  value)
inlineinherited

◆ SetName()

void G4VCrossSectionDataSet::SetName ( const G4String nam)
inlineinherited

Definition at line 240 of file G4VCrossSectionDataSet.hh.

241{
242 name = nam;
243}

References G4VCrossSectionDataSet::name.

Referenced by G4ParticleHPInelasticData::G4ParticleHPInelasticData().

◆ SetVerboseLevel()

void G4VCrossSectionDataSet::SetVerboseLevel ( G4int  value)
inlinevirtualinherited

◆ ThresholdMomentum()

G4double G4ChipsProtonInelasticXS::ThresholdMomentum ( G4int  targZ,
G4int  targN 
)
private

Definition at line 262 of file G4ChipsProtonInelasticXS.cc.

263{
264 static const G4double third=1./3.;
265 static const G4double pM = G4Proton::Proton()->Definition()->GetPDGMass(); // Projectile mass in MeV
266 static const G4double tpM= pM+pM; // Doubled projectile mass (MeV)
267
268 G4double tA=tZ+tN;
269 if(tZ<.99 || tN<0.) return 0.;
270 else if(tZ==1 && tN==0) return 800.; // A threshold on the free proton
271 //G4double dE=1.263*tZ/(1.+G4Pow::GetInstance()->powA(tA,third));
272 G4double dE=tZ/(1.+G4Pow::GetInstance()->powA(tA,third)); // Safety for diffused edge of the nucleus (QE)
273 G4double tM=931.5*tA;
274 G4double T=dE+dE*(dE/2+pM)/tM;
275 return std::sqrt(T*(tpM+T));
276}
static const G4double dE
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:230
static G4Proton * Definition()
Definition: G4Proton.cc:48
static G4Proton * Proton()
Definition: G4Proton.cc:92

References dE, G4Proton::Definition(), G4Pow::GetInstance(), G4ParticleDefinition::GetPDGMass(), anonymous_namespace{G4ChipsKaonPlusInelasticXS.cc}::pM, G4Pow::powA(), G4Proton::Proton(), anonymous_namespace{G4ChipsKaonMinusElasticXS.cc}::third, and anonymous_namespace{G4ChipsKaonPlusInelasticXS.cc}::tpM.

Referenced by CrossSectionLin().

Field Documentation

◆ colCS

std::vector<G4double> G4ChipsProtonInelasticXS::colCS
private

Definition at line 96 of file G4ChipsProtonInelasticXS.hh.

Referenced by GetChipsCrossSection().

◆ colN

std::vector<G4int> G4ChipsProtonInelasticXS::colN
private

Definition at line 92 of file G4ChipsProtonInelasticXS.hh.

Referenced by GetChipsCrossSection().

◆ colP

std::vector<G4double> G4ChipsProtonInelasticXS::colP
private

Definition at line 94 of file G4ChipsProtonInelasticXS.hh.

Referenced by GetChipsCrossSection().

◆ colTH

std::vector<G4double> G4ChipsProtonInelasticXS::colTH
private

Definition at line 95 of file G4ChipsProtonInelasticXS.hh.

Referenced by GetChipsCrossSection().

◆ colZ

std::vector<G4int> G4ChipsProtonInelasticXS::colZ
private

Definition at line 93 of file G4ChipsProtonInelasticXS.hh.

Referenced by GetChipsCrossSection().

◆ HEN

std::vector<G4double*>* G4ChipsProtonInelasticXS::HEN
private

◆ isForAllAtomsAndEnergies

G4bool G4VCrossSectionDataSet::isForAllAtomsAndEnergies
privateinherited

◆ j

G4int G4ChipsProtonInelasticXS::j =0
private

Definition at line 91 of file G4ChipsProtonInelasticXS.hh.

Referenced by GetChipsCrossSection().

◆ lastCS

G4double G4ChipsProtonInelasticXS::lastCS
private

Definition at line 86 of file G4ChipsProtonInelasticXS.hh.

Referenced by G4ChipsProtonInelasticXS(), and GetChipsCrossSection().

◆ lastHEN

G4double* G4ChipsProtonInelasticXS::lastHEN
private

Definition at line 81 of file G4ChipsProtonInelasticXS.hh.

Referenced by CalculateCrossSection(), and G4ChipsProtonInelasticXS().

◆ lastI

G4int G4ChipsProtonInelasticXS::lastI
private

Definition at line 87 of file G4ChipsProtonInelasticXS.hh.

Referenced by G4ChipsProtonInelasticXS(), and GetChipsCrossSection().

◆ lastLEN

G4double* G4ChipsProtonInelasticXS::lastLEN
private

Definition at line 80 of file G4ChipsProtonInelasticXS.hh.

Referenced by CalculateCrossSection(), and G4ChipsProtonInelasticXS().

◆ lastN

G4int G4ChipsProtonInelasticXS::lastN
private

Definition at line 82 of file G4ChipsProtonInelasticXS.hh.

Referenced by G4ChipsProtonInelasticXS(), and GetChipsCrossSection().

◆ lastP

G4double G4ChipsProtonInelasticXS::lastP
private

Definition at line 84 of file G4ChipsProtonInelasticXS.hh.

Referenced by G4ChipsProtonInelasticXS(), and GetChipsCrossSection().

◆ lastTH

G4double G4ChipsProtonInelasticXS::lastTH
private

◆ lastZ

G4int G4ChipsProtonInelasticXS::lastZ
private

Definition at line 83 of file G4ChipsProtonInelasticXS.hh.

Referenced by G4ChipsProtonInelasticXS(), and GetChipsCrossSection().

◆ LEN

std::vector<G4double*>* G4ChipsProtonInelasticXS::LEN
private

◆ maxKinEnergy

G4double G4VCrossSectionDataSet::maxKinEnergy
privateinherited

◆ minKinEnergy

G4double G4VCrossSectionDataSet::minKinEnergy
privateinherited

◆ name

G4String G4VCrossSectionDataSet::name
protectedinherited

◆ registry

G4CrossSectionDataSetRegistry* G4VCrossSectionDataSet::registry
privateinherited

◆ verboseLevel

G4int G4VCrossSectionDataSet::verboseLevel
protectedinherited

Definition at line 168 of file G4VCrossSectionDataSet.hh.

Referenced by G4BGGNucleonElasticXS::BuildPhysicsTable(), G4BGGPionElasticXS::BuildPhysicsTable(), G4BGGPionInelasticXS::BuildPhysicsTable(), G4GammaNuclearXS::BuildPhysicsTable(), G4NeutronCaptureXS::BuildPhysicsTable(), G4NeutronElasticXS::BuildPhysicsTable(), G4NeutronInelasticXS::BuildPhysicsTable(), G4ParticleInelasticXS::BuildPhysicsTable(), G4BGGNucleonInelasticXS::BuildPhysicsTable(), G4LENDCrossSection::create_used_target_map(), G4BGGNucleonElasticXS::G4BGGNucleonElasticXS(), G4BGGNucleonInelasticXS::G4BGGNucleonInelasticXS(), G4BGGPionElasticXS::G4BGGPionElasticXS(), G4BGGPionInelasticXS::G4BGGPionInelasticXS(), G4GammaNuclearXS::G4GammaNuclearXS(), G4NeutronCaptureXS::G4NeutronCaptureXS(), G4NeutronElasticXS::G4NeutronElasticXS(), G4NeutronInelasticXS::G4NeutronInelasticXS(), G4ParticleInelasticXS::G4ParticleInelasticXS(), G4NeutronCaptureXS::GetElementCrossSection(), G4NeutronElasticXS::GetElementCrossSection(), G4NeutronInelasticXS::GetElementCrossSection(), G4BGGNucleonElasticXS::GetElementCrossSection(), G4BGGPionElasticXS::GetElementCrossSection(), G4BGGPionInelasticXS::GetElementCrossSection(), G4BGGNucleonInelasticXS::GetElementCrossSection(), G4GammaNuclearXS::GetElementCrossSection(), G4ParticleInelasticXS::GetElementCrossSection(), G4BGGNucleonElasticXS::GetIsoCrossSection(), G4BGGPionElasticXS::GetIsoCrossSection(), G4BGGPionInelasticXS::GetIsoCrossSection(), G4GammaNuclearXS::GetIsoCrossSection(), G4BGGNucleonInelasticXS::GetIsoCrossSection(), G4VCrossSectionDataSet::GetVerboseLevel(), G4NeutronElasticXS::Initialise(), G4ParticleInelasticXS::IsoCrossSection(), G4NeutronCaptureXS::IsoCrossSection(), G4NeutronInelasticXS::IsoCrossSection(), G4GammaNuclearXS::RetrieveVector(), G4NeutronCaptureXS::RetrieveVector(), G4NeutronInelasticXS::RetrieveVector(), G4ParticleInelasticXS::RetrieveVector(), and G4VCrossSectionDataSet::SetVerboseLevel().


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