Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:21:36

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/ActsVersion.hpp"
0010 #include "ActsPython/Utilities/Helpers.hpp"
0011 
0012 #include <pybind11/pybind11.h>
0013 
0014 namespace py = pybind11;
0015 
0016 /// This adds the core module entries to the Python module
0017 /// There is a certain order necessary as py::class_ definitions
0018 /// need to be registered before they can be used in other modules.
0019 namespace ActsPython {
0020 
0021 void addDefinitions(py::module_& m);
0022 void addMagneticField(py::module_& m);
0023 void addUtilities(py::module_& m);
0024 void addVisualization(py::module_& m);
0025 
0026 void addMaterial(py::module_& m);
0027 void addSurfaces(py::module_& m);
0028 void addGeometry(py::module_& m);
0029 void addGeometryGen1(py::module_& m);
0030 void addGeometryGen3(py::module_& m);
0031 void addNavigation(py::module_& m);
0032 void addPropagation(py::module_& m);
0033 void addSeeding(py::module_& mt);
0034 void addTrackFinding(py::module_& m);
0035 
0036 }  // namespace ActsPython
0037 
0038 namespace py = pybind11;
0039 
0040 PYBIND11_MODULE(ActsPythonBindings, m) {
0041   using namespace ActsPython;
0042 
0043   m.doc() = "Acts";
0044   m.attr("__version__") =
0045       std::tuple{Acts::VersionMajor, Acts::VersionMinor, Acts::VersionPatch};
0046 
0047   {
0048     auto mv = m.def_submodule("version");
0049 
0050     mv.attr("major") = Acts::VersionMajor;
0051     mv.attr("minor") = Acts::VersionMinor;
0052     mv.attr("patch") = Acts::VersionPatch;
0053 
0054     mv.attr("commit_hash") = std::string{Acts::CommitHash.value_or("UNKNOWN")};
0055     mv.attr("commit_hash_short") =
0056         std::string{Acts::CommitHashShort.value_or("UNKNOWN")};
0057   }
0058 
0059   addDefinitions(m);
0060   addMagneticField(m);
0061   addMaterial(m);
0062   addUtilities(m);
0063   addVisualization(m);
0064 
0065   addSurfaces(m);
0066   addGeometry(m);
0067   addGeometryGen1(m);
0068   addGeometryGen3(m);
0069   addNavigation(m);
0070   addPropagation(m);
0071   addSeeding(m);
0072   addTrackFinding(m);
0073 }