Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VCrossSectionDataSet Class Reference

#include <G4VCrossSectionDataSet.hh>

Inherited by G4BGGNucleonElasticXS, G4BGGNucleonInelasticXS, G4BGGPionElasticXS, G4BGGPionInelasticXS, G4ChipsAntiBaryonElasticXS, G4ChipsAntiBaryonInelasticXS, G4ChipsHyperonElasticXS, G4ChipsHyperonInelasticXS, G4ChipsKaonMinusElasticXS, G4ChipsKaonMinusInelasticXS, G4ChipsKaonPlusElasticXS, G4ChipsKaonPlusInelasticXS, G4ChipsKaonZeroElasticXS, G4ChipsKaonZeroInelasticXS, G4ChipsNeutronElasticXS, G4ChipsNeutronInelasticXS, G4ChipsPionMinusElasticXS, G4ChipsPionMinusInelasticXS, G4ChipsPionPlusElasticXS, G4ChipsPionPlusInelasticXS, G4ChipsProtonElasticXS, G4ChipsProtonInelasticXS, G4CrossSectionElastic, G4CrossSectionInelastic, G4CrossSectionPairGG, G4ElectroNuclearCrossSection, G4EMDissociationCrossSection, G4GeneralSpaceNNCrossSection, G4HadronCaptureDataSet, G4HadronElasticDataSet, G4HadronFissionDataSet, G4HadronInelasticDataSet, G4IonProtonCrossSection, G4IonsKoxCrossSection, G4IonsShenCrossSection, G4IonsSihverCrossSection, G4KokoulinMuonNuclearXS, G4LENDCrossSection, G4NeutronCaptureXS, G4NeutronElasticXS, G4NeutronInelasticCrossSection, G4NeutronInelasticXS, G4NucleonNuclearCrossSection, G4ParticleHPCaptureData, G4ParticleHPElasticData, G4ParticleHPFissionData, G4ParticleHPInelasticData, G4ParticleHPJENDLHEData, G4ParticleHPThermalScatteringData, G4PhotoNuclearCrossSection, G4PiNuclearCrossSection, G4ProtonInelasticCrossSection, G4TripathiCrossSection, G4TripathiLightCrossSection, G4UPiNuclearCrossSection, and G4ZeroXS.

Public Member Functions

 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Protected Member Functions

void SetName (const G4String &)
 

Protected Attributes

G4int verboseLevel
 

Detailed Description

Definition at line 71 of file G4VCrossSectionDataSet.hh.

Constructor & Destructor Documentation

G4VCrossSectionDataSet::G4VCrossSectionDataSet ( const G4String nam = "")

Definition at line 54 of file G4VCrossSectionDataSet.cc.

54  :
55  verboseLevel(0),minKinEnergy(0.0),maxKinEnergy(100*TeV),name(nam)
56 {
58  registry->Register(this);
59 }
const XML_Char * name
Definition: expat.h:151
static constexpr double TeV
Definition: G4SIunits.hh:218
static G4CrossSectionDataSetRegistry * Instance()
void Register(G4VCrossSectionDataSet *)

Here is the call graph for this function:

G4VCrossSectionDataSet::~G4VCrossSectionDataSet ( )
virtual

Definition at line 61 of file G4VCrossSectionDataSet.cc.

62 {
63  registry->DeRegister(this);
64 }
void DeRegister(G4VCrossSectionDataSet *)

Here is the call graph for this function:

Member Function Documentation

G4double G4VCrossSectionDataSet::ComputeCrossSection ( const G4DynamicParticle part,
const G4Element elm,
const G4Material mat = 0 
)

Definition at line 84 of file G4VCrossSectionDataSet.cc.

