Geant4-11
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes
G4NeutronCaptureXS Class Referencefinal

#include <G4NeutronCaptureXS.hh>

Inheritance diagram for G4NeutronCaptureXS:
G4VCrossSectionDataSet

Public Member Functions

void BuildPhysicsTable (const G4ParticleDefinition &) final
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
void CrossSectionDescription (std::ostream &) const final
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
bool ForAllAtomsAndEnergies () const
 
 G4NeutronCaptureXS ()
 
 G4NeutronCaptureXS (const G4NeutronCaptureXS &)=delete
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
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 GetMaxKinEnergy () const
 
G4double GetMinKinEnergy () const
 
const G4StringGetName () const
 
virtual G4int GetVerboseLevel () const
 
G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *) final
 
G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *) final
 
G4double IsoCrossSection (G4double ekin, G4double logekin, G4int Z, G4int A)
 
G4NeutronCaptureXSoperator= (const G4NeutronCaptureXS &right)=delete
 
const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE) final
 
void SetForAllAtomsAndEnergies (G4bool val)
 
void SetMaxKinEnergy (G4double value)
 
void SetMinKinEnergy (G4double value)
 
void SetName (const G4String &nam)
 
virtual void SetVerboseLevel (G4int value)
 
 ~G4NeutronCaptureXS () final
 

Static Public Member Functions

static const char * Default_Name ()
 

Protected Attributes

G4String name
 
G4int verboseLevel
 

Private Member Functions

const G4StringFindDirectoryPath ()
 
const G4PhysicsVectorGetPhysicsVector (G4int Z)
 
void Initialise (G4int Z)
 
void InitialiseOnFly (G4int Z)
 
G4PhysicsVectorRetrieveVector (std::ostringstream &in, G4bool warn)
 

Private Attributes

G4double elimit
 
G4double emax
 
G4bool isForAllAtomsAndEnergies
 
G4bool isMaster = false
 
G4double logElimit
 
G4double maxKinEnergy
 
G4double minKinEnergy
 
G4CrossSectionDataSetRegistryregistry
 
std::vector< G4doubletemp
 

Static Private Attributes

static G4ElementDatadata = nullptr
 
static G4String gDataDirectory = ""
 
static const G4int MAXZCAPTURE = 93
 

Detailed Description

Definition at line 58 of file G4NeutronCaptureXS.hh.

Constructor & Destructor Documentation

◆ G4NeutronCaptureXS() [1/2]

G4NeutronCaptureXS::G4NeutronCaptureXS ( )
explicit

Definition at line 59 of file G4NeutronCaptureXS.cc.

61 emax(20*CLHEP::MeV),elimit(1.0e-10*CLHEP::eV)
62{
63 // verboseLevel = 0;
64 if(verboseLevel > 0){
65 G4cout << "G4NeutronCaptureXS::G4NeutronCaptureXS: Initialise for Z < "
66 << MAXZCAPTURE << G4endl;
67 }
69}
G4double G4Log(G4double x)
Definition: G4Log.hh:226
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static const G4int MAXZCAPTURE
static const char * Default_Name()
G4VCrossSectionDataSet(const G4String &nam="")
static constexpr double MeV
static constexpr double eV

References elimit, G4cout, G4endl, G4Log(), logElimit, MAXZCAPTURE, and G4VCrossSectionDataSet::verboseLevel.

◆ ~G4NeutronCaptureXS()

G4NeutronCaptureXS::~G4NeutronCaptureXS ( )
final

Definition at line 71 of file G4NeutronCaptureXS.cc.

72{
73 if(isMaster) { delete data; data = nullptr; }
74}
static G4ElementData * data

References data, and isMaster.

◆ G4NeutronCaptureXS() [2/2]

G4NeutronCaptureXS::G4NeutronCaptureXS ( const G4NeutronCaptureXS )
delete

Member Function Documentation

◆ BuildPhysicsTable()

