Geant4 11.4.0
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 {0}
G4String name

Detailed Description

Definition at line 55 of file G4NeutronInelasticXS.hh.

Constructor & Destructor Documentation

◆ G4NeutronInelasticXS() [1/2]

G4NeutronInelasticXS::G4NeutronInelasticXS ( )

Definition at line 70 of file G4NeutronInelasticXS.cc.

72 neutron(G4Neutron::Neutron()),
73 lowElimit(1.0e-7*CLHEP::eV)
74{
75 verboseLevel = 0;
76 if (verboseLevel > 0) {
77 G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < "
78 << MAXZINEL << G4endl;
79 }
80 loglowElimit = G4Log(lowElimit);
81 ggXsection =
83 if (ggXsection == nullptr)
84 ggXsection = new G4ComponentGGHadronNucleusXsc();
85
86 if (nullptr == data) {
87 data = new G4ElementData(MAXZINEL);
88 data->SetName("nInelastic");
89 dataR = new G4ElementData(MAXZINEL);
90 dataR->SetName("nRInelastic");
91 FindDirectoryPath();
92 for (G4int Z=1; Z<MAXZINEL; ++Z) { Initialise(Z); }
93 }
94
96}
G4double G4Log(G4double x)
Definition G4Log.hh:169
int G4int
Definition G4Types.hh:85
#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)

Referenced by G4NeutronInelasticXS(), and operator=().

◆ ~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 315 of file G4NeutronInelasticXS.cc.

316{
317 if (verboseLevel > 0) {
318 G4cout << "G4NeutronInelasticXS::BuildPhysicsTable for "
319 << p.GetParticleName() << G4endl;
320 }
321 if (p.GetParticleName() != "neutron") {
323 ed << p.GetParticleName() << " is a wrong particle type -"
324 << " only neutron is allowed";
325 G4Exception("G4NeutronInelasticXS::BuildPhysicsTable(..)","had012",
326 FatalException, ed, "");
327 return;
328 }
329
331
332 // it is possible re-initialisation for the new run
334
335 // initialise static tables only once
336 std::call_once(applyOnce, [this]() { isInitializer = true; });
337
338 if (isInitializer) {
339 G4AutoLock l(&nInelasticXSMutex);
340
341 // Upload data for elements used in geometry
342 for ( auto const & elm : *table ) {
343 G4int Z = std::max( 1, std::min( elm->GetZasInt(), MAXZINEL-1) );
344 if ( nullptr == data->GetElementData(Z) ) { Initialise(Z); }
345 }
346 l.unlock();
347 }
348 // prepare isotope selection
349 std::size_t nIso = temp.size();
350 for ( auto const & elm : *table ) {
351 std::size_t n = elm->GetNumberOfIsotopes();
352 if (n > nIso) { nIso = n; }
353 }
354 temp.resize(nIso, 0.0);
355}
G4TemplateAutoLock< G4Mutex > G4AutoLock
std::vector< G4Element * > G4ElementTable
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static const G4ElementTable * GetElementTable()
Definition G4Element.cc:401
static G4HadronicParameters * Instance()
const G4String & GetParticleName() const

Referenced by G4InterfaceToXS::G4InterfaceToXS().

◆ ComputeCrossSectionPerElement()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 131 of file G4NeutronInelasticXS.cc.

135{
136 return ElementCrossSection(ekin, loge, elm->GetZasInt());
137}
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 186 of file G4NeutronInelasticXS.cc.

191{
192 return IsoCrossSection(ekin, loge, Z, A);
193}
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 98 of file G4NeutronInelasticXS.cc.

99{
100 outFile << "G4NeutronInelasticXS calculates the neutron inelastic scattering\n"
101 << "cross section on nuclei using data from the high precision\n"
102 << "neutron database. These data are simplified and smoothed over\n"
103 << "the resonance region in order to reduce CPU time.\n"
104 << "For high energy Glauber-Gribov cross section model is used\n";
105}

◆ Default_Name()

const char * G4NeutronInelasticXS::Default_Name ( )
inlinestatic

Definition at line 63 of file G4NeutronInelasticXS.hh.

63{ return "G4NeutronInelasticXS"; }

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

◆ ElementCrossSection()

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

Definition at line 140 of file G4NeutronInelasticXS.cc.

141{
142 G4int Z = std::min(ZZ, MAXZINEL-1);
143 G4double ekin = eKin;
144 G4double loge = logE;
145 G4double xs{0.0};
146 G4bool done{false};
147
148 // very low energy limit
149 if (ekin < lowElimit) {
150 ekin = lowElimit;
151 loge = loglowElimit;
152 }
153
154 // data from the resonance region
155 if (fRfilesEnabled) {
156 auto pv = GetPhysicsVectorR(Z);
157 if (nullptr != pv && ekin < inel_max_r_e[Z]) {
158 xs = pv->LogVectorValue(ekin, loge);
159 done = true;
160 }
161 }
162 // data above the resonance region pv should always defined
163 if (!done) {
164 auto pv = GetPhysicsVector(Z);
165 if (ekin <= pv->GetMaxEnergy()) {
166 xs = pv->LogVectorValue(ekin, loge);
167 }
168 else {
169 xs = coeff[Z]*ggXsection->GetInelasticElementCrossSection(neutron, ekin,
170 Z, aeff[Z]);
171 }
172 }
173
174#ifdef G4VERBOSE
175 if(verboseLevel > 1) {
176 G4cout << "G4NeutronInelasticXS::ElementCrossSection Z= " << Z
177 << " Ekin(MeV)= " << ekin/CLHEP::MeV
178 << ", ElmXSinel(b)= " << xs/CLHEP::barn
179 << G4endl;
180 }
181#endif
182 return xs;
183}
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86

