Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleHPFFFissionFS Class Reference

#include <G4ParticleHPFFFissionFS.hh>

Inheritance diagram for G4ParticleHPFFFissionFS:
Collaboration 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)
 
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 (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)
 
G4bool DoNotAdjustFinalState ()
 
- Protected Attributes inherited from G4ParticleHPFinalState
G4bool hasXsec
 
G4bool hasFSData
 
G4bool hasAnyData
 
G4ParticleHPNames theNames
 
G4Cache< G4HadFinalState * > theResult
 
G4double theBaseA
 
G4double theBaseZ
 
G4int theBaseM
 
G4int theNDLDataZ
 
G4int theNDLDataA
 
G4int theNDLDataM
 
G4ParticleDefinitiontheProjectile
 

Detailed Description

Definition at line 37 of file G4ParticleHPFFFissionFS.hh.

Constructor & Destructor Documentation

G4ParticleHPFFFissionFS::G4ParticleHPFFFissionFS ( )
inline

Definition at line 41 of file G4ParticleHPFFFissionFS.hh.

41 { hasXsec = false; }

Here is the caller graph for this function:

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

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)

Here is the call graph for this function:

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->begin()->first;
175  }
176  else
177  {
178  //Find closest energy point
179  G4double Dmin=DBL_MAX;
180  G4int i = 0;
181  for ( std::map< G4double , std::map< G4int , G4double >* >::iterator it = mEnergyFSPData->begin() ;
182  it != mEnergyFSPData->end() ; it++ )
183  {
184  G4double e = (it->first);
185  G4double d = std::fabs ( energy - e );
186  if ( d < Dmin )
187  {
188  Dmin = d;
189  key_energy = e;
190  }
191  i++;
192  }
193  }
194 
195  std::map<G4int,G4double>* mFSPYieldData = (*mEnergyFSPData)[key_energy];
196 
197  G4int ifrag=0;
198  G4double ceilling = mFSPYieldData->rbegin()->second; // Because of numerical accuracy, this is not always 2
199  for ( std::map<G4int,G4double>::iterator it = mFSPYieldData->begin() ; it != mFSPYieldData->end() ; it++ )
200  {
201  //if ( ( rand - it->second/ceilling ) < 1.0e-6 ) std::cout << rand - it->second/ceilling << std::endl;
202  if ( rand <= it->second/ceilling )
203  {
204  //G4cout << it->first << " " << it->second/ceilling << G4endl;
205  ifrag = it->first;
206  break;
207  }
208  }
209 
210  fragZ = ifrag/100000;
211  fragA = (ifrag%100000)/100;
212  fragM = (ifrag%100);
213 
214  //G4cout << fragZ << " " << fragA << " " << fragM << G4endl;
215 }
static constexpr double second
Definition: G4SIunits.hh:157
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
G4double energy(const ThreeVector &p, const G4double m)
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83

Here is the caller graph for this function:

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 }
static G4ParticleHPManager * GetInstance()
double Y(double density)
void GetDataStream(G4String, std::istringstream &iss)
int G4int
Definition: G4Types.hh:78
double A(double temperature)
bool G4bool
Definition: G4Types.hh:79
static constexpr double eV
Definition: G4SIunits.hh:215
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
static const G4int imax
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4ParticleHPFinalState* G4ParticleHPFFFissionFS::New ( )
inlinevirtual

Implements G4ParticleHPFinalState.

Definition at line 48 of file G4ParticleHPFFFissionFS.hh.

Here is the call graph for this function:


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