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;
23 bool parse(
const std::string &
line,
bool withIndex);
30 if (pos == std::string::npos)
33 std::string
tmp = boost::trim_copy(line.substr(0, pos));
35 boost::token_compress_on);
41 std::istringstream ss(
comments[i++]);
44 ss.peek() != std::istringstream::traits_type::eof())
50 std::istringstream ss(
comments[i++]);
54 ss.peek() != std::istringstream::traits_type::eof())
60 tmp = boost::trim_copy(line.substr(pos + 1));
62 boost::token_compress_on);
68 const std::vector<std::string>::const_iterator &
end)
70 std::vector<std::string>::const_iterator line =
begin;
74 if ((line++)->
find(
"****") != std::string::npos)
77 AlpgenParTokens tokens;
80 if (line == end || !tokens.parse(*line++,
true) ||
81 !tokens.values.empty())
86 if (line == end || !tokens.parse(*line++,
false) ||
87 tokens.values.size() < 6)
94 while(line != end && line->find(
"****") == std::string::npos) {
95 if (!tokens.parse(*line++,
true) ||
96 tokens.values.size() != 1)
106 if (line == end || !tokens.parse(*line++,
false) ||
107 tokens.values.size() != 2)
110 xsec = tokens.values[0];
114 if (line == end || !tokens.parse(*line++,
true) ||
115 tokens.values.size() != 1)
119 lumi = tokens.values[0];
126 #define DEFINE_ALPGEN_PARAMETER(x) { AlpgenHeader::x, #x }
129 struct AlpgenParameterName {
134 {
return this->index ==
index; }
137 static const alpgenParameterNames[] = {
183 static const unsigned int size =
sizeof alpgenParameterNames /
184 sizeof alpgenParameterNames[0];
186 const AlpgenParameterName *pos =
188 alpgenParameterNames + size, index);
190 if (pos != alpgenParameterNames + size)
193 std::ostringstream ss;
194 ss <<
"unknown " << (int)index;
Evaluator * parse(const T &text)
bool operator==(const CaloTower &t1, const CaloTower &t2)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< std::vector< double > > tmp
tuple size
Write out results.