本文整理汇总了C++中PartList::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ PartList::insert方法的具体用法?C++ PartList::insert怎么用?C++ PartList::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PartList
的用法示例。
在下文中一共展示了PartList::insert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadParticles
void ReadParticles(PartList &list,
const boost::property_tree::ptree &pt) {
auto particleTree = pt.get_child_optional("ParticleList");
if (!particleTree)
return;
for (auto const &v : particleTree.get()) {
auto tmp = ParticleProperties(v.second);
auto p = std::make_pair(tmp.name(), tmp);
auto last = list.insert(p);
if (!last.second) {
LOG(INFO) << "ReadParticles() | Particle " << last.first->first
<< " already exists in list. We overwrite its parameters!";
last.first->second = tmp;
}
tmp = last.first->second;
// cparity is optional
double cparity = 0.0;
try {
cparity = tmp.GetQuantumNumber("Cparity");
} catch (std::exception &ex) {
}
LOG(DEBUG) << "ReadParticles() | Particle " << tmp.name()
<< " (id=" << tmp.GetId() << ") "
<< " J(PC)=" << tmp.GetSpinQuantumNumber("Spin") << "("
<< tmp.GetQuantumNumber("Parity") << cparity << ") "
<< " mass=" << tmp.GetMass()
<< " decayType=" << tmp.GetDecayType();
}
return;
}