Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:12:08

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/Plugins/Python/Utilities.hpp"
0010 #include "Acts/Utilities/Logger.hpp"
0011 #include "ActsExamples/Generators/Pythia8ProcessGenerator.hpp"
0012 
0013 #include <memory>
0014 #include <string>
0015 #include <unordered_map>
0016 
0017 #include <pybind11/pybind11.h>
0018 #include <pybind11/stl.h>
0019 #include <pybind11/stl/filesystem.h>
0020 
0021 namespace py = pybind11;
0022 using namespace ActsExamples;
0023 
0024 namespace Acts::Python {
0025 void addPythia8(Context& ctx) {
0026   auto mex = ctx.get("examples");
0027 
0028   auto p8 = mex.def_submodule("pythia8");
0029   ctx.modules["pythia8"] = p8;
0030 
0031   using Gen = ActsExamples::Pythia8Generator;
0032   auto gen =
0033       py::class_<Gen, ActsExamples::ParticlesGenerator, std::shared_ptr<Gen>>(
0034           p8, "Pythia8Generator")
0035           .def(py::init<const Gen::Config&, Acts::Logging::Level>(),
0036                py::arg("config"), py::arg("level"));
0037 
0038   py::class_<Gen::Config>(gen, "Config")
0039       .def(py::init<>())
0040       .def_readwrite("pdgBeam0", &Gen::Config::pdgBeam0)
0041       .def_readwrite("pdgBeam1", &Gen::Config::pdgBeam1)
0042       .def_readwrite("cmsEnergy", &Gen::Config::cmsEnergy)
0043       .def_readwrite("settings", &Gen::Config::settings)
0044       .def_readwrite("printShortEventListing",
0045                      &Gen::Config::printShortEventListing)
0046       .def_readwrite("printLongEventListing",
0047                      &Gen::Config::printLongEventListing)
0048       .def_readwrite("labelSecondaries", &Gen::Config::labelSecondaries)
0049       .def_readwrite("spatialVertexThreshold",
0050                      &Gen::Config::spatialVertexThreshold)
0051       .def_readwrite("initializationSeed", &Gen::Config::initializationSeed)
0052       .def_readwrite("writeHepMC3", &Gen::Config::writeHepMC3);
0053 
0054   patchClassesWithConfig(p8);
0055 }
0056 }  // namespace Acts::Python