89 G4String baseName = getenv(
"G4NEUTRONHPDATA" );
106 vElement.resize( numberOfElements );
107 for (
size_t i = 0; i < numberOfElements; ++i )
110 G4Element* theElement = (*theElementTable)[i];
114 G4int nIso = (*theElementTable)[i]->GetNumberOfIsotopes();
115 G4int Z =
static_cast<G4int> ((*theElementTable)[i]->GetZ());
118 G4bool found_at_least_one =
false;
119 for (
G4int i1 = 0; i1 < nIso; i1++ )
126 std::stringstream ss;
127 ss << dirName << aFSType << Z <<
"_" << A <<
"_" << theNames.
GetName( Z-1 );
130 file.open ( filename , std::fstream::in );
137 found_at_least_one =
true;
157 found_at_least_one =
TRUE;
161 if ( found_at_least_one )
vElement[i] =
true;
176 std::stringstream ss;
177 ss << dirName << aFSType << Z <<
"_" << A <<
"_" << theNames.
GetName( Z-1 );
181 file.open ( filename , std::fstream::in );
187 found_at_least_one =
TRUE;
205 found_at_least_one =
TRUE;
209 if ( found_at_least_one )
vElement[i] =
true;
222 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use NeutronHP data for particles other than neutrons!!!");
247 for (
G4int i1 = 0; i1 < nIso; i1++ )
288 std::vector< G4double > v_e;
289 std::vector< G4double > v_xs;
291 for (
G4int i = 0 ; i < len ; i++ )
299 v_e.push_back( e*
eV );
300 v_xs.push_back( xs*
barn );
305 for (
G4int i = 0 ; i < len ; i++ )
307 aPhysVec->
PutValues( static_cast< size_t >( i ) , v_e[ i ] , v_xs[ i ] );
327 std::pair< G4int , G4PhysicsVector* > aPair = std::pair < G4int , G4PhysicsVector* > (
A , aPhysVec );
329 std::map < G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itm;
333 itm->second->insert ( aPair );
337 std::map< G4int , G4PhysicsVector* >* aMap =
new std::map< G4int , G4PhysicsVector* >;
338 aMap->insert ( aPair );
339 mIsotope.insert( std::pair<
G4int , std::map< G4int , G4PhysicsVector* >* > ( Z , aMap ) );
353 if (
mIsotope.find ( Z )->second->find ( A ) !=
mIsotope.find ( Z )->second->end() )
356 aPhysVec =
mIsotope.find ( Z )->second->find ( A )->second;
357 aXSection = aPhysVec->
GetValue( ek , outOfRange );
364 std::map < G4int , G4PhysicsVector* >::iterator it;
366 for ( it =
mIsotope.find ( Z )->second->begin() ; it !=
mIsotope.find ( Z )->second->end() ; it++ )
368 G4int delta = std::abs( A - it->first );
369 if ( delta < delta0 ) delta0 = delta;
374 G4int A1 = A + delta0;
375 if (
mIsotope.find ( Z )->second->find ( A1 ) !=
mIsotope.find ( Z )->second->end() )
377 aPhysVec =
mIsotope.find ( Z )->second->find ( A1 )->second;
382 aPhysVec =
mIsotope.find ( Z )->second->find ( A1 )->second;
385 aXSection = aPhysVec->
GetValue( ek , outOfRange );
387 aXSection *= std::pow ( 1.0*A/ A1 , 2.0 / 3.0 );
size_t GetNumberOfIsotopes() const
void PutValues(size_t binNumber, G4double binValue, G4double dataValue)
void registAPhysicsVector(G4int, G4int, G4PhysicsVector *)
G4bool isThisInMap(G4int, G4int)
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
G4double GetKineticEnergy() const
G4int GetFirstIsotope(G4int Z)
~G4NeutronHPJENDLHEData()
G4double getXSfromThisIsotope(G4int, G4int, G4double)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
G4bool isThisNewIsotope(G4int z, G4int a)
const G4String & GetParticleName() const
void DumpPhysicsTable(const G4ParticleDefinition &)
static size_t GetNumberOfElements()
G4PhysicsVector * readAFile(std::fstream *)
G4double * GetRelativeAbundanceVector() const
static const double second
static const double perCent
static G4Neutron * Neutron()
static const G4double A[nN]
G4int GetNumberOfIsotopes(G4int Z)
G4int GetIsotopeNucleonCount(G4int number)
G4bool IsApplicable(const G4DynamicParticle *, const G4Element *)
const G4Isotope * GetIsotope(G4int iso) const
G4double GetAbundance(G4int number)
std::vector< G4Element * > G4ElementTable
std::vector< G4bool > vElement
static G4ElementTable * GetElementTable()
std::map< G4int, std::map< G4int, G4PhysicsVector * > * > mIsotope
void BuildPhysicsTable(const G4ParticleDefinition &)