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 &)

Detailed Description

Definition at line 37 of file G4NeutronHPFFFissionFS.hh.


Constructor & Destructor Documentation

G4NeutronHPFFFissionFS::G4NeutronHPFFFissionFS (  )  [inline]

Definition at line 41 of file G4NeutronHPFFFissionFS.hh.

References G4NeutronHPFinalState::hasXsec.

00041 { hasXsec = false; }

G4NeutronHPFFFissionFS::~G4NeutronHPFFFissionFS (  )  [inline]

Definition at line 42 of file G4NeutronHPFFFissionFS.hh.

00042 {}


Member Function Documentation

G4DynamicParticleVector * G4NeutronHPFFFissionFS::ApplyYourself ( G4int  nNeutrons  ) 

Reimplemented from G4NeutronHPFissionBaseFS.

Definition at line 118 of file G4NeutronHPFFFissionFS.cc.

References G4NeutronHPFissionBaseFS::ApplyYourself().

00119 {  
00120    G4DynamicParticleVector * aResult;
00121 //    G4cout <<"G4NeutronHPFFFissionFS::ApplyYourself +"<<G4endl;
00122    aResult = G4NeutronHPFissionBaseFS::ApplyYourself(nNeutrons);    
00123    return aResult;
00124 }

void G4NeutronHPFFFissionFS::GetAFissionFragment ( G4double  ,
G4int ,
G4int ,
G4int  
)

Definition at line 126 of file G4NeutronHPFFFissionFS.cc.

References DBL_MAX, and G4UniformRand.

Referenced by G4NeutronHPFissionFS::ApplyYourself().

00127 {
00128    //G4cout << "G4NeutronHPFFFissionFS::GetAFissionFragment " << G4endl;
00129 
00130    G4double rand =G4UniformRand();
00131    //G4cout << rand << G4endl;
00132 
00133    std::map< G4double , std::map< G4int , G4double >* >* mEnergyFSPData = FissionProductYieldData.find( 454 )->second;
00134     
00135    //It is not clear that the treatment of the scheme 2 on two-dimensional interpolation. 
00136    //So, here just use the closest energy point array of yield data. 
00137    //TK120531
00138    G4double key_energy = DBL_MAX;
00139    if ( mEnergyFSPData->size() == 1 )
00140    {
00141       key_energy = mEnergyFSPData->begin()->first;
00142    }
00143    else
00144    {
00145       //Find closest energy point
00146       G4double Dmin=DBL_MAX; 
00147       G4int i = 0;
00148       for ( std::map< G4double , std::map< G4int , G4double >* >::iterator it = mEnergyFSPData->begin() ; 
00149       it != mEnergyFSPData->end() ; it++ )
00150       {
00151          G4double e = (it->first);
00152          G4double d = std::fabs ( energy - e ); 
00153          if ( d < Dmin ) 
00154          {
00155             Dmin = d;
00156             key_energy = e;
00157          }
00158          i++;
00159       }
00160    }
00161 
00162    std::map<G4int,G4double>* mFSPYieldData = (*mEnergyFSPData)[key_energy];
00163 
00164    G4int ifrag=0;
00165    G4double ceilling = mFSPYieldData->rbegin()->second; // Becaseu of numerical accuracy, this is not always 2 
00166    for ( std::map<G4int,G4double>::iterator it = mFSPYieldData->begin() ; it != mFSPYieldData->end() ; it++ )
00167    {
00168       //if ( ( rand - it->second/ceilling ) < 1.0e-6 ) std::cout << rand - it->second/ceilling << std::endl;
00169       if ( rand <= it->second/ceilling ) 
00170       {  
00171          //G4cout << it->first << " " << it->second/ceilling << G4endl;
00172          ifrag = it->first;
00173          break;
00174       }
00175    }
00176 
00177    fragZ = ifrag/100000;
00178    fragA = (ifrag%100000)/100;
00179    fragM = (ifrag%100);
00180 
00181    //G4cout << fragZ << " " << fragA << " " << fragM << G4endl;
00182 }

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

Reimplemented from G4NeutronHPFissionBaseFS.

Definition at line 33 of file G4NeutronHPFFFissionFS.cc.