void G4NeutronCaptureXS::BuildPhysicsTable ( const G4ParticleDefinition p)
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 234 of file G4NeutronCaptureXS.cc.

235{
236 if(verboseLevel > 0){
237 G4cout << "G4NeutronCaptureXS::BuildPhysicsTable for "
238 << p.GetParticleName() << G4endl;
239 }
240 if(p.GetParticleName() != "neutron") {
242 ed << p.GetParticleName() << " is a wrong particle type -"
243 << " only neutron is allowed";
244 G4Exception("G4NeutronCaptureXS::BuildPhysicsTable(..)","had012",
245 FatalException, ed, "");
246 return;
247 }
248
249 if(nullptr == data) {
250#ifdef G4MULTITHREADED
251 G4MUTEXLOCK(&neutronCaptureXSMutex);
252 if(nullptr == data) {
253#endif
254 isMaster = true;
255 data = new G4ElementData();
256 data->SetName("NeutronCapture");
258#ifdef G4MULTITHREADED
259 }
260 G4MUTEXUNLOCK(&neutronCaptureXSMutex);
261#endif
262 }
263
264 // it is possible re-initialisation for the second run
266 if(isMaster) {
267
268 // Access to elements
269 for ( auto & elm : *table ) {
270 G4int Z = std::max( 1, std::min( elm->GetZasInt(), MAXZCAPTURE-1) );
271 if ( nullptr == data->GetElementData(Z) ) { Initialise(Z); }
272 }
273 }
274 // prepare isotope selection
275 size_t nIso = temp.size();
276 for ( auto & elm : *table ) {
277 size_t n = elm->GetNumberOfIsotopes();
278 if(n > nIso) { nIso = n; }
279 }
280 temp.resize(nIso, 0.0);
281}
std::vector< G4Element * > G4ElementTable
@ 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
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
G4PhysicsVector * GetElementData(G4int Z)
void SetName(const G4String &nam)
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:397
std::vector< G4double > temp
const G4String & FindDirectoryPath()
const G4String & GetParticleName() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments

References data, FatalException, FindDirectoryPath(), G4cout, G4endl, G4Exception(), G4MUTEXLOCK, G4MUTEXUNLOCK, G4ElementData::GetElementData(), G4Element::GetElementTable(), G4ParticleDefinition::GetParticleName(), Initialise(), isMaster, G4INCL::Math::max(), MAXZCAPTURE, G4INCL::Math::min(), CLHEP::detail::n, G4ElementData::SetName(), temp, G4VCrossSectionDataSet::verboseLevel, and Z.

◆ 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
double G4double
Definition: G4Types.hh:83
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 G4NeutronCaptureXS::CrossSectionDescription ( std::ostream &  outFile) const
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 76 of file G4NeutronCaptureXS.cc.

77{
78 outFile << "G4NeutronCaptureXS calculates the neutron capture cross sections\n"
79 << "on nuclei using data from the high precision neutron database.\n"
80 << "These data are simplified and smoothed over the resonance region\n"
81 << "in order to reduce CPU time. G4NeutronCaptureXS is set to zero\n"
82 << "above 20 MeV for all targets. Cross section is zero also for Z>92.\n";
83}

◆ Default_Name()

static const char * G4NeutronCaptureXS::Default_Name ( )
inlinestatic

Definition at line 66 of file G4NeutronCaptureXS.hh.

66{return "G4NeutronCaptureXS";}

Referenced by LBE::ConstructHad(), and G4NeutronCrossSectionXS::ConstructProcess().

◆ DumpPhysicsTable()

void G4VCrossSectionDataSet::DumpPhysicsTable ( const G4ParticleDefinition )
virtualinherited

◆ FindDirectoryPath()

const G4String & G4NeutronCaptureXS::FindDirectoryPath ( )
private

Definition at line 283 of file G4NeutronCaptureXS.cc.

