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"
38 #include "boost/smart_ptr.hpp"
46 static const std::string
name;
49 if (args.size() != 4) {
51 "sumErrSqRadialPeak expects 4 arguments, " + std::to_string(args.size()) +
" given");
56 begin_ = boost::get<double>(args[2]);
57 end_ = boost::get<double>(args[3]);
64 sim_peaks->parseFile();
65 meas_peaks->parseFile();
69 "Error check turn number range");
79 for (
int turn =
begin_; turn <
end_ + 1; ++turn) {
80 double sim_value = 0.0, meas_value = 0.0;
82 sim_peaks->getPeak(turn, sim_value);
83 meas_peaks->getPeak(turn, meas_value);
85 std::cout <<
"Exception while getting value "
86 <<
"from peak file: " <<
e.what()
90 double val = meas_value - sim_value;
94 return boost::make_tuple(
std::sqrt(
sum) / (
double)nPeaks, is_valid);
Tps< T > sqrt(const Tps< T > &x)
Square root.
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
T::PETE_Expr_t::PETE_Return_t sum(const PETE_Expr< T > &expr)
Inform & endl(Inform &inf)
boost::tuple< double, bool > Result_t
constexpr double e
The value of.
std::vector< argument_t > arguments_t
std::string sim_filename_
boost::tuple< std::string, std::string, int, int > argument_types
static const std::string name
Expressions::Result_t operator()(client::function::arguments_t args)
std::string meas_filename_
virtual const char * what() const