1#include <pybind11/pybind11.h>
2#include <pybind11/stl.h>
12namespace py = pybind11;
17 auto m_plotting = m.def_submodule(
"plotting");
18 m_plotting.doc() =
"This is a Python binding of MaCh3s C++ based plotting library.";
20 py::class_<MaCh3Plotting::PlottingManager>(m_plotting,
"PlottingManager")
22 py::init<const std::string &>(),
23 "construct a PlottingManager using the specified config file",
24 py::arg(
"config_file_name")
29 "default constructor, will initialise the PlottingManager with the default plotting config"
35 "initalise this PlottingManager"
41 "Print a usage message for the current executable"
47 "Parse command line variables",
54 "Set the name of the current executable, which will be used when getting executable specific options from the plotting config file",
61 "Get the path to a particular file",
62 py::arg(
"input_file_id")
68 "Get the specified label of a particular input file",
69 py::arg(
"input_file_id")
75 "Get any additional root drawing options specified by the user"
81 "Get the output name specified by the user, can specify an additional *suffix* to append to the file name but before the file extension",
82 py::arg(
"suffix") =
""
88 "Get the list of all file names"
94 "Get the list of all file labels"
100 "Get the number of specified files"
104 "get_split_by_sample",
106 "Get whether or not the user has set the 'split by sample' (-s) option"
112 "Get whether or not the user specified the 'plot ratios' (-r) option"
118 "Get wheter or not the user has specified the 'draw grid' (-g) option"
124 "Get the StyleManager associated with this PlottingManager"
130 "Get the InputManager associated with this PlottingManager"
138 py::class_<MaCh3Plotting::InputManager>(m_plotting,
"InputManager")
142 "Print a summary of everything this manager knows"
148 "Get the LLH scan for a particular parameter from a particular file",
149 py::arg(
"input_file_id"),
150 py::arg(
"param_name"),
151 py::arg(
"LLH_type") =
"total"
155 "get_llh_scan_by_sample",
157 "Get the LLH scan for a particular parameter from a particular file for a particular sample",
158 py::arg(
"input_file_id"),
166 "Get whether a particular file has LLH scans for a particular parameter",
167 py::arg(
"input_file_id"),
169 py::arg(
"LLH_type") =
"total"
173 "get_enabled_llh_by_sample",
175 "Get whether a particular file has LLH scans for a particular parameter for a particular sample",
176 py::arg(
"input_file_id"),
182 "get_post_fit_error",
184 "Get the post fit error for a parameter from a particular file",
185 py::arg(
"input_file_id"),
187 py::arg(
"error_type") =
""
191 "get_post_fit_value",
193 "Get the post fit value for a parameter from a particular file",
194 py::arg(
"input_file_id"),
196 py::arg(
"error_type") =
""
200 "get_known_parameters",
202 "Get all the parameters that this manager knows about. Useful for iterating over"
208 "Get all the samples that this manager knows about. Useful for iterating over"
212 "get_tagged_parameters",
214 "Get all the parameters whose tags match some specified list",
216 py::arg(
"check_type") =
"all"
220 "get_tagged_samples",
222 "Get all the samples whose tags match some specified list",
224 py::arg(
"check_type") =
"all"
230 "Get the number of input files registered with this manager"
234 "get_known_llh_parameters",
236 "Get all the parameters that a file has LLH scans for",
241 "get_known_llh_samples",
243 "Get all the samples that a file has individual LLH scans for",
248 "get_known_post_fit_parameters",
250 "Get all the parameters that a file has post fit values and errors for",
255 "get_known_MCMC_parameters",
257 "Get all the parameters that a file has MCMC chain entries for",
262 "get_known_1d_posterior_parameters",
264 "Get all the parameters that a file has processed 1d posteriors for",
271 "Load up a particular step in the MCMC chain for a particular input file",
279 "Get the value of a particular parameter for the current entry (set by set_MCMC_entry) in the chain for a particular file",
285 "get_n_MCMC_entries",
287 "Get the number of entries in the MCMC chain in a particular file"
293 "Get the 1d posterior for a particular parameter from a particular file",
300 py::class_<MaCh3Plotting::StyleManager>(m_plotting,
"StyleManager")
302 "prettify_parameter_name",
304 "Convert internally used parameter name to a nice pretty name that can be used in plots",
309 "prettify_sample_name",
311 "Convert internally used sample name to a nice pretty name that can be used in plots",
const std::string getOutputName()
Get the straight up output file name with no bells or whistles, just the file extension.
void initialise()
initalise this PlottingManager.
void parseInputsVec(std::vector< std::string > argv)
Parse vector of command line arguments.
void setExec(std::string execName)
Internally set the name of the executable that manager is being used in.
const std::vector< std::string > getFileNames()
void usage()
Print a usage message for the current executable.
const std::string getFileName(int i)
const std::vector< std::string > getFileLabels()
const std::string getDrawOptions()
const std::string getFileLabel(int i)
const StyleManager & style()
Get the StyleManager contained within this PlottingManager, for doing style related things.
const InputManager & input()
Get the InputManager contained within this PlottingManager, for doing input related things.
std::string prettifyParamName(const std::string &origName) const
Convert hideous and vulgar internal parameter name into a beautiful presentable name.
void initPlotting(py::module &m)