Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VCrossSectionDataSet.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// -------------------------------------------------------------------
27//
28// GEANT4 Class header file
29//
30//
31// File name: G4VCrossSectionDataSet
32//
33// Author F.W. Jones, TRIUMF, 20-JAN-97
34//
35// Modifications:
36// 23.01.2009 V.Ivanchenko move constructor and destructor to source
37// 05.07.2010 V.Ivanchenko added name, min and max energy limit and
38// corresponding access methods
39// 12.08.2011 G.Folger, V.Ivanchenko, T.Koi, D.Wright redesign the class
40//
41//
42// Class Description
43// This is a base class for hadronic cross section data sets. Users may
44// derive specialized cross section classes and register them with the
45// appropriate process, or use provided data sets.
46//
47// Each cross section should have unique name
48// Minimal and maximal energy for the cross section will be used in run
49// time before IsApplicable method is called
50//
51// Both the name and the energy interval will be used for documentation
52//
53// Class Description - End
54
55#ifndef G4VCrossSectionDataSet_h
56#define G4VCrossSectionDataSet_h 1
57
58#include "globals.hh"
60#include "G4DynamicParticle.hh"
61#include "G4Element.hh"
62#include <iostream>
63
65class G4Isotope;
66class G4Material;
68
70{
71public: //with description
72
73 G4VCrossSectionDataSet(const G4String& nam = "");
74
76
77 //============== Is Applicable methods ===============================
78 // The following three methods have default implementations returning
79 // "false". Derived classes should implement only needed methods.
80
81 // Element-wise cross section
82 virtual
84 const G4Material* mat = nullptr);
85
86 // Derived classes should implement this method if they provide isotope-wise
87 // cross sections. Default arguments G4Element and G4Material are needed to
88 // access low-energy neutron cross sections, but are not required for others.
89 virtual
91 const G4Element* elm = nullptr,
92 const G4Material* mat = nullptr);
93
94 //============== GetCrossSection methods ===============================
95
96 // This is a generic method to access cross section per element
97 // This method should not be overwritten in a derived class
99 const G4Material* mat = nullptr);
100
101 // This is a generic method to compute cross section per element
102 // If the DataSet is not applicable the method returns zero
103 // This method should not be overwritten in a derived class
105 const G4Element*,
106 const G4Material* mat = nullptr);
107
108 // Implement element cross section, IsApplicable does not checked.
109 // In the default implementation a sum of isotope cross sections is computed
110 virtual
112 const G4ParticleDefinition*,
113 const G4Element*,
114 const G4Material* mat = nullptr);
115
116 // Implement these methods for element-wise cross section
117 virtual
119 const G4Material* mat = nullptr);
120
121 // Derived classes should implement these methods if they provide isotope-wise
122 // cross sections. Extra arguments G4Isotope, G4Element, and G4Material are
123 // needed to access low-energy neutron cross sections, but not in other cases.
124 virtual
126 const G4Isotope* iso = nullptr,
127 const G4Element* elm = nullptr,
128 const G4Material* mat = nullptr);
129
130 virtual
133 const G4Isotope* iso = nullptr,
134 const G4Element* elm = nullptr,
135 const G4Material* mat = nullptr);
136
137 //=====================================================================
138
139 // Implement this method if needed
140 // This method is called for element-wise cross section
141 // Default implementation assumes equal cross sections for all isotopes
142 virtual const G4Isotope* SelectIsotope(const G4Element*, G4double kinEnergy,
143 G4double logE);
144
145 // Implement this method if needed
146 virtual
148
149 // Implement this method if needed
150 // Default implementation will provide a dump of the cross section
151 // in logarithmic scale in the interval of applicability
152 virtual
154
155 virtual void CrossSectionDescription(std::ostream&) const;
156
157 virtual void SetVerboseLevel(G4int value);
158
159 inline G4double GetMinKinEnergy() const;
160
161 inline void SetMinKinEnergy(G4double value);
162
163 inline G4double GetMaxKinEnergy() const;
164
165 inline void SetMaxKinEnergy(G4double value);
166
167 inline bool ForAllAtomsAndEnergies() const;
168
169 inline void SetForAllAtomsAndEnergies(G4bool val);
170
171 inline const G4String& GetName() const;
172
173 inline void SetName(const G4String& nam);
174
176 (const G4VCrossSectionDataSet &right) = delete;
178
179protected:
180
182
184
185private:
186
188
189 G4double minKinEnergy;
190 G4double maxKinEnergy;
191
192 G4bool isForAllAtomsAndEnergies;
193
194};
195
196inline G4double
198 const G4Element* elm,
199 const G4Material* mat)
200{
201 return ComputeCrossSection(dp, elm, mat);
202}
203
205{
206 verboseLevel = value;
207}
208
210{
211 minKinEnergy = value;
212}
213
215{
216 return minKinEnergy;
217}
218
220{
221 maxKinEnergy = value;
222}
223
225{
226 return maxKinEnergy;
227}
228
230{
231 return name;
232}
233
235{
236 return isForAllAtomsAndEnergies;
237}
238
240{
241 isForAllAtomsAndEnergies = val;
242}
243
245{
246 name = nam;
247}
248
249#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
const G4int Z[17]
const G4double A[17]
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
void SetMaxKinEnergy(G4double value)
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 G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
virtual void DumpPhysicsTable(const G4ParticleDefinition &)
virtual G4double ComputeCrossSectionPerElement(G4double kinEnergy, G4double loge, const G4ParticleDefinition *, const G4Element *, const G4Material *mat=nullptr)
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
virtual void SetVerboseLevel(G4int value)
void SetMinKinEnergy(G4double value)
virtual G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
const G4String & GetName() const
virtual void CrossSectionDescription(std::ostream &) const
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, const G4Material *mat=nullptr)
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
G4VCrossSectionDataSet(const G4VCrossSectionDataSet &)=delete
void SetForAllAtomsAndEnergies(G4bool val)
void SetName(const G4String &nam)
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
virtual const G4Isotope * SelectIsotope(const G4Element *, G4double kinEnergy, G4double logE)