50 else if ( !(vElement[ anE->
GetIndex() ]) ) result =
false;
68 reactionName = reaction;
89 G4String baseName = getenv(
"G4NEUTRONHPDATA" );
90 G4String dirName = baseName+
"/JENDL_HE/"+particleName+
"/"+reactionName ;
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++ )
123 if ( isThisNewIsotope( Z , A ) )
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;
144 registAPhysicsVector( Z , A , aPhysVec );
157 found_at_least_one =
TRUE;
161 if ( found_at_least_one ) vElement[i] =
true;
173 if ( isThisNewIsotope( Z , A ) )
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;
193 registAPhysicsVector( Z , A , aPhysVec );
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++ )
253 result += frac * getXSfromThisIsotope( Z , A , ek );
269 result += frac * getXSfromThisIsotope( Z , A , ek );
280G4PhysicsVector* G4NeutronHPJENDLHEData::readAFile ( std::fstream* file )
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 ] );
317 if ( mIsotope.find ( z ) == mIsotope.end() )
return false;
318 if ( mIsotope.find ( z ) -> second->find ( a ) == mIsotope.find ( z ) -> second->end() )
return false;
327 std::pair< G4int , G4PhysicsVector* > aPair = std::pair < G4int , G4PhysicsVector* > ( A , aPhysVec );
329 std::map < G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itm;
330 itm = mIsotope.find ( Z );
331 if ( itm != mIsotope.end() )
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 );
std::vector< G4Element * > G4ElementTable
G4double GetKineticEnergy() const
G4double * GetRelativeAbundanceVector() const
static size_t GetNumberOfElements()
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
static const G4ElementTable * GetElementTable()
void PutValues(size_t binNumber, G4double binValue, G4double dataValue)
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
void BuildPhysicsTable(const G4ParticleDefinition &)
~G4NeutronHPJENDLHEData()
void DumpPhysicsTable(const G4ParticleDefinition &)
G4bool IsApplicable(const G4DynamicParticle *, const G4Element *)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
static G4Neutron * Neutron()
const G4String & GetParticleName() const
G4double GetValue(G4double theEnergy, G4bool &isOutRange)
G4double GetAbundance(G4int number)
G4int GetFirstIsotope(G4int Z)
G4int GetNumberOfIsotopes(G4int Z)
G4int GetIsotopeNucleonCount(G4int number)