Reading of the decay width and some branching ratios is demonstrated in this example. It also shows how individual fields can be accessed with a SLHAea::Key via the SLHAea::Coll::field() method:
#include <fstream>
#include <iostream>
using namespace std;
using namespace SLHAea;
int main()
{
ifstream ifs("slha2.txt");
const Block chi10_decay = input.
at(
"1000022");
cout <<
"chi_10 decay width: " << chi10_decay.
at(
"DECAY").
at(2) << endl;
cout << "BR(chi_10 -> mu- W+): "
<< chi10_decay.
at(
"(any)",
"2",
"13",
"24").
at(0) << endl;
cout << "BR(chi_10 -> tau- W+): "
<< chi10_decay.
at(
"(any)",
"2",
"15",
"24").
at(0) << endl;
cout << "BR(chi_10 -> mu+ W-): "
<< input.
field(
"1000022;(any),2,-13,-24;0") << endl;
cout << "BR(chi_10 -> tau+ W-): "
<< input.
field(
"1000022;(any),2,-15,-24;0") << endl;
double sum = 0.;
line != chi10_decay.
end(); ++line)
{
if (!line->is_data_line()) continue;
sum += to<double>(line->at(0));
}
cout << "Sum of all chi_10 BRs: " << sum << endl;
}