1 #ifndef Analysis_Tools_plotscomp_config_h_ 2 #define Analysis_Tools_plotscomp_config_h_ 4 #include "boost/program_options.hpp" 5 #include "boost/algorithm/string.hpp" 51 namespace po = boost::program_options;
52 po::options_description desc(
"Options");
54 (
"help,h" ,
"Show help messages")
55 (
"bkg,b" ,
"Run in the background")
56 (
"logx" ,
"x-axis in log scale")
57 (
"logy" ,
"y-axis in log scale")
58 (
"files" , po::value<std::vector<std::string> >(&
files_)->multitoken(),
"list of files")
59 (
"histos" , po::value<std::vector<std::string> >(&
histos_)->multitoken(),
"list of histograms")
60 (
"titles" , po::value<std::vector<std::string> >(&
titles_)->multitoken(),
"titles of histograms")
61 (
"title,t" , po::value <std::string> (&
title_) -> default_value(
"") ,
"Title of the histogram")
62 (
"legend1" , po::value <std::string> (&
legend1_)-> default_value(
"histo 1") ,
"Legend of the histogram 1")
63 (
"legend2" , po::value <std::string> (&
legend2_)-> default_value(
"histo 2") ,
"Legend of the histogram 2")
64 (
"scale,s" , po::value <float> (&
scale_) -> default_value(1) ,
"Scale factor for the 2nd histogram")
65 (
"min" , po::value <float> (&
min_) -> default_value(-1) ,
"Min value histogram range")
66 (
"max" , po::value <float> (&
max_) -> default_value(-2) ,
"Max value histogram range")
67 (
"file,f" , po::value <std::string> (&
file_) -> default_value(
"") ,
"File with up to 2 histograms to compare")
68 (
"hist1" , po::value <std::string> (&
hist1_ ) -> default_value(
"") ,
"1st histogram name in file")
69 (
"hist2" , po::value <std::string> (&
hist2_ ) -> default_value(
"") ,
"2nd histogram name in file")
70 (
"hist,h" , po::value <std::string> (&
hist_) -> default_value(
"") ,
"Histogram name common to the different files")
71 (
"file1" , po::value <std::string> (&
file1_) -> default_value(
"") ,
"1st file with 1 histogram to compare")
72 (
"file2" , po::value <std::string> (&
file2_) -> default_value(
"") ,
"2nd file with 1 histogram to compare")
73 (
"output" , po::value <std::string> (&
outplot_)-> default_value(
"") ,
"name of the output plot");
85 po::store(po::parse_command_line(argc, argv, desc), vm);
88 if ( vm.count(
"help") )
90 std::cout <<
"PlotsCompare macro" << std::endl
95 if ( vm.count(
"logx") )
logx_ =
true;
96 if ( vm.count(
"logy") )
logy_ =
true;
97 if ( vm.count(
"bkg") )
app_ =
false;
111 std::cerr <<
"ERROR: " << e.what() << std::endl << std::endl;
112 std::cerr << desc << std::endl;
117 catch(std::exception& e)
119 std::cerr <<
"ERROR: " << e.what() << std::endl << std::endl;
std::vector< std::string > titles_
std::vector< std::string > histos_
int plotscomp_config(int argc, char *argv[])
std::vector< std::string > files_