30 #ifndef __SUMERRSQRADIALPEAK_H__
31 #define __SUMERRSQRADIALPEAK_H__
35 #include "boost/type_traits/remove_cv.hpp"
36 #include "boost/variant/get.hpp"
37 #include "boost/variant/variant.hpp"
45 static const std::string
name;
48 if (args.size() != 4) {
50 "sumErrSqRadialPeak expects 4 arguments, " + std::to_string(args.size()) +
" given");
55 begin_ = boost::get<double>(args[2]);
56 end_ = boost::get<double>(args[3]);
61 const std::unique_ptr<PeakReader> sim_peaks(
new PeakReader(sim_filename_));
63 sim_peaks->parseFile();
64 meas_peaks->parseFile();
66 if ( end_ < begin_ || end_ < 0 || begin_ < 0 )
68 "Error check turn number range");
76 int nPeaks = end_ - begin_ + 1;
78 for (
int turn = begin_; turn < end_ + 1; ++turn) {
79 double sim_value = 0.0, meas_value = 0.0;
81 sim_peaks->getPeak(turn, sim_value);
82 meas_peaks->getPeak(turn, meas_value);
84 std::cout <<
"Exception while getting value "
85 <<
"from peak file: " << e.
what()
89 double val = meas_value - sim_value;
93 return boost::make_tuple(
std::sqrt(sum) / (
double)nPeaks, is_valid);
Tps< T > sqrt(const Tps< T > &x)
Square root.
Expressions::Result_t operator()(client::function::arguments_t args)
std::string meas_filename_
std::string sim_filename_
std::vector< argument_t > arguments_t
virtual const char * what() const
clearpage the user may choose between constant or variable radius This model includes fringe fields begin
Inform & endl(Inform &inf)
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
static const std::string name
boost::tuple< std::string, std::string, int, int > argument_types
constexpr double e
The value of .
boost::tuple< double, bool > Result_t