51 else if ( !(vElement[ anE->
GetIndex() ]) ) result =
false;
59 for ( std::map<
G4int , std::map< G4int , G4PhysicsVector* >* >::iterator itZ = mIsotope.begin();
60 itZ != mIsotope.end(); ++itZ ) {
61 std::map< G4int , G4PhysicsVector* >* pointer_map = itZ->second;
63 for ( std::map< G4int , G4PhysicsVector* >::iterator itA = pointer_map->begin();
64 itA != pointer_map->end() ; ++itA ) {
66 if ( pointerPhysicsVector ) {
67 delete pointerPhysicsVector;
82 reactionName = reaction;
97 G4String dirName = baseName+
"/JENDL_HE/"+particleName+
"/"+reactionName ;
112 vElement.resize( numberOfElements );
113 for ( std::size_t i = 0; i < numberOfElements; ++i )
115 G4Element* theElement = (*theElementTable)[i];
119 G4int nIso = (
G4int)(*theElementTable)[i]->GetNumberOfIsotopes();
123 G4bool found_at_least_one =
false;
124 for (
G4int i1 = 0; i1 < nIso; ++i1 )
128 if ( isThisNewIsotope(
Z ,
A ) )
130 std::stringstream ss;
131 ss << dirName << aFSType <<
Z <<
"_" <<
A <<
"_" << theNames.
GetName(
Z-1 );
134 file.open ( filename , std::fstream::in );
139 found_at_least_one =
true;
143 registAPhysicsVector(
Z ,
A , aPhysVec );
153 found_at_least_one =
TRUE;
156 if ( found_at_least_one ) vElement[i] =
true;
166 if ( isThisNewIsotope(
Z ,
A ) )
169 std::stringstream ss;
170 ss << dirName << aFSType <<
Z <<
"_" <<
A <<
"_" << theNames.
GetName(
Z-1 );
174 file.open ( filename , std::fstream::in );
180 found_at_least_one =
TRUE;
186 registAPhysicsVector(
Z ,
A , aPhysVec );
196 found_at_least_one =
TRUE;
200 if ( found_at_least_one ) vElement[i] =
true;
209 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use NeutronHP data for particles other than neutrons!!!");
228 for (
G4int i1 = 0; i1 < nIso; ++i1 )
232 result += frac * getXSfromThisIsotope(
Z ,
A , ek );
243 result += frac * getXSfromThisIsotope(
Z ,
A , ek );
250G4PhysicsVector* G4ParticleHPJENDLHEData::readAFile ( std::fstream* file )
257 std::vector< G4double > v_e;
258 std::vector< G4double > v_xs;
260 for (
G4int i = 0 ; i < len ; ++i )
268 v_e.push_back( e*eV );
269 v_xs.push_back( xs*barn );
274 for (
G4int i = 0 ; i < len ; ++i )
276 aPhysVec->
PutValues(
static_cast< std::size_t
>( i ) , v_e[ i ] , v_xs[ i ] );
285 if ( mIsotope.find ( z ) == mIsotope.end() )
return false;
286 if ( mIsotope.find ( z ) -> second->find ( a ) == mIsotope.find ( z ) -> second->end() )
return false;
293 std::pair< G4int , G4PhysicsVector* > aPair = std::pair < G4int , G4PhysicsVector* > (
A , aPhysVec );
294 auto itm = mIsotope.find (
Z );
295 if ( itm != mIsotope.cend() )
297 itm->second->insert ( aPair );
301 std::map< G4int , G4PhysicsVector* >* aMap =
new std::map< G4int , G4PhysicsVector* >;
302 aMap->insert ( aPair );
303 mIsotope.insert( std::pair<
G4int , std::map< G4int , G4PhysicsVector* >* > (
Z , aMap ) );
314 if ( mIsotope.find (
Z )->second->find (
A ) != mIsotope.find (
Z )->second->end() )
316 aPhysVec = mIsotope.find (
Z )->second->find (
A )->second;
317 aXSection = aPhysVec->
GetValue( ek , outOfRange );
323 for (
auto it = mIsotope.find (
Z )->second->cbegin();
324 it!= mIsotope.find (
Z )->second->cend(); ++it )
326 G4int delta = std::abs(
A - it->first );
327 if ( delta < delta0 ) delta0 = delta;
333 if ( mIsotope.find (
Z )->second->find ( A1 ) != mIsotope.find (
Z )->second->cend() )
335 aPhysVec = mIsotope.find (
Z )->second->find ( A1 )->second;
340 aPhysVec = mIsotope.find (
Z )->second->find ( A1 )->second;
343 aXSection = aPhysVec->
GetValue( ek , outOfRange );
std::vector< G4Element * > G4ElementTable
const char * G4FindDataDir(const char *)
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
~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)
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)