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

#include <G4NeutronHPFFFissionFS.hh>

+ Inheritance diagram for G4NeutronHPFFFissionFS:

Public Member Functions

 G4NeutronHPFFFissionFS ()
 
 ~G4NeutronHPFFFissionFS ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType)
 
G4DynamicParticleVectorApplyYourself (G4int nNeutrons)
 
G4NeutronHPFinalStateNew ()
 
void GetAFissionFragment (G4double, G4int &, G4int &, G4int &)
 
- Public Member Functions inherited from G4NeutronHPFissionBaseFS
 G4NeutronHPFissionBaseFS ()
 
virtual ~G4NeutronHPFissionBaseFS ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &bit)
 
G4DynamicParticleVectorApplyYourself (G4int Prompt)
 
virtual G4double GetXsec (G4double anEnergy)
 
virtual G4NeutronHPVectorGetXsec ()
 
void SetNeutron (const G4ReactionProduct &aNeutron)
 
void SetTarget (const G4ReactionProduct &aTarget)
 
- Public Member Functions inherited from G4NeutronHPFinalState
 G4NeutronHPFinalState ()
 
virtual ~G4NeutronHPFinalState ()
 
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType)
 
virtual void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType)=0
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &)
 
virtual G4NeutronHPFinalStateNew ()=0
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
virtual G4double GetXsec (G4double)
 
virtual G4NeutronHPVectorGetXsec ()
 
void SetA_Z (G4double anA, G4double aZ, G4int aM=0)
 
G4double GetZ ()
 
G4double GetN ()
 
