Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-09 09:26:47

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