15 #include <boost/program_options.hpp>
19 using boost::program_options::bool_switch;
22 auto opt = desc.add_options();
23 opt(
"g4-rnd-seed1", value<unsigned int>()->default_value(287362910),
24 "The first seed of the G4 random number generation");
25 opt(
"g4-rnd-seed2", value<unsigned int>()->default_value(730284537),
26 "The second seed of the G4 random number generation");
27 opt(
"g4-pg-nparticles", value<unsigned int>()->default_value(100),
28 "The number of particles produced by the g4 particle gun");
29 opt(
"g4-material-tracks",
30 value<std::string>()->default_value(
"geant4-material-tracks"),
31 "The output collection for material tracks");
32 opt(
"g4-vertex-posX", value<double>()->default_value(0.0),
33 "The X position of the geantino vertex");
34 opt(
"g4-vertex-posY", value<double>()->default_value(0.0),
35 "The Y position of the geantino vertex");
36 opt(
"g4-vertex-posZ", value<double>()->default_value(0.0),
37 "The Z position of the geantino vertex");
38 opt(
"g4-vertex-sigmaX", value<double>()->default_value(0.0),
39 "The X spread of the geantino vertex");
40 opt(
"g4-vertex-sigmaY", value<double>()->default_value(0.0),
41 "The Y spread of the geantino vertex");
42 opt(
"g4-vertex-sigmaZ", value<double>()->default_value(0.0),
43 "The Z spread of the geantino vertex");
45 value<read_range>()->multitoken()->default_value({-
M_PI,
M_PI}),
46 "Azimutal angle phi range for the geantino");
48 value<read_range>()->multitoken()->default_value({-5., 5.}),
49 "Pseudorapidity eta range for the geantino");
50 opt(
"g4-sampling-variable", value<std::string>()->default_value(
"theta"),
51 "Variable from which the particle generation is uniform. Can be theta "
60 gRecConfig.
tracksPerEvent = variables[
"g4-pg-nparticles"].as<
unsigned int>();
62 variables[
"g4-rnd-seed1"].as<
unsigned int>();
64 variables[
"g4-rnd-seed2"].as<
unsigned int>();
66 variables[
"g4-material-tracks"].as<std::string>();
69 variables[
"g4-vertex-posX"].as<
double>();
71 variables[
"g4-vertex-posY"].as<
double>();
73 variables[
"g4-vertex-posZ"].as<
double>();
75 variables[
"g4-vertex-sigmaX"].as<
double>();
77 variables[
"g4-vertex-sigmaY"].as<
double>();
79 variables[
"g4-vertex-sigmaZ"].as<
double>();
81 read_range iphir = variables[
"g4-phi-range"].template as<read_range>();
82 read_range ietar = variables[
"g4-eta-range"].template as<read_range>();
88 variables[
"g4-sampling-variable"].as<std::string>();