| 
    GammaCombo
    Rev:Unversioneddirectory
    
   | 
 
#include <OptParser.h>
Public Member Functions | |
| void | bookAllOptions () | 
| Book all available options, if you are lazy.  More... | |
| void | bookFlowcontrolOptions () | 
| Book options associated to the flow control.  More... | |
| void | bookOption (TString opt) | 
| Book the given option.  More... | |
| void | bookPlottingOptions () | 
| Book options associated to plotting.  More... | |
| void | bookPluginOptions () | 
| Book options associated to the Plugin method and the Berger-Boos method (batch job handling, control plots).  More... | |
| void | bookProbOptions () | 
| Book options associated to the Prob method.  More... | |
| bool | isAction (TString s) | 
| Check the –action argument.  More... | |
| bool | isAsimovCombiner (int id) | 
| Check if a combiner with a given ID is an Asimov combiner.  More... | |
| bool | isQuickhack (int id) | 
| Check the –quickhack argument.  More... | |
| OptParser () | |
| Organize command line options.  More... | |
| void | parseArguments (int argc, char *argv[]) | 
| Parse the command line for booked options.  More... | |
| ~OptParser () | |
Private Member Functions | |
| int | convertToDigitWithCheck (TString parseMe, TString usage) | 
| Helper function for parseCombinerString().  More... | |
| int | convertToIntWithCheck (TString parseMe, TString usage) | 
| Helper function for parseCombinerString().  More... | |
| void | defineOptions () | 
| Define the names of all available command line options.  More... | |
| bool | parseAssignment (TString parseMe, TString &name, TString &value) | 
| Parse a variable assignment string.  More... | |
| bool | parseAssignment (TString parseMe, TString &name, float &value) | 
| Parse a variable assignment string.  More... | |
| void | parseCombinerString (TString parseMe, int &resultCmbId, vector< int > &resultAddDelPdf) | 
| Parse -c string (combiner ID with add/del PDF modification requests).  More... | |
| void | parsePosition (TString parseMe, float &x, float &y, TString usage) | 
| Parse the position arguments, which define the position of the legend and logo in the plots.  More... | |
| void | parsePositionAndScale (TString parseMe, Double_t &x, Double_t &y, Double_t &scale, TString usage) | 
| bool | parseRange (TString parseMe, float &min, float &max) | 
| Parse the range arguments.  More... | |
Private Attributes | |
| vector< TString > | availableOptions | 
| vector< TString > | bookedOptions | 
Definition at line 22 of file OptParser.h.
| OptParser::OptParser | ( | ) | 
Organize command line options.
The strategy is to have one object of this class present in the main program, which then gets passed down to all other objects. The command line options are made available through data members of this class. Options can be booked, either in blocks using the respective functions, or individually. Only booked options get parsed from the command line.
To add a new option,
Definition at line 18 of file OptParser.cpp.
| OptParser::~OptParser | ( | ) | 
| void OptParser::bookAllOptions | ( | ) | 
Book all available options, if you are lazy.
Definition at line 218 of file OptParser.cpp.
| void OptParser::bookFlowcontrolOptions | ( | ) | 
Book options associated to the flow control.
Definition at line 302 of file OptParser.cpp.
| void OptParser::bookOption | ( | TString | opt | ) | 
Book the given option.
Checks if it is available.
| opt | Book this option. | 
Definition at line 315 of file OptParser.cpp.
| void OptParser::bookPlottingOptions | ( | ) | 
Book options associated to plotting.
Definition at line 227 of file OptParser.cpp.
| void OptParser::bookPluginOptions | ( | ) | 
Book options associated to the Plugin method and the Berger-Boos method (batch job handling, control plots).
Definition at line 254 of file OptParser.cpp.
| void OptParser::bookProbOptions | ( | ) | 
Book options associated to the Prob method.
Definition at line 280 of file OptParser.cpp.
      
  | 
  private | 
Helper function for parseCombinerString().
Checks if a string is a digit (positive integer), if not, exits with printing the usage.
Definition at line 1350 of file OptParser.cpp.
      
  | 
  private | 
Helper function for parseCombinerString().
Checks if a string is an integer (pos or neg), if not, exits with printing the usage.
Definition at line 1336 of file OptParser.cpp.
      
  | 
  private | 
