Geant4 11.2.2
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 41 of file G4WendtFissionFragmentGenerator.hh.

Constructor & Destructor Documentation

◆ ~G4WendtFissionFragmentGenerator()

G4WendtFissionFragmentGenerator::~G4WendtFissionFragmentGenerator ( )

Definition at line 187 of file G4WendtFissionFragmentGenerator.cc.

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

Member Function Documentation

◆ ApplyYourself()

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

Definition at line 62 of file G4WendtFissionFragmentGenerator.cc.

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

Referenced by G4ParticleHPChannel::ApplyYourself().

◆ GetInstance()

static G4WendtFissionFragmentGenerator * G4WendtFissionFragmentGenerator::GetInstance ( )
inlinestatic

Definition at line 45 of file G4WendtFissionFragmentGenerator.hh.

46 {
47 if (instance == nullptr) instance = new G4WendtFissionFragmentGenerator();
48 return instance;
49 }

Referenced by G4ParticleHPChannel::G4ParticleHPChannel().

◆ InitializeANucleus()

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

Definition at line 102 of file G4WendtFissionFragmentGenerator.cc.

105{
106 // G4FFG_FUNCTIONENTER__
107
110 std::pair<std::map<const G4int, G4FissionFragmentGenerator*>::iterator, bool> newIsotope;
111
112 // Check to see if the isotope/isomer alread exists in the table
113 newIsotope =
114 fissionIsotopes.insert(std::make_pair(isotope, (G4FissionFragmentGenerator*)nullptr));
115
116 if (newIsotope.second || newIsotope.first->second == NULL) {
117 // Get the data file
118 G4bool flag;
119 G4ParticleHPDataUsed dataFile = fileNames.GetName(A, Z, M, dataDirectory, "FF", flag);
120 G4String dataFileName = dataFile.GetName();
121
122 // Check if the file exists, and do not create a fission object if it doesn't
123 // G4cout << "*** Z = " << Z << "\tA = " << A << "\t\t\t Directory: "<< dataDirectory << " DATA
124 // FILE: " << dataFileName << G4endl;
125 std::istringstream dataStream(std::ios::in);
126 G4ParticleHPManager::GetInstance()->GetDataStream(dataFileName, dataStream);
127 if (!dataStream) {
128 // G4FFG_FUNCTIONLEAVE__
129 // G4cerr << "*** Stream error" << G4endl;
130 return;
131 }
132
133 // Check the data file parameters
134 if (!flag
135 || (Z < 2.5
136 && ((G4double)abs(dataFile.GetZ() - Z) > 0.001
137 || (G4double)abs((G4int)dataFile.GetA() - A) > 0.0001)))
138 {
139 // G4cerr << "*** Something wrong with the data request.\tFlag :" << flag << G4endl;
140 // G4FFG_FUNCTIONLEAVE__
141 return;
142 }
143
144 auto const fissionGenerator = new G4FissionFragmentGenerator();
145 newIsotope.first->second = fissionGenerator;
146
147 switch (M) {
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);
166 fissionGenerator->G4SetCause(G4FFGEnumerations::NEUTRON_INDUCED);
167 // TODO Load all the fission data and use the projectile energy instead
168 fissionGenerator->G4SetIncidentEnergy(G4FFGDefaultValues::ThermalNeutronEnergy);
169 fissionGenerator->G4SetYieldType(G4FFGEnumerations::INDEPENDENT);
170 fissionGenerator->G4SetSamplingScheme(G4FFGEnumerations::NORMAL);
171
172 // TODO Remove the need for forcing a load in the initialization phase,
173 // i.e. remove the ability to dynamically change the fission parameters
174 // that cause reload because a G4FissionFragmentGenerator class for
175 // each isotope should be loaded in the initialization phase
176 if (!fissionGenerator->InitializeFissionProductYieldClass(dataStream)) {
177 // Delete if the initialization fails
178 delete fissionGenerator;
179
180 fissionIsotopes.erase(newIsotope.first);
181 }
182 }
183
184 // G4FFG_FUNCTIONLEAVE__
185}
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
void GetDataStream(const G4String &, std::istringstream &iss)
static G4ParticleHPManager * GetInstance()
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active)

Referenced by G4ParticleHPChannel::UpdateData().


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