Commandline.hh

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_COMMANDLINE_HH 
00003 #define RIVET_COMMANDLINE_HH 1
00004 
00005 #include "Rivet/Rivet.hh"
00006 #include "Rivet/HistoFormat.hh"
00007 #include "Rivet/AnalysisLoader.hh"
00008 #include "Rivet/Tools/Logging.hh"
00009 #include <tclap/CmdLine.h>
00010 
00011 
00012 namespace Rivet {
00013 
00014   class Analysis;
00015 
00016 
00017   namespace Commandline {
00018     /// @author Andy Buckley
00019     /// @date   2007-02-08
00020 
00021 
00022     /// Add command line parsing of analyses and their negations.
00023     void addAnalysisArgs(TCLAP::CmdLine& cmd,
00024                          TCLAP::MultiArg<string>*& analysesArg,
00025                          TCLAP::SwitchArg*& analysesAllArg,
00026                          TCLAP::ValuesConstraint<string>*& anaNameConstraint);
00027 
00028     /// Add command line parsing of histogram file and format specifications.
00029     void addHistoArgs(TCLAP::CmdLine& cmd,
00030                       TCLAP::ValueArg<string>*& histoNameArg,
00031                       TCLAP::ValueArg<string>*& histoTypeArg,
00032                       TCLAP::ValuesConstraint<string>*& histoTypeConstraint);
00033 
00034     /// Add command line options to control the logging system.
00035     void addLoggingArgs(TCLAP::CmdLine& cmd, 
00036                         TCLAP::MultiArg<string>*& logsArg);
00037     
00038     /// Set the Rivet analysis components of the Configuration object based on
00039     /// the command line arguments.  Be careful - this function deletes the
00040     /// argument objects.
00041     void useAnalysisArgs(TCLAP::CmdLine& cmd,
00042                          TCLAP::MultiArg<string>* analysesArg,
00043                          TCLAP::SwitchArg* analysesAllArg,
00044                          set<string>& cfgAnalyses);
00045 
00046     /// Set the histogramming components of the Configuration object based on
00047     /// the command line arguments.  Be careful - this function deletes the
00048     /// argument objects.
00049     void useHistoArgs(TCLAP::CmdLine& cmd,
00050                       TCLAP::ValueArg<string>* histoNameArg,
00051                       TCLAP::ValueArg<string>* histoTypeArg,
00052                       string& cfgHistoFileName,
00053                       HistoFormat& cfgHistoFormat);
00054 
00055     /// Set the logging components of the Configuration object based on the
00056     /// command line arguments.  Be careful - this function deletes the argument
00057     /// object.
00058     void useLoggingArgs(TCLAP::CmdLine& cmd,
00059                         TCLAP::MultiArg<string>* logsArg,
00060                         Log::LevelMap& cfgLogLevels);
00061 
00062   }  
00063 }
00064 
00065 #endif