17 #include <boost/program_options.hpp>
20 using boost::program_options::bool_switch;
23 auto opt = desc.add_options();
24 opt(
"gen-vertex-xy-std-mm", value<double>()->default_value(0.0),
25 "Transverse vertex standard deviation in mm");
26 opt(
"gen-vertex-z-std-mm", value<double>()->default_value(0.0),
27 "Longitudinal vertex standard deviation in mm");
28 opt(
"gen-vertex-t-std-ns", value<double>()->default_value(0.0),
29 "Temporal vertex standard deviation in ns");
31 value<Interval>()->value_name(
"MIN:MAX")->default_value({-180.0, 180.0}),
32 "Transverse direction angle generation range in degree");
34 value<Interval>()->value_name(
"MIN:MAX")->default_value({-4.0, 4.0}),
35 "Pseudo-rapidity generation range");
36 opt(
"gen-eta-uniform", bool_switch(),
37 "Sample eta directly and not cos(theta).");
39 value<Interval>()->value_name(
"MIN:MAX")->default_value({1.0, 10.0}),
40 "Absolute (or transverse) momentum generation range in GeV");
41 opt(
"gen-mom-transverse", bool_switch(),
42 "Momentum referse to transverse momentum");
44 "PDG number of the particle, will be adjusted for charge flip.");
45 opt(
"gen-randomize-charge", bool_switch(),
46 "Flip the charge and change the PDG number accordingly.");
47 opt(
"gen-nparticles", value<size_t>()->default_value(1
u),
48 "Number of generated particles per vertex");
49 opt(
"gen-nvertices", value<size_t>()->default_value(1
u),
50 "Number of generated vertices");
55 using namespace Acts::UnitLiterals;
58 auto getValue = [&](
const char*
name,
auto unit) {
59 return vars[
name].as<
double>() * unit;
61 auto getRange = [&](
const char*
name,
auto unit,
auto&
lower,
auto&
upper) {
67 auto vertexGen = std::make_shared<GaussianVertexGenerator>();
68 vertexGen->stddev[
Acts::ePos0] = getValue(
"gen-vertex-xy-std-mm", 1_mm);
69 vertexGen->stddev[
Acts::ePos1] = getValue(
"gen-vertex-xy-std-mm", 1_mm);
70 vertexGen->stddev[
Acts::ePos2] = getValue(
"gen-vertex-z-std-mm", 1_mm);
71 vertexGen->stddev[
Acts::eTime] = getValue(
"gen-vertex-t-std-ns", 1_ns);
74 getRange(
"gen-phi-degree", 1_degree, pgCfg.phiMin, pgCfg.phiMax);
76 double etaMin = 0, etaMax = 0;
77 getRange(
"gen-eta", 1.0, etaMin, etaMax);
79 pgCfg.etaUniform = vars[
"gen-eta-uniform"].template as<bool>();
80 pgCfg.thetaMin = 2 * std::atan(std::exp(-etaMin));
81 pgCfg.thetaMax = 2 * std::atan(std::exp(-etaMax));
82 getRange(
"gen-mom-gev", 1_GeV, pgCfg.pMin, pgCfg.pMax);
83 pgCfg.pTransverse = vars[
"gen-mom-transverse"].template as<bool>();
86 pgCfg.randomizeCharge = vars[
"gen-randomize-charge"].template as<bool>();
87 pgCfg.numParticles = vars[
"gen-nparticles"].as<
size_t>();
90 throw std::runtime_error{
91 "Too many particles per vertex requested for Fatras Barcode"};
94 size_t nVertices = vars[
"gen-nvertices"].as<
size_t>();
97 throw std::runtime_error{
"Too many vertices requested for Fatras Barcode"};
100 auto mGen = std::make_shared<FixedMultiplicityGenerator>();
106 std::make_shared<ParametricParticleGenerator>(pgCfg)},