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

#include <G4NeutronInelasticXS.hh>

+ Inheritance diagram for G4NeutronInelasticXS:

Public Member Functions

 G4NeutronInelasticXS ()
 
 ~G4NeutronInelasticXS () override=default
 
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 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
 
G4double GetIsoCrossSection (const G4DynamicParticle *, 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)
 
G4double IsoCrossSection (G4double ekin, G4double logekin, G4int Z, G4int A)
 
G4NeutronInelasticXSoperator= (const G4NeutronInelasticXS &right)=delete
 
 G4NeutronInelasticXS (const G4NeutronInelasticXS &)=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 G4NeutronInelasticXS.hh.

Constructor & Destructor Documentation

◆ G4NeutronInelasticXS() [1/2]

G4NeutronInelasticXS::G4NeutronInelasticXS ( )

Definition at line 67 of file G4NeutronInelasticXS.cc.

69 neutron(G4Neutron::Neutron()),
70 elimit(20*CLHEP::MeV)
71{
72 verboseLevel = 0;
73 if (verboseLevel > 0){
74 G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < "
75 << MAXZINEL << G4endl;
76 }
77 if (nullptr == data) {
78 data = new G4ElementData(MAXZINEL);
79 data->SetName("nInelastic");
80 FindDirectoryPath();
81 }
82 ggXsection =
84 if(ggXsection == nullptr)
85 ggXsection = new G4ComponentGGHadronNucleusXsc();
87}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4VComponentCrossSection * GetComponentCrossSection(const G4String &name)
static G4CrossSectionDataSetRegistry * Instance()
void SetName(const G4String &nam)
static const char * Default_Name()
static G4Neutron * Neutron()
Definition G4Neutron.cc:101
G4VCrossSectionDataSet(const G4String &nam="")
void SetForAllAtomsAndEnergies(G4bool val)

◆ ~G4NeutronInelasticXS()

G4NeutronInelasticXS::~G4NeutronInelasticXS ( )
overridedefault

◆ G4NeutronInelasticXS() [2/2]

G4NeutronInelasticXS::G4NeutronInelasticXS ( const G4NeutronInelasticXS & )
delete

Member Function Documentation

◆ BuildPhysicsTable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 269 of file G4NeutronInelasticXS.cc.

270{
271 if (verboseLevel > 0) {
272 G4cout << "G4NeutronInelasticXS::BuildPhysicsTable for "
273 << p.GetParticleName() << G4endl;
274 }
275 if (p.GetParticleName() != "neutron") {
277 ed << p.GetParticleName() << " is a wrong particle type -"
278 << " only neutron is allowed";
279 G4Exception("G4NeutronInelasticXS::BuildPhysicsTable(..)","had012",
280 FatalException, ed, "");
281 return;
282 }
283 // it is possible re-initialisation for the new run
285
286 // initialise static tables only once
287 std::call_once(applyOnce, [this]() { isInitializer = true; });
288
289 if (isInitializer) {
290 G4AutoLock l(&nInelasticXSMutex);
291
292 // Upload data for elements used in geometry
293 for ( auto const & elm : *table ) {
294 G4int Z = std::max( 1, std::min( elm->GetZasInt(), MAXZINEL-1) );
295 if ( nullptr == data->GetElementData(Z) ) { Initialise(Z); }
296 }
297 l.unlock();
298 }
299 // prepare isotope selection
300 std::size_t nIso = temp.size();
301 for ( auto const & elm : *table ) {
302 std::size_t n = elm->GetNumberOfIsotopes();
303 if (n > nIso) { nIso = n; }
304 }
305 temp.resize(nIso, 0.0);
306}
std::vector< G4Element * > G4ElementTable
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
int G4int
Definition G4Types.hh:85
G4PhysicsVector * GetElementData(G4int Z) const
static G4ElementTable * GetElementTable()
Definition G4Element.cc:389
const G4String & GetParticleName() const

◆ ComputeCrossSectionPerElement()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 122 of file G4NeutronInelasticXS.cc.

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

◆ ComputeIsoCrossSection()

G4double G4NeutronInelasticXS::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 G4NeutronInelasticXS.cc.

157{
158 return IsoCrossSection(ekin, loge, Z, A);
159}
const G4double A[17]
G4double IsoCrossSection(G4double ekin, G4double logekin, G4int Z, G4int A)

◆ CrossSectionDescription()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 89 of file G4NeutronInelasticXS.cc.

90{
91 outFile << "G4NeutronInelasticXS calculates the neutron inelastic scattering\n"
92 << "cross section on nuclei using data from the high precision\n"
93 << "neutron database. These data are simplified and smoothed over\n"
94 << "the resonance region in order to reduce CPU time.\n"
95 << "For high energy Glauber-Gribov cross section model is used\n";
96}

◆ Default_Name()

static const char * G4NeutronInelasticXS::Default_Name ( )
inlinestatic

Definition at line 63 of file G4NeutronInelasticXS.hh.

63{ return "G4NeutronInelasticXS"; }

Referenced by G4INCLXXNeutronBuilder::Build(), and G4NeutronCrossSectionXS::ConstructProcess().

