9 #include "boost/type_traits/remove_cv.hpp"
10 #include "boost/variant/get.hpp"
11 #include "boost/variant/variant.hpp"
12 #include "boost/smart_ptr.hpp"
37 static const std::string
name;
41 if (args.size() != 3) {
43 "sumErrSq expects 3 arguments, " + std::to_string(args.size()) +
" given");
46 std::string measurement_filename = boost::get<std::string>(args[0]);
47 var_name_ = boost::get<std::string>(args[1]);
54 boost::scoped_ptr<SDDSReader> sim_stats(
new SDDSReader(stat_filename_));
56 sim_stats->parseFile();
65 double sim_value = 0.0;
67 sim_stats->getInterpolatedValue(
68 measurement.spos, var_name_, sim_value);
70 std::cout <<
"Exception while getting value "
71 <<
"from SDDS file: " << e.
what()
75 double val = measurement.measurement - sim_value;
79 return boost::make_tuple(
sqrt(sum/measurements_.size()), is_valid);
virtual const char * what() const
void parseMeasurements(std::string measurement_filename)
constexpr double e
The value of .
std::string stat_filename_
std::vector< Measurement > measurements_
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
boost::tuple< double, bool > Result_t
std::vector< argument_t > arguments_t
static const std::string name
Implements a parser and value extractor for Probe loss files.
Tps< T > sqrt(const Tps< T > &x)
Square root.
friend std::istream & operator>>(std::istream &stream, Measurement &measurement)
boost::tuple< std::string, std::string, std::string > argument_types
Inform & endl(Inform &inf)
Expressions::Result_t operator()(client::function::arguments_t args)