284{
285 // check environment variable
286 // build the complete string identifying the file with the data set
287 if(gDataDirectory.empty()) {
288 char* path = std::getenv("G4PARTICLEXSDATA");
289 if (nullptr != path) {
290 std::ostringstream ost;
291 ost << path << "/neutron/cap";
292 gDataDirectory = ost.str();
293 } else {
294 G4Exception("G4NeutronCaptureXS::Initialise(..)","had013",
296 "Environment variable G4PARTICLEXSDATA is not defined");
297 }
298 }
299 return gDataDirectory;
300}
static G4String gDataDirectory

References FatalException, G4Exception(), and gDataDirectory.

Referenced by BuildPhysicsTable(), and Initialise().

◆ ForAllAtomsAndEnergies()

bool G4VCrossSectionDataSet::ForAllAtomsAndEnergies ( ) const
inlineinherited

◆ 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 G4NeutronCaptureXS::GetElementCrossSection ( const G4DynamicParticle aParticle,
G4int  Z,
const G4Material  
)
finalvirtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 101 of file G4NeutronCaptureXS.cc.

103{
104 G4double xs = 0.0;
105 G4double ekin = aParticle->GetKineticEnergy();
106 if(ekin > emax) { return xs; }
107
108 G4int Z = std::min(ZZ, MAXZCAPTURE-1);
109 G4double logEkin = aParticle->GetLogKineticEnergy();
110 if(ekin < elimit) { ekin = elimit; logEkin = logElimit; }
111
112 auto pv = GetPhysicsVector(Z);
113 if(pv == nullptr) { return xs; }
114
115 const G4double e1 = pv->Energy(1);
116 xs = (ekin >= e1) ? pv->LogVectorValue(ekin, logEkin)
117 : (*pv)[1]*std::sqrt(e1/ekin);
118
119#ifdef G4VERBOSE
120 if(verboseLevel > 1){
121 G4cout << "Ekin= " << ekin/CLHEP::MeV
122 << " ElmXScap(b)= " << xs/CLHEP::barn << G4endl;
123 }
124#endif
125 return xs;
126}
static const G4double e1[44]
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const
const G4PhysicsVector * GetPhysicsVector(G4int Z)
static constexpr double barn
Definition: SystemOfUnits.h:86

References CLHEP::barn, e1, elimit, emax, G4cout, G4endl, G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetLogKineticEnergy(), GetPhysicsVector(), logElimit, MAXZCAPTURE, CLHEP::MeV, G4INCL::Math::min(), G4VCrossSectionDataSet::verboseLevel, and Z.

◆ GetIsoCrossSection()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 129 of file G4NeutronCaptureXS.cc.

133{
134 return IsoCrossSection(aParticle->GetKineticEnergy(),
135 aParticle->GetLogKineticEnergy(),
136 Z, A);
137}
G4double IsoCrossSection(G4double ekin, G4double logekin, G4int Z, G4int A)

References A, G4DynamicParticle::GetKineticEnergy(), G4DynamicParticle::GetLogKineticEnergy(), IsoCrossSection(), and Z.

◆ GetMaxKinEnergy()

G4double G4VCrossSectionDataSet::GetMaxKinEnergy ( ) const
inlineinherited

◆ GetMinKinEnergy()

G4double G4VCrossSectionDataSet::GetMinKinEnergy ( ) const
inlineinherited

◆ GetName()

const G4String & G4VCrossSectionDataSet::GetName ( ) const
inlineinherited

◆ GetPhysicsVector()

const G4PhysicsVector * G4NeutronCaptureXS::GetPhysicsVector ( G4int  Z)
inlineprivate

Definition at line 124 of file G4NeutronCaptureXS.hh.

125{
126 const G4PhysicsVector* pv = data->GetElementData(Z);
127 if(pv == nullptr) {
129 pv = data->GetElementData(Z);
130 }
131 return pv;
132}
void InitialiseOnFly(G4int Z)

