Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FissionProductYieldDist.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 * File: G4FissionProductYieldDist.hh
28 * Author: B. Wendt ([email protected])
29 *
30 * Created on May 11, 2011, 12:04 PM
31 */
32
33#ifndef G4FISSIONPRODUCTYIELDDIST_HH
34#define G4FISSIONPRODUCTYIELDDIST_HH
35
36#include "G4Ions.hh"
37#include "G4Gamma.hh"
38#include "G4IonTable.hh"
39#include "G4ParticleHPNames.hh"
40#include "globals.hh"
41#include "G4DynamicParticle.hh"
43#include "G4ReactionProduct.hh"
44
45#include "G4ENDFTapeRead.hh"
47#include "G4FFGEnumerations.hh"
48#include "G4FPYNubarValues.hh"
49#include "G4FPYSamplingOps.hh"
51
52/** G4FissionProductYieldDist is the base class for storing all the fission
53 * data and generating fission events. */
55{
56public:
57// Constructor definition
58 /** Default constructor
59 * - Usage:
60 * - \p WhichIsotope: Isotope number of the element in ZZZAAA form
61 * - \p WhichMetaState: \p GROUND_STATE, \p META_1, or \p META_2
62 * - \p WhichCause: \p SPONTANEOUS or \p N_INDUCED
63 * - \p WhichYieldType: \p INDEPENDENT or \p CUMULATIVE
64 *
65 * - Notes:
66 */
67 G4FissionProductYieldDist( G4int WhichIsotope,
68 G4FFGEnumerations::MetaState WhichMetaState,
70 G4FFGEnumerations::YieldType WhichYieldType,
71 std::istringstream& dataStream);
72 /** Overloaded constructor
73 * - Usage:
74 * - \p WhichIsotope: Isotope number of the element in ZZZAAA form
75 * - \p WhichMetaState: \p GROUND_STATE, \p META_1, or \p META_2
76 * - \p WhichCause: \p SPONTANEOUS or \p N_INDUCED
77 * - \p WhichYieldType: \p INDEPENDENT or \p CUMULATIVE
78 * - \p Verbosity: Verbosity level
79 *
80 * - Notes:
81 */
82 G4FissionProductYieldDist( G4int WhichIsotope,
83 G4FFGEnumerations::MetaState WhichMetaState,
85 G4FFGEnumerations::YieldType WhichYieldType,
86 G4int Verbosity,
87 std::istringstream& dataStream);
88private:
89 /** Initialize is a common function called by all constructors. */
90 void Initialize( std::istringstream& dataStream );
91
92#ifdef G4MULTITHREADED
93 static G4Mutex fissprodMutex;
94#endif
95
96public:
97// Functions
98 /** Generates a fission event using default sampling and returns the pointer
99 * to that fission event.
100 * - Usage: No arguments required
101 *
102 * - Notes:
103 * - The fission products are loaded into FissionContainer in the
104 * following order:
105 * - First daughter product
106 * - Second daughter product
107 * - Alpha particles
108 * - Neutrons
109 * - Gamma rays
110 * - The last particle will have a NULL NextFragment pointer
111 */
113 /** Selects a fission fragment at random from the probability tree and
114 * returns the \p G4Ions pointer.
115 * - Usage: No arguments required
116 *
117 * - Notes:
118 */
120 /** Set the alpha production behavior for fission event generation.
121 * - Usage:
122 * - if \p AlphaProduction is negative then alpha particles are sampled
123 * randomly.
124 *
125 * - Notes:
126 * - The maximum number of alpha particles that may be created is
127 * physically limited by the nucleons present in the parent nucleus.
128 * Setting the AlphaProduction too high will have unpredictable
129 * results on the sampling of the fission products.
130 */
131 void G4SetAlphaProduction( G4double WhatAlphaProduction );
132 /** Sets the energy of the incident particle
133 * - Usage:
134 * - \p WhatIncidentEnergy: Kinetic energy, if any, of the incident
135 * neutron in GeV
136 *
137 * - Notes:
138 */
139 void G4SetEnergy( G4double WhatIncidentEnergy );
140 /** Sets the probability of ternary fission
141 * - Usage:
142 * - \p WhatTernaryProbability: Probability of generating a ternary
143 * fission event.
144 *
145 * - Notes:
146 */
147 void G4SetTernaryProbability( G4double TernaryProbability );
148 /** Sets the verbosity levels
149 * - Usage:
150 * - \p WhichVerbosity: Combination of levels
151 *
152 * - Notes:
153 * - \p SILENT: All verbose output is repressed
154 * - \p UPDATES: Only high-level internal changes are reported
155 * - \p DAUGHTER_INFO: Displays information about daughter product sampling
156 * - \p NEUTRON_INFO: Displays information about neutron sampling
157 * - \p GAMMA_INFO: Displays information about gamma sampling
158 * - \p ALPHA_INFO: Displays information about alpha sampling
159 * - \p MOMENTUM_INFO: Displays information about momentum balancing
160 * - \p EXTRAPOLATION_INTERPOLATION_INFO: Displays information about any data extrapolation or interpolation that occurs
161 * - \p DEBUG: Reports program flow as it steps through functions
162 * - \p PRINT_ALL: Displays any and all output
163 */
164 void G4SetVerbosity( G4int WhatVerbosity );
165
166protected:
167// Variables
168 // Class descriptor variables
169 /** Number in ZZZAAA format of the isotope that
170 * G4FissionProductYieldDist references
171 */
173 /** MetaState information of the isotope that G4FissionProductYieldDist
174 * references
175 * \n Possible values are \p GROUND_STATE, \p META_1, or \p META_2
176 */
178 /** The cause of fission: \p SPONTANEOUS or \p N_INDUCED. */
180 /** The type of yield to be used: \p INDEPENDET or \p CUMULATIVE */
182
183 // Datafile variables
184 /** Name of the fission yield product data file that
185 * G4FissionProductYieldDist references
186 */
188
189 // Fission generation variables
190 /** Contains the \p G4Ions pointer to an alpha particle */
192 /** Controls whether alpha particles are emitted, and how many */
194 /** Sets the ternary fission probability. Valid ranges are [0, 1] */
196 /** Contains the \p g4ParticleDefinition pointer to a gamma particle */
198 /** Kinetic energy, if any, of the incident particle in GeV. */
200 /** Sets the mean gamma energy, in MeV, produced by the fission of the
201 * isotope described by Isotope_
202 */
204 /** Contains the G4ParticleDefinition pointer to a neutron, cast as a
205 * G4Ion for compatibility*/
207 /** Nubar for the isotope and incident neutron energy that
208 * G4FissionProductYieldDist references.
209 */
211 /** Width of the gaussian distribution that samples nubar for the
212 * isotope and incident neutron energy that G4FissionProductYieldDist
213 * references.
214 */
216 /** Counter for the number of protons available to the fission event */
218 /** Counter for the number of nucleons available to the fission event */
220 /** Container for the energy remaining to be assigned in the fission generation */
222 /** Verbosity level */
224
225 // Pointers to the field of trees and relevant normalization data
226 /** An array, or 'field', of the probability trees */
228 /** Defines the smallest Z particle in the field of trees */
230 /** Defines the smallest A particle in the field of trees */
232 /** Defines the largest Z particle in the field of trees. */
234 /** Defines the largest Z particle in the field of trees */
236 /** Number of specific energy groups */
238 /** Energy values of each energy */
240 /** Variable for ensuring that the input data is normalized */
242 /** A running total of all the probabilities */
244 /** The number of trees in the field */
246 /** A run-time counter for the total number of branches stored */
248
249 // Pointers to runtime classes that G4FissionProductYieldDist needs to
250 // function properly
251 /** Pointer to \p G4IonTable
252 * \n All \p G4Ions are created using
253 * \p G4IonTable
254 */
256 /** Pointer to \p G4NeutronHPNames
257 * \n Provides access to the list of element names included in Geant4
258 */
260 /** Pointer to the \p CLHEP library random engine */
262
263//Functions
264 /** Checks to make sure that alpha overpopulation will not occur, which
265 * could result in an unsolvable zero momentum in the LAB system.
266 */
267 void CheckAlphaSanity( void );
268 /** Returns the \p G4Ions definitions pointer for the particle whose
269 * probability segment contains the (0, 1] random number \p RandomParticle
270 */
271 G4Ions* FindParticle( G4double RandomParticle );
272 /** Returns the \p G4Ions definitions pointer for the particle whose
273 * probability segment contains the (0, 1] random number \p RandomParticle
274 * by extrapolating values using the current data set.
275 * This function exists so that that different models of extrapolation
276 * may be more easily implemented in the future.
277 */
279 G4bool LowerEnergyGroupExists );
280 /** Returns the \p G4Ions definitions pointer for the particle whose
281 * probability segment contains the (0, 1] random number \p RandomParticle
282 * by interpolating values in the current data set.
283 * This function exists so that that different models of interpolation
284 * may be more easily implemented in the future.
285 */
287 G4int LowerEnergyGroup );
288 /** Returns the \p G4Ions definitions pointer for the particle whose
289 * probability segment contains the (0, 1] random number \p RandomParticle
290 * by searching through a branch. Both the extrapolation and interpolation
291 * schemes currently use this function to identify the particle.
292 */
294 G4double RandomParticle,
295 G4int EnergyGroup1,
296 G4int EnergyGroup2 );
297 /** Generates a \p G4DynamicParticleVector with the fission alphas
298 */
299 virtual void GenerateAlphas( std::vector< G4ReactionProduct* >* Alphas );
300 /** Generate a linked chain of neutrons and return the pointer to the last
301 * neutron in the chain.
302 */
303 virtual void GenerateNeutrons( std::vector< G4ReactionProduct* >* Neutrons );
304 /** Selects a fission product from the probability tree, limited by the
305 * number of nucleons available to the system
306 */
307 virtual G4Ions* GetFissionProduct( void ) = 0;
308 /** Returns the \p G4Ions definition pointer to the isotope defined by
309 * \p Product and \p MetaState.
310 * Searches the \p ParticleTable for the particle defined by \p Product
311 * (ZZZAAA) and \p MetaState and returns the \p G4Ions
312 * pointer to that particle. If the particle does not exist then it is
313 * created in \p G4ParticleTable and the pointer to the new particle is
314 * returned.
315 */
318 /** Generates the directory location for the data file referenced by
319 * G4FissionProductYieldDist
320 */
322 /** Generates the appropriate file name for the isotope requested */
323 G4String MakeFileName( G4int Isotope,
325 /** Creates a \p G4DynamicParticle from an existing \p G4ReactionProduct */
327 /** Generates the unique name for an isotope/isomer defined by \p Isotope\
328 * and \p MetaState in the following format: ZZZ_AAAmX_NAME
329 */
332 /** Dynamically allocates and initializes the 'field' of 'trees' with the
333 * 'trunks'
334 */
335 virtual void MakeTrees( void );
336 /** Reads in the probability data from the data file */
337 virtual void ReadProbabilities( void );
338 /** Renormalizes the data in a ProbabilityTree.
339 * Traverses the tree structure and renormalizes all the probability data
340 * into probability segments, ensuring that no segment overlaps the
341 * other.
342 */
343 void Renormalize( ProbabilityBranch* Branch );
344 /** Sample the energy of the alpha particles. The energy used by the alpha
345 * particles is subtracted from the available energy
346 */
347 void SampleAlphaEnergies( std::vector< G4ReactionProduct* >* Alphas );
348 /** Samples the energy of the gamma rays */
349 void SampleGammaEnergies( std::vector< G4ReactionProduct* >* Gammas );
350 /** Sample the energy of the neutrons using the Watt fission spectrum. The
351 * kinetic energy consumed is returned.
352 */
353 void SampleNeutronEnergies( std::vector< G4ReactionProduct* >* Neutrons );
354 /** Sets the nubar values for the isotope referenced by
355 * G4FissionProductYieldDistdefined from the data sets defined in
356 * SpecialOps.hh
357 */
358 void SetNubar( void );
359 /** Sorts information for a potential new particle into the correct tree */
360 virtual void SortProbability( G4ENDFYieldDataContainer* YieldData );
361
362// Destructor function(s)
363public:
364 /** Default deconstructor. It is a virtual function since
365 * G4FissionProductYieldDist is a parent class
366 */
367 virtual ~G4FissionProductYieldDist( void );
368protected:
369 /** Recursively burns each branch in a probability tree. */
370 void BurnTree( ProbabilityBranch* Branch );
371};
372
373#endif /* G4FISSIONPRODUCTYIELDDIST_HH */
374
std::vector< G4DynamicParticle * > G4DynamicParticleVector
std::mutex G4Mutex
Definition: G4Threading.hh:81
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
void Renormalize(ProbabilityBranch *Branch)
void BurnTree(ProbabilityBranch *Branch)
void G4SetEnergy(G4double WhatIncidentEnergy)
void SampleAlphaEnergies(std::vector< G4ReactionProduct * > *Alphas)
void SampleNeutronEnergies(std::vector< G4ReactionProduct * > *Neutrons)
const G4FFGEnumerations::MetaState MetaState_
G4Ions * FindParticleBranchSearch(ProbabilityBranch *Branch, G4double RandomParticle, G4int EnergyGroup1, G4int EnergyGroup2)
G4DynamicParticleVector * G4GetFission(void)
virtual void SortProbability(G4ENDFYieldDataContainer *YieldData)
G4String MakeFileName(G4int Isotope, G4FFGEnumerations::MetaState MetaState)
G4String MakeIsotopeName(G4int Isotope, G4FFGEnumerations::MetaState MetaState)
const G4FFGEnumerations::FissionCause Cause_
G4Ions * FindParticle(G4double RandomParticle)
G4Ions * FindParticleInterpolation(G4double RandomParticle, G4int LowerEnergyGroup)
virtual void GenerateNeutrons(std::vector< G4ReactionProduct * > *Neutrons)
G4Ions * GetParticleDefinition(G4int Product, G4FFGEnumerations::MetaState MetaState)
void G4SetAlphaProduction(G4double WhatAlphaProduction)
virtual void GenerateAlphas(std::vector< G4ReactionProduct * > *Alphas)
G4DynamicParticle * MakeG4DynamicParticle(G4ReactionProduct *)
virtual G4Ions * GetFissionProduct(void)=0
void SampleGammaEnergies(std::vector< G4ReactionProduct * > *Gammas)
void G4SetVerbosity(G4int WhatVerbosity)
const G4FFGEnumerations::YieldType YieldType_
void G4SetTernaryProbability(G4double TernaryProbability)
G4Ions * FindParticleExtrapolation(G4double RandomParticle, G4bool LowerEnergyGroupExists)
Definition: G4Ions.hh:52