Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronElasticXS Class Referencefinal

#include <G4NeutronElasticXS.hh>

+ Inheritance diagram for G4NeutronElasticXS:

Public Member Functions

 G4NeutronElasticXS ()
 
 ~G4NeutronElasticXS () final
 
G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *) final
 
G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *) final
 
G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *) final
 
G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat) final
 
G4double ComputeCrossSectionPerElement (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, const G4Element *, const G4Material *) final
 
G4double ComputeIsoCrossSection (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat) final
 
const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE) final
 
void BuildPhysicsTable (const G4ParticleDefinition &) final
 
void CrossSectionDescription (std::ostream &) const final
 
G4double ElementCrossSection (G4double kinEnergy, G4double loge, G4int Z)
 
G4NeutronElasticXSoperator= (const G4NeutronElasticXS &right)=delete
 
 G4NeutronElasticXS (const G4NeutronElasticXS &)=delete
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
bool ForAllAtomsAndEnergies () const
 
void SetForAllAtomsAndEnergies (G4bool val)
 
const G4StringGetName () const
 
void SetName (const G4String &nam)
 
G4VCrossSectionDataSetoperator= (const G4VCrossSectionDataSet &right)=delete
 
 G4VCrossSectionDataSet (const G4VCrossSectionDataSet &)=delete
 

Static Public Member Functions

static const char * Default_Name ()
 

Additional Inherited Members

- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 
G4String name
 

Detailed Description

Definition at line 55 of file G4NeutronElasticXS.hh.

Constructor & Destructor Documentation

◆ G4NeutronElasticXS() [1/2]

G4NeutronElasticXS::G4NeutronElasticXS ( )

Definition at line 66 of file G4NeutronElasticXS.cc.

68 neutron(G4Neutron::Neutron())
69{
70 // verboseLevel = 0;
71 if (verboseLevel > 0){
72 G4cout << "G4NeutronElasticXS::G4NeutronElasticXS Initialise for Z < "
73 << MAXZEL << G4endl;
74 }
75 ggXsection =
77 if (ggXsection == nullptr)
78 ggXsection = new G4ComponentGGHadronNucleusXsc();
80}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4VComponentCrossSection * GetComponentCrossSection(const G4String &name)
static G4CrossSectionDataSetRegistry * Instance()
static const char * Default_Name()
static G4Neutron * Neutron()
Definition G4Neutron.cc:101
G4VCrossSectionDataSet(const G4String &nam="")
void SetForAllAtomsAndEnergies(G4bool val)

◆ ~G4NeutronElasticXS()

G4NeutronElasticXS::~G4NeutronElasticXS ( )
final

Definition at line 82 of file G4NeutronElasticXS.cc.

83{
84 if (isFirst) {
85 for(G4int i=0; i<MAXZEL; ++i) {
86 delete data[i];
87 data[i] = nullptr;
88 }
89 }
90}
int G4int
Definition G4Types.hh:85

◆ G4NeutronElasticXS() [2/2]

G4NeutronElasticXS::G4NeutronElasticXS ( const G4NeutronElasticXS & )
delete

Member Function Documentation

◆ BuildPhysicsTable()

void G4NeutronElasticXS::BuildPhysicsTable ( const G4ParticleDefinition & p)
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 197 of file G4NeutronElasticXS.cc.

198{
199 if(verboseLevel > 0){
200 G4cout << "G4NeutronElasticXS::BuildPhysicsTable for "
201 << p.GetParticleName() << G4endl;
202 }
203 if(p.GetParticleName() != "neutron") {
205 ed << p.GetParticleName() << " is a wrong particle type -"
206 << " only neutron is allowed";
207 G4Exception("G4NeutronElasticXS::BuildPhysicsTable(..)","had012",
208 FatalException, ed, "");
209 return;
210 }
211 if (fLock || isFirst) {
212 G4AutoLock l(&nElasticXSMutex);
213 if (fLock) {
214 isFirst = true;
215 fLock = false;
216 FindDirectoryPath();
217 }
218
219 // Access to elements
221 for ( auto & elm : *table ) {
222 G4int Z = std::max( 1, std::min( elm->GetZasInt(), MAXZEL-1) );
223 if ( nullptr == data[Z] ) { Initialise(Z); }
224 }
225 l.unlock();
226 }
227}
std::vector< G4Element * > G4ElementTable
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static G4ElementTable * GetElementTable()
Definition G4Element.cc:389
const G4String & GetParticleName() const

◆ ComputeCrossSectionPerElement()

G4double G4NeutronElasticXS::ComputeCrossSectionPerElement ( G4double kinEnergy,
G4double loge,
const G4ParticleDefinition * ,
const G4Element * elm,
const G4Material *  )
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 124 of file G4NeutronElasticXS.cc.

128{
129 return ElementCrossSection(ekin, loge, elm->GetZasInt());
130}
G4int GetZasInt() const
Definition G4Element.hh:120
G4double ElementCrossSection(G4double kinEnergy, G4double loge, G4int Z)

◆ ComputeIsoCrossSection()

