Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 G4WendtFissionFragmentGeneratorGetInstance ()
 

Detailed Description

Definition at line 42 of file G4WendtFissionFragmentGenerator.hh.

Constructor & Destructor Documentation

◆ ~G4WendtFissionFragmentGenerator()

G4WendtFissionFragmentGenerator::~G4WendtFissionFragmentGenerator ( )

Definition at line 194 of file G4WendtFissionFragmentGenerator.cc.

196{
197 std::map< const G4int, G4FissionFragmentGenerator* >::iterator fissionGenerator;
198
199 for(fissionGenerator = fissionIsotopes.begin(); fissionGenerator != fissionIsotopes.end(); ++fissionGenerator)
200 {
201 delete fissionGenerator->second;
202 }
203}

Member Function Documentation

◆ ApplyYourself()

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

Definition at line 64 of file G4WendtFissionFragmentGenerator.cc.

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

Referenced by G4ParticleHPChannel::ApplyYourself().

◆ GetInstance()

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 }

◆ InitializeANucleus()

void G4WendtFissionFragmentGenerator::InitializeANucleus ( const G4int  A,
const G4int  Z,
const G4int  M,
const G4String dataDirectory 
)

Definition at line 109 of file G4WendtFissionFragmentGenerator.cc.

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

Referenced by G4ParticleHPChannel::UpdateData().


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