61 for ( std::map<
G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itZ =
mIsotope.begin();
63 std::map< G4int , G4PhysicsVector* >* pointer_map = itZ->second;
65 for ( std::map< G4int , G4PhysicsVector* >::iterator itA = pointer_map->begin();
66 itA != pointer_map->end() ; ++itA ) {
68 if ( pointerPhysicsVector ) {
69 delete pointerPhysicsVector;
106 G4String baseName = getenv(
"G4NEUTRONHPDATA" );
108 G4String aFSType =
"/CrossSection/";
123 vElement.resize( numberOfElements );
124 for (
size_t i = 0; i < numberOfElements; ++i )
127 G4Element* theElement = (*theElementTable)[i];
131 G4int nIso = (*theElementTable)[i]->GetNumberOfIsotopes();
132 G4int Z =
static_cast<G4int> ((*theElementTable)[i]->GetZ());
135 G4bool found_at_least_one =
false;
136 for (
G4int i1 = 0; i1 < nIso; i1++ )
143 std::stringstream ss;
144 ss << dirName << aFSType << Z <<
"_" << A <<
"_" << theNames.
GetName( Z-1 );
147 file.open ( filename , std::fstream::in );
154 found_at_least_one =
true;
174 found_at_least_one =
TRUE;
178 if ( found_at_least_one )
vElement[i] =
true;
193 std::stringstream ss;
194 ss << dirName << aFSType << Z <<
"_" << A <<
"_" << theNames.
GetName( Z-1 );
198 file.open ( filename , std::fstream::in );
204 found_at_least_one =
TRUE;
222 found_at_least_one =
TRUE;
226 if ( found_at_least_one )
vElement[i] =
true;
239 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use NeutronHP data for particles other than neutrons!!!");
264 for (
G4int i1 = 0; i1 < nIso; i1++ )
305 std::vector< G4double > v_e;
306 std::vector< G4double > v_xs;
308 for (
G4int i = 0 ; i < len ; i++ )
316 v_e.push_back( e*
eV );
317 v_xs.push_back( xs*
barn );
322 for (
G4int i = 0 ; i < len ; i++ )
324 aPhysVec->
PutValues( static_cast< size_t >( i ) , v_e[ i ] , v_xs[ i ] );
344 std::pair< G4int , G4PhysicsVector* > aPair = std::pair < G4int , G4PhysicsVector* > (
A , aPhysVec );
346 std::map < G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itm;
350 itm->second->insert ( aPair );
354 std::map< G4int , G4PhysicsVector* >* aMap =
new std::map< G4int , G4PhysicsVector* >;
355 aMap->insert ( aPair );
356 mIsotope.insert( std::pair<
G4int , std::map< G4int , G4PhysicsVector* >* > ( Z , aMap ) );
370 if (
mIsotope.find ( Z )->second->find ( A ) !=
mIsotope.find ( Z )->second->end() )
373 aPhysVec =
mIsotope.find ( Z )->second->find ( A )->second;
374 aXSection = aPhysVec->
GetValue( ek , outOfRange );
381 std::map < G4int , G4PhysicsVector* >::iterator it;
383 for ( it =
mIsotope.find ( Z )->second->begin() ; it !=
mIsotope.find ( Z )->second->end() ; it++ )
385 G4int delta = std::abs( A - it->first );
386 if ( delta < delta0 ) delta0 = delta;
391 G4int A1 = A + delta0;
392 if (
mIsotope.find ( Z )->second->find ( A1 ) !=
mIsotope.find ( Z )->second->end() )
394 aPhysVec =
mIsotope.find ( Z )->second->find ( A1 )->second;
399 aPhysVec =
mIsotope.find ( Z )->second->find ( A1 )->second;
402 aXSection = aPhysVec->
GetValue( ek , outOfRange );
404 aXSection *= std::pow ( 1.0*A/ A1 , 2.0 / 3.0 );
size_t GetNumberOfIsotopes() const
void PutValues(size_t binNumber, G4double binValue, G4double dataValue)
G4ParticleHPJENDLHEData()
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
G4double GetKineticEnergy() const
void DumpPhysicsTable(const G4ParticleDefinition &)
G4int GetFirstIsotope(G4int Z)
G4bool isThisInMap(G4int, G4int)
std::vector< G4bool > vElement
const G4String & GetParticleName() const
std::map< G4int, std::map< G4int, G4PhysicsVector * > * > mIsotope
static size_t GetNumberOfElements()
void registAPhysicsVector(G4int, G4int, G4PhysicsVector *)
G4double * GetRelativeAbundanceVector() const
static const double second
static const double perCent
static G4Neutron * Neutron()
static const G4double A[nN]
G4PhysicsVector * readAFile(std::fstream *)
G4int GetNumberOfIsotopes(G4int Z)
G4bool IsApplicable(const G4DynamicParticle *, const G4Element *)
G4double getXSfromThisIsotope(G4int, G4int, G4double)
G4int GetIsotopeNucleonCount(G4int number)
G4bool isThisNewIsotope(G4int z, G4int a)
void BuildPhysicsTable(const G4ParticleDefinition &)
const G4Isotope * GetIsotope(G4int iso) const
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
G4double GetAbundance(G4int number)
std::vector< G4Element * > G4ElementTable
~G4ParticleHPJENDLHEData()
static G4ElementTable * GetElementTable()
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)