Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4WendtFissionFragmentGenerator Class Reference

#include <G4WendtFissionFragmentGenerator.hh>

Public Member Functions

G4HadFinalStateApplyYourself (const G4HadProjectile &projectile, G4int Z, G4int A)
 
void InitializeANucleus (const G4int A, const G4int Z, const G4int M, const G4String &dataDirectory)
 
 ~G4WendtFissionFragmentGenerator ()
 

Static Public Member Functions

static
G4WendtFissionFragmentGenerator
GetInstance ()
 

Detailed Description

Definition at line 42 of file G4WendtFissionFragmentGenerator.hh.

Constructor & Destructor Documentation

G4WendtFissionFragmentGenerator::~G4WendtFissionFragmentGenerator ( )

Definition at line 190 of file G4WendtFissionFragmentGenerator.cc.

191 {
192  std::map< const G4int, G4FissionFragmentGenerator* >::iterator fissionGenerator;
193 
194  for(fissionGenerator = fissionIsotopes.begin(); fissionGenerator != fissionIsotopes.end(); ++fissionGenerator)
195  {
196  delete fissionGenerator->second;
197  }
198 }

Member Function Documentation

G4HadFinalState * G4WendtFissionFragmentGenerator::ApplyYourself ( const G4HadProjectile projectile,
G4int  Z,
G4int  A 
)

Definition at line 60 of file G4WendtFissionFragmentGenerator.cc.

61 {
63 
64  G4HadFinalState* finalState = NULL;
65  G4DynamicParticleVector* finalParticles = NULL;
66  G4int isotope;
67  std::map< const G4int, G4FissionFragmentGenerator* >::iterator fissionGenerator;
68 
69  // Look for the first available isomer since no M is provided for ApplyYourself()
70  for(unsigned int M = 0; M < 10; ++M)
71  {
73  fissionGenerator = fissionIsotopes.find(isotope);
74 
75  if(fissionGenerator != fissionIsotopes.end())
76  {
77  // Only generate particles if the generator was constructed
78  if(fissionGenerator->second)
79  {
80  finalParticles = fissionGenerator->second->G4GenerateFission(projectile);
81  }
82 
83  break;
84  }
85  }
86 
87  if(finalParticles)
88  {
89  finalState = new G4HadFinalState();
90 
91  for(unsigned int i = 0; i < finalParticles->size(); ++i)
92  {
93  finalState->AddSecondary((*finalParticles)[i]);
94  }
95  }
96 
97  //TK modified 131108 add next line
98  //TK 160112 fix for coverity #53481
99  if ( finalState != NULL ) finalState->SetStatusChange(stopAndKill);
101  return finalState;
102 }
int G4int
Definition: G4Types.hh:78
static G4int G4MakeIsotopeCode(G4int Z, G4int A, G4int M)
double A(double temperature)
std::vector< G4DynamicParticle * > G4DynamicParticleVector
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__

Here is the call graph for this function:

Here is the caller graph for this function:

static G4WendtFissionFragmentGenerator* G4WendtFissionFragmentGenerator::GetInstance ( )
inlinestatic

Definition at line 46 of file G4WendtFissionFragmentGenerator.hh.

46  {
47  if ( instance == NULL) instance = new G4WendtFissionFragmentGenerator();
48  return instance;
49  }
void G4WendtFissionFragmentGenerator::InitializeANucleus ( const G4int  A,
const G4int  Z,
const G4int  M,
const G4String dataDirectory 
)

Definition at line 105 of file G4WendtFissionFragmentGenerator.cc.

106 {
107 //G4FFG_FUNCTIONENTER__
108 
111  std::pair< std::map< const G4int, G4FissionFragmentGenerator* >::iterator, bool > newIsotope;
112 
113  // Check to see if the isotope/isomer alread exists in the table
114  newIsotope = fissionIsotopes.insert(std::make_pair(isotope, (G4FissionFragmentGenerator*)NULL));
115 
116  if(newIsotope.second || newIsotope.first->second == NULL)
117  {
118  // Get the data file
119  G4bool flag;
120  G4ParticleHPDataUsed dataFile = fileNames.GetName(A, Z, M, dataDirectory, "FF", flag);
121  G4String dataFileName = dataFile.GetName();
122 
123  // Check if the file exists, and do not create a fission object if it doesn't
124  // G4cout << "*** Z = " << Z << "\tA = " << A << "\t\t\t Directory: "<< dataDirectory << " DATA FILE: " << dataFileName << G4endl;
125  std::istringstream dataStream(std::ios::in);
126  G4ParticleHPManager::GetInstance()->GetDataStream(dataFileName, dataStream);
127  if(!dataStream)
128  {
129  //G4FFG_FUNCTIONLEAVE__
130  // G4cerr << "*** Stream error" << G4endl;
131  return;
132  }
133 
134  // Check the data file parameters
135  if(!flag
136  || ( Z < 2.5 && ( (G4double)abs( dataFile.GetZ() - Z ) > 0.001 || (G4double)abs( (G4int)dataFile.GetA() - A ) > 0.0001 ) ) )
137  {
138  //G4cerr << "*** Something wrong with the data request.\tFlag :" << flag << G4endl;
139  //G4FFG_FUNCTIONLEAVE__
140  return;
141  }
142 
143  G4FissionFragmentGenerator* const fissionGenerator = new G4FissionFragmentGenerator();
144  newIsotope.first->second = fissionGenerator;
145 
146  switch(M)
147  {
148  case 1:
149  metaState = G4FFGEnumerations::META_1;
150  break;
151 
152  case 2:
153  metaState = G4FFGEnumerations::META_2;
154  break;
155 
156  default:
157  // TODO Display a warning message here indicating that an invalid metastate was passed in
158  // Fall through to the ground state by default
159  case 0:
161  break;
162  }
163 
164  fissionGenerator->G4SetIsotope(isotope);
165  fissionGenerator->G4SetMetaState(metaState);
167  // TODO Load all the fission data and use the projectile energy instead
171 
172 
173  // TODO Remove the need for forcing a load in the initialization phase,
174  // i.e. remove the ability to dynamically change the fission parameters
175  // that cause reload because a G4FissionFragmentGenerator class for
176  // each isotope should be loaded in the initialization phase
177  if(!fissionGenerator->InitializeFissionProductYieldClass(dataStream))
178  {
179  // Delete if the initialization fails
180  delete fissionGenerator;
181 
182  fissionIsotopes.erase(newIsotope.first);
183  }
184  }
185 
186 //G4FFG_FUNCTIONLEAVE__
187 }
static G4ParticleHPManager * GetInstance()
void G4SetSamplingScheme(G4FFGEnumerations::FissionSamplingScheme NewScheme)
void G4SetYieldType(G4FFGEnumerations::YieldType WhichYieldType)
void G4SetMetaState(G4FFGEnumerations::MetaState WhichMetaState)
void GetDataStream(G4String, std::istringstream &iss)
int G4int
Definition: G4Types.hh:78
static G4int G4MakeIsotopeCode(G4int Z, G4int A, G4int M)
bool InitializeFissionProductYieldClass(std::istringstream &dataFile)
double A(double temperature)
bool G4bool
Definition: G4Types.hh:79
void G4SetIsotope(G4int WhichIsotope)
void G4SetCause(G4FFGEnumerations::FissionCause WhichCause)
void G4SetIncidentEnergy(G4double WhatIncidentEnergy)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
double G4double
Definition: G4Types.hh:76
static const G4double ThermalNeutronEnergy

Here is the call graph for this function:

Here is the caller graph for this function:


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