76 for ( std::map<
G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itZ =
mIsotope.begin();
78 std::map< G4int , G4PhysicsVector* >* pointer_map = itZ->second;
80 for ( std::map< G4int , G4PhysicsVector* >::iterator itA = pointer_map->begin();
81 itA != pointer_map->end() ; ++itA ) {
83 if ( pointerPhysicsVector ) {
84 delete pointerPhysicsVector;
104 G4String baseName = getenv(
"G4NEUTRONHPDATA" );
106 G4String aFSType =
"/CrossSection/";
121 vElement.resize( numberOfElements );
122 for (
size_t i = 0; i < numberOfElements; ++i )
125 G4Element* theElement = (*theElementTable)[i];
129 G4int nIso = (*theElementTable)[i]->GetNumberOfIsotopes();
130 G4int Z =
static_cast<G4int> ((*theElementTable)[i]->GetZ());
133 G4bool found_at_least_one =
false;
134 for (
G4int i1 = 0; i1 < nIso; i1++ )
141 std::stringstream ss;
142 ss << dirName << aFSType << Z <<
"_" << A <<
"_" << theNames.
GetName( Z-1 );
145 file.open ( filename , std::fstream::in );
152 found_at_least_one =
true;
172 found_at_least_one =
TRUE;
176 if ( found_at_least_one )
vElement[i] =
true;
191 std::stringstream ss;
192 ss << dirName << aFSType << Z <<
"_" << A <<
"_" << theNames.
GetName( Z-1 );
196 file.open ( filename , std::fstream::in );
202 found_at_least_one =
TRUE;
220 found_at_least_one =
TRUE;
224 if ( found_at_least_one )
vElement[i] =
true;
237 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use NeutronHP data for particles other than neutrons!!!");
262 for (
G4int i1 = 0; i1 < nIso; i1++ )
303 std::vector< G4double > v_e;
304 std::vector< G4double > v_xs;
306 for (
G4int i = 0 ; i < len ; i++ )
314 v_e.push_back( e*
eV );
315 v_xs.push_back( xs*
barn );
320 for (
G4int i = 0 ; i < len ; i++ )
322 aPhysVec->
PutValues( static_cast< size_t >( i ) , v_e[ i ] , v_xs[ i ] );
342 std::pair< G4int , G4PhysicsVector* > aPair = std::pair < G4int , G4PhysicsVector* > (
A , aPhysVec );
344 std::map < G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itm;
348 itm->second->insert ( aPair );
352 std::map< G4int , G4PhysicsVector* >* aMap =
new std::map< G4int , G4PhysicsVector* >;
353 aMap->insert ( aPair );
354 mIsotope.insert( std::pair<
G4int , std::map< G4int , G4PhysicsVector* >* > ( Z , aMap ) );
368 if (
mIsotope.find ( Z )->second->find ( A ) !=
mIsotope.find ( Z )->second->end() )
371 aPhysVec =
mIsotope.find ( Z )->second->find ( A )->second;
372 aXSection = aPhysVec->
GetValue( ek , outOfRange );
379 std::map < G4int , G4PhysicsVector* >::iterator it;
381 for ( it =
mIsotope.find ( Z )->second->begin() ; it !=
mIsotope.find ( Z )->second->end() ; it++ )
383 G4int delta = std::abs( A - it->first );
384 if ( delta < delta0 ) delta0 = delta;
389 G4int A1 = A + delta0;
390 if (
mIsotope.find ( Z )->second->find ( A1 ) !=
mIsotope.find ( Z )->second->end() )
392 aPhysVec =
mIsotope.find ( Z )->second->find ( A1 )->second;
397 aPhysVec =
mIsotope.find ( Z )->second->find ( A1 )->second;
400 aXSection = aPhysVec->
GetValue( ek , outOfRange );
402 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 &)