64 std::map< G4int , G4PhysicsVector* >* pointer_map = itZ->second;
66 for ( std::map< G4int , G4PhysicsVector* >::iterator itA = pointer_map->begin();
67 itA != pointer_map->end() ; ++itA ) {
69 if ( pointerPhysicsVector ) {
70 delete pointerPhysicsVector;
107 G4String baseName = std::getenv(
"G4NEUTRONHPDATA" );
109 G4String aFSType =
"/CrossSection/";
124 vElement.resize( numberOfElements );
125 for (
size_t i = 0; i < numberOfElements; ++i )
128 G4Element* theElement = (*theElementTable)[i];
132 G4int nIso = (*theElementTable)[i]->GetNumberOfIsotopes();
133 G4int Z =
static_cast<G4int> ((*theElementTable)[i]->GetZ());
136 G4bool found_at_least_one =
false;
137 for (
G4int i1 = 0; i1 < nIso; i1++ )
144 std::stringstream ss;
145 ss << dirName << aFSType <<
Z <<
"_" <<
A <<
"_" << theNames.
GetName(
Z-1 );
148 file.open ( filename , std::fstream::in );
155 found_at_least_one =
true;
175 found_at_least_one =
TRUE;
179 if ( found_at_least_one )
vElement[i] =
true;
194 std::stringstream ss;
195 ss << dirName << aFSType <<
Z <<
"_" <<
A <<
"_" << theNames.
GetName(
Z-1 );
199 file.open ( filename , std::fstream::in );
205 found_at_least_one =
TRUE;
223 found_at_least_one =
TRUE;
227 if ( found_at_least_one )
vElement[i] =
true;
240 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use NeutronHP data for particles other than neutrons!!!");
265 for (
G4int i1 = 0; i1 < nIso; i1++ )
306 std::vector< G4double > v_e;
307 std::vector< G4double > v_xs;
309 for (
G4int i = 0 ; i < len ; i++ )
317 v_e.push_back( e*
eV );
318 v_xs.push_back( xs*
barn );
323 for (
G4int i = 0 ; i < len ; i++ )
325 aPhysVec->
PutValues(
static_cast< size_t >( i ) , v_e[ i ] , v_xs[ i ] );
345 std::pair< G4int , G4PhysicsVector* > aPair = std::pair < G4int , G4PhysicsVector* > (
A , aPhysVec );
347 std::map < G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itm;
351 itm->second->insert ( aPair );
355 std::map< G4int , G4PhysicsVector* >* aMap =
new std::map< G4int , G4PhysicsVector* >;
356 aMap->insert ( aPair );
357 mIsotope.insert( std::pair<
G4int , std::map< G4int , G4PhysicsVector* >* > (
Z , aMap ) );
374 aPhysVec =
mIsotope.find (
Z )->second->find (
A )->second;
375 aXSection = aPhysVec->
GetValue( ek , outOfRange );
382 std::map < G4int , G4PhysicsVector* >::iterator it;
384 for ( it =
mIsotope.find (
Z )->second->begin() ; it !=
mIsotope.find (
Z )->second->end() ; it++ )
386 G4int delta = std::abs(
A - it->first );
387 if ( delta < delta0 ) delta0 = delta;
395 aPhysVec =
mIsotope.find (
Z )->second->find ( A1 )->second;
400 aPhysVec =
mIsotope.find (
Z )->second->find ( A1 )->second;
403 aXSection = aPhysVec->
GetValue( ek , outOfRange );
std::vector< G4Element * > G4ElementTable
static constexpr double perCent
static constexpr double barn
static constexpr double second
static constexpr double eV
static constexpr double MeV
G4double GetKineticEnergy() const
static G4ElementTable * GetElementTable()
G4double * GetRelativeAbundanceVector() const
static size_t GetNumberOfElements()
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
static G4Neutron * Neutron()
const G4String & GetParticleName() const
G4bool isThisNewIsotope(G4int z, G4int a)
~G4ParticleHPJENDLHEData()
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
void registAPhysicsVector(G4int, G4int, G4PhysicsVector *)
G4ParticleHPJENDLHEData()
G4bool isThisInMap(G4int, G4int)
G4bool IsApplicable(const G4DynamicParticle *, const G4Element *)
void BuildPhysicsTable(const G4ParticleDefinition &)
std::vector< G4bool > vElement
std::map< G4int, std::map< G4int, G4PhysicsVector * > * > mIsotope
G4double getXSfromThisIsotope(G4int, G4int, G4double)
void DumpPhysicsTable(const G4ParticleDefinition &)
G4PhysicsVector * readAFile(std::fstream *)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void PutValues(const std::size_t index, const G4double energy, const G4double value)
G4double GetValue(const G4double energy, G4bool &isOutRange) const
static G4Pow * GetInstance()
G4double A23(G4double A) const
G4double GetAbundance(G4int number)
G4int GetFirstIsotope(G4int Z)
G4int GetNumberOfIsotopes(G4int Z)
G4int GetIsotopeNucleonCount(G4int number)