30#ifndef __MAX_NORM_RADIALPEAK_H__
31#define __MAX_NORM_RADIALPEAK_H__
37#include "boost/type_traits/remove_cv.hpp"
38#include "boost/variant/get.hpp"
39#include "boost/variant/variant.hpp"
40#include "boost/smart_ptr.hpp"
48 static const std::string
name;
51 if (args.size() != 4) {
53 "maxNormRadialPeak expects 4 arguments, " + std::to_string(args.size()) +
" given");
58 begin_ = boost::get<double>(args[2]);
59 end_ = boost::get<double>(args[3]);
66 sim_peaks->parseFile();
67 meas_peaks->parseFile();
71 "Error check turn number range");
78 double maximum = -1.0;
80 for (
int turn =
begin_; turn <
end_ + 1; ++turn) {
81 double sim_value = 0.0, meas_value = 0.0;
83 sim_peaks->getPeak(turn, sim_value);
84 meas_peaks->getPeak(turn, meas_value);
86 std::cout <<
"Exception while getting value "
87 <<
"from peak file: " <<
e.what()
91 double val =
std::abs(meas_value - sim_value);
95 return boost::make_tuple(maximum, is_valid);
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 max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
boost::tuple< double, bool > Result_t
constexpr double e
The value of.
std::vector< argument_t > arguments_t
std::string meas_filename_
boost::tuple< std::string, std::string, int, int > argument_types
static const std::string name
std::string sim_filename_
Expressions::Result_t operator()(client::function::arguments_t args)
virtual const char * what() const