1 #ifndef tvx_ProgramOptions_h
2 #define tvx_ProgramOptions_h
7 #include <boost/program_options/options_description.hpp>
8 #include <boost/program_options/variables_map.hpp>
9 #include <boost/program_options/parsers.hpp>
15 namespace po = boost::program_options;
72 os << boost::any_cast<T>(any_value);
74 }
catch(boost:: bad_any_cast& e) {
79 std::ostream&
operator<<(std::ostream& os,
const boost::any& any_value);
void Print() const
Prints the options and their values.
float fSparsity
An approximate fraction of events to read and process.
std::string fInFilePath
Full path to either a root file with event tree or a text file with a list of such root files...
unsigned int fMaxEventsUser
The maximum number of input events to process.
bool SaveGraphics() const
po::variables_map fOptionsValues
Processes and controls user options provided in the command line.
std::string GetOutPrefix() const
void ProcessOptions()
Takes the standard command line arguments and parses them with the boost program_options utility...
bool fSaveGraphics
This flag controls whether to produce images for created histograms.
unsigned int GetMaxEventsUser() const
std::string PathToInputFile() const
ProgramOptions(int argc, char **argv)
bool out_to_stream(std::ostream &os, const boost::any &any_value)
A helper function to print values of boost's any type.
po::options_description fOptions
std::string fOutPrefix
A prefix to specify the location of the output files.
std::string GetOutFileName(std::string suffix="hist") const
Form the name of the output file from the input file name by appending a suffix to it...
std::ostream & operator<<(std::ostream &os, const boost::any &any_value)
float GetSparsity() const
void VerifyOptions()
Verifies user submitted values.