Geant4  10.02.p03
G4VCrossSectionDataSet Class Reference

#include <G4VCrossSectionDataSet.hh>

Inherited by CexmcFakeCrossSectionData, 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.

Collaboration diagram for G4VCrossSectionDataSet:

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
 

Private Member Functions

G4VCrossSectionDataSetoperator= (const G4VCrossSectionDataSet &right)
 
 G4VCrossSectionDataSet (const G4VCrossSectionDataSet &)
 

Private Attributes

G4CrossSectionDataSetRegistryregistry
 
G4double minKinEnergy
 
G4double maxKinEnergy
 
G4String name
 

Detailed Description

Definition at line 71 of file G4VCrossSectionDataSet.hh.

Constructor & Destructor Documentation

◆ G4VCrossSectionDataSet() [1/2]

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 }
static G4CrossSectionDataSetRegistry * Instance()
void Register(G4VCrossSectionDataSet *)
G4CrossSectionDataSetRegistry * registry
static const double TeV
Definition: G4SIunits.hh:215
Here is the call graph for this function:

◆ ~G4VCrossSectionDataSet()

G4VCrossSectionDataSet::~G4VCrossSectionDataSet ( )
virtual

Definition at line 61 of file G4VCrossSectionDataSet.cc.

62 {
63  registry->DeRegister(this);
64 }
void DeRegister(G4VCrossSectionDataSet *)
G4CrossSectionDataSetRegistry * registry
Here is the call graph for this function:

◆ G4VCrossSectionDataSet() [2/2]

G4VCrossSectionDataSet::G4VCrossSectionDataSet ( const G4VCrossSectionDataSet )
private

Member Function Documentation

◆ BuildPhysicsTable()

◆ ComputeCrossSection()

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 }
G4int GetNistFirstIsotopeN(G4int Z) const
virtual G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
std::vector< G4Isotope * > G4IsotopeVector
const G4double fact
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
G4double GetIsotopeAbundance(G4int Z, G4int N) const
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:158
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:166
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
double A(double temperature)
Float_t Z
G4IsotopeVector * GetIsotopeVector() const
Definition: G4Element.hh:162
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)
G4int GetN() const
Definition: G4Isotope.hh:94
double G4double
Definition: G4Types.hh:76
G4double GetZ() const
Definition: G4Element.hh:131
G4int GetNumberOfNistIsotopes(G4int Z) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CrossSectionDescription()

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 199 of file G4VCrossSectionDataSet.cc.

200 {
201  outFile << "The description for this cross section data set has not been written yet.\n";
202 }
Here is the caller graph for this function:

◆ DumpPhysicsTable()

◆ GetCrossSection()

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:

◆ GetElementCrossSection()

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  return 0.0;
149 }
static const double MeV
Definition: G4SIunits.hh:211
G4double GetKineticEnergy() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
Float_t Z
G4ParticleDefinition * GetDefinition() const
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const
Definition: G4Material.hh:178
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetIsoCrossSection()

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 152 of file G4VCrossSectionDataSet.cc.

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

◆ GetMaxKinEnergy()

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:

◆ GetMinKinEnergy()

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:

◆ GetName()

const G4String & G4VCrossSectionDataSet::GetName ( void  ) const
inline

Definition at line 221 of file G4VCrossSectionDataSet.hh.

222 {
223  return name;
224 }
Here is the caller graph for this function:

◆ GetVerboseLevel()

G4int G4VCrossSectionDataSet::GetVerboseLevel ( ) const
inlinevirtual

◆ IsElementApplicable()

◆ IsIsoApplicable()

◆ operator=()

G4VCrossSectionDataSet& G4VCrossSectionDataSet::operator= ( const G4VCrossSectionDataSet right)
private

◆ SelectIsotope()

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

Reimplemented in G4NeutronInelasticXS, and G4NeutronCaptureXS.

Definition at line 171 of file G4VCrossSectionDataSet.cc.

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

◆ SetMaxKinEnergy()

void G4VCrossSectionDataSet::SetMaxKinEnergy ( G4double  value)
inline

Definition at line 211 of file G4VCrossSectionDataSet.hh.

212 {
213  maxKinEnergy = value;
214 }
Here is the caller graph for this function:

◆ SetMinKinEnergy()

void G4VCrossSectionDataSet::SetMinKinEnergy ( G4double  value)
inline

Definition at line 201 of file G4VCrossSectionDataSet.hh.

202 {
203  minKinEnergy = value;
204 }
Here is the caller graph for this function:

◆ SetName()

void G4VCrossSectionDataSet::SetName ( const G4String nam)
inlineprotected

Definition at line 226 of file G4VCrossSectionDataSet.hh.

227 {
228  name = nam;
229 }
Here is the caller graph for this function:

◆ SetVerboseLevel()

void G4VCrossSectionDataSet::SetVerboseLevel ( G4int  value)
inlinevirtual

Member Data Documentation

◆ maxKinEnergy

G4double G4VCrossSectionDataSet::maxKinEnergy
private

Definition at line 177 of file G4VCrossSectionDataSet.hh.

◆ minKinEnergy

G4double G4VCrossSectionDataSet::minKinEnergy
private

Definition at line 176 of file G4VCrossSectionDataSet.hh.

◆ name

G4String G4VCrossSectionDataSet::name
private

Definition at line 179 of file G4VCrossSectionDataSet.hh.

◆ registry

G4CrossSectionDataSetRegistry* G4VCrossSectionDataSet::registry
private

Definition at line 174 of file G4VCrossSectionDataSet.hh.

◆ verboseLevel

G4int G4VCrossSectionDataSet::verboseLevel
protected

Definition at line 167 of file G4VCrossSectionDataSet.hh.


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