Referenced by ComputeCrossSectionPerElement(), and GetElementCrossSection().

◆ GetElementCrossSection()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 123 of file G4NeutronInelasticXS.cc.

125{
126 return ElementCrossSection(aParticle->GetKineticEnergy(),
127 aParticle->GetLogKineticEnergy(), Z);
128}
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 196 of file G4NeutronInelasticXS.cc.

200{
201 return IsoCrossSection(aParticle->GetKineticEnergy(),
202 aParticle->GetLogKineticEnergy(), Z, A);
203}

◆ IsElementApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 108 of file G4NeutronInelasticXS.cc.

110{
111 return true;
112}

◆ IsIsoApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 115 of file G4NeutronInelasticXS.cc.

118{
119 return true;
120}

◆ IsoCrossSection()

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

Definition at line 206 of file G4NeutronInelasticXS.cc.

208{
209 G4double xs{0.0};
210 G4int Z = std::min(ZZ, MAXZINEL-1);
211 G4bool done{false};
212
213 // data from the resonance region
214 if (fRfilesEnabled) {
215 auto pv = GetPhysicsVectorR(Z);
216 if (nullptr != pv && ekin < inel_max_r_e[Z]) {
217 // use isotope x-section if possible
218 if (dataR->GetNumberOfComponents(Z) > 0) {
219 auto pviso = dataR->GetComponentDataByID(Z, A);
220 if (pviso != nullptr) {
221 xs = pviso->LogVectorValue(ekin, loge);
222 done = true;
223 }
224 }
225 // isotope data are not available or applicable
226 if (!done) {
227 xs = pv->LogVectorValue(ekin, loge);
228 done = true;
229 }
230 }
231 }
232 // data above the resonance region
233 if (!done) {
234 auto pv = GetPhysicsVector(Z);
235 // use isotope x-section if possible
236 if (data->GetNumberOfComponents(Z) > 0) {
237 auto pviso = data->GetComponentDataByID(Z, A);
238 if (pviso != nullptr && ekin <= pviso->GetMaxEnergy()) {
239 xs = pviso->LogVectorValue(ekin, loge);
240 done = true;
241 }
242 }
243 // isotope data are not available or applicable
244 // use element x-section
245 if (!done) {
246 if (ekin <= pv->GetMaxEnergy()) {
247 xs = pv->LogVectorValue(ekin, loge);
248 }
249 else {
250 xs = coeff[Z]*
251 ggXsection->GetInelasticElementCrossSection(neutron, ekin,
252 Z, aeff[Z]);
253 }
254 }
255 }
256
257#ifdef G4VERBOSE
258 if (verboseLevel > 1) {
259 G4cout << "G4NeutronInelasticXS::IsoXS: Z= " << Z << " A= " << A
260 << " Ekin(MeV)= " << ekin/CLHEP::MeV
261 << ", ElmXS(b)= " << xs/CLHEP::barn << G4endl;
262 }
263#endif
264 return xs;
265}

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 267 of file G4NeutronInelasticXS.cc.

269{
270 std::size_t nIso = anElement->GetNumberOfIsotopes();
271 const G4Isotope* iso = anElement->GetIsotope(0);
272 if(1 == nIso) { return iso; }
273
274 // more than 1 isotope
275 G4int Z = anElement->GetZasInt();
276 if (nullptr == data->GetElementData(Z)) { InitialiseOnFly(Z); }
277
278 const G4double* abundVector = anElement->GetRelativeAbundanceVector();
280 G4double sum = 0.0;
281 std::size_t j;
282
283 // isotope wise cross section not available
284 if (Z >= MAXZINEL || 0 == data->GetNumberOfComponents(Z)) {
285 for (j=0; j<nIso; ++j) {
286 sum += abundVector[j];
287 if(q <= sum) {
288 iso = anElement->GetIsotope((G4int)j);
289 break;
290 }
291 }
292 return iso;
293 }
294
295 // use isotope cross sections
296 auto nn = temp.size();
297 if(nn < nIso) { temp.resize(nIso, 0.); }
298
299 for (j=0; j<nIso; ++j) {
300 sum += abundVector[j]*IsoCrossSection(kinEnergy, logE, Z,
301 anElement->GetIsotope((G4int)j)->GetN());
302 temp[j] = sum;
303 }
304 sum *= q;
305 for (j = 0; j<nIso; ++j) {
306 if (temp[j] >= sum) {
307 iso = anElement->GetIsotope((G4int)j);
308 break;
309 }
310 }
311 return iso;
312}
#define G4UniformRand()
Definition Randomize.hh:52
G4double * GetRelativeAbundanceVector() const
Definition G4Element.hh:149
std::size_t GetNumberOfIsotopes() const
Definition G4Element.hh:143
const G4Isotope * GetIsotope(G4int iso) const
Definition G4Element.hh:151
G4int GetN() const
Definition G4Isotope.hh:83

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