5 #ifndef COMPWA_PROPERTIES_HPP_ 6 #define COMPWA_PROPERTIES_HPP_ 11 #include "boost/property_tree/ptree.hpp" 42 return DecayInfo.get<std::string>(
"<xmlattr>.Type");
66 throw std::runtime_error(
"ParticleProperties::getQuantumNumber<int>() | " 68 type +
"' not found!");
77 throw std::runtime_error(
"ParticleProperties::getQuantumNumber<double>() | " 79 type +
"' not found!");
88 os << i.getName() <<
" [ " << i.getId()
89 <<
" ]: mass = " << i.getMass().Value << std::endl;
95 auto found = std::find_if(list.begin(), list.end(),
96 [&Pid](
auto const &x) {
return x.getId() == Pid; });
97 if (list.end() == found) {
98 throw std::runtime_error(
"Could not find particle with id " +
99 std::to_string(Pid) +
" in list");
105 std::string refname) {
107 std::find_if(list.begin(), list.end(), [&refname](
auto const &x) {
108 return x.getName() == refname;
110 if (list.end() == found) {
111 throw std::runtime_error(
"Could not find particle with name " + refname +
std::string getDecayType() const
ParticleProperties(boost::property_tree::ptree pt)
T getQuantumNumber(std::string type) const
ComPWA::FitParameter< double > Mass
ComPWA::FitParameter< double > getMass() const
std::ostream & operator<<(std::ostream &os, const Event &ev)
ParticleList readParticles(std::stringstream &Stream)
Read list of particles from a stringstream For some reason the boost xml parser needs a non-const ref...
const ParticleProperties & findParticle(const ParticleList &list, pid Pid)
std::set< ParticleProperties > ParticleList
friend bool operator<(const ParticleProperties &l, const ParticleProperties &r)
boost::property_tree::ptree getDecayInfo() const
void insertParticles(ParticleList &list, const boost::property_tree::ptree &pt)
Read list of particles from a boost::property_tree.
std::string getName() const
std::map< std::string, double > RealQuantumNumbers
boost::property_tree::ptree DecayInfo
Store decay info in property_tree.
std::map< std::string, int > IntQuantumNumbers