Define the names of all available command line options.
Other places of the code will check against this list.
Definition at line 118 of file OptParser.cpp.
| bool OptParser::isAction | ( | TString | s | ) | 
| bool OptParser::isAsimovCombiner | ( | int | id | ) | 
Check if a combiner with a given ID is an Asimov combiner.
The ID is the position of the -c argument on the command line.
| id | - position of -c argument | 
Definition at line 1419 of file OptParser.cpp.
| bool OptParser::isQuickhack | ( | int | id | ) | 
| void OptParser::parseArguments | ( | int | argc, | 
| char * | argv[] | ||
| ) | 
Parse the command line for booked options.
Then apply some post-processing and checks, where necessary. Save the parsed values into the datamembers. If an option was not given or not booked, it will assume the default value given here.
< can't assign directly because of TString cast
Definition at line 346 of file OptParser.cpp.
      
  | 
  private | 
Parse a variable assignment string.
| parseMe | Format: "foovar=3.14" | 
| name | return string | 
| value | return value | 
Definition at line 1306 of file OptParser.cpp.
      
  | 
  private | 
Parse a variable assignment string.
| parseMe | Format: "foovar=3.14" | 
| name | return string | 
| value | return value | 
Definition at line 1324 of file OptParser.cpp.
      
  | 
  private | 
Parse -c string (combiner ID with add/del PDF modification requests).
The string to parse looks sth like "combinerId:+pdfId1,-pdfId2" Examples: -c 26 -c 26:+12,+23 -c 26:+12,-3
| parseMe | - the string provided to -c | 
| resultCmbId | - resulting combiner ID | 
| resultAddDelPdf | - vector of all PDF IDs, that are requested to be added or deleted to/from the combiner. If it is supposed to be added, a positive PDF ID is stored, if it is supposed to be deleted, a negative PDF ID is stored | 
Definition at line 1374 of file OptParser.cpp.
      
  | 
  private | 
Parse the position arguments, which define the position of the legend and logo in the plots.
The position needs to be given as x:y, where x and y are floating point numbers between 0.0 and 1.0. To use the default position for either one, use "def".
| parseMe | - parse this string. Example formats: 0.1:0.5, .1:.5, def:0.6, .75:def | 
| x | - return value x | 
| y | - return value y | 
| usage | - string containing some usage information which is printed when there is an error. | 
Definition at line 1177 of file OptParser.cpp.
      
  | 
  private | 
Definition at line 1219 of file OptParser.cpp.
      
  | 
  private | 
Parse the range arguments.
| parseMe | Format: "min-max", e.g. "3.28:7.34" | 
| min | return value | 
| max | return value | 
Definition at line 1280 of file OptParser.cpp.
| vector<TString> OptParser::action | 
Definition at line 39 of file OptParser.h.
| vector<int> OptParser::asimov | 
Definition at line 40 of file OptParser.h.
| vector<TString> OptParser::asimovfile | 
Definition at line 41 of file OptParser.h.
      
  | 
  private | 
Definition at line 163 of file OptParser.h.
| bool OptParser::batcheos | 
Definition at line 77 of file OptParser.h.
| int OptParser::batchstartn | 
Definition at line 76 of file OptParser.h.
      
  | 
  private | 
