File indexing completed on 2025-01-18 09:12:04
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Definitions/PdgParticle.hpp"
0010 #include "Acts/Plugins/Python/Utilities.hpp"
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "ActsExamples/Generators/EventGenerator.hpp"
0013 #include "ActsExamples/Generators/Pythia8ProcessGenerator.hpp"
0014 #include "ActsExamples/Utilities/Range.hpp"
0015
0016 #include <memory>
0017 #include <string>
0018 #include <unordered_map>
0019 #include <vector>
0020
0021 #include <pybind11/pybind11.h>
0022 #include <pybind11/stl.h>
0023
0024 namespace py = pybind11;
0025 using namespace ActsExamples;
0026
0027 namespace Acts::Python {
0028 void addPythia8(Context& ctx) {
0029 auto mex = ctx.get("examples");
0030
0031 auto p8 = mex.def_submodule("pythia8");
0032 ctx.modules["pythia8"] = p8;
0033
0034 using Gen = ActsExamples::Pythia8Generator;
0035 auto gen = py::class_<Gen, ActsExamples::EventGenerator::ParticlesGenerator,
0036 std::shared_ptr<Gen>>(p8, "Pythia8Generator")
0037 .def(py::init<const Gen::Config&, Acts::Logging::Level>(),
0038 py::arg("config"), py::arg("level"));
0039
0040 py::class_<Gen::Config>(gen, "Config")
0041 .def(py::init<>())
0042 .def_readwrite("pdgBeam0", &Gen::Config::pdgBeam0)
0043 .def_readwrite("pdgBeam1", &Gen::Config::pdgBeam1)
0044 .def_readwrite("cmsEnergy", &Gen::Config::cmsEnergy)
0045 .def_readwrite("settings", &Gen::Config::settings)
0046 .def_readwrite("printShortEventListing",
0047 &Gen::Config::printShortEventListing)
0048 .def_readwrite("printLongEventListing",
0049 &Gen::Config::printLongEventListing)
0050 .def_readwrite("labelSecondaries", &Gen::Config::labelSecondaries)
0051 .def_readwrite("spatialVertexThreshold",
0052 &Gen::Config::spatialVertexThreshold)
0053 .def_readwrite("initializationSeed", &Gen::Config::initializationSeed);
0054
0055 patchClassesWithConfig(p8);
0056 }
0057 }