87 {
88  G4int Z = G4lrint(elm->GetZ());
89 
90  if (IsElementApplicable(part, Z, mat)) {
91  return GetElementCrossSection(part, Z, mat);
92  }
93 
94  // isotope-wise cross section making sum over available
95  // isotope cross sections, which may be incomplete, so
96  // the result is corrected
97  G4int nIso = elm->GetNumberOfIsotopes();
98  G4double fact = 0.0;
99  G4double xsec = 0.0;
100  G4Isotope* iso = 0;
101 
102  if (0 < nIso) {
103 
104  // user-defined isotope abundances
105  G4IsotopeVector* isoVector = elm->GetIsotopeVector();
106  G4double* abundVector = elm->GetRelativeAbundanceVector();
107 
108  for (G4int j = 0; j<nIso; ++j) {
109  iso = (*isoVector)[j];
110  G4int A = iso->GetN();
111  if(abundVector[j] > 0.0 && IsIsoApplicable(part, Z, A, elm, mat)) {
112  fact += abundVector[j];
113  xsec += abundVector[j]*GetIsoCrossSection(part, Z, A, iso, elm, mat);
114  }
115  }
116 
117  } else {
118 
119  // natural isotope abundances
121  G4int n0 = nist->GetNistFirstIsotopeN(Z);
122  G4int nn = nist->GetNumberOfNistIsotopes(Z);
123  for (G4int A = n0; A < n0+nn; ++A) {
124  G4double abund = nist->GetIsotopeAbundance(Z, A);
125  if(abund > 0.0 && IsIsoApplicable(part, Z, A, elm, mat)) {
126  fact += abund;
127  xsec += abund*GetIsoCrossSection(part, Z, A, iso, elm, mat);
128  }
129  }
130  }
131  if(fact > 0.0) { xsec /= fact; }
132  return xsec;
133 }
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
virtual G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
std::vector< G4Isotope * > G4IsotopeVector
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
G4double GetZ() const
Definition: G4Element.hh:131
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
G4int GetNistFirstIsotopeN(G4int Z) const
G4int GetN() const
Definition: G4Isotope.hh:94
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
double A(double temperature)
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
G4double GetIsotopeAbundance(G4int Z, G4int N) const
G4int GetNumberOfNistIsotopes(G4int Z) const
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:163
int G4lrint(double ad)
Definition: templates.hh:163
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VCrossSectionDataSet::CrossSectionDescription ( std::ostream &  outFile) const
virtual

Reimplemented in G4GeneralSpaceNNCrossSection, G4ParticleHPThermalScatteringData, G4BGGPionInelasticXS, G4BGGNucleonElasticXS, G4NeutronInelasticXS, G4BGGNucleonInelasticXS, G4BGGPionElasticXS, G4NeutronCaptureXS, G4ParticleHPInelasticData, G4ParticleHPCaptureData, G4ParticleHPElasticData, G4CrossSectionElastic, G4CrossSectionInelastic, G4NeutronElasticXS, G4ParticleHPFissionData, G4IonProtonCrossSection, G4IonsShenCrossSection, G4ZeroXS, G4UPiNuclearCrossSection, G4ElectroNuclearCrossSection, G4CrossSectionPairGG, G4NucleonNuclearCrossSection, G4IonsKoxCrossSection, G4IonsSihverCrossSection, G4KokoulinMuonNuclearXS, G4ChipsKaonZeroElasticXS, G4ChipsKaonZeroInelasticXS, G4NeutronInelasticCrossSection, G4ChipsPionPlusInelasticXS, G4ChipsKaonPlusInelasticXS, G4ChipsAntiBaryonElasticXS, G4ChipsKaonMinusElasticXS, G4ChipsNeutronElasticXS, G4ChipsNeutronInelasticXS, G4ChipsPionMinusElasticXS, G4ChipsPionMinusInelasticXS, G4PiNuclearCrossSection, G4ChipsHyperonElasticXS, G4ChipsHyperonInelasticXS, G4ChipsKaonMinusInelasticXS, G4ChipsKaonPlusElasticXS, G4ChipsPionPlusElasticXS, G4ChipsProtonElasticXS, G4ChipsProtonInelasticXS, G4HadronCaptureDataSet, G4ChipsAntiBaryonInelasticXS, G4HadronElasticDataSet, G4HadronFissionDataSet, G4HadronInelasticDataSet, and G4PhotoNuclearCrossSection.

Definition at line 197 of file G4VCrossSectionDataSet.cc.

