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

#include <G4NeutronCaptureXS.hh>

+ Inheritance diagram for G4NeutronCaptureXS:

Public Member Functions

 G4NeutronCaptureXS ()
 
 ~G4NeutronCaptureXS () 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 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)
 
G4NeutronCaptureXSoperator= (const G4NeutronCaptureXS &right)=delete
 
 G4NeutronCaptureXS (const G4NeutronCaptureXS &)=delete
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
 
virtual G4double ComputeCrossSectionPerElement (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, const G4Element *, const G4Material *mat=nullptr)
 
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 G4double ComputeIsoCrossSection (G4double kinEnergy, G4double loge, const G4ParticleDefinition *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
 
virtual const G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy, G4double logE)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
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 57 of file G4NeutronCaptureXS.hh.

Constructor & Destructor Documentation

◆ G4NeutronCaptureXS() [1/2]

G4NeutronCaptureXS::G4NeutronCaptureXS ( )
explicit

Definition at line 61 of file G4NeutronCaptureXS.cc.

63 emax(20*CLHEP::MeV),elimit(1.0e-10*CLHEP::eV)
64{
65 // verboseLevel = 0;
66 if(verboseLevel > 0){
67 G4cout << "G4NeutronCaptureXS::G4NeutronCaptureXS: Initialise for Z < "
68 << MAXZCAPTURE << G4endl;
69 }
70 logElimit = G4Log(elimit);
71}
G4double G4Log(G4double x)
Definition: G4Log.hh:227
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static const char * Default_Name()

◆ ~G4NeutronCaptureXS()

G4NeutronCaptureXS::~G4NeutronCaptureXS ( )
final

Definition at line 73 of file G4NeutronCaptureXS.cc.

74{
75 if(isMaster) { delete data; data = nullptr; }
76}

◆ 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 260 of file G4NeutronCaptureXS.cc.

261{
262 if(verboseLevel > 0){
263 G4cout << "G4NeutronCaptureXS::BuildPhysicsTable for "
264 << p.GetParticleName() << G4endl;
265 }
266 if(p.GetParticleName() != "neutron") {
268 ed << p.GetParticleName() << " is a wrong particle type -"
269 << " only neutron is allowed";
270 G4Exception("G4NeutronCaptureXS::BuildPhysicsTable(..)","had012",
271 FatalException, ed, "");
272 return;
273 }
274
275 if(nullptr == data) {
276 G4AutoLock l(&neutronCaptureXSMutex);
277 if(nullptr == data) {
278 isMaster = true;
279 data = new G4ElementData();
280 data->SetName("NeutronCapture");
281 FindDirectoryPath();
282 }
283 l.unlock();
284 }
285
286 // it is possible re-initialisation for the second run
288 if(isMaster) {
289
290 // Access to elements
291 for ( auto & elm : *table ) {
292 G4int Z = std::max( 1, std::min( elm->GetZasInt(), MAXZCAPTURE-1) );
293 if ( nullptr == data->GetElementData(Z) ) { Initialise(Z); }
294 }
295 }
296 // prepare isotope selection
297 std::size_t nIso = temp.size();
298 for ( auto & elm : *table ) {
299 std::size_t n = elm->GetNumberOfIsotopes();
300 if(n > nIso) { nIso = n; }
301 }
302 temp.resize(nIso, 0.0);
303}
std::vector< G4Element * > G4ElementTable
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
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:403
const G4String & GetParticleName() const

◆ ComputeCrossSectionPerElement()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 113 of file G4NeutronCaptureXS.cc.

117{
118 G4double xs = 0.0;
119 if(ekin < emax) { xs = ElementCrossSection(ekin, loge, elm->GetZasInt()); }
120 return xs;
121}
double G4double
Definition: G4Types.hh:83
G4int GetZasInt() const
Definition: G4Element.hh:132
G4double ElementCrossSection(G4double kinEnergy, G4double loge, G4int Z)

◆ ComputeIsoCrossSection()

G4double G4NeutronCaptureXS::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 145 of file G4NeutronCaptureXS.cc.

150{
151 return IsoCrossSection(ekin, loge, Z, A);
152}
const G4double A[17]
G4double IsoCrossSection(G4double ekin, G4double logekin, G4int Z, G4int A)

◆ CrossSectionDescription()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 78 of file G4NeutronCaptureXS.cc.

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

◆ Default_Name()

static const char * G4NeutronCaptureXS::Default_Name ( )
inlinestatic

Definition at line 65 of file G4NeutronCaptureXS.hh.

65{return "G4NeutronCaptureXS";}

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

◆ ElementCrossSection()

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

Definition at line 124 of file G4NeutronCaptureXS.cc.

125{
126 G4int Z = std::min(ZZ, MAXZCAPTURE-1);
127 G4double logEkin = loge;
128 if(ekin < elimit) { ekin = elimit; logEkin = logElimit; }
129
130 auto pv = GetPhysicsVector(Z);
131 const G4double e1 = pv->Energy(1);
132 G4double xs = (ekin >= e1) ? pv->LogVectorValue(ekin, logEkin)
133 : (*pv)[1]*std::sqrt(e1/ekin);
134
135#ifdef G4VERBOSE
136 if(verboseLevel > 1){
137 G4cout << "Ekin= " << ekin/CLHEP::MeV
138 << " ElmXScap(b)= " << xs/CLHEP::barn << G4endl;
139 }
140#endif
141 return xs;
142}

