Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPFFFissionFS Class Reference

#include <G4ParticleHPFFFissionFS.hh>

+ Inheritance diagram for G4ParticleHPFFFissionFS:

Public Member Functions

 G4ParticleHPFFFissionFS ()
 
 ~G4ParticleHPFFFissionFS () override
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *) override
 
G4DynamicParticleVectorApplyYourself (G4int nNeutrons)
 
G4ParticleHPFinalStateNew () override
 
void GetAFissionFragment (G4double, G4int &, G4int &, G4int &)
 
- Public Member Functions inherited from G4ParticleHPFissionBaseFS
 G4ParticleHPFissionBaseFS ()
 
 ~G4ParticleHPFissionBaseFS () override
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &bit, G4ParticleDefinition *) override
 
G4DynamicParticleVectorApplyYourself (G4int Prompt)
 
G4double GetXsec (G4double anEnergy) override
 
G4ParticleHPVectorGetXsec () override
 
void SetNeutronRP (const G4ReactionProduct &aNeutron)
 
void SetTarget (const G4ReactionProduct &aTarget)
 
- Public Member Functions inherited from G4ParticleHPFinalState
 G4ParticleHPFinalState ()
 
virtual ~G4ParticleHPFinalState ()
 
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType, G4ParticleDefinition *p)
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
void SetA_Z (G4double anA, G4double aZ, G4int aM=0)
 
G4double GetZ ()
 
G4double GetN ()
 
G4double GetA ()
 
G4int GetM ()
 
void SetAZMs (G4ParticleHPDataUsed used)
 
