9#include <boost/program_options.hpp>
13namespace po = boost::program_options;
25 po::options_description
generic(
" Generic options");
26 auto generic_add =
generic.add_options();
27 generic_add(
"help,h",
"display this help and exit");
30 po::options_description config_req(
" Configuration (required)");
31 auto config_req_add = config_req.add_options();
32 config_req_add(
"input,i", po::value<string>(&
fsChanHistosIn)->required()->value_name(
"<protocol://xxxxxx>"),
33 "name or host:port or whatever is needed for input channel (histos/canvases config and data), "
34 "cf http://api.zeromq.org/2-1:zmq-bind");
37 po::options_description config(
" Configuration (optional or with default)");
38 auto config_add = config.add_options();
39 config_add(
"highwater,hwm", po::value<int32_t>(&
fiHistosInZmqHwm)->default_value(1),
40 "ZMQ input channel high-water mark in messages: 0 = no buffering, val = nb updates kept in buffer \n"
41 "Tune to match nb of update emitters but also to avoid extrem memory usage!");
43 "ZMQ input channel timeout in ms: -1 = block (term. handling!), 0 = instant (CPU load!), val = nb ms");
44 config_add(
"port,p", po::value<uint32_t>(&
fuHttpServerPort)->default_value(8080),
45 "port on which the http ROOT server (JSroot) will be available (mind default value!)");
46 config_add(
"output,o", po::value<string>(&
fsHistoFileName)->value_name(
"<file name>"),
47 "name of the output ROOT file with histograms backup");
48 config_add(
"overwrite,w", po::bool_switch(&
fOverwrite)->default_value(
false),
49 "allow to overwite an existing output file");
50 config_add(
"hideguicmds", po::bool_switch(&
fHideGuiCommands)->default_value(
false),
51 "allow to hides (disable) the GUI commands for Reset/Save/Close");
52#ifdef BOOST_IOS_HAS_ZSTD
53 config_add(
"compressed,c", po::bool_switch(&
fCompressedInput)->default_value(
false),
54 "enables ZSTD decompression of the input stream (compression needed in source!)");
58 po::options_description cmdline_options(
"Allowed options");
59 cmdline_options.add(generic).add(config_req).add(config);
62 po::variables_map vars;
63 po::store(po::parse_command_line(argc, argv, cmdline_options), vars);
66 if (vars.count(
"help") != 0u) {
67 std::cout << cmdline_options << std::endl;
int32_t fiHistosInZmqHwm
High-Water Mark, default keep only 1 update in buffer.
std::string fsChanHistosIn
bool fOverwrite
Enable overwriting of existing output file.
uint32_t fuHttpServerPort
HTTP port of the ROOT web server.
bool fCompressedInput
Enables ZSTD stream decompression is available.
int32_t fiHistosInZmqRcvToMs
Timeout in ms: -1 = block, 0 = instant, val = nb ms.
bool fHideGuiCommands
Hides (disables) the GUI commands for Reset/Save/Close.
std::string fsHistoFileName
Output file name (ROOT format)
void ParseOptions(int argc, char *argv[])
Get configuration file name (YAML format)