diff --git a/sammy/src/endf/ResonanceParameterIO.cpp b/sammy/src/endf/ResonanceParameterIO.cpp index 9a823aee875b12b46df4124d110e8d148818d8cc..6e32459bbf0e0b6384b28a9668a3fdf5c462d11e 100644 --- a/sammy/src/endf/ResonanceParameterIO.cpp +++ b/sammy/src/endf/ResonanceParameterIO.cpp @@ -1479,5 +1479,24 @@ namespace sammy{ } } } + + std::vector<std::string> ResonanceParameterIO::getParticlePairNames(SammyRMatrixParameters & params){ + std::vector<std::string> name_list; + + for ( int ig = 0; ig < params.getNumSpinGroups(); ig++){ + SammySpinGroupInfo * spinInfo = params.getSpinGroupInfo(ig); + for ( int ic = 0; ic < spinInfo->getNumChannels(); ic++){ + SammyChannelInfo *channelInfo = spinInfo->getChannelInfo(ic); + SammyParticlePairInfo *pairInfo = params.getParticlePairInfo(channelInfo->getParticlePairIndex()); + std::string name; + if (pairInfo->getName().empty()) name = "undefined"; + else name = pairInfo->getName(); + + name_list.push_back(name); + } + } + + return name_list; + } } diff --git a/sammy/src/endf/ResonanceParameterIO.h b/sammy/src/endf/ResonanceParameterIO.h index 0a5738fd623bd225c20c714c3b59268e2b1cf5d5..525ec24cb7cc5353b82e1985fb2304e3e6102ff5 100644 --- a/sammy/src/endf/ResonanceParameterIO.h +++ b/sammy/src/endf/ResonanceParameterIO.h @@ -116,7 +116,9 @@ namespace sammy{ * @param incidentSpin if old spin group format the spin of the incident particle * @return 0 if no error occurred, 1 for a warning and -1 for an error */ - int readSpinGroupData(SammyRMatrixParameters & isotopes, SammyRMatrixParameters & params, bool oldFormat, double mass, double incidentSpin); + int readSpinGroupData(SammyRMatrixParameters & isotopes, SammyRMatrixParameters & params, bool oldFormat, double mass, double incidentSpin); + std::vector<std::string> getParticlePairNames(SammyRMatrixParameters & params); + void setParticlePairNames(SammyRMatrixParameters & params); protected: class IsotopeData{ public: @@ -128,9 +130,9 @@ namespace sammy{ void setSpecialParticlePairInfo( SammyParticlePairInfo & info, int index, const std::string & type) const; - void readParameterCard1Line(size_t & lineNum, std::vector<double> & values,std::vector<int> & fitOptions, int & group, double & x) const; + void readParameterCard1Line(size_t & lineNum, std::vector<double> & values,std::vector<int> & fitOptions, int & group, double & x) const; - void readParameterCard10Line(size_t & lineNum, IsotopeData & isoData, bool large) const; + void readParameterCard10Line(size_t & lineNum, IsotopeData & isoData, bool large) const; int readNewChannelData(const std::string & line, int channelId, SammyRMatrixParameters & params); @@ -142,7 +144,7 @@ namespace sammy{ */ void setParticleNames(SammyParticlePairInfo & info); - void setParticlePairNames(SammyRMatrixParameters & params); + bool manySpinGroups;