198 {
199  outFile << "The description for this cross section data set has not been written yet.\n";
200 }

Here is the caller graph for this function:

G4double G4VCrossSectionDataSet::GetCrossSection ( const G4DynamicParticle dp,
const G4Element elm,
const G4Material mat = 0 
)
inline

Definition at line 183 of file G4VCrossSectionDataSet.hh.

186 {
187  return ComputeCrossSection(dp, elm, mat);
188 }
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)

Here is the call graph for this function:

G4double G4VCrossSectionDataSet::GetElementCrossSection ( const G4DynamicParticle dynPart,
G4int  Z,
const G4Material mat = 0 
)
virtual

Reimplemented in G4GeneralSpaceNNCrossSection, G4TripathiLightCrossSection, G4EMDissociationCrossSection, G4BGGPionInelasticXS, G4BGGNucleonElasticXS, G4BGGNucleonInelasticXS, G4BGGPionElasticXS, G4NeutronInelasticXS, G4NeutronCaptureXS, G4CrossSectionElastic, G4CrossSectionInelastic, G4NeutronElasticXS, G4CrossSectionPairGG, G4IonProtonCrossSection, G4ElectroNuclearCrossSection, G4ZeroXS, G4KokoulinMuonNuclearXS, G4ProtonInelasticCrossSection, G4IonsShenCrossSection, G4HadronCaptureDataSet, G4NucleonNuclearCrossSection, G4HadronElasticDataSet, G4IonsKoxCrossSection, G4IonsSihverCrossSection, G4HadronFissionDataSet, G4HadronInelasticDataSet, G4PhotoNuclearCrossSection, G4NeutronInelasticCrossSection, G4TripathiCrossSection, and G4PiNuclearCrossSection.

Definition at line 136 of file G4VCrossSectionDataSet.cc.

139 {
140  G4cout << "G4VCrossSectionDataSet::GetCrossSection per element ERROR: "
141  << " there is no cross section for "
142  << dynPart->GetDefinition()->GetParticleName()
143  << " E(MeV)= " << dynPart->GetKineticEnergy()/MeV;
144  if(mat) { G4cout << " inside " << mat->GetName(); }
145  G4cout << " for Z= " << Z << G4endl;
146  throw G4HadronicException(__FILE__, __LINE__,
147  "G4VCrossSectionDataSet::GetElementCrossSection is absent");
148 }
G4double GetKineticEnergy() const
const G4String & GetName() const
Definition: G4Material.hh:178
G4ParticleDefinition * GetDefinition() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4VCrossSectionDataSet::GetIsoCrossSection ( const G4DynamicParticle dynPart,
G4int  Z,
G4int  A,
const G4Isotope iso = 0,
const G4Element elm = 0,
const G4Material mat = 0 
)
virtual

Reimplemented in G4BGGPionInelasticXS, G4BGGNucleonElasticXS, G4BGGNucleonInelasticXS, G4BGGPionElasticXS, G4NeutronInelasticXS, G4NeutronCaptureXS, G4LENDCrossSection, G4ParticleHPThermalScatteringData, G4ChipsKaonZeroElasticXS, G4ChipsKaonZeroInelasticXS, G4IonsShenCrossSection, G4ChipsNeutronInelasticXS, G4ChipsPionPlusInelasticXS, G4ParticleHPInelasticData, G4ChipsKaonPlusInelasticXS, G4ParticleHPElasticData, G4ChipsAntiBaryonElasticXS, G4ChipsKaonMinusElasticXS, G4ChipsNeutronElasticXS, G4ChipsPionMinusElasticXS, G4ChipsPionMinusInelasticXS, G4ParticleHPCaptureData, G4ChipsHyperonElasticXS, G4ChipsHyperonInelasticXS, G4ChipsKaonMinusInelasticXS, G4ChipsKaonPlusElasticXS, G4ChipsPionPlusElasticXS, G4ChipsProtonElasticXS, G4ChipsProtonInelasticXS, G4ChipsAntiBaryonInelasticXS, and G4ParticleHPFissionData.