◆ ElementCrossSection()

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

Definition at line 131 of file G4NeutronInelasticXS.cc.

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

Referenced by ComputeCrossSectionPerElement(), and GetElementCrossSection().

◆ GetElementCrossSection()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 114 of file G4NeutronInelasticXS.cc.

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

◆ GetIsoCrossSection()

G4double G4NeutronInelasticXS::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 G4NeutronInelasticXS.cc.

166{
167 return IsoCrossSection(aParticle->GetKineticEnergy(),
168 aParticle->GetLogKineticEnergy(), Z, A);
169}

◆ IsElementApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 99 of file G4NeutronInelasticXS.cc.

101{
102 return true;
103}

◆ IsIsoApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 106 of file G4NeutronInelasticXS.cc.

109{
110 return true;
111}

◆ IsoCrossSection()

G4double G4NeutronInelasticXS::IsoCrossSection ( G4double ekin,
G4double logekin,
G4int Z,
G4int A )

Definition at line 172 of file G4NeutronInelasticXS.cc.

174{
175 G4double xs = 0.0;
176 G4int Z = (ZZ >= MAXZINEL) ? MAXZINEL - 1 : ZZ;
177
178 auto pv = GetPhysicsVector(Z);
179 /*
180 G4cout << "G4NeutronInelasticXS::IsoCrossSection Z= "
181 << Z << " A= " << A << G4endl;
182 G4cout << " Amin= " << amin[Z] << " Amax= " << amax[Z]
183 << " E(MeV)= " << ekin << " Ncomp="
184 << data->GetNumberOfComponents(Z) << G4endl;
185 */
186
187 // compute isotope cross section if applicable
188 if (ekin <= elimit && data->GetNumberOfComponents(Z) > 0) {
189 auto pviso = data->GetComponentDataByID(Z, A);
190 if (nullptr != pviso) {
191 xs = pviso->LogVectorValue(ekin, logekin);
192#ifdef G4VERBOSE
193 if(verboseLevel > 1) {
194 G4cout << "G4NeutronInelasticXS::IsoXS: Ekin(MeV)= "
195 << ekin/CLHEP::MeV
196 << " xs(b)= " << xs/CLHEP::barn
197 << " Z= " << Z << " A= " << A << G4endl;
198 }
199#endif
200 return xs;
201 }
202 }
203
204 // use element x-section
205 xs = (ekin <= pv->GetMaxEnergy()) ? pv->LogVectorValue(ekin, logekin)
206 : coeff[Z]*ggXsection->GetInelasticElementCrossSection(neutron, ekin,
207 Z, aeff[Z]);
208 xs *= A/aeff[Z];
209#ifdef G4VERBOSE
210 if(verboseLevel > 1) {
211 G4cout << "G4NeutronInelasticXS::IsoXS: Z= " << Z << " A= " << A
212 << " Ekin(MeV)= " << ekin/CLHEP::MeV
213 << ", ElmXS(b)= " << xs/CLHEP::barn << G4endl;
214 }
215#endif
216 return xs;
217}
G4PhysicsVector * GetComponentDataByID(G4int Z, G4int id) const

Referenced by ComputeIsoCrossSection(), GetIsoCrossSection(), and SelectIsotope().

◆ operator=()

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

◆ SelectIsotope()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 219 of file G4NeutronInelasticXS.cc.

221{
222 G4int nIso = (G4int)anElement->GetNumberOfIsotopes();
223 const G4Isotope* iso = anElement->GetIsotope(0);
224 if(1 == nIso) { return iso; }
225
226 // more than 1 isotope
227 G4int Z = anElement->GetZasInt();
228 if (nullptr == data->GetElementData(Z)) { InitialiseOnFly(Z); }
229
230 const G4double* abundVector = anElement->GetRelativeAbundanceVector();
232 G4double sum = 0.0;
233 G4int j;
234
235 // isotope wise cross section not available
236 if (Z >= MAXZINEL || 0 == data->GetNumberOfComponents(Z)) {
237 for (j=0; j<nIso; ++j) {
238 sum += abundVector[j];
239 if(q <= sum) {
240 iso = anElement->GetIsotope(j);
241 break;
242 }
243 }
244 return iso;
245 }
246
247 // use isotope cross sections
248 G4int nn = (G4int)temp.size();
249 if(nn < nIso) { temp.resize(nIso, 0.); }
250
251 for (j=0; j<nIso; ++j) {
252 // G4cout << j << "-th isotope " << anElement->GetIsotope(j)->GetN()
253 // << " abund= " << abundVector[j] << G4endl;
254 sum += abundVector[j]*IsoCrossSection(kinEnergy, logE, Z,
255 anElement->GetIsotope(j)->GetN());
256 temp[j] = sum;
257 }
258 sum *= q;
259 for (j = 0; j<nIso; ++j) {
260 if (temp[j] >= sum) {
261 iso = anElement->GetIsotope(j);
262 break;
263 }
264 }
265 return iso;
266}
#define G4UniformRand()
Definition Randomize.hh:52
std::size_t GetNumberOfComponents(G4int Z) const
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
G4int GetN() const
Definition G4Isotope.hh:83

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