Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:12:57

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 "Acts/Plugins/Python/Utilities.hpp"
0011 
0012 #include <tuple>
0013 #include <unordered_map>
0014 
0015 #include <pybind11/detail/common.h>
0016 #include <pybind11/functional.h>
0017 #include <pybind11/operators.h>
0018 #include <pybind11/pybind11.h>
0019 #include <pybind11/pytypes.h>
0020 #include <pybind11/stl.h>
0021 #include <pyerrors.h>
0022 
0023 namespace py = pybind11;
0024 using namespace Acts::Python;
0025 
0026 namespace Acts::Python {
0027 void addContext(Context& ctx);
0028 void addAny(Context& ctx);
0029 void addUnits(Context& ctx);
0030 void addFramework(Context& ctx);
0031 void addLogging(Context& ctx);
0032 void addPdgParticle(Context& ctx);
0033 void addAlgebra(Context& ctx);
0034 void addBinning(Context& ctx);
0035 void addEventData(Context& ctx);
0036 
0037 void addPropagation(Context& ctx);
0038 void addNavigation(Context& ctx);
0039 
0040 void addGeometry(Context& ctx);
0041 void addGeometryBuildingGen1(Context& ctx);
0042 void addExperimentalGeometry(Context& ctx);
0043 
0044 void addMagneticField(Context& ctx);
0045 
0046 void addMaterial(Context& ctx);
0047 void addOutput(Context& ctx);
0048 void addDetector(Context& ctx);
0049 void addExampleAlgorithms(Context& ctx);
0050 void addInput(Context& ctx);
0051 void addGenerators(Context& ctx);
0052 void addTruthTracking(Context& ctx);
0053 void addTrackFitting(Context& ctx);
0054 void addTrackFinding(Context& ctx);
0055 void addTruthJet(Context& ctx);
0056 void addVertexing(Context& ctx);
0057 void addAmbiguityResolution(Context& ctx);
0058 void addUtilities(Context& ctx);
0059 
0060 void addRootInput(Context& ctx);
0061 void addRootOutput(Context& ctx);
0062 
0063 // Plugins
0064 void addDigitization(Context& ctx);
0065 void addPythia8(Context& ctx);
0066 void addGeoModel(Context& ctx);
0067 void addTGeo(Context& ctx);
0068 void addJson(Context& ctx);
0069 void addDetray(Context& ctx);
0070 void addHepMC3(Context& ctx);
0071 void addExaTrkXTrackFinding(Context& ctx);
0072 void addSvg(Context& ctx);
0073 void addObj(Context& ctx);
0074 void addOnnx(Context& ctx);
0075 void addOnnxNeuralCalibrator(Context& ctx);
0076 void addCovfie(Context& ctx);
0077 void addTraccc(Context& ctx);
0078 void addHashing(Context& ctx);
0079 
0080 }  // namespace Acts::Python
0081 
0082 PYBIND11_MODULE(ActsPythonBindings, m) {
0083   Acts::Python::Context ctx;
0084   ctx.modules["main"] = m;
0085   auto mex = m.def_submodule("_examples");
0086   ctx.modules["examples"] = mex;
0087   auto prop = m.def_submodule("_propagator");
0088   ctx.modules["propagation"] = prop;
0089   m.doc() = "Acts";
0090 
0091   m.attr("__version__") =
0092       std::tuple{Acts::VersionMajor, Acts::VersionMinor, Acts::VersionPatch};
0093 
0094   {
0095     auto mv = m.def_submodule("version");
0096 
0097     mv.attr("major") = Acts::VersionMajor;
0098     mv.attr("minor") = Acts::VersionMinor;
0099     mv.attr("patch") = Acts::VersionPatch;
0100 
0101     mv.attr("commit_hash") = Acts::CommitHash;
0102     mv.attr("commit_hash_short") = Acts::CommitHashShort;
0103   }
0104 
0105   addContext(ctx);
0106   addAny(ctx);
0107   addUnits(ctx);
0108   addFramework(ctx);
0109   addLogging(ctx);
0110   addPdgParticle(ctx);
0111   addAlgebra(ctx);
0112   addBinning(ctx);
0113   addEventData(ctx);
0114   addOutput(ctx);
0115 
0116   addPropagation(ctx);
0117   addNavigation(ctx);
0118   addGeometryBuildingGen1(ctx);
0119   addGeometry(ctx);
0120   addExperimentalGeometry(ctx);
0121 
0122   addMagneticField(ctx);
0123   addMaterial(ctx);
0124   addDetector(ctx);
0125   addExampleAlgorithms(ctx);
0126   addInput(ctx);
0127   addGenerators(ctx);
0128   addTruthTracking(ctx);
0129   addTrackFitting(ctx);
0130   addTrackFinding(ctx);
0131   addTruthJet(ctx);
0132   addVertexing(ctx);
0133   addAmbiguityResolution(ctx);
0134   addUtilities(ctx);
0135 
0136   addDigitization(ctx);
0137   addPythia8(ctx);
0138   addJson(ctx);
0139   addGeoModel(ctx);
0140   addTGeo(ctx);
0141   addDetray(ctx);
0142   addHepMC3(ctx);
0143   addExaTrkXTrackFinding(ctx);
0144   addObj(ctx);
0145   addSvg(ctx);
0146   addOnnx(ctx);
0147   addOnnxNeuralCalibrator(ctx);
0148   addCovfie(ctx);
0149   addTraccc(ctx);
0150   addHashing(ctx);
0151 
0152   addRootInput(ctx);
0153   addRootOutput(ctx);
0154 }