Definition at line 151 of file G4VCrossSectionDataSet.cc.

156 {
157  G4cout << "G4VCrossSectionDataSet::GetCrossSection per isotope ERROR: "
158  << " there is no cross section for "
159  << dynPart->GetDefinition()->GetParticleName()
160  << " E(MeV)= " << dynPart->GetKineticEnergy()/MeV;
161  if(mat) { G4cout << " inside " << mat->GetName(); }
162  if(elm) { G4cout << " for " << elm->GetName(); }
163  G4cout << " Z= " << Z << " A= " << A << G4endl;
164  throw G4HadronicException(__FILE__, __LINE__,
165  "G4VCrossSectionDataSet::GetIsoCrossSection is absent");
166 }
G4double GetKineticEnergy() const
const G4String & GetName() const
Definition: G4Material.hh:178
G4ParticleDefinition * GetDefinition() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
const G4String & GetName() const
Definition: G4Element.hh:127

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4VCrossSectionDataSet::GetMaxKinEnergy ( ) const
inline

Definition at line 216 of file G4VCrossSectionDataSet.hh.

217 {
218  return maxKinEnergy;
219 }

Here is the caller graph for this function:

G4double G4VCrossSectionDataSet::GetMinKinEnergy ( ) const
inline

Definition at line 206 of file G4VCrossSectionDataSet.hh.

207 {
208  return minKinEnergy;
209 }

Here is the caller graph for this function:

const G4String & G4VCrossSectionDataSet::GetName ( ) const
inline

Definition at line 221 of file G4VCrossSectionDataSet.hh.

222 {
223  return name;
224 }
const XML_Char * name
Definition: expat.h:151

Here is the caller graph for this function:

G4int G4VCrossSectionDataSet::GetVerboseLevel ( ) const
inlinevirtual
G4Isotope * G4VCrossSectionDataSet::SelectIsotope ( const G4Element anElement,
G4double  kinEnergy 
)
virtual

Reimplemented in G4NeutronInelasticXS, and G4NeutronCaptureXS.

Definition at line 169 of file G4VCrossSectionDataSet.cc.

170 {
171  G4int nIso = anElement->GetNumberOfIsotopes();
172  G4IsotopeVector* isoVector = anElement->GetIsotopeVector();
173  G4Isotope* iso = (*isoVector)[0];
174 
175  // more than 1 isotope
176  if(1 < nIso) {
177  G4double* abundVector = anElement->GetRelativeAbundanceVector();
178  G4double sum = 0.0;
179  G4double q = G4UniformRand();
180  for (G4int j = 0; j<nIso; ++j) {
181  sum += abundVector[j];
182  if(q <= sum) {
183  iso = (*isoVector)[j];
184  break;
185  }
186  }
187  }
188  return iso;
189 }
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
std::vector< G4Isotope * > G4IsotopeVector
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:163
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4VCrossSectionDataSet::SetMaxKinEnergy ( G4double  value)
inline

Definition at line 211 of file G4VCrossSectionDataSet.hh.

212 {
213  maxKinEnergy = value;
214 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4VCrossSectionDataSet::SetMinKinEnergy ( G4double  value)
inline

Definition at line 201 of file G4VCrossSectionDataSet.hh.

202 {
203  minKinEnergy = value;
204 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Here is the caller graph for this function:

void G4VCrossSectionDataSet::SetName ( const G4String nam)
inlineprotected

Definition at line 226 of file G4VCrossSectionDataSet.hh.

227 {
228  name = nam;
229 }
const XML_Char * name
Definition: expat.h:151

Here is the caller graph for this function:

void G4VCrossSectionDataSet::SetVerboseLevel ( G4int  value)
inlinevirtual

Reimplemented in G4ParticleHPInelasticData, G4ParticleHPCaptureData, G4ParticleHPElasticData, and G4ParticleHPFissionData.

Definition at line 196 of file G4VCrossSectionDataSet.hh.

197 {
199 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

Member Data Documentation

G4int G4VCrossSectionDataSet::verboseLevel
protected

Definition at line 167 of file G4VCrossSectionDataSet.hh.


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