G4int GetM ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4NeutronHPFinalState
void SetAZMs (G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
 
void adjust_final_state (G4LorentzVector)
 
- Protected Attributes inherited from G4NeutronHPFinalState
G4bool hasXsec
 
G4bool hasFSData
 
G4bool hasAnyData
 
G4NeutronHPNames theNames
 
G4HadFinalState theResult
 
G4double theBaseA
 
G4double theBaseZ
 
G4int theBaseM
 
G4int theNDLDataZ
 
G4int theNDLDataA
 
G4int theNDLDataM
 

Detailed Description

Definition at line 37 of file G4NeutronHPFFFissionFS.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPFFFissionFS()

G4NeutronHPFFFissionFS::G4NeutronHPFFFissionFS ( )
inline

Definition at line 41 of file G4NeutronHPFFFissionFS.hh.

41{ hasXsec = false; }

Referenced by New().

◆ ~G4NeutronHPFFFissionFS()

G4NeutronHPFFFissionFS::~G4NeutronHPFFFissionFS ( )
inline

Definition at line 42 of file G4NeutronHPFFFissionFS.hh.

42{}

Member Function Documentation

◆ ApplyYourself()

G4DynamicParticleVector * G4NeutronHPFFFissionFS::ApplyYourself ( G4int  nNeutrons)

Definition at line 118 of file G4NeutronHPFFFissionFS.cc.

119{
120 G4DynamicParticleVector * aResult;
121// G4cout <<"G4NeutronHPFFFissionFS::ApplyYourself +"<<G4endl;
122 aResult = G4NeutronHPFissionBaseFS::ApplyYourself(nNeutrons);
123 return aResult;
124}
std::vector< G4DynamicParticle * > G4DynamicParticleVector
G4DynamicParticleVector * ApplyYourself(G4int Prompt)

◆ GetAFissionFragment()

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

Definition at line 126 of file G4NeutronHPFFFissionFS.cc.

127{
128 //G4cout << "G4NeutronHPFFFissionFS::GetAFissionFragment " << G4endl;
129
130 G4double rand =G4UniformRand();
131 //G4cout << rand << G4endl;
132
133 std::map< G4double , std::map< G4int , G4double >* >* mEnergyFSPData = FissionProductYieldData.find( 454 )->second;
134
135 //It is not clear that the treatment of the scheme 2 on two-dimensional interpolation.
136 //So, here just use the closest energy point array of yield data.
137 //TK120531
138 G4double key_energy = DBL_MAX;
139 if ( mEnergyFSPData->size() == 1 )
140 {
141 key_energy = mEnergyFSPData->begin()->first;
142 }
143 else
144 {
145 //Find closest energy point
146 G4double Dmin=DBL_MAX;
147 G4int i = 0;
148 for ( std::map< G4double , std::map< G4int , G4double >* >::iterator it = mEnergyFSPData->begin() ;
149 it != mEnergyFSPData->end() ; it++ )
150 {
151 G4double e = (it->first);
152 G4double d = std::fabs ( energy - e );
153 if ( d < Dmin )
154 {
155 Dmin = d;
156 key_energy = e;
157 }
158 i++;
159 }
160 }
161
162 std::map<G4int,G4double>* mFSPYieldData = (*mEnergyFSPData)[key_energy];
163
164 G4int ifrag=0;
165 G4double ceilling = mFSPYieldData->rbegin()->second; // Becaseu of numerical accuracy, this is not always 2
166 for ( std::map<G4int,G4double>::iterator it = mFSPYieldData->begin() ; it != mFSPYieldData->end() ; it++ )
167 {
168 //if ( ( rand - it->second/ceilling ) < 1.0e-6 ) std::cout << rand - it->second/ceilling << std::endl;
169 if ( rand <= it->second/ceilling )
170 {
171 //G4cout << it->first << " " << it->second/ceilling << G4endl;
172 ifrag = it->first;
173 break;
174 }
175 }
176
177 fragZ = ifrag/100000;
178 fragA = (ifrag%100000)/100;
179 fragM = (ifrag%100);
180
181 //G4cout << fragZ << " " << fragA << " " << fragM << G4endl;
182}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4UniformRand()
Definition: Randomize.hh:53
#define DBL_MAX
Definition: templates.hh:83

Referenced by G4NeutronHPFissionFS::ApplyYourself().

◆ Init()

void G4NeutronHPFFFissionFS::Init ( G4double  A,
G4double  Z,
G4int  M,
G4String dirName,
G4String aFSType 
)
virtual

Implements G4NeutronHPFinalState.

Definition at line 33 of file G4NeutronHPFFFissionFS.cc.

34{
35 //G4cout << "G4NeutronHPFFFissionFS::Init" << G4endl;
36 G4String aString = "FF";
37
38 G4String tString = dirName;
39 G4bool dbool;
40 G4NeutronHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, aString , dbool);
41 G4String filename = aFile.GetName();
42 theBaseA = aFile.GetA();
43 theBaseZ = aFile.GetZ();
44
45//3456
46 if ( !dbool || ( Z < 2.5 && ( std::abs(theBaseZ-Z)>0.0001 || std::abs(theBaseA-A)>0.0001) ) )
47 {
48 hasAnyData = false;
49 hasFSData = false;
50 hasXsec = false;
51 return; // no data for exactly this isotope.
52 }
53 std::ifstream theData(filename, std::ios::in);
54 G4double dummy;
55 if ( !theData )
56 {
57 theData.close();
58 hasFSData = false;
59 hasXsec = false;
60 hasAnyData = false;
61 return; // no data for this FS for this isotope
62 }
63
64
65 hasFSData = true;
66 // MT Energy FPS Yield
67 //std::map< int , std::map< double , std::map< int , double >* >* > FisionProductYieldData;
68 while ( theData.good() )
69 {
70 G4int iMT, iMF;
71 G4int imax;
72 //Reading the data
73 // MT MF AWR
74 theData >> iMT >> iMF >> dummy;
75 // nBlock
76 theData >> imax;
77 //if ( !theData.good() ) continue;
78 // Ei FPS Yield
79 std::map< G4double , std::map< G4int , G4double >* >* mEnergyFSPData = new std::map< G4double , std::map< G4int , G4double >* >;
80
81 std::map< G4double , G4int >* mInterporation = new std::map< G4double , G4int >;
82 for ( G4int i = 0 ; i <= imax ; i++ )
83 {
84
85 G4double YY=0.0;
86 G4double Ei;
87 G4int jmax;
88 G4int ip;
89 // energy of incidnece neutron
90 theData >> Ei;
91 // Number of data set followings
92 theData >> jmax;
93 // interpolation scheme
94 theData >> ip;
95 mInterporation->insert( std::pair<G4double,G4int>(Ei*eV,ip) );
96 // nNumber nIP
97 std::map<G4int,G4double>* mFSPYieldData = new std::map<G4int,G4double>;
98 for ( G4int j = 0 ; j < jmax ; j++ )
99 {
100 G4int FSP;
101 G4int mFSP;
102 G4double Y;
103 theData >> FSP >> mFSP >> Y;
104 G4int k = FSP*100+mFSP;
105 YY = YY + Y;
106 //if ( iMT == 454 )G4cout << iMT << " " << i << " " << j << " " << k << " " << Y << " " << YY << G4endl;
107 mFSPYieldData->insert( std::pair<G4int,G4double>( k , YY ) );
108 }
109 mEnergyFSPData->insert( std::pair<G4double,std::map<G4int,G4double>*>(Ei*eV,mFSPYieldData) );
110 }
111
112 FissionProductYieldData.insert( std::pair< G4int , std::map< G4double , std::map< G4int , G4double >* >* > (iMT,mEnergyFSPData));
113 mMTInterpolation.insert( std::pair<G4int,std::map<G4double,G4int>*> (iMT,mInterporation) );
114 }
115 theData.close();
116}
bool G4bool
Definition: G4Types.hh:67
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)

Referenced by G4NeutronHPFissionFS::Init().

◆ New()

G4NeutronHPFinalState * G4NeutronHPFFFissionFS::New ( )
inlinevirtual

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