References data, G4ElementData::GetElementData(), InitialiseOnFly(), and Z.

Referenced by GetElementCrossSection(), and IsoCrossSection().

◆ GetVerboseLevel()

G4int G4VCrossSectionDataSet::GetVerboseLevel ( ) const
inlinevirtualinherited

◆ Initialise()

void G4NeutronCaptureXS::Initialise ( G4int  Z)
private

Definition at line 315 of file G4NeutronCaptureXS.cc.

316{
317 if(nullptr != data->GetElementData(Z)) { return; }
318
319 // upload element data
320 std::ostringstream ost;
321 ost << FindDirectoryPath() << Z ;
322 G4PhysicsVector* v = RetrieveVector(ost, true);
324
325 // upload isotope data
326 if(amin[Z] < amax[Z]) {
327 G4int nmax = amax[Z] - amin[Z] + 1;
329
330 for(G4int A=amin[Z]; A<=amax[Z]; ++A) {
331 std::ostringstream ost1;
332 ost1 << gDataDirectory << Z << "_" << A;
333 v = RetrieveVector(ost1, false);
334 data->AddComponent(Z, A, v);
335 }
336 }
337}
static const G4int amax[]
static const G4int amin[]
void InitialiseForComponent(G4int Z, G4int nComponents=0)
void InitialiseForElement(G4int Z, G4PhysicsVector *v)
void AddComponent(G4int Z, G4int id, G4PhysicsVector *v)
G4PhysicsVector * RetrieveVector(std::ostringstream &in, G4bool warn)

References A, G4ElementData::AddComponent(), amax, amin, data, FindDirectoryPath(), gDataDirectory, G4ElementData::GetElementData(), G4ElementData::InitialiseForComponent(), G4ElementData::InitialiseForElement(), RetrieveVector(), and Z.

Referenced by BuildPhysicsTable(), and InitialiseOnFly().

◆ InitialiseOnFly()

void G4NeutronCaptureXS::InitialiseOnFly ( G4int  Z)
private

Definition at line 302 of file G4NeutronCaptureXS.cc.

303{
304#ifdef G4MULTITHREADED
305 G4MUTEXLOCK(&neutronCaptureXSMutex);
306 if(nullptr == data->GetElementData(Z)) {
307#endif
308 Initialise(Z);
309#ifdef G4MULTITHREADED
310 }
311 G4MUTEXUNLOCK(&neutronCaptureXSMutex);
312#endif
313}

References data, G4MUTEXLOCK, G4MUTEXUNLOCK, G4ElementData::GetElementData(), Initialise(), and Z.

Referenced by GetPhysicsVector().

◆ IsElementApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 86 of file G4NeutronCaptureXS.cc.

88{
89 return true;
90}

◆ IsIsoApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 93 of file G4NeutronCaptureXS.cc.

96{
97 return true;
98}

◆ IsoCrossSection()

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

Definition at line 139 of file G4NeutronCaptureXS.cc.

