Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutronGeneralProcess.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//
29// GEANT4 Class header file
30//
31//
32// File name: G4NeutronGeneralProcess
33//
34// Author: Vladimir Ivanchenko
35//
36// Creation date: 08.08.2022
37//
38// Modifications:
39//
40// Class Description:
41//
42// It is the neutron super process
43
44// -------------------------------------------------------------------
45//
46
47#ifndef G4NeutronGeneralProcess_h
48#define G4NeutronGeneralProcess_h 1
49
50#include "G4HadronicProcess.hh"
51#include "globals.hh"
52#include "G4HadDataHandler.hh"
53#include <vector>
54
55class G4Step;
56class G4Track;
61
62//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
63
65{
66public:
67
68 explicit G4NeutronGeneralProcess(const G4String& pname="NeutronGeneralProc");
69
70 ~G4NeutronGeneralProcess() override;
71
73
74 void ProcessDescription(std::ostream& outFile) const override;
75
76 // Initialise for build of tables
77 void PreparePhysicsTable(const G4ParticleDefinition&) override;
78
79 // Build physics table during initialisation
80 void BuildPhysicsTable(const G4ParticleDefinition&) override;
81
82 // Store internal tables after initialisation
84 const G4String& directory, G4bool ascii) override;
85
86 // Called before tracking of each new G4Track
87 void StartTracking(G4Track*) override;
88
89 // implementation of virtual method, specific for G4NeutronGeneralProcess
91 const G4Track& track,
92 G4double previousStepSize,
93 G4ForceCondition* condition) override;
94
95 // implementation of virtual method, specific for G4NeutronGeneralProcess
96 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
97
98 const G4VProcess* GetCreatorProcess() const override;
99
100 // Temporary method
101 const G4String& GetSubProcessName() const;
102
103 // Temporary method
105
109
110 // access methods to cross sections and processes
113
114 inline const G4VProcess* GetSelectedProcess() const;
115
116 inline void SetTimeLimit(G4double val);
117
118 inline void SetMinEnergyLimit(G4double val);
119
120 // hide copy constructor and assignment operator
123 (const G4NeutronGeneralProcess &right) = delete;
124
125protected:
126
127 G4double GetMeanFreePath(const G4Track& track, G4double previousStepSize,
128 G4ForceCondition* condition) override;
129
130 inline G4double ComputeGeneralLambda(size_t idxe, size_t idxt);
131
132 inline G4double GetProbability(size_t idxt);
133
134 inline void SelectedProcess(const G4Step& step, G4HadronicProcess* ptr,
136
137private:
138
139 // partial cross section
140 G4double ComputeCrossSection(G4VCrossSectionDataSet*, const G4Material*,
141 G4double kinEnergy, G4double loge);
142
143 G4VCrossSectionDataSet* InitialisationXS(G4HadronicProcess*);
144
145 // total cross section
146 inline void CurrentCrossSection(const G4Track&);
147
148 static G4HadDataHandler* theHandler;
149 static const size_t nTables = 5;
150 static G4String nameT[nTables];
151
152 G4HadronicProcess* fInelasticP = nullptr;
153 G4HadronicProcess* fElasticP = nullptr;
154 G4HadronicProcess* fCaptureP = nullptr;
155 G4HadronicProcess* fSelectedProc = nullptr;
156
157 G4VCrossSectionDataSet* fInelasticXS = nullptr;
158 G4VCrossSectionDataSet* fElasticXS = nullptr;
159 G4VCrossSectionDataSet* fCaptureXS = nullptr;
160
161 G4CrossSectionDataStore* fXSSInelastic = nullptr;
162 G4CrossSectionDataStore* fXSSElastic = nullptr;
163 G4CrossSectionDataStore* fXSSCapture = nullptr;
164 G4CrossSectionDataStore* fCurrentXSS = nullptr;
165
166 const G4ParticleDefinition* fNeutron;
167 const G4Material* fCurrMat = nullptr;
168
169 G4double fMinEnergy;
170 G4double fMiddleEnergy;
171 G4double fMaxEnergy;
172 G4double fTimeLimit;
173 G4double fXSFactorInel = 1.0;
174 G4double fXSFactorEl = 1.0;
175 G4double fCurrE = 0.0;
176 G4double fCurrLogE = 0.0;
177 G4double fLambda = 0.0;
178
179 // number of bins per decade
180 std::size_t nLowE = 100;
181 std::size_t nHighE = 10;
182
183 std::size_t idxEnergy = 0;
184 std::size_t matIndex = 0;
185
186 G4bool isMaster = true;
187 std::vector<G4double> fXsec;
188};
189
190//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
191
192inline G4double
193G4NeutronGeneralProcess::ComputeGeneralLambda(std::size_t idxe, std::size_t idxt)
194{
195 idxEnergy = idxe;
196 return theHandler->GetVector(idxt, matIndex)
197 ->LogVectorValue(fCurrE, fCurrLogE);
198}
199
200//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
201
203{
204 return theHandler->GetVector(idxt, matIndex)
205 ->LogVectorValue(fCurrE, fCurrLogE);
206}
207
208//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
209
210inline void
214
215{
216 fSelectedProc = ptr;
217 fCurrentXSS = xs;
219}
220
221//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
222
224{
225 return fSelectedProc;
226}
227
228//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
229
230inline void G4NeutronGeneralProcess::CurrentCrossSection(const G4Track& track)
231{
232 G4double energy = track.GetKineticEnergy();
233 const G4Material* mat = track.GetMaterial();
234 if(mat != fCurrMat || energy != fCurrE) {
235 fCurrMat = mat;
236 matIndex = mat->GetIndex();
237 fCurrE = energy;
238 fCurrLogE = track.GetDynamicParticle()->GetLogKineticEnergy();
239 fLambda = (energy <= fMiddleEnergy) ? ComputeGeneralLambda(0, 0)
240 : ComputeGeneralLambda(1, 3);
241 currentInteractionLength = 1.0/fLambda;
242 }
243}
244
245//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
246
248{
249 fTimeLimit = val;
250}
251
252//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
253
255{
256 fMinEnergy = val;
257}
258
259//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
260
261#endif
G4double condition(const G4ErrorSymMatrix &m)
G4ForceCondition
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4double GetLogKineticEnergy() const
const G4PhysicsVector * GetVector(std::size_t itable, std::size_t ivec) const
std::size_t GetIndex() const
void SetCaptureProcess(G4HadronicProcess *)
G4NeutronGeneralProcess(const G4String &pname="NeutronGeneralProc")
void StartTracking(G4Track *) override
G4NeutronGeneralProcess(G4NeutronGeneralProcess &)=delete
void ProcessDescription(std::ostream &outFile) const override
G4VCrossSectionDataSet * GetXSection(G4int type)
void PreparePhysicsTable(const G4ParticleDefinition &) override
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
void SelectedProcess(const G4Step &step, G4HadronicProcess *ptr, G4CrossSectionDataStore *)
const G4VProcess * GetSelectedProcess() const
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
void SetElasticProcess(G4HadronicProcess *)
G4double GetProbability(size_t idxt)
G4bool StorePhysicsTable(const G4ParticleDefinition *part, const G4String &directory, G4bool ascii) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4double ComputeGeneralLambda(size_t idxe, size_t idxt)
const G4VProcess * GetCreatorProcess() const override
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
const G4String & GetSubProcessName() const
G4HadronicProcess * GetHadronicProcess(G4int type)
void SetInelasticProcess(G4HadronicProcess *)
G4bool IsApplicable(const G4ParticleDefinition &) override
G4double LogVectorValue(const G4double energy, const G4double theLogEnergy) const
void SetProcessDefinedStep(const G4VProcess *aValue)
G4StepPoint * GetPostStepPoint() const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetKineticEnergy() const
G4double currentInteractionLength