Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4NeutronHPFFFissionFS Class Reference

#include <G4NeutronHPFFFissionFS.hh>

Inheritance diagram for G4NeutronHPFFFissionFS:
G4NeutronHPFissionBaseFS G4NeutronHPFinalState

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)
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
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)
 
G4bool DoNotAdjustFinalState ()
 
- 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 36 of file G4NeutronHPFFFissionFS.hh.

Constructor & Destructor Documentation

G4NeutronHPFFFissionFS::G4NeutronHPFFFissionFS ( )
inline

Definition at line 40 of file G4NeutronHPFFFissionFS.hh.

References G4NeutronHPFinalState::hasXsec.

Referenced by New().

40 { hasXsec = false; }
G4NeutronHPFFFissionFS::~G4NeutronHPFFFissionFS ( )
inline

Definition at line 41 of file G4NeutronHPFFFissionFS.hh.

41 {}

Member Function Documentation

G4DynamicParticleVector * G4NeutronHPFFFissionFS::ApplyYourself ( G4int  nNeutrons)

Definition at line 121 of file G4NeutronHPFFFissionFS.cc.

References G4NeutronHPFissionBaseFS::ApplyYourself().

122 {
123  G4DynamicParticleVector * aResult;
124 // G4cout <<"G4NeutronHPFFFissionFS::ApplyYourself +"<<G4endl;
125  aResult = G4NeutronHPFissionBaseFS::ApplyYourself(nNeutrons);
126  return aResult;
127 }
G4DynamicParticleVector * ApplyYourself(G4int Prompt)
std::vector< G4DynamicParticle * > G4DynamicParticleVector
void G4NeutronHPFFFissionFS::GetAFissionFragment ( G4double  energy,
G4int fragZ,
G4int fragA,
G4int fragM 
)

Definition at line 129 of file G4NeutronHPFFFissionFS.cc.

References DBL_MAX, G4UniformRand, and python.hepunit::second.

Referenced by G4NeutronHPFissionFS::ApplyYourself().

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

Implements G4NeutronHPFinalState.

Definition at line 34 of file G4NeutronHPFFFissionFS.cc.

References python.hepunit::eV, G4NeutronHPDataUsed::GetA(), G4NeutronHPManager::GetDataStream(), G4NeutronHPManager::GetInstance(), G4NeutronHPNames::GetName(), G4NeutronHPDataUsed::GetName(), G4NeutronHPDataUsed::GetZ(), G4NeutronHPFinalState::hasAnyData, G4NeutronHPFinalState::hasFSData, G4NeutronHPFinalState::hasXsec, jmax, G4NeutronHPFinalState::theBaseA, G4NeutronHPFinalState::theBaseZ, and G4NeutronHPFinalState::theNames.

Referenced by G4NeutronHPFissionFS::Init().

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

Implements G4NeutronHPFinalState.

Definition at line 47 of file G4NeutronHPFFFissionFS.hh.

References G4NeutronHPFFFissionFS().


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