141{
142 G4double xs = 0.0;
143 if(eKin > emax) { return xs; }
144
145 G4int Z = std::min(ZZ, MAXZCAPTURE-1);
146 G4double ekin = eKin;
147 G4double logEkin = logE;
148 if(ekin < elimit) {
149 ekin = elimit;
150 logEkin = logElimit;
151 }
152
153 auto pv = GetPhysicsVector(Z);
154 if(pv == nullptr) { return xs; }
155
156 if(amin[Z] < amax[Z] && A >= amin[Z] && A <= amax[Z]) {
158 if(pviso != nullptr) {
159 const G4double e1 = pviso->Energy(1);
160 xs = (ekin >= e1) ? pviso->LogVectorValue(ekin, logEkin)
161 : (*pviso)[1]*std::sqrt(e1/ekin);
162#ifdef G4VERBOSE
163 if(verboseLevel > 0) {
164 G4cout << "G4NeutronCaptureXS::IsoXS: Ekin(MeV)= " << ekin/MeV
165 << " xs(b)= " << xs/barn
166 << " Z= " << Z << " A= " << A << G4endl;
167 }
168#endif
169 return xs;
170 }
171 }
172 // isotope data are not available or applicable
173 const G4double e1 = pv->Energy(1);
174 xs = (ekin >= e1) ? pv->LogVectorValue(ekin, logEkin)
175 : (*pv)[1]*std::sqrt(e1/ekin);
176#ifdef G4VERBOSE
177 if(verboseLevel > 0) {
178 G4cout << "G4NeutronCaptureXS::IsoXS: Ekin(MeV)= " << ekin/MeV
179 << " xs(b)= " << xs/barn
180 << " Z= " << Z << " A= " << A << " no iso XS" << G4endl;
181 }
182#endif
183 return xs;
184}
static constexpr double barn
Definition: G4SIunits.hh:85
static constexpr double MeV
Definition: G4SIunits.hh:200
G4PhysicsVector * GetComponentDataByIndex(G4int Z, G4int idx)
G4double Energy(const std::size_t index) const
G4double LogVectorValue(const G4double energy, const G4double theLogEnergy) const

References A, amax, amin, barn, data, e1, elimit, emax, G4PhysicsVector::Energy(), G4cout, G4endl, G4ElementData::GetComponentDataByIndex(), GetPhysicsVector(), logElimit, G4PhysicsVector::LogVectorValue(), MAXZCAPTURE, MeV, G4INCL::Math::min(), G4VCrossSectionDataSet::verboseLevel, and Z.

Referenced by GetIsoCrossSection(), and SelectIsotope().

◆ operator=()

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

◆ RetrieveVector()

G4PhysicsVector * G4NeutronCaptureXS::RetrieveVector ( std::ostringstream &  in,
G4bool  warn 
)
private

Definition at line 340 of file G4NeutronCaptureXS.cc.

341{
342 G4PhysicsLogVector* v = nullptr;
343 std::ifstream filein(ost.str().c_str());
344 if (!filein.is_open()) {
345 if(warn) {
347 ed << "Data file <" << ost.str().c_str()
348 << "> is not opened!";
349 G4Exception("G4NeutronCaptureXS::RetrieveVector(..)","had014",
350 FatalException, ed, "Check G4PARTICLEXSDATA");
351 }
352 } else {
353 if(verboseLevel > 1) {
354 G4cout << "File " << ost.str()
355 << " is opened by G4NeutronCaptureXS" << G4endl;
356 }
357 // retrieve data from DB
358 v = new G4PhysicsLogVector();
359 if(!v->Retrieve(filein, true)) {
361 ed << "Data file <" << ost.str().c_str()
362 << "> is not retrieved!";
363 G4Exception("G4NeutronCaptureXS::RetrieveVector(..)","had015",
364 FatalException, ed, "Check G4PARTICLEXSDATA");
365 }
366 }
367 return v;
368}
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)

References FatalException, G4cout, G4endl, G4Exception(), G4PhysicsVector::Retrieve(), and G4VCrossSectionDataSet::verboseLevel.

Referenced by Initialise().

◆ SelectIsotope()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 187 of file G4NeutronCaptureXS.cc.

