27 #ifndef __SUMERRSQ_H__
28 #define __SUMERRSQ_H__
35 #include "boost/type_traits/remove_cv.hpp"
36 #include "boost/variant/get.hpp"
37 #include "boost/variant/variant.hpp"
38 #include "boost/smart_ptr.hpp"
55 static const std::string
name;
59 if (args.size() != 3) {
61 "sumErrSq expects 3 arguments, " + std::to_string(args.size()) +
" given");
64 std::string measurement_filename = boost::get<std::string>(args[0]);
65 var_name_ = boost::get<std::string>(args[1]);
72 const std::unique_ptr<SDDSReader> sim_stats(
new SDDSReader(stat_filename_));
74 sim_stats->parseFile();
83 double sim_value = 0.0;
85 sim_stats->getInterpolatedValue(
86 measurement.spos, var_name_, sim_value);
88 std::cout <<
"Exception while getting value "
89 <<
"from SDDS file: " << e.
what()
93 double val = measurement.measurement - sim_value;
97 return boost::make_tuple(
sqrt(sum/measurements_.size()), is_valid);
Tps< T > sqrt(const Tps< T > &x)
Square root.
Expressions::Result_t operator()(client::function::arguments_t args)
std::vector< argument_t > arguments_t
virtual const char * what() const
Inform & endl(Inform &inf)
std::vector< Measurement > measurements_
std::string stat_filename_
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
boost::tuple< std::string, std::string, std::string > argument_types
static const std::string name
friend std::istream & operator>>(std::istream &stream, Measurement &measurement)
constexpr double e
The value of .
boost::tuple< double, bool > Result_t
void parseMeasurements(std::string measurement_filename)