ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Pythia8Options.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Pythia8Options.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
11 #include <boost/program_options.hpp>
12 
17 #include "Acts/Utilities/Units.hpp"
18 
20  boost::program_options::options_description& opt) {
21  using namespace boost::program_options;
22 
23  opt.add_options()("evg-cms-energy", value<double>()->default_value(14000.),
24  "Center-of-mass energy collision in GeV")(
25  "evg-beam0", value<int32_t>()->default_value(Acts::PdgParticle::eProton),
26  "PDG number of the first beam particle")(
27  "evg-beam1", value<int32_t>()->default_value(Acts::PdgParticle::eProton),
28  "PDG number of the second beam particle")(
29  "evg-hard-process",
30  value<std::string>()->default_value("HardQCD:all = on"),
31  "Pythia8 process string for the hard scatter")(
32  "evg-pileup-process",
33  value<std::string>()->default_value("SoftQCD:all = on"),
34  "Pythi8 process string for the pile-up")(
35  "evg-pileup", value<size_t>()->default_value(200),
36  "Number of instantaneous pile-up events")(
37  "evg-vertex-xy-std", value<double>()->default_value(0.015),
38  "Transverse vertex standard deviation in mm")(
39  "evg-vertex-z-std", value<double>()->default_value(55.5),
40  "Longitudinal vertex standard deviation in mm")(
41  "evg-vertex-t-std", value<double>()->default_value(0.08),
42  "Temporal vertex standard deviation in ns")(
43  "evg-shuffle", bool_switch(), "Randomnly shuffle the vertex order.");
44 }
45 
47  const boost::program_options::variables_map& vm, Acts::Logging::Level lvl) {
49  hard.pdgBeam0 = static_cast<Acts::PdgParticle>(vm["evg-beam0"].as<int32_t>());
50  hard.pdgBeam1 = static_cast<Acts::PdgParticle>(vm["evg-beam1"].as<int32_t>());
51  hard.cmsEnergy = vm["evg-cms-energy"].as<double>();
52  hard.settings = {vm["evg-hard-process"].as<std::string>()};
53 
55  pileup.pdgBeam0 =
56  static_cast<Acts::PdgParticle>(vm["evg-beam0"].as<int32_t>());
57  pileup.pdgBeam1 =
58  static_cast<Acts::PdgParticle>(vm["evg-beam1"].as<int32_t>());
59  pileup.cmsEnergy = vm["evg-cms-energy"].as<double>();
60  pileup.settings = {vm["evg-pileup-process"].as<std::string>()};
61 
62  auto mu = vm["evg-pileup"].as<size_t>();
63  auto vtxStdXY =
64  vm["evg-vertex-xy-std"].as<double>() * Acts::UnitConstants::mm;
65  auto vtxStdZ = vm["evg-vertex-z-std"].as<double>() * Acts::UnitConstants::mm;
66  auto vtxStdT = vm["evg-vertex-t-std"].as<double>() * Acts::UnitConstants::ns;
67 
69  cfg.generators = {
71  GaussianVertexGenerator{{vtxStdXY, vtxStdXY, vtxStdZ, vtxStdT}},
72  Pythia8Generator::makeFunction(hard, lvl)},
74  GaussianVertexGenerator{{vtxStdXY, vtxStdXY, vtxStdZ, vtxStdT}},
75  Pythia8Generator::makeFunction(pileup, lvl)},
76  };
77  cfg.shuffle = vm["evg-shuffle"].as<bool>();
78 
79  return cfg;
80 }