189{
190 size_t nIso = anElement->GetNumberOfIsotopes();
191 const G4Isotope* iso = anElement->GetIsotope(0);
192
193 //G4cout << "SelectIsotope NIso= " << nIso << G4endl;
194 if(1 == nIso) { return iso; }
195
196 // more than 1 isotope
197 G4int Z = anElement->GetZasInt();
198
199 const G4double* abundVector = anElement->GetRelativeAbundanceVector();
201 G4double sum = 0.0;
202
203 // is there isotope wise cross section?
204 size_t j;
205 if(amax[Z] == amin[Z] || Z >= MAXZCAPTURE) {
206 for (j = 0; j<nIso; ++j) {
207 sum += abundVector[j];
208 if(q <= sum) {
209 iso = anElement->GetIsotope(j);
210 break;
211 }
212 }
213 return iso;
214 }
215 size_t nn = temp.size();
216 if(nn < nIso) { temp.resize(nIso, 0.); }
217
218 for (j=0; j<nIso; ++j) {
219 sum += abundVector[j]*IsoCrossSection(kinEnergy, logE, Z,
220 anElement->GetIsotope(j)->GetN());
221 temp[j] = sum;
222 }
223 sum *= q;
224 for (j = 0; j<nIso; ++j) {
225 if(temp[j] >= sum) {
226 iso = anElement->GetIsotope(j);
227 break;
228 }
229 }
230 return iso;
231}
#define G4UniformRand()
Definition: Randomize.hh:52
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170

References amax, amin, G4UniformRand, G4Element::GetIsotope(), G4Isotope::GetN(), G4Element::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), G4Element::GetZasInt(), IsoCrossSection(), MAXZCAPTURE, G4InuclParticleNames::nn, temp, and Z.

◆ 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

Field Documentation

◆ data

G4ElementData * G4NeutronCaptureXS::data = nullptr
staticprivate

◆ elimit

G4double G4NeutronCaptureXS::elimit
private

◆ emax

G4double G4NeutronCaptureXS::emax
private

Definition at line 106 of file G4NeutronCaptureXS.hh.

Referenced by GetElementCrossSection(), and IsoCrossSection().

◆ gDataDirectory

G4String G4NeutronCaptureXS::gDataDirectory = ""
staticprivate

Definition at line 116 of file G4NeutronCaptureXS.hh.

Referenced by FindDirectoryPath(), and Initialise().

◆ isForAllAtomsAndEnergies

G4bool G4VCrossSectionDataSet::isForAllAtomsAndEnergies
privateinherited

◆ isMaster

G4bool G4NeutronCaptureXS::isMaster = false
private

Definition at line 112 of file G4NeutronCaptureXS.hh.

Referenced by BuildPhysicsTable(), and ~G4NeutronCaptureXS().

◆ logElimit

G4double G4NeutronCaptureXS::logElimit
private

◆ maxKinEnergy

G4double G4VCrossSectionDataSet::maxKinEnergy
privateinherited

◆ MAXZCAPTURE

const G4int G4NeutronCaptureXS::MAXZCAPTURE = 93
staticprivate

◆ minKinEnergy

G4double G4VCrossSectionDataSet::minKinEnergy
privateinherited

◆ name

G4String G4VCrossSectionDataSet::name
protectedinherited

◆ registry

G4CrossSectionDataSetRegistry* G4VCrossSectionDataSet::registry
privateinherited

◆ temp

std::vector<G4double> G4NeutronCaptureXS::temp
private

Definition at line 110 of file G4NeutronCaptureXS.hh.

Referenced by BuildPhysicsTable(), and SelectIsotope().

◆ verboseLevel

G4int G4VCrossSectionDataSet::verboseLevel
protectedinherited

Definition at line 168 of file G4VCrossSectionDataSet.hh.

Referenced by G4BGGNucleonElasticXS::BuildPhysicsTable(), G4BGGPionElasticXS::BuildPhysicsTable(), G4BGGPionInelasticXS::BuildPhysicsTable(), G4GammaNuclearXS::BuildPhysicsTable(), 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(), G4NeutronElasticXS::G4NeutronElasticXS(), G4NeutronInelasticXS::G4NeutronInelasticXS(), G4ParticleInelasticXS::G4ParticleInelasticXS(), 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(), IsoCrossSection(), G4NeutronInelasticXS::IsoCrossSection(), G4GammaNuclearXS::RetrieveVector(), RetrieveVector(), G4NeutronInelasticXS::RetrieveVector(), G4ParticleInelasticXS::RetrieveVector(), and G4VCrossSectionDataSet::SetVerboseLevel().


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