References G4NeutronHPDataUsed::GetA(), G4NeutronHPDataUsed::GetName(), G4NeutronHPNames::GetName(), G4NeutronHPDataUsed::GetZ(), G4NeutronHPFinalState::hasAnyData, G4NeutronHPFinalState::hasFSData, G4NeutronHPFinalState::hasXsec, G4NeutronHPFinalState::theBaseA, G4NeutronHPFinalState::theBaseZ, and G4NeutronHPFinalState::theNames.

Referenced by G4NeutronHPFissionFS::Init().

00034 {
00035    //G4cout << "G4NeutronHPFFFissionFS::Init" << G4endl;
00036    G4String aString = "FF";
00037 
00038    G4String tString = dirName;
00039    G4bool dbool;
00040    G4NeutronHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, aString , dbool);
00041    G4String filename = aFile.GetName();
00042    theBaseA = aFile.GetA();
00043    theBaseZ = aFile.GetZ();
00044 
00045 //3456
00046    if ( !dbool || ( Z < 2.5 && ( std::abs(theBaseZ-Z)>0.0001 || std::abs(theBaseA-A)>0.0001) ) )
00047    {
00048       hasAnyData = false;
00049       hasFSData = false; 
00050       hasXsec = false;
00051       return; // no data for exactly this isotope.
00052    }
00053    std::ifstream theData(filename, std::ios::in);
00054    G4double dummy;
00055    if ( !theData )
00056    {
00057       theData.close();
00058       hasFSData = false;
00059       hasXsec = false;
00060       hasAnyData = false;
00061       return; // no data for this FS for this isotope
00062    }
00063 
00064 
00065    hasFSData = true; 
00066       //          MT              Energy            FPS    Yield
00067       //std::map< int , std::map< double , std::map< int , double >* >* > FisionProductYieldData; 
00068    while ( theData.good() )
00069    {
00070       G4int iMT, iMF;
00071       G4int imax;
00072       //Reading the data
00073       //         MT       MF       AWR
00074       theData >> iMT >> iMF >> dummy;
00075       //         nBlock 
00076       theData >> imax;
00077       //if ( !theData.good() ) continue;
00078       //        Ei                   FPS     Yield
00079       std::map< G4double , std::map< G4int , G4double >* >* mEnergyFSPData = new std::map< G4double , std::map< G4int , G4double >* >;
00080 
00081       std::map< G4double , G4int >* mInterporation = new std::map< G4double , G4int >;
00082       for ( G4int i = 0 ; i <= imax ; i++ ) 
00083       {
00084        
00085          G4double YY=0.0; 
00086          G4double Ei;
00087          G4int jmax;
00088          G4int ip;
00089          //        energy of incidnece neutron 
00090          theData >> Ei;
00091          //        Number of data set followings 
00092          theData >> jmax;
00093          //         interpolation scheme
00094          theData >> ip;
00095          mInterporation->insert( std::pair<G4double,G4int>(Ei*eV,ip) );
00096          //         nNumber  nIP
00097          std::map<G4int,G4double>* mFSPYieldData = new std::map<G4int,G4double>;
00098          for ( G4int j = 0 ; j < jmax ; j++ ) 
00099          {
00100             G4int FSP;
00101             G4int mFSP;
00102             G4double Y;
00103             theData >> FSP >> mFSP >> Y;
00104             G4int k = FSP*100+mFSP;
00105             YY = YY + Y;
00106             //if ( iMT == 454 )G4cout << iMT << " " << i << " " << j << " " <<  k << " " << Y << " " << YY << G4endl;
00107             mFSPYieldData->insert( std::pair<G4int,G4double>( k , YY ) );
00108          }
00109          mEnergyFSPData->insert( std::pair<G4double,std::map<G4int,G4double>*>(Ei*eV,mFSPYieldData) ); 
00110       }
00111 
00112       FissionProductYieldData.insert( std::pair< G4int , std::map< G4double , std::map< G4int , G4double >* >* > (iMT,mEnergyFSPData));
00113       mMTInterpolation.insert( std::pair<G4int,std::map<G4double,G4int>*> (iMT,mInterporation) ); 
00114    } 
00115    theData.close();
00116 }

G4NeutronHPFinalState* G4NeutronHPFFFissionFS::New (  )  [inline, virtual]

Implements G4NeutronHPFinalState.

Definition at line 48 of file G4NeutronHPFFFissionFS.hh.

00049       {
00050          G4NeutronHPFFFissionFS * theNew = new G4NeutronHPFFFissionFS;
00051          return theNew;
00052       }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:37 2013 for Geant4 by  doxygen 1.4.7