Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-27 07:56:22

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/Definitions/Algebra.hpp"
0010 #include "ActsExamples/Fatras/FatrasSimulation.hpp"
0011 #include "ActsExamples/Io/Json/JsonGeometryList.hpp"
0012 #include "ActsExamples/Printers/ParticlesPrinter.hpp"
0013 #include "ActsExamples/Printers/TrackParametersPrinter.hpp"
0014 #include "ActsExamples/Utilities/Range.hpp"
0015 #include "ActsExamples/Utilities/TrackSelectorAlgorithm.hpp"
0016 #include "ActsPython/Utilities/Helpers.hpp"
0017 #include "ActsPython/Utilities/Macros.hpp"
0018 
0019 #include <vector>
0020 
0021 #include <pybind11/pybind11.h>
0022 #include <pybind11/stl.h>
0023 
0024 namespace py = pybind11;
0025 
0026 using namespace ActsExamples;
0027 using namespace Acts;
0028 
0029 namespace ActsPython {
0030 
0031 void addExampleAlgorithms(Context& ctx) {
0032   auto& mex = ctx.get("examples");
0033 
0034   mex.def("readJsonGeometryList", ActsExamples::readJsonGeometryList);
0035 
0036   ACTS_PYTHON_DECLARE_ALGORITHM(
0037       ActsExamples::FatrasSimulation, mex, "FatrasSimulation", inputParticles,
0038       outputParticles, outputSimHits, randomNumbers, trackingGeometry,
0039       magneticField, pMin, emScattering, emEnergyLossIonisation,
0040       emEnergyLossRadiation, emPhotonConversion, generateHitsOnSensitive,
0041       generateHitsOnMaterial, generateHitsOnPassive, averageHitsPerParticle);
0042 
0043   ACTS_PYTHON_DECLARE_ALGORITHM(ActsExamples::ParticlesPrinter, mex,
0044                                 "ParticlesPrinter", inputParticles);
0045 
0046   ACTS_PYTHON_DECLARE_ALGORITHM(ActsExamples::TrackParametersPrinter, mex,
0047                                 "TrackParametersPrinter", inputTrackParameters);
0048 
0049   {
0050     using Alg = ActsExamples::TrackSelectorAlgorithm;
0051     using Config = Alg::Config;
0052 
0053     auto alg = py::class_<Alg, IAlgorithm, std::shared_ptr<Alg>>(
0054                    mex, "TrackSelectorAlgorithm")
0055                    .def(py::init<const Alg::Config&, Logging::Level>(),
0056                         py::arg("config"), py::arg("level"))
0057                    .def_property_readonly("config", &Alg::config);
0058 
0059     auto c = py::class_<Config>(alg, "Config").def(py::init<>());
0060 
0061     ACTS_PYTHON_STRUCT(c, inputTracks, outputTracks, selectorConfig);
0062   }
0063 }
0064 }  // namespace ActsPython