9 #include <boost/algorithm/string/classification.hpp>
10 #include <boost/algorithm/string/split.hpp>
11 #include <boost/algorithm/string/trim.hpp>
18 struct AlpgenParTokens {
20 std::vector<double>
values;
29 if (
pos == std::string::npos)
41 if (
ss.bad() ||
ss.peek() != std::istringstream::traits_type::eof())
50 if (
ss.bad() ||
ss.peek() != std::istringstream::traits_type::eof())
63 const std::vector<std::string>::const_iterator &
end) {
64 std::vector<std::string>::const_iterator
line =
begin;
68 if ((
line++)->
find(
"****") != std::string::npos)
71 AlpgenParTokens tokens;
74 if (
line ==
end || !tokens.parse(*
line++,
true) || !tokens.values.empty())
79 if (
line ==
end || !tokens.parse(*
line++,
false) || tokens.values.size() < 6)
86 while (
line !=
end &&
line->find(
"****") == std::string::npos) {
87 if (!tokens.parse(*
line++,
true) || tokens.values.size() != 1)
97 if (
line ==
end || !tokens.parse(*
line++,
false) || tokens.values.size() != 2)
100 xsec = tokens.values[0];
104 if (
line ==
end || !tokens.parse(*
line++,
true) || tokens.values.size() != 1)
108 lumi = tokens.values[0];
115 #define DEFINE_ALPGEN_PARAMETER(x) \
116 { AlpgenHeader::x, #x }
119 struct AlpgenParameterName {
126 const alpgenParameterNames[] = {
144 static const unsigned int size =
sizeof alpgenParameterNames /
sizeof alpgenParameterNames[0];
146 const AlpgenParameterName *
pos =
std::find(alpgenParameterNames, alpgenParameterNames +
size,
index);
148 if (
pos != alpgenParameterNames +
size)
151 std::ostringstream
ss;