52 else if ( !(vElement[ anE->
GetIndex() ]) ) result =
false;
62 for ( std::map<
G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itZ = mIsotope.begin();
63 itZ != mIsotope.end(); ++itZ ) {
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;
86 reactionName = reaction;
107 G4String baseName = std::getenv(
"G4NEUTRONHPDATA" );
108 G4String dirName = baseName+
"/JENDL_HE/"+particleName+
"/"+reactionName ;
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++ )
141 if ( isThisNewIsotope( Z ,
A ) )
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;
162 registAPhysicsVector( Z ,
A , aPhysVec );
175 found_at_least_one =
TRUE;
179 if ( found_at_least_one ) vElement[i] =
true;
191 if ( isThisNewIsotope( Z ,
A ) )
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;
211 registAPhysicsVector( Z ,
A , aPhysVec );
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++ )
271 result += frac * getXSfromThisIsotope( Z ,
A , ek );
287 result += frac * getXSfromThisIsotope( Z ,
A , ek );
298G4PhysicsVector* G4ParticleHPJENDLHEData::readAFile ( std::fstream* file )
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 ] );
335 if ( mIsotope.find ( z ) == mIsotope.end() )
return false;
336 if ( mIsotope.find ( z ) -> second->find ( a ) == mIsotope.find ( z ) -> second->end() )
return false;
345 std::pair< G4int , G4PhysicsVector* > aPair = std::pair < G4int , G4PhysicsVector* > ( A , aPhysVec );
347 std::map < G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itm;
348 itm = mIsotope.find ( Z );
349 if ( itm != mIsotope.end() )
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 ) );
371 if ( mIsotope.find ( Z )->second->find ( A ) != mIsotope.find ( Z )->second->end() )
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;
393 if ( mIsotope.find ( Z )->second->find ( A1 ) != mIsotope.find ( Z )->second->end() )
395 aPhysVec = mIsotope.find ( Z )->second->find ( A1 )->second;
400 aPhysVec = mIsotope.find ( Z )->second->find ( A1 )->second;
403 aXSection = aPhysVec->
GetValue( ek , outOfRange );
double A(double temperature)
std::vector< G4Element * > G4ElementTable
G4double GetKineticEnergy() const
static G4ElementTable * GetElementTable()
G4double * GetRelativeAbundanceVector() const
static size_t GetNumberOfElements()
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
void PutValues(std::size_t index, G4double e, G4double dataValue)
static G4Neutron * Neutron()
const G4String & GetParticleName() const
~G4ParticleHPJENDLHEData()
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
G4ParticleHPJENDLHEData()
G4bool IsApplicable(const G4DynamicParticle *, const G4Element *)
void BuildPhysicsTable(const G4ParticleDefinition &)
void DumpPhysicsTable(const G4ParticleDefinition &)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
G4double GetValue(G4double theEnergy, 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)