52 YieldType_(WhichYield)
62 Verbosity_(Verbosity),
63 YieldType_(WhichYield)
73 Verbosity_(Verbosity),
74 YieldType_(WhichYield)
82 std::istringstream dataStream(std::ios::in);
93 EnergyGroupValues_ =
nullptr;
98 ReadInData(dataStream);
100 catch (std::exception& e) {
101 delete YieldContainerTable_;
115 return EnergyGroupValues_;
123 return EnergyGroups_;
133 return NumberOfElements;
141 if (WhichYield >= 0 && WhichYield < YieldContainerTable_->G4GetNumberOfElements()) {
153 this->Verbosity_ = WhatVerbosity;
158void G4ENDFTapeRead::ReadInData(std::istringstream& dataStream)
163 if (!dataStream.good()) {
165 "Fission product data not available");
169 throw std::exception();
391 G4int currentEnergy = 0;
404 std::vector<G4double> projectileEnergies;
405 std::map<const G4int, std::pair<std::vector<G4double>, std::vector<G4double>>> intermediateData;
406 std::map<const G4int, std::pair<std::vector<G4double>, std::vector<G4double>>>::iterator
409 while (dataStream.good())
411 dataStream >>
MT >> MF >> dummy >> blockCount;
413 correctMT =
MT == YieldType_;
415 for (
G4int b = 0; b < blockCount; ++b) {
416 dataStream >> incidentEnergy >> itemCount >> interpolation;
417 maxSize = maxSize >= itemCount ? maxSize : itemCount;
421 projectileEnergies.push_back(incidentEnergy);
422 currentEnergy =
G4int(projectileEnergies.size() - 1);
429 for (
G4int i = 0; i < itemCount; ++i) {
430 dataStream >> isotope >> metastate >> yield;
433 identifier = isotope * 10 + metastate;
437 .insert(std::make_pair(
438 identifier, std::make_pair(std::vector<G4double>(projectileEnergies.size(), 0.0),
439 std::vector<G4double>(projectileEnergies.size(), 0.0))))
442 if (dataIterator->second.first.size() < projectileEnergies.size()) {
443 dataIterator->second.first.resize(projectileEnergies.size());
444 dataIterator->second.second.resize(projectileEnergies.size());
447 dataIterator->second.first[currentEnergy] = yield;
448 dataIterator->second.second[currentEnergy] = error;
459 EnergyGroups_ = (
G4int)projectileEnergies.size();
460 EnergyGroupValues_ =
new G4double[EnergyGroups_];
463 auto NewYield =
new G4double[EnergyGroups_];
464 auto NewError =
new G4double[EnergyGroups_];
466 for (
G4int energyGroup = 0; energyGroup < EnergyGroups_; energyGroup++) {
468 EnergyGroupValues_[energyGroup] = projectileEnergies[energyGroup];
472 for (dataIterator = intermediateData.begin(); dataIterator != intermediateData.end();
475 identifier = dataIterator->first;
476 metastate = identifier % 10;
488 "Unsupported metastable state supplied in fission yield data. Defaulting to "
495 NewProduct = (identifier - metastate) / 10;
497 for (
G4int energyGroup = 0; energyGroup < EnergyGroups_; energyGroup++) {
498 if (energyGroup < (
signed)dataIterator->second.first.size()) {
499 yield = dataIterator->second.first[energyGroup];
500 error = dataIterator->second.second[energyGroup];
507 NewYield[energyGroup] = yield;
508 NewError[energyGroup] = error;
528 delete[] EnergyGroupValues_;
529 delete YieldContainerTable_;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define G4FFG_DATA_FUNCTIONENTER__
#define G4FFG_DATA_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__
G4double * G4GetEnergyGroupValues()
void Initialize(G4String dataFile)
G4int G4GetNumberOfEnergyGroups()
void G4SetVerbosity(G4int WhatVerbosity)
G4ENDFYieldDataContainer * G4GetYield(G4int WhichYield)
G4ENDFTapeRead(G4String FileLocation, G4String FileName, G4FFGEnumerations::YieldType WhichYield, G4FFGEnumerations::FissionCause WhichCause)
G4int G4GetNumberOfFissionProducts()
void SetProduct(G4int Product)
void SetMetaState(G4FFGEnumerations::MetaState MetaState)
void SetYieldError(G4double *YieldError)
void SetYieldProbability(G4double *YieldProbability)
void GetDataStream(const G4String &, std::istringstream &iss)
static G4ParticleHPManager * GetInstance()
G4long G4GetNumberOfElements()
T * G4GetContainer(unsigned int WhichContainer)