Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
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 ()
 

Private Member Functions

 G4WendtFissionFragmentGenerator ()
 
 G4WendtFissionFragmentGenerator (G4WendtFissionFragmentGenerator const &)
 
void operator= (G4WendtFissionFragmentGenerator const &)
 

Private Attributes

G4ParticleHPNames fileNames
 
std::map< const G4int, G4FissionFragmentGenerator * > fissionIsotopes
 
G4int secID
 
G4int Verbosity_
 

Static Private Attributes

static G4ThreadLocal G4WendtFissionFragmentGeneratorinstance = NULL
 

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}
std::map< const G4int, G4FissionFragmentGenerator * > fissionIsotopes

References fissionIsotopes.

◆ G4WendtFissionFragmentGenerator() [1/2]

G4WendtFissionFragmentGenerator::G4WendtFissionFragmentGenerator ( )
private

Definition at line 42 of file G4WendtFissionFragmentGenerator.cc.

44{
45 // Set the default verbosity
47
48 // Set the creator model ID
49 secID = G4PhysicsModelCatalog::GetModelID( "model_NeutronHPFission" );
50}
static G4int GetModelID(const G4int modelIndex)
static const G4FFGEnumerations::Verbosity Verbosity

References G4PhysicsModelCatalog::GetModelID(), secID, G4FFGDefaultValues::Verbosity, and Verbosity_.

Referenced by GetInstance().

◆ G4WendtFissionFragmentGenerator() [2/2]

G4WendtFissionFragmentGenerator::G4WendtFissionFragmentGenerator ( G4WendtFissionFragmentGenerator const &  )
private

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)

References A, fissionIsotopes, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, G4FissionFragmentGenerator::G4MakeIsotopeCode(), M, secID, stopAndKill, and Z.

Referenced by G4ParticleHPChannel::ApplyYourself().

◆ GetInstance()

static G4WendtFissionFragmentGenerator * G4WendtFissionFragmentGenerator::GetInstance ( )
inlinestatic

Definition at line 46 of file G4WendtFissionFragmentGenerator.hh.

46 {
48 return instance;
49 }
static G4ThreadLocal G4WendtFissionFragmentGenerator * instance

References G4WendtFissionFragmentGenerator(), and instance.

◆ 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
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)
static const G4double ThermalNeutronEnergy

References A, fileNames, fissionIsotopes, G4FissionFragmentGenerator::G4MakeIsotopeCode(), G4FissionFragmentGenerator::G4SetCause(), G4FissionFragmentGenerator::G4SetIncidentEnergy(), G4FissionFragmentGenerator::G4SetIsotope(), G4FissionFragmentGenerator::G4SetMetaState(), G4FissionFragmentGenerator::G4SetSamplingScheme(), G4FissionFragmentGenerator::G4SetYieldType(), G4ParticleHPDataUsed::GetA(), G4ParticleHPManager::GetDataStream(), G4ParticleHPManager::GetInstance(), G4ParticleHPDataUsed::GetName(), G4ParticleHPNames::GetName(), G4ParticleHPDataUsed::GetZ(), G4FFGEnumerations::GROUND_STATE, G4FFGEnumerations::INDEPENDENT, G4FissionFragmentGenerator::InitializeFissionProductYieldClass(), M, G4FFGEnumerations::META_1, G4FFGEnumerations::META_2, G4FFGEnumerations::NEUTRON_INDUCED, G4FFGEnumerations::NORMAL, G4FFGDefaultValues::ThermalNeutronEnergy, and Z.

Referenced by G4ParticleHPChannel::UpdateData().

◆ operator=()

void G4WendtFissionFragmentGenerator::operator= ( G4WendtFissionFragmentGenerator const &  )
private

Field Documentation

◆ fileNames

G4ParticleHPNames G4WendtFissionFragmentGenerator::fileNames
private

Definition at line 65 of file G4WendtFissionFragmentGenerator.hh.

Referenced by InitializeANucleus().

◆ fissionIsotopes

std::map< const G4int, G4FissionFragmentGenerator* > G4WendtFissionFragmentGenerator::fissionIsotopes
private

A map of all the fission isotopes loaded at initialization

Definition at line 64 of file G4WendtFissionFragmentGenerator.hh.

Referenced by ApplyYourself(), InitializeANucleus(), and ~G4WendtFissionFragmentGenerator().

◆ instance

G4ThreadLocal G4WendtFissionFragmentGenerator * G4WendtFissionFragmentGenerator::instance = NULL
staticprivate

Definition at line 60 of file G4WendtFissionFragmentGenerator.hh.

Referenced by GetInstance().

◆ secID

G4int G4WendtFissionFragmentGenerator::secID
private

◆ Verbosity_

G4int G4WendtFissionFragmentGenerator::Verbosity_
private

Definition at line 67 of file G4WendtFissionFragmentGenerator.hh.

Referenced by G4WendtFissionFragmentGenerator().


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