void SetAZMs (G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
 
void SetProjectile (G4ParticleDefinition *projectile)
 
G4ParticleHPFinalStateoperator= (const G4ParticleHPFinalState &right)=delete
 
 G4ParticleHPFinalState (const G4ParticleHPFinalState &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from G4ParticleHPFinalState
void adjust_final_state (G4LorentzVector)
 
- Protected Attributes inherited from G4ParticleHPFinalState
G4ParticleDefinitiontheProjectile {nullptr}
 
G4ParticleHPManagerfManager
 
G4IonTableionTable
 
G4int theBaseA {0}
 
G4int theBaseZ {0}
 
G4int theBaseM {0}
 
G4int theNDLDataZ {0}
 
G4int theNDLDataA {0}
 
G4int theNDLDataM {0}
 
G4int secID {-1}
 
G4bool hasXsec {true}
 
G4bool hasFSData {true}
 
G4bool hasAnyData {true}
 
G4ParticleHPNames theNames
 
G4Cache< G4HadFinalState * > theResult
 

Detailed Description

Definition at line 37 of file G4ParticleHPFFFissionFS.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPFFFissionFS()

G4ParticleHPFFFissionFS::G4ParticleHPFFFissionFS ( )
inline

Definition at line 40 of file G4ParticleHPFFFissionFS.hh.

Referenced by New().

◆ ~G4ParticleHPFFFissionFS()

G4ParticleHPFFFissionFS::~G4ParticleHPFFFissionFS ( )
override

Definition at line 37 of file G4ParticleHPFFFissionFS.cc.

38{
39 auto it = FissionProductYieldData.begin();
40 while (it != FissionProductYieldData.end()) { // Loop checking, 11.05.2015, T. Koi
41 std::map<G4double, std::map<G4int, G4double>*>* firstLevel = it->second;
42 if (firstLevel != nullptr) {
43 auto it2 = firstLevel->begin();
44 while (it2 != firstLevel->end()) { // Loop checking, 11.05.2015, T. Koi
45 delete it2->second;
46 it2->second = 0;
47 firstLevel->erase(it2);
48 it2 = firstLevel->begin();
49 }
50 }
51 delete firstLevel;
52 it->second = 0;
53 FissionProductYieldData.erase(it);
54 it = FissionProductYieldData.begin();
55 }
56
57 auto ii = mMTInterpolation.begin();
58 while (ii != mMTInterpolation.end()) { // Loop checking, 11.05.2015, T. Koi
59 delete ii->second;
60 mMTInterpolation.erase(ii);
61 ii = mMTInterpolation.begin();
62 }
63}

Member Function Documentation

◆ ApplyYourself()

G4DynamicParticleVector * G4ParticleHPFFFissionFS::ApplyYourself ( G4int nNeutrons)

Definition at line 151 of file G4ParticleHPFFFissionFS.cc.

152{
154 // G4cout <<"G4ParticleHPFFFissionFS::ApplyYourself +"<<G4endl;
155 aResult = G4ParticleHPFissionBaseFS::ApplyYourself(nNeutrons);
156 return aResult;
157}
std::vector< G4DynamicParticle * > G4DynamicParticleVector
G4DynamicParticleVector * ApplyYourself(G4int Prompt)

◆ GetAFissionFragment()

void G4ParticleHPFFFissionFS::GetAFissionFragment ( G4double energy,
G4int & fragZ,
G4int & fragA,
G4int & fragM )

Definition at line 159 of file G4ParticleHPFFFissionFS.cc.

161{
162 // G4cout << "G4ParticleHPFFFissionFS::GetAFissionFragment " << G4endl;
163
164 G4double rand = G4UniformRand();
165 // G4cout << rand << G4endl;
166
167 auto ptr = FissionProductYieldData.find(454);
168 if (ptr == FissionProductYieldData.end())
169 return;
170
171 auto mEnergyFSPData = ptr->second;
172
173 // It is not clear that the treatment of the scheme 2 on two-dimensional interpolation.
174 // So, here just use the closest energy point array of yield data.
175 // TK120531
176 G4double key_energy = DBL_MAX;
177 if (mEnergyFSPData->size() == 1) {
178 key_energy = mEnergyFSPData->cbegin()->first;
179 }
180 else {
181 // Find closest energy point
182 G4double Dmin = DBL_MAX;
183 for (auto it = mEnergyFSPData->cbegin(); it != mEnergyFSPData->cend(); ++it) {
184 G4double e = (it->first);
185 G4double d = std::fabs(energy - e);
186 if (d < Dmin) {
187 Dmin = d;
188 key_energy = e;
189 }
190 }
191 }
192
193 std::map<G4int, G4double>* mFSPYieldData = (*mEnergyFSPData)[key_energy];
194
195 G4int ifrag = 0;
196 G4double ceilling =
197 mFSPYieldData->rbegin()->second; // Because of numerical accuracy, this is not always 2
198 for (auto it = mFSPYieldData->cbegin(); it != mFSPYieldData->cend(); ++it) {
199 // if ( ( rand - it->second/ceilling ) < 1.0e-6 ) std::cout << rand - it->second/ceilling <<
200 // std::endl;
201 if (rand <= it->second / ceilling) {
202 // G4cout << it->first << " " << it->second/ceilling << G4endl;
203 ifrag = it->first;
204 break;
205 }
206 }
207
208 fragZ = ifrag / 100000;
209 fragA = (ifrag % 100000) / 100;
210 fragM = (ifrag % 100);
211
212 // G4cout << fragZ << " " << fragA << " " << fragM << G4endl;
213}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4UniformRand()
Definition Randomize.hh:52
#define DBL_MAX
Definition templates.hh:62

Referenced by G4ParticleHPFissionFS::ApplyYourself().

◆ Init()

void G4ParticleHPFFFissionFS::Init ( G4double A,
G4double Z,
G4int M,
G4String & dirName,
G4String & aFSType,
G4ParticleDefinition *  )
overridevirtual

Implements G4ParticleHPFinalState.

Definition at line 65 of file G4ParticleHPFFFissionFS.cc.

67{
68 // G4cout << "G4ParticleHPFFFissionFS::Init" << G4endl;
69 G4String aString = "FF";
70
71 G4String tString = dirName;
72 G4bool dbool;
74 theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, aString, dbool);
75 G4String filename = aFile.GetName();
76 theBaseA = aFile.GetA();
77 theBaseZ = aFile.GetZ();
78
79 // 3456
80 if (!dbool || (Z < 2.5 && (std::abs(theBaseZ - Z) > 0.0001 || std::abs(theBaseA - A) > 0.0001))) {
81 hasAnyData = false;
82 hasFSData = false;
83 hasXsec = false;
84 return; // no data for exactly this isotope.
85 }
86 // std::ifstream theData(filename, std::ios::in);
87 std::istringstream theData(std::ios::in);
89 G4double dummy;
90 if (!theData) {
91 // theData.close();
92 hasFSData = false;
93 hasXsec = false;
94 hasAnyData = false;
95 return; // no data for this FS for this isotope
96 }
97
98 hasFSData = true;
99 // MT Energy FPS Yield
100 // std::map< int , std::map< double , std::map< int , double >* >* > FisionProductYieldData;
101 while (theData.good()) // Loop checking, 11.05.2015, T. Koi
102 {
103 G4int iMT, iMF;
104 G4int imax;
105 // Reading the data
106 // MT MF AWR
107 theData >> iMT >> iMF >> dummy;
108 // nBlock
109 theData >> imax;
110 // if ( !theData.good() ) continue;
111 // Ei FPS Yield
112 auto mEnergyFSPData = new std::map<G4double, std::map<G4int, G4double>*>;
113
114 auto mInterporation = new std::map<G4double, G4int>;
115 for (G4int i = 0; i <= imax; i++) {
116 G4double YY = 0.0;
117 G4double Ei;
118 G4int jmax;
119 G4int ip;
120 // energy of incidence neutron
121 theData >> Ei;
122 // Number of data set followings
123 theData >> jmax;
124 // interpolation scheme
125 theData >> ip;
126 mInterporation->insert(std::pair<G4double, G4int>(Ei * eV, ip));
127 // nNumber nIP
128 auto mFSPYieldData = new std::map<G4int, G4double>;
129 for (G4int j = 0; j < jmax; j++) {
130 G4int FSP;
131 G4int mFSP;
132 G4double Y;
133 theData >> FSP >> mFSP >> Y;
134 G4int k = FSP * 100 + mFSP;
135 YY = YY + Y;
136 // if ( iMT == 454 )G4cout << iMT << " " << i << " " << j << " " << k << " " << Y << " " <<
137 // YY << G4endl;
138 mFSPYieldData->insert(std::pair<G4int, G4double>(k, YY));
139 }
140 mEnergyFSPData->insert(
141 std::pair<G4double, std::map<G4int, G4double>*>(Ei * eV, mFSPYieldData));
142 }
143
144 FissionProductYieldData.insert(
145 std::pair<G4int, std::map<G4double, std::map<G4int, G4double>*>*>(iMT, mEnergyFSPData));
146 mMTInterpolation.insert(std::pair<G4int, std::map<G4double, G4int>*>(iMT, mInterporation));
147 }
148 // theData.close();
149}
G4double Y(G4double density)
#define M(row, col)
bool G4bool
Definition G4Types.hh:86
const G4double A[17]
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 G4ParticleHPFissionFS::Init().

◆ New()

G4ParticleHPFinalState * G4ParticleHPFFFissionFS::New ( )
inlineoverridevirtual

Implements G4ParticleHPFinalState.

Definition at line 48 of file G4ParticleHPFFFissionFS.hh.

49 {
50 auto theNew = new G4ParticleHPFFFissionFS;
51 return theNew;
52 }

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