Definition at line 164 of file OptParser.h.
| bool OptParser::cacheStartingValues | 
Definition at line 42 of file OptParser.h.
| vector<int> OptParser::cls | 
Definition at line 43 of file OptParser.h.
| CmdLine OptParser::cmd | 
Definition at line 151 of file OptParser.h.
| vector<int> OptParser::color | 
Definition at line 44 of file OptParser.h.
| vector<int> OptParser::combid | 
Definition at line 45 of file OptParser.h.
| vector<vector<int> > OptParser::combmodifications | 
Definition at line 46 of file OptParser.h.
| bool OptParser::confirmsols | 
Definition at line 47 of file OptParser.h.
| bool OptParser::controlplot | 
Definition at line 48 of file OptParser.h.
| int OptParser::coverageCorrectionID | 
Definition at line 49 of file OptParser.h.
| int OptParser::coverageCorrectionPoint | 
Definition at line 50 of file OptParser.h.
| bool OptParser::debug | 
Definition at line 51 of file OptParser.h.
| int OptParser::digits | 
Definition at line 52 of file OptParser.h.
| bool OptParser::enforcePhysRange | 
Definition at line 53 of file OptParser.h.
| TString OptParser::filenameaddition | 
Definition at line 56 of file OptParser.h.
| TString OptParser::filenamechange | 
Definition at line 55 of file OptParser.h.
| vector<int> OptParser::fillstyle | 
Definition at line 54 of file OptParser.h.
| vector<vector<FixPar> > OptParser::fixParameters | 
Definition at line 57 of file OptParser.h.
| TString OptParser::group | 
Definition at line 61 of file OptParser.h.
| TString OptParser::groupPos | 
Definition at line 62 of file OptParser.h.
| TString OptParser::hfagLabel | 
Definition at line 63 of file OptParser.h.
| TString OptParser::hfagLabelPos | 
Definition at line 64 of file OptParser.h.
| int OptParser::id | 
Definition at line 65 of file OptParser.h.
| bool OptParser::importance | 
Definition at line 66 of file OptParser.h.
| bool OptParser::info | 
Definition at line 67 of file OptParser.h.
| bool OptParser::interactive | 
Definition at line 68 of file OptParser.h.
| bool OptParser::intprob | 
Definition at line 120 of file OptParser.h.
| vector<int> OptParser::jmax | 
Definition at line 69 of file OptParser.h.
| vector<int> OptParser::jmin | 
Definition at line 70 of file OptParser.h.
| TString OptParser::jobdir | 
Definition at line 71 of file OptParser.h.
| bool OptParser::largest | 
Definition at line 72 of file OptParser.h.
| bool OptParser::latex | 
Definition at line 73 of file OptParser.h.
| bool OptParser::lightfiles | 
Definition at line 75 of file OptParser.h.
| vector<TString> OptParser::loadParamsFile | 
Definition at line 74 of file OptParser.h.
| int OptParser::nbatchjobs | 
Definition at line 78 of file OptParser.h.
| int OptParser::nBBpoints | 
Definition at line 79 of file OptParser.h.
| int OptParser::ncoveragetoys | 
Definition at line 87 of file OptParser.h.
| int OptParser::ndiv | 
Definition at line 80 of file OptParser.h.
| int OptParser::ndivy | 
Definition at line 81 of file OptParser.h.
| bool OptParser::nosyst | 
Definition at line 82 of file OptParser.h.
| int OptParser::npoints1d | 
Definition at line 83 of file OptParser.h.
| int OptParser::npoints2dx | 
Definition at line 84 of file OptParser.h.
| int OptParser::npoints2dy | 
Definition at line 85 of file OptParser.h.
| int OptParser::npointstoy | 
Definition at line 86 of file OptParser.h.
| int OptParser::nrun | 
Definition at line 88 of file OptParser.h.
| int OptParser::nsmooth | 
Definition at line 90 of file OptParser.h.
| int OptParser::ntoys | 
Definition at line 89 of file OptParser.h.
| bool OptParser::parevol | 
Definition at line 92 of file OptParser.h.
| TString OptParser::parsavefile | 
Definition at line 91 of file OptParser.h.
| vector<int> OptParser::pevid | 
Definition at line 93 of file OptParser.h.
| vector<vector<RangePar> > OptParser::physRanges | 
Definition at line 58 of file OptParser.h.
| vector<int> OptParser::plot2dcl | 
Definition at line 94 of file OptParser.h.
| TString OptParser::plotext | 
Definition at line 95 of file OptParser.h.
| float OptParser::plotgroupx | 
Definition at line 104 of file OptParser.h.
| float OptParser::plotgroupy | 
Definition at line 105 of file OptParser.h.
| Double_t OptParser::plotHFAGLabelPosX | 
Definition at line 106 of file OptParser.h.
| Double_t OptParser::plotHFAGLabelPosY | 
Definition at line 107 of file OptParser.h.
| Double_t OptParser::plotHFAGLabelScale | 
Definition at line 108 of file OptParser.h.
| int OptParser::plotid | 
Definition at line 96 of file OptParser.h.
| bool OptParser::plotlegend | 
Definition at line 98 of file OptParser.h.
| float OptParser::plotlegsizex | 
Definition at line 101 of file OptParser.h.
| float OptParser::plotlegsizey | 
Definition at line 102 of file OptParser.h.
| TString OptParser::plotlegstyle | 
Definition at line 103 of file OptParser.h.
| float OptParser::plotlegx | 
Definition at line 99 of file OptParser.h.
| float OptParser::plotlegy | 
Definition at line 100 of file OptParser.h.
| bool OptParser::plotlog | 
Definition at line 97 of file OptParser.h.
| bool OptParser::plotmagnetic | 
Definition at line 109 of file OptParser.h.
| int OptParser::plotnsigmacont | 
Definition at line 110 of file OptParser.h.
| bool OptParser::plotorigin | 
Definition at line 114 of file OptParser.h.
| bool OptParser::plotpluginonly | 
Definition at line 111 of file OptParser.h.
| bool OptParser::plotprelim | 
Definition at line 113 of file OptParser.h.
| bool OptParser::plotpulls | 
Definition at line 112 of file OptParser.h.
| vector<int> OptParser::plotsoln | 
Definition at line 116 of file OptParser.h.
| vector<int> OptParser::plotsolutions | 
Definition at line 115 of file OptParser.h.
| bool OptParser::plotunoff | 
Definition at line 117 of file OptParser.h.
| float OptParser::plotymax | 
Definition at line 119 of file OptParser.h.
| float OptParser::plotymin | 
Definition at line 118 of file OptParser.h.
| float OptParser::pluginPlotRangeMax | 
Definition at line 122 of file OptParser.h.
| float OptParser::pluginPlotRangeMin | 
Definition at line 121 of file OptParser.h.
| bool OptParser::printcor | 
Definition at line 126 of file OptParser.h.
| float OptParser::printSolX | 
Definition at line 127 of file OptParser.h.
| float OptParser::printSolY | 
Definition at line 128 of file OptParser.h.
| bool OptParser::probforce | 
Definition at line 123 of file OptParser.h.
| bool OptParser::probimprove | 
Definition at line 124 of file OptParser.h.
| TString OptParser::probScanResult | 
Definition at line 125 of file OptParser.h.
| vector<int> OptParser::qh | 
Definition at line 129 of file OptParser.h.
| TString OptParser::queue | 
Definition at line 130 of file OptParser.h.
| vector<vector<TString> > OptParser::randomizeToyVars | 
Definition at line 60 of file OptParser.h.
| vector<TString> OptParser::readfromfile | 
Definition at line 131 of file OptParser.h.
| vector<TString> OptParser::relation | 
Definition at line 132 of file OptParser.h.
| vector<vector<TString> > OptParser::removeRanges | 
Definition at line 59 of file OptParser.h.
| bool OptParser::runCLs | 
Definition at line 133 of file OptParser.h.
| TString OptParser::save | 
Definition at line 134 of file OptParser.h.
| bool OptParser::saveAtMin | 
Definition at line 135 of file OptParser.h.
| vector<float> OptParser::savenuisances1d | 
Definition at line 136 of file OptParser.h.
| vector<float> OptParser::savenuisances2dx | 
Definition at line 137 of file OptParser.h.
| vector<float> OptParser::savenuisances2dy | 
Definition at line 138 of file OptParser.h.
| bool OptParser::scanforce | 
Definition at line 139 of file OptParser.h.
| float OptParser::scanrangeMax | 
Definition at line 141 of file OptParser.h.
| float OptParser::scanrangeMin | 
Definition at line 140 of file OptParser.h.
| float OptParser::scanrangeyMax | 
Definition at line 143 of file OptParser.h.
| float OptParser::scanrangeyMin | 
Definition at line 142 of file OptParser.h.
| bool OptParser::smooth2d | 
Definition at line 144 of file OptParser.h.
| vector<TString> OptParser::title | 
Definition at line 145 of file OptParser.h.
| TString OptParser::toyFiles | 
Definition at line 146 of file OptParser.h.
| bool OptParser::usage | 
Definition at line 147 of file OptParser.h.
| vector<TString> OptParser::var | 
Definition at line 148 of file OptParser.h.
| bool OptParser::verbose | 
Definition at line 149 of file OptParser.h.
 1.8.12