Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /acts/Python/Plugins/src/Root.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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/Material/IMaterialDecorator.hpp"
0010 #include "Acts/Utilities/Logger.hpp"
0011 #include "ActsPlugins/Root/RootMaterialDecorator.hpp"
0012 #include "ActsPlugins/Root/RootMaterialMapIo.hpp"
0013 #include "ActsPython/Utilities/Helpers.hpp"
0014 #include "ActsPython/Utilities/Macros.hpp"
0015 
0016 #include <memory>
0017 #include <vector>
0018 
0019 #include <TGeoManager.h>
0020 #include <TGeoVolume.h>
0021 #include <pybind11/pybind11.h>
0022 #include <pybind11/stl.h>
0023 #include <pybind11/stl/filesystem.h>
0024 
0025 namespace py = pybind11;
0026 using namespace pybind11::literals;
0027 
0028 PYBIND11_MODULE(ActsPluginsPythonBindingsRoot, root) {
0029   using namespace Acts;
0030   using namespace ActsPlugins;
0031 
0032   {
0033     auto ac = py::class_<RootMaterialMapIo::Config>(root, "AccessorConfig")
0034                   .def(py::init<>());
0035 
0036     ACTS_PYTHON_STRUCT(ac, volumePrefix, portalPrefix, layerPrefix,
0037                        passivePrefix, sensitivePrefix, nBinsHistName,
0038                        axisDirHistName, axisBoundaryTypeHistName, indexHistName,
0039                        minRangeHistName, maxRangeHistName, thicknessHistName,
0040                        x0HistName, l0HistName, aHistName, zHistName,
0041                        rhoHistName);
0042 
0043     auto ao = py::class_<RootMaterialMapIo::Options>(root, "AccessorOptions")
0044                   .def(py::init<>());
0045 
0046     ACTS_PYTHON_STRUCT(ao, homogeneousMaterialTreeName, indexedMaterialTreeName,
0047                        folderSurfaceNameBase, folderVolumeNameBase,
0048                        indexedMaterial);
0049 
0050     auto rmd =
0051         py::class_<RootMaterialDecorator, IMaterialDecorator,
0052                    std::shared_ptr<RootMaterialDecorator>>(
0053             root, "RootMaterialDecorator")
0054             .def(py::init<RootMaterialDecorator::Config, Logging::Level>(),
0055                  py::arg("config"), py::arg("level"));
0056 
0057     using Config = RootMaterialDecorator::Config;
0058     auto c = py::class_<Config>(rmd, "Config").def(py::init<>());
0059 
0060     ACTS_PYTHON_STRUCT(c, accessorConfig, accessorOptions, fileName);
0061   }
0062 }