Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
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 39 of file G4WendtFissionFragmentGenerator.hh.

Constructor & Destructor Documentation

G4WendtFissionFragmentGenerator::~G4WendtFissionFragmentGenerator ( )

Definition at line 183 of file G4WendtFissionFragmentGenerator.cc.

184 {
185  std::map< const G4int, G4FissionFragmentGenerator* >::iterator fissionGenerator;
186 
187  for(fissionGenerator = fissionIsotopes.begin(); fissionGenerator != fissionIsotopes.end(); ++fissionGenerator)
188  {
189  delete fissionGenerator->second;
190  }
191 }

Member Function Documentation

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

Definition at line 54 of file G4WendtFissionFragmentGenerator.cc.

References G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4FissionFragmentGenerator::G4MakeIsotopeCode(), and stopAndKill.

Referenced by G4NeutronHPChannel::ApplyYourself().

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

Definition at line 46 of file G4WendtFissionFragmentGenerator.cc.

47 {
49 
50  return &newMe;
51 }
void G4WendtFissionFragmentGenerator::InitializeANucleus ( const G4int  A,
const G4int  Z,
const G4int  M,
const G4String dataDirectory 
)

Definition at line 98 of file G4WendtFissionFragmentGenerator.cc.

References G4FissionFragmentGenerator::G4MakeIsotopeCode(), G4FissionFragmentGenerator::G4SetCause(), G4FissionFragmentGenerator::G4SetIncidentEnergy(), G4FissionFragmentGenerator::G4SetIsotope(), G4FissionFragmentGenerator::G4SetMetaState(), G4FissionFragmentGenerator::G4SetSamplingScheme(), G4FissionFragmentGenerator::G4SetYieldType(), G4NeutronHPDataUsed::GetA(), G4NeutronHPManager::GetDataStream(), G4NeutronHPManager::GetInstance(), G4NeutronHPNames::GetName(), G4NeutronHPDataUsed::GetName(), G4NeutronHPDataUsed::GetZ(), G4FFGEnumerations::GROUND_STATE, G4FFGEnumerations::INDEPENDENT, G4FissionFragmentGenerator::InitializeFissionProductYieldClass(), G4FFGEnumerations::META_1, G4FFGEnumerations::META_2, G4FFGEnumerations::NEUTRON_INDUCED, and G4FFGEnumerations::NORMAL.

Referenced by G4NeutronHPChannel::UpdateData().

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

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