1 #ifndef DOXYGEN_SHOULD_SKIP_THIS
18 goptions.defineSwitch(
"log",
"a switch, this is just an example.");
21 help =
"Example: -runno=12\n";
25 help =
"If not set, use all available threads. 0: use all threads\n";
26 help =
"Example: -nthreads=12\n";
29 vector <GVariable> gparticle = {
31 {
"multiplicity", 1,
"number of particles per event"},
33 {
"theta",
"0*degrees",
"polar angle"},
34 {
"delta_theta", 0,
"Particle polar angle range, centered on theta. Default: 0"},
38 help =
"Example to add three particles, one electron and two protons, identical except spread in theta: \n \n";
39 help +=
"-gparticle=\"[{pname: e-, multiplicity: 1, p: 2300, theta: 23.0}, {pname: proton, multiplicity: 2, p: 1200, theta: 14.0, delta_theta: 10}]\"\n";
40 goptions.defineOption(
"gparticle",
"define the generator particle(s)", gparticle, help);
46 int main(
int argc,
char *argv[]) {
50 cout <<
" > Nthreads: " << gopts->
getScalarInt(
"nthreads") << endl;
The GOptions class manages command-line options and switches.
int getScalarInt(const string &tag) const
Retrieves the value of a scalar integer option.
Encapsulates a variable with a name, value, and description.