#include <G4NeutronHPorLFission.hh>
Inheritance diagram for G4NeutronHPorLFission:
Public Member Functions | |
G4NeutronHPorLFission () | |
~G4NeutronHPorLFission () | |
G4HadFinalState * | ApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &aTargetNucleus) |
virtual const std::pair< G4double, G4double > | GetFatalEnergyCheckLevels () const |
G4int | GetNiso () |
G4bool | IsThisElementOK (G4String) |
G4VCrossSectionDataSet * | GiveXSectionDataSet () |
Definition at line 59 of file G4NeutronHPorLFission.hh.
G4NeutronHPorLFission::G4NeutronHPorLFission | ( | ) |
Definition at line 42 of file G4NeutronHPorLFission.cc.
References G4cout, G4endl, G4Element::GetElementTable(), G4Element::GetNumberOfElements(), G4HadronicInteraction::SetMaxEnergy(), and G4HadronicInteraction::SetMinEnergy().
00043 :G4HadronicInteraction("NeutronHPorLFission") 00044 { 00045 SetMinEnergy(0.*eV); 00046 SetMaxEnergy(20.*MeV); 00047 00048 if( !getenv("G4NEUTRONHPDATA") ) 00049 throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files."); 00050 00051 dirName = getenv("G4NEUTRONHPDATA"); 00052 G4String tString = "/Fission/"; 00053 dirName = dirName + tString; 00054 // G4cout <<"G4NeutronHPorLFission::G4NeutronHPorLFission testit "<<dirName<<G4endl; 00055 unavailable_elements.clear(); 00056 00057 numEle = G4Element::GetNumberOfElements(); 00058 theFission = new G4NeutronHPChannel[numEle]; 00059 00060 for ( G4int i = 0; i < numEle ; i++) 00061 { 00062 if ( (*(G4Element::GetElementTable()))[i]-> GetZ() > 87 ) //TK modified for ENDF-VII 00063 { 00064 theFission[i].Init((*(G4Element::GetElementTable()))[i], dirName); 00065 try { while(!theFission[i].Register(&theFS)) ; } 00066 catch ( G4HadronicException ) 00067 { 00068 unavailable_elements.insert ( (*(G4Element::GetElementTable()))[i]->GetName() ); 00069 } 00070 } 00071 } 00072 00073 if ( unavailable_elements.size() > 0 ) 00074 { 00075 std::set< G4String>::iterator it; 00076 G4cout << "HP Fission data are not available for thess elements "<< G4endl; 00077 for ( it = unavailable_elements.begin() ; it != unavailable_elements.end() ; it++ ) 00078 { 00079 G4cout << *it << G4endl; 00080 } 00081 G4cout << "Low Energy Parameterization Models will be used."<< G4endl; 00082 } 00083 00084 createXSectionDataSet(); 00085 }
G4NeutronHPorLFission::~G4NeutronHPorLFission | ( | ) |
G4HadFinalState * G4NeutronHPorLFission::ApplyYourself | ( | const G4HadProjectile & | aTrack, | |
G4Nucleus & | aTargetNucleus | |||
) | [virtual] |
Implements G4HadronicInteraction.
Definition at line 95 of file G4NeutronHPorLFission.cc.
References G4NeutronHPChannel::ApplyYourself(), G4UniformRand, G4Material::GetElement(), G4Element::GetIndex(), G4HadProjectile::GetMaterial(), G4Material::GetNumberOfElements(), G4Material::GetTemperature(), G4NeutronHPThermalBoost::GetThermalEnergy(), G4Material::GetVecNbOfAtomsPerVolume(), G4NeutronHPChannel::GetXsec(), and CLHEP::detail::n.
Referenced by G4NeutronHPorLFissionModel::ApplyYourself().
00096 { 00097 const G4Material * theMaterial = aTrack.GetMaterial(); 00098 G4int n = theMaterial->GetNumberOfElements(); 00099 G4int index = theMaterial->GetElement(0)->GetIndex(); 00100 if(n!=1) 00101 { 00102 G4int i; 00103 xSec = new G4double[n]; 00104 G4double sum=0; 00105 const G4double * NumAtomsPerVolume = theMaterial->GetVecNbOfAtomsPerVolume(); 00106 G4double rWeight; 00107 G4NeutronHPThermalBoost aThermalE; 00108 for (i=0; i<n; i++) 00109 { 00110 index = theMaterial->GetElement(i)->GetIndex(); 00111 rWeight = NumAtomsPerVolume[i]; 00112 G4double x = aThermalE.GetThermalEnergy(aTrack, theMaterial->GetElement(i), theMaterial->GetTemperature()); 00113 00114 //xSec[i] = theFission[index].GetXsec(aThermalE.GetThermalEnergy(aTrack, 00115 // theMaterial->GetElement(i), 00116 // theMaterial->GetTemperature())); 00117 xSec[i] = theFission[index].GetXsec(x); 00118 00119 xSec[i] *= rWeight; 00120 sum+=xSec[i]; 00121 } 00122 G4double random = G4UniformRand(); 00123 G4double running = 0; 00124 for (i=0; i<n; i++) 00125 { 00126 running += xSec[i]; 00127 index = theMaterial->GetElement(i)->GetIndex(); 00128 if(random<=running/sum) break; 00129 } 00130 delete [] xSec; 00131 // it is element-wise initialised. 00132 } 00133 return theFission[index].ApplyYourself(aTrack); 00134 }
const std::pair< G4double, G4double > G4NeutronHPorLFission::GetFatalEnergyCheckLevels | ( | ) | const [virtual] |
Reimplemented from G4HadronicInteraction.
Definition at line 152 of file G4NeutronHPorLFission.cc.
References DBL_MAX.
00153 { 00154 //return std::pair<G4double, G4double>(10*perCent,10*GeV); 00155 return std::pair<G4double, G4double>(10*perCent,DBL_MAX); 00156 }
G4int G4NeutronHPorLFission::GetNiso | ( | ) | [inline] |
Definition at line 69 of file G4NeutronHPorLFission.hh.
References G4NeutronHPChannel::GetNiso().
00069 {return theFission[0].GetNiso();}
G4VCrossSectionDataSet* G4NeutronHPorLFission::GiveXSectionDataSet | ( | ) | [inline] |
Definition at line 88 of file G4NeutronHPorLFission.hh.
Referenced by G4NeutronHPorLFissionModel::GiveHPXSectionDataSet().
Definition at line 138 of file G4NeutronHPorLFission.cc.
Referenced by G4NeutronHPorLFissionModel::ApplyYourself().
00139 { 00140 if ( unavailable_elements.find( name ) == unavailable_elements.end() ) 00141 return TRUE; 00142 else 00143 return FALSE; 00144 }