travex
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tvx::ProgramOptions Class Reference

Processes and controls user options provided in the command line. More...

#include <ProgramOptions.h>

Public Member Functions

 ProgramOptions (int argc, char **argv)
 
std::string PathToInputFile () const
 
unsigned int GetMaxEventsUser () const
 
float GetSparsity () const
 
bool SaveGraphics () const
 
std::string GetOutPrefix () const
 
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. More...
 
void ProcessOptions ()
 Takes the standard command line arguments and parses them with the boost program_options utility. More...
 
void Print () const
 Prints the options and their values. More...
 

Protected Member Functions

void VerifyOptions ()
 Verifies user submitted values. More...
 

Protected Attributes

int fArgc
 
char ** fArgv
 
po::options_description fOptions
 
po::variables_map fOptionsValues
 
std::string fInFilePath
 Full path to either a root file with event tree or a text file with a list of such root files. More...
 
std::string fOutPrefix
 A prefix to specify the location of the output files. More...
 
unsigned int fMaxEventsUser
 The maximum number of input events to process. More...
 
float fSparsity
 An approximate fraction of events to read and process. More...
 
bool fSaveGraphics
 This flag controls whether to produce images for created histograms. More...
 

Detailed Description

Processes and controls user options provided in the command line.

Definition at line 21 of file ProgramOptions.h.

Constructor & Destructor Documentation

ProgramOptions::ProgramOptions ( int  argc,
char **  argv 
)

Definition at line 14 of file ProgramOptions.cxx.

Member Function Documentation

unsigned int tvx::ProgramOptions::GetMaxEventsUser ( ) const
inline

Definition at line 28 of file ProgramOptions.h.

std::string ProgramOptions::GetOutFileName ( std::string  suffix = "hist") const

Form the name of the output file from the input file name by appending a suffix to it.

The following rules applied depending on the input file extension:

input_file_name -> input_file_name.<suffix>.root input_file_name.blah -> input_file_name.blah.<suffix>.root input_file_name.root -> input_file_name.<suffix>.root

Definition at line 114 of file ProgramOptions.cxx.

std::string tvx::ProgramOptions::GetOutPrefix ( ) const
inline

Definition at line 31 of file ProgramOptions.h.

float tvx::ProgramOptions::GetSparsity ( ) const
inline

Definition at line 29 of file ProgramOptions.h.

std::string tvx::ProgramOptions::PathToInputFile ( ) const
inline

Definition at line 27 of file ProgramOptions.h.

void ProgramOptions::Print ( ) const

Prints the options and their values.

Definition at line 57 of file ProgramOptions.cxx.

void ProgramOptions::ProcessOptions ( )

Takes the standard command line arguments and parses them with the boost program_options utility.

Additional checks are implemented to verify the validity of the supplied arguments.

Definition at line 41 of file ProgramOptions.cxx.

bool tvx::ProgramOptions::SaveGraphics ( ) const
inline

Definition at line 30 of file ProgramOptions.h.

void ProgramOptions::VerifyOptions ( )
protected

Verifies user submitted values.

Performs basic test of values provided by the user in the command line to maker sure that they are valid.

Definition at line 72 of file ProgramOptions.cxx.

Member Data Documentation

int tvx::ProgramOptions::fArgc
protected

Definition at line 42 of file ProgramOptions.h.

char** tvx::ProgramOptions::fArgv
protected

Definition at line 43 of file ProgramOptions.h.

std::string tvx::ProgramOptions::fInFilePath
protected

Full path to either a root file with event tree or a text file with a list of such root files.

Definition at line 49 of file ProgramOptions.h.

unsigned int tvx::ProgramOptions::fMaxEventsUser
protected

The maximum number of input events to process.

Definition at line 55 of file ProgramOptions.h.

po::options_description tvx::ProgramOptions::fOptions
protected

Definition at line 44 of file ProgramOptions.h.

po::variables_map tvx::ProgramOptions::fOptionsValues
protected

Definition at line 45 of file ProgramOptions.h.

std::string tvx::ProgramOptions::fOutPrefix
protected

A prefix to specify the location of the output files.

Definition at line 52 of file ProgramOptions.h.

bool tvx::ProgramOptions::fSaveGraphics
protected

This flag controls whether to produce images for created histograms.

Definition at line 61 of file ProgramOptions.h.

float tvx::ProgramOptions::fSparsity
protected

An approximate fraction of events to read and process.

Definition at line 58 of file ProgramOptions.h.


The documentation for this class was generated from the following files: