36 std::string translationConfig = managerOptions[
"translationConfig"].as<std::string>();
37 if (translationConfig ==
"")
40 MACH3LOG_DEBUG(
"PlottingManager: Using default translation config file name");
43 MACH3LOG_DEBUG(
"PlottingManager: Using translation config file: {}", translationConfig);
45 std::string styleConfig = managerOptions[
"styleConfig"].as<std::string>();
46 if (styleConfig ==
"")
49 MACH3LOG_DEBUG(
"PlottingManager: Using default style config file name");
52 MACH3LOG_DEBUG(
"PlottingManager: Using style config file: {}", styleConfig);
55 _styleMan = std::make_unique<StyleManager>(styleConfig);
58 _inputMan = std::make_unique<InputManager>(translationConfig);
95 while ((c = getopt(argc, argv,
"o:l:d:c:srgh")) != -1)
141 for (; optind < argc; optind++)
153 MACH3LOG_ERROR(
"you specified -r <_plotRatios> = true but didnt specify any files to compare against, was this a mistake?");
158 MACH3LOG_INFO(
"No file labels specified, will just use the file names");
198 if (saveName.find(
".") == std::string::npos)
204 std::string ext = saveName;
206 while (ext.find(
".") != std::string::npos)
207 ext.erase(0, ext.find(
".") + 1);
208 if (ext ==
"pdf" || ext ==
"ps" || ext ==
"eps")
214 MACH3LOG_WARN(
"file extension '{}' that you provided doesnt support multiple plots in one file", ext);
215 MACH3LOG_WARN(
"should be one of .pdf, .eps .ps, will use pdf");
228 while (ext.find(
".") != std::string::npos)
230 dotPos += ext.find(
".");
231 ext.erase(0, ext.find(
".") + 1);
234 name.erase(dotPos, ext.size() + 1);
235 return name + suffix +
"." + ext;
251 size_t end = labelString.find(
";");
252 while (end != std::string::npos)
254 labelVec.push_back(labelString.substr(0, end));
255 labelString.erase(labelString.begin(), labelString.begin() + end + 1);
256 end = labelString.find(
";");
258 labelVec.push_back(labelString.substr(0, end));
#define M3OpenConfig(filename)
Macro to simplify calling LoadYaml with file and line info.
Custom exception class for MaCh3 errors.
const std::string getOutputName()
Get the straight up output file name with no bells or whistles, just the file extension.
const std::string DEFAULT_PLOTTING_CONFIG
void initialise()
initalise this PlottingManager.
const std::string DEFAULT_STYLE_CONFIG
std::string _configFileName
std::vector< std::string > _defaultFileLabels
void setExec(std::string execName)
Internally set the name of the executable that manager is being used in.
std::vector< std::string > _fileLabels
const std::string DEFAULT_TRANSLATION_CONFIG
std::vector< std::string > _fileNames
std::unique_ptr< InputManager > _inputMan
void parseInputs(int argc, char *const *argv)
Parse command line arguments.
void usage()
Print a usage message for the current executable.
std::string _extraDrawOptions
PlottingManager()
Construct a new PlottingManager using default plottingConfig config.
YAML::Node _plottingConfig
void parseFileLabels(std::string labelString, std::vector< std::string > &labelVec)
Parse string of labels into a vector of strings.
void setOutFileName(std::string fileName)
Parse and set the output file name, if extension specified, check its one root supports,...
std::unique_ptr< StyleManager > _styleMan
void addUserOption()
Describe an option you want to add to the PlottingManager which can be read in from the command line ...
std::string getUserOption(std::string option)
Retrieve a command line option you specified using addOption.