HOPS
HOPS class reference
MHO_PlotDataExtractor.hh
Go to the documentation of this file.
1 #ifndef MHO_PlotDataExtractor_HH__
2 #define MHO_PlotDataExtractor_HH__
3 
5 
6 #include <algorithm>
7 #include <cmath>
8 #include <iomanip>
9 #include <numeric>
10 #include <sstream>
11 #include <string>
12 #include <vector>
13 
14 namespace hops
15 {
16 
21 {
22  public:
29  static std::vector< double > extract_vector(const mho_json& plot_dict, const std::string& key);
30 
36  static std::vector< double > create_index_vector(size_t size);
37 
44  static std::string format_scientific(double value, int precision = 3);
45 
46  static std::string format_standard(double value, int minDigits, int roundPlaces);
47 
55  static int extract_int(const mho_json& plot_dict, const std::string& key, int default_value = 0);
56 
64  static std::string extract_string(const mho_json& plot_dict, const std::string& key,
65  const std::string& default_value = "");
66 
74  static double extract_double(const mho_json& plot_dict, const std::string& key, double default_value = 0.0);
75 };
76 
77 } // namespace hops
78 
79 #endif /* end of include guard: MHO_PlotDataExtractor_HH__ */
nlohmann::json mho_json
Definition: MHO_JSONHeaderWrapper.hh:5
Utility class for extracting and processing plot data from JSON.
Definition: MHO_PlotDataExtractor.hh:21
static std::vector< double > extract_vector(const mho_json &plot_dict, const std::string &key)
Extracts a vector of doubles from JSON plot dictionary.
Definition: MHO_PlotDataExtractor.cc:8
static std::string format_scientific(double value, int precision=3)
Formats a double as scientific notation string.
Definition: MHO_PlotDataExtractor.cc:34
static std::string format_standard(double value, int minDigits, int roundPlaces)
Definition: MHO_PlotDataExtractor.cc:41
static int extract_int(const mho_json &plot_dict, const std::string &key, int default_value=0)
Extracts integer value from JSON with fallback.
Definition: MHO_PlotDataExtractor.cc:51
static double extract_double(const mho_json &plot_dict, const std::string &key, double default_value=0.0)
Extracts double value from JSON with fallback.
Definition: MHO_PlotDataExtractor.cc:94
static std::string extract_string(const mho_json &plot_dict, const std::string &key, const std::string &default_value="")
Extracts string value from JSON with fallback.
Definition: MHO_PlotDataExtractor.cc:74
static std::vector< double > create_index_vector(size_t size)
Creates an index vector (0, 1, 2, ..., size-1)
Definition: MHO_PlotDataExtractor.cc:27
Definition: MHO_AdhocFlagging.hh:18
Definition: vex.h:175