Referenced by ComputeCrossSectionPerElement(), and GetElementCrossSection().

◆ GetElementCrossSection()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 103 of file G4NeutronCaptureXS.cc.

105{
106 G4double xs = 0.0;
107 G4double ekin = aParticle->GetKineticEnergy();
108 if(ekin < emax) { xs = ElementCrossSection(ekin, aParticle->GetLogKineticEnergy(), Z); }
109 return xs;
110}
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const

◆ 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 155 of file G4NeutronCaptureXS.cc.

159{
160 return IsoCrossSection(aParticle->GetKineticEnergy(),
161 aParticle->GetLogKineticEnergy(),
162 Z, A);
163}

◆ IsElementApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 88 of file G4NeutronCaptureXS.cc.

90{
91 return true;
92}

◆ IsIsoApplicable()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 95 of file G4NeutronCaptureXS.cc.

98{
99 return true;
100}

◆ IsoCrossSection()

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

Definition at line 165 of file G4NeutronCaptureXS.cc.

167{
168 G4double xs = 0.0;
169 if(eKin > emax) { return xs; }
170
171 G4int Z = std::min(ZZ, MAXZCAPTURE-1);
172 G4double ekin = eKin;
173 G4double logEkin = logE;
174 if(ekin < elimit) {
175 ekin = elimit;
176 logEkin = logElimit;
177 }
178
179 auto pv = GetPhysicsVector(Z);
180 if(pv == nullptr) { return xs; }
181
182 if(amin[Z] < amax[Z] && A >= amin[Z] && A <= amax[Z]) {
183 G4PhysicsVector* pviso = data->GetComponentDataByIndex(Z, A - amin[Z]);
184 if(pviso != nullptr) {
185 const G4double e1 = pviso->Energy(1);
186 xs = (ekin >= e1) ? pviso->LogVectorValue(ekin, logEkin)
187 : (*pviso)[1]*std::sqrt(e1/ekin);
188#ifdef G4VERBOSE
189 if(verboseLevel > 0) {
190 G4cout << "G4NeutronCaptureXS::IsoXS: Ekin(MeV)= " << ekin/MeV
191 << " xs(b)= " << xs/barn
192 << " Z= " << Z << " A= " << A << G4endl;
193 }
194#endif
195 return xs;
196 }
197 }
198 // isotope data are not available or applicable
199 const G4double e1 = pv->Energy(1);
200 xs = (ekin >= e1) ? pv->LogVectorValue(ekin, logEkin)
201 : (*pv)[1]*std::sqrt(e1/ekin);
202#ifdef G4VERBOSE
203 if(verboseLevel > 0) {
204 G4cout << "G4NeutronCaptureXS::IsoXS: Ekin(MeV)= " << ekin/MeV
205 << " xs(b)= " << xs/barn
206 << " Z= " << Z << " A= " << A << " no iso XS" << G4endl;
207 }
208#endif
209 return xs;
210}
G4PhysicsVector * GetComponentDataByIndex(G4int Z, G4int idx)
G4double Energy(const std::size_t index) const
G4double LogVectorValue(const G4double energy, const G4double theLogEnergy) const

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

◆ operator=()

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

◆ SelectIsotope()

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 213 of file G4NeutronCaptureXS.cc.

215{
216 G4int nIso = (G4int)anElement->GetNumberOfIsotopes();
217 const G4Isotope* iso = anElement->GetIsotope(0);
218
219 //G4cout << "SelectIsotope NIso= " << nIso << G4endl;
220 if(1 == nIso) { return iso; }
221
222 // more than 1 isotope
223 G4int Z = anElement->GetZasInt();
224
225 const G4double* abundVector = anElement->GetRelativeAbundanceVector();
227 G4double sum = 0.0;
228
229 // is there isotope wise cross section?
230 G4int j;
231 if(amax[Z] == amin[Z] || Z >= MAXZCAPTURE) {
232 for (j = 0; j<nIso; ++j) {
233 sum += abundVector[j];
234 if(q <= sum) {
235 iso = anElement->GetIsotope(j);
236 break;
237 }
238 }
239 return iso;
240 }
241 G4int nn = (G4int)temp.size();
242 if(nn < nIso) { temp.resize(nIso, 0.); }
243
244 for (j=0; j<nIso; ++j) {
245 sum += abundVector[j]*IsoCrossSection(kinEnergy, logE, Z,
246 anElement->GetIsotope(j)->GetN());
247 temp[j] = sum;
248 }
249 sum *= q;
250 for (j = 0; j<nIso; ++j) {
251 if(temp[j] >= sum) {
252 iso = anElement->GetIsotope(j);
253 break;
254 }
255 }
256 return iso;
257}
#define G4UniformRand()
Definition: Randomize.hh:52
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
G4int GetN() const
Definition: G4Isotope.hh:93

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