47 if (eKin < 20 * MeV || 3 * GeV < eKin || aP->GetDefinition() !=
G4Neutron::Neutron()) {
51 else if (!(vElement[anE->
GetIndex()]))
59 for (
auto& itZ : mIsotope) {
60 std::map<G4int, G4PhysicsVector*>* pointer_map = itZ.second;
61 if (pointer_map !=
nullptr) {
62 for (
auto& itA : *pointer_map) {
64 if (pointerPhysicsVector !=
nullptr) {
65 delete pointerPhysicsVector;
79 reactionName = reaction;
90 const G4String& dirName = baseName +
"/JENDL_HE/" + particleName +
"/" + reactionName;
91 const G4String& aFSType =
"/CrossSection/";
105 vElement.resize(numberOfElements);
106 for (std::size_t i = 0; i < numberOfElements; ++i) {
107 G4Element* theElement = (*theElementTable)[i];
112 auto Z = (
G4int)(*theElementTable)[i]->GetZ();
113 for (
G4int i1 = 0; i1 < nIso; ++i1) {
116 if (isThisNewIsotope(Z,
A)) {
117 std::stringstream ss;
118 ss << dirName << aFSType << Z <<
"_" <<
A <<
"_" << theNames.
GetName(Z - 1);
121 file.open(filename, std::fstream::in);
129 registAPhysicsVector(Z,
A, aPhysVec);
153 for (
G4int i1 = 0; i1 < nIso; ++i1) {
157 result += frac * getXSfromThisIsotope(Z,
A, ek);
169 std::vector<G4double> v_e;
170 std::vector<G4double> v_xs;
172 for (
G4int i = 0; i < len; ++i) {
179 v_e.push_back(e * eV);
180 v_xs.push_back(xs * barn);
183 auto aPhysVec =
new G4PhysicsFreeVector(
static_cast<std::size_t
>(len), v_e.front(), v_e.back());
185 for (
G4int i = 0; i < len; ++i) {
186 aPhysVec->PutValues(
static_cast<std::size_t
>(i), v_e[i], v_xs[i]);
194 if (mIsotope.find(z) == mIsotope.end())
return false;
195 if (mIsotope.find(z)->second->find(a) == mIsotope.find(z)->second->end())
return false;
201 std::pair<G4int, G4PhysicsVector*> aPair = std::pair<G4int, G4PhysicsVector*>(
A, aPhysVec);
202 auto itm = mIsotope.find(Z);
203 if (itm != mIsotope.cend()) {
204 itm->second->insert(aPair);
207 auto aMap =
new std::map<G4int, G4PhysicsVector*>;
209 mIsotope.insert(std::pair<
G4int, std::map<G4int, G4PhysicsVector*>*>(Z, aMap));
217 G4PhysicsVector* aPhysVec;
218 auto isoZ = mIsotope.find(Z);
219 if (isoZ == mIsotope.end()) {
return aXSection; }
220 auto isoA = isoZ->second->find(
A);
221 if (isoA != isoZ->second->end()) {
222 aPhysVec = isoA->second;
223 aXSection = aPhysVec->
Value(ek);
228 for (
auto it = isoZ->second->begin(); it != isoZ->second->end(); ++it)
230 G4int delta = std::abs(
A - it->first);
231 if (delta < delta0) delta0 = delta;
237 auto isoA1 = isoZ->second->find(A1);
239 if (isoA1 != isoZ->second->end()) {
240 aPhysVec = isoA1->second;
245 auto isoA2 = isoZ->second->find(A1);
246 if (isoA2 != isoZ->second->end()) {
247 aPhysVec = isoA2->second;
252 aXSection = aPhysVec->
Value(ek);
const char * G4FindDataDir(const char *)
G4double GetKineticEnergy() const
G4double * GetRelativeAbundanceVector() const
static std::size_t GetNumberOfElements()
std::size_t GetNumberOfIsotopes() const
std::size_t GetIndex() const
const G4Isotope * GetIsotope(G4int iso) const
static const G4ElementTable * GetElementTable()
static G4Neutron * Neutron()
const G4String & GetParticleName() const
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
G4ParticleHPJENDLHEData()
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4bool IsApplicable(const G4DynamicParticle *, const G4Element *)
void DumpPhysicsTable(const G4ParticleDefinition &) override
~G4ParticleHPJENDLHEData() override
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active) const
G4double Value(const G4double energy, std::size_t &lastidx) const
static G4Pow * GetInstance()
G4double A23(G4double A) const
G4VCrossSectionDataSet(const G4String &nam="")