G4double G4NeutronElasticXS::ComputeIsoCrossSection ( G4double kinEnergy,
G4double loge,
const G4ParticleDefinition * ,
G4int Z,
G4int A,
const G4Isotope * iso,
const G4Element * elm,
const G4Material * mat )
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 152 of file G4NeutronElasticXS.cc.

157{
158 return ElementCrossSection(ekin, loge, Z)*A/aeff[Z];
159}
const G4double A[17]

◆ CrossSectionDescription()

void G4NeutronElasticXS::CrossSectionDescription ( std::ostream & outFile) const
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 92 of file G4NeutronElasticXS.cc.

93{
94 outFile << "G4NeutronElasticXS calculates the neutron elastic scattering\n"
95 << "cross section on nuclei using data from the high precision\n"
96 << "neutron database. These data are simplified and smoothed over\n"
97 << "the resonance region in order to reduce CPU time.\n"
98 << "For high energies Glauber-Gribiv cross section is used.\n";
99}

◆ Default_Name()

static const char * G4NeutronElasticXS::Default_Name ( )
inlinestatic

Definition at line 63 of file G4NeutronElasticXS.hh.

63{return "G4NeutronElasticXS";}

◆ ElementCrossSection()

G4double G4NeutronElasticXS::ElementCrossSection ( G4double kinEnergy,
G4double loge,
G4int Z )

Definition at line 132 of file G4NeutronElasticXS.cc.

133{
134 G4int Z = (ZZ >= MAXZEL) ? MAXZEL - 1 : ZZ;
135 auto pv = GetPhysicsVector(Z);
136
137 G4double xs = (ekin <= pv->GetMaxEnergy()) ? pv->LogVectorValue(ekin, loge)
138 : coeff[Z]*ggXsection->GetElasticElementCrossSection(neutron, ekin,
139 Z, aeff[Z]);
140
141#ifdef G4VERBOSE
142 if(verboseLevel > 1) {
143 G4cout << "Z= " << Z << " Ekin(MeV)= " << ekin/CLHEP::MeV
144 << ", nElmXSel(b)= " << xs/CLHEP::barn
145 << G4endl;
146 }
147#endif
148 return xs;
149}
double G4double
Definition G4Types.hh:83
G4double GetElasticElementCrossSection(const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)

Referenced by ComputeCrossSectionPerElement(), ComputeIsoCrossSection(), GetElementCrossSection(), and GetIsoCrossSection().

◆ GetElementCrossSection()

G4double G4NeutronElasticXS::GetElementCrossSection ( const G4DynamicParticle * aParticle,
G4int Z,
const G4Material *  )
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 116 of file G4NeutronElasticXS.cc.

118{
119 return ElementCrossSection(aParticle->GetKineticEnergy(),
120 aParticle->GetLogKineticEnergy(), Z);
121}
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const

◆ GetIsoCrossSection()

G4double G4NeutronElasticXS::GetIsoCrossSection ( const G4DynamicParticle * aParticle,
G4int Z,
G4int A,
const G4Isotope * iso,
const G4Element * elm,
const G4Material * mat )
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 162 of file G4NeutronElasticXS.cc.

166{
167 return ElementCrossSection(aParticle->GetKineticEnergy(),
168 aParticle->GetLogKineticEnergy(), Z)*A/aeff[Z];
169
170}

◆ IsElementApplicable()

G4bool G4NeutronElasticXS::IsElementApplicable ( const G4DynamicParticle * ,
G4int Z,
const G4Material *  )
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 102 of file G4NeutronElasticXS.cc.

104{
105 return true;
106}

◆ IsIsoApplicable()

G4bool G4NeutronElasticXS::IsIsoApplicable ( const G4DynamicParticle * ,
G4int Z,
G4int A,
const G4Element * ,
const G4Material *  )
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 108 of file G4NeutronElasticXS.cc.

111{
112 return false;
113}

◆ operator=()

G4NeutronElasticXS & G4NeutronElasticXS::operator= ( const G4NeutronElasticXS & right)
delete

◆ SelectIsotope()

const G4Isotope * G4NeutronElasticXS::SelectIsotope ( const G4Element * anElement,
G4double kinEnergy,
G4double logE )
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 172 of file G4NeutronElasticXS.cc.

174{
175 G4int nIso = (G4int)anElement->GetNumberOfIsotopes();
176 const G4Isotope* iso = anElement->GetIsotope(0);
177
178 //G4cout << "SelectIsotope NIso= " << nIso << G4endl;
179 if(1 == nIso) { return iso; }
180
181 const G4double* abundVector = anElement->GetRelativeAbundanceVector();
183 G4double sum = 0.0;
184
185 // isotope wise cross section not used
186 for (G4int j=0; j<nIso; ++j) {
187 sum += abundVector[j];
188 if(q <= sum) {
189 iso = anElement->GetIsotope(j);
190 break;
191 }
192 }
193 return iso;
194}
#define G4UniformRand()
Definition Randomize.hh:52
G4double * GetRelativeAbundanceVector() const
Definition G4Element.hh:149
const G4Isotope * GetIsotope(G4int iso) const
Definition G4Element.hh:151
size_t GetNumberOfIsotopes() const
Definition G4Element.hh:143

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