Geant4 11.1.1
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 ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
 
G4DynamicParticleVectorApplyYourself (G4int nNeutrons)
 
G4ParticleHPFinalStateNew ()
 
void GetAFissionFragment (G4double, G4int &, G4int &, G4int &)
 
- Public Member Functions inherited from G4ParticleHPFissionBaseFS
 G4ParticleHPFissionBaseFS ()
 
virtual ~G4ParticleHPFissionBaseFS ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &bit, G4ParticleDefinition *)
 
G4DynamicParticleVectorApplyYourself (G4int Prompt)
 
virtual G4double GetXsec (G4double anEnergy)
 
virtual G4ParticleHPVectorGetXsec ()
 
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 *projectile)
 
virtual void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)=0
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &)
 
virtual G4ParticleHPFinalStateNew ()=0
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
virtual G4double GetXsec (G4double)
 
virtual G4ParticleHPVectorGetXsec ()
 
void SetA_Z (G4double anA, G4double aZ, G4int aM=0)
 
G4double GetZ ()
 
G4double GetN ()
 
G4double GetA ()
 
G4int GetM ()
 
void SetAZMs (G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
 
void SetProjectile (G4ParticleDefinition *projectile)
 

Additional Inherited Members

- Protected Member Functions inherited from G4ParticleHPFinalState
void adjust_final_state (G4LorentzVector)
 
- Protected Attributes inherited from G4ParticleHPFinalState
G4bool hasXsec
 
G4bool hasFSData
 
G4bool hasAnyData
 
G4ParticleHPNames theNames
 
G4Cache< G4HadFinalState * > theResult
 
G4ParticleDefinitiontheProjectile
 
G4double theBaseA
 
G4double theBaseZ
 
G4int theBaseM
 
G4int theNDLDataZ
 
G4int theNDLDataA
 
G4int theNDLDataM
 
G4int secID
 

Detailed Description

Definition at line 37 of file G4ParticleHPFFFissionFS.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPFFFissionFS()

G4ParticleHPFFFissionFS::G4ParticleHPFFFissionFS ( )
inline

Definition at line 41 of file G4ParticleHPFFFissionFS.hh.

Referenced by New().

◆ ~G4ParticleHPFFFissionFS()

G4ParticleHPFFFissionFS::~G4ParticleHPFFFissionFS ( )

Definition at line 36 of file G4ParticleHPFFFissionFS.cc.

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

Member Function Documentation

◆ ApplyYourself()

G4DynamicParticleVector * G4ParticleHPFFFissionFS::ApplyYourself ( G4int  nNeutrons)

Definition at line 151 of file G4ParticleHPFFFissionFS.cc.

152{
153 G4DynamicParticleVector * aResult;
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.

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

Implements G4ParticleHPFinalState.

Definition at line 64 of file G4ParticleHPFFFissionFS.cc.

65{
66 //G4cout << "G4ParticleHPFFFissionFS::Init" << G4endl;
67 G4String aString = "FF";
68
69 G4String tString = dirName;
70 G4bool dbool;
71 G4ParticleHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, aString , dbool);
72 G4String filename = aFile.GetName();
73 theBaseA = aFile.GetA();
74 theBaseZ = aFile.GetZ();
75
76//3456
77 if ( !dbool || ( Z < 2.5 && ( std::abs(theBaseZ-Z)>0.0001 || std::abs(theBaseA-A)>0.0001) ) )
78 {
79 hasAnyData = false;
80 hasFSData = false;
81 hasXsec = false;
82 return; // no data for exactly this isotope.
83 }
84 //std::ifstream theData(filename, std::ios::in);
85 std::istringstream theData(std::ios::in);
87 G4double dummy;
88 if ( !theData )
89 {
90 //theData.close();
91 hasFSData = false;
92 hasXsec = false;
93 hasAnyData = false;
94 return; // no data for this FS for this isotope
95 }
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 std::map< G4double , std::map< G4int , G4double >* >* mEnergyFSPData = new std::map< G4double , std::map< G4int , G4double >* >;
113
114 std::map< G4double , G4int >* mInterporation = new std::map< G4double , G4int >;
115 for ( G4int i = 0 ; i <= imax ; i++ )
116 {
117
118 G4double YY=0.0;
119 G4double Ei;
120 G4int jmax;
121 G4int ip;
122 // energy of incidence neutron
123 theData >> Ei;
124 // Number of data set followings
125 theData >> jmax;
126 // interpolation scheme
127 theData >> ip;
128 mInterporation->insert( std::pair<G4double,G4int>(Ei*eV,ip) );
129 // nNumber nIP
130 std::map<G4int,G4double>* mFSPYieldData = new std::map<G4int,G4double>;
131 for ( G4int j = 0 ; j < jmax ; j++ )
132 {
133 G4int FSP;
134 G4int mFSP;
135 G4double Y;
136 theData >> FSP >> mFSP >> Y;
137 G4int k = FSP*100+mFSP;
138 YY = YY + Y;
139 //if ( iMT == 454 )G4cout << iMT << " " << i << " " << j << " " << k << " " << Y << " " << YY << G4endl;
140 mFSPYieldData->insert( std::pair<G4int,G4double>( k , YY ) );
141 }
142 mEnergyFSPData->insert( std::pair<G4double,std::map<G4int,G4double>*>(Ei*eV,mFSPYieldData) );
143 }
144
145 FissionProductYieldData.insert( 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 G4int Z[17]
const G4double A[17]
static G4ParticleHPManager * GetInstance()
void GetDataStream(G4String, std::istringstream &iss)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)

Referenced by G4ParticleHPFissionFS::Init().

◆ New()

G4ParticleHPFinalState * G4ParticleHPFFFissionFS::New ( )
inlinevirtual

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