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