21#ifndef __SEPTUM_EXPRESSION_H__
22#define __SEPTUM_EXPRESSION_H__
27#include "boost/variant/get.hpp"
28#include "boost/variant/variant.hpp"
29#include "boost/smart_ptr.hpp"
39 static const std::string
name;
42 if (args.size() != 1) {
44 "SeptumExpr expects 1 arguments, " + std::to_string(args.size()) +
" given");
47 std::string probe = boost::get<std::string>(args[0]);
54 boost::scoped_ptr<PeakReader> sim_peaks(
new PeakReader(probe + std::string(
".peaks")));
55 sim_peaks->parseFile();
57 boost::scoped_ptr<ProbeHistReader> sim_hist(
new ProbeHistReader(probe + std::string(
".hist")));
58 sim_hist->parseFile();
60 double upperBound = 0.0;
61 double lowerBound = 0.0;
63 size_t nTurns = sim_peaks->getNumberOfPeaks();
64 sim_peaks->getPeak(nTurns, upperBound);
65 sim_peaks->getPeak(nTurns - 1, lowerBound);
67 result = sim_hist->minimum(lowerBound, upperBound);
70 std::cout <<
"Exception while getting septum value "
76 return boost::make_tuple(result, is_valid);
Inform & endl(Inform &inf)
boost::tuple< double, bool > Result_t
std::vector< argument_t > arguments_t
static const std::string name
Expressions::Result_t operator()(client::function::arguments_t args)
virtual const char * what() const