Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-28 07:46: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/Utilities/Logger.hpp"
0010 #include "ActsExamples/HelloWorld/HelloLoggerAlgorithm.hpp"
0011 #include "ActsExamples/HelloWorld/HelloRandomAlgorithm.hpp"
0012 #include "ActsExamples/HelloWorld/HelloWhiteBoardAlgorithm.hpp"
0013 #include "ActsPython/Utilities/Macros.hpp"
0014 
0015 #include <memory>
0016 
0017 #include <pybind11/pybind11.h>
0018 #include <pybind11/stl.h>
0019 
0020 namespace py = pybind11;
0021 
0022 using namespace ActsExamples;
0023 using namespace Acts;
0024 
0025 namespace ActsPython {
0026 
0027 void addHelloWorld(py::module& mex) {
0028   py::class_<HelloLoggerAlgorithm, IAlgorithm,
0029              std::shared_ptr<HelloLoggerAlgorithm>>(mex, "HelloLoggerAlgorithm")
0030       .def(py::init([](Logging::Level level) {
0031              return std::make_shared<HelloLoggerAlgorithm>(
0032                  getDefaultLogger("HelloLoggerAlgorithm", level));
0033            }),
0034            py::arg("level"))
0035       .def(py::init([](std::unique_ptr<const Logger> logger) {
0036              return std::make_shared<HelloLoggerAlgorithm>(std::move(logger));
0037            }),
0038            py::arg("logger"));
0039 
0040   ACTS_PYTHON_DECLARE_ALGORITHM(
0041       HelloRandomAlgorithm, mex, "HelloRandomAlgorithm", randomNumbers,
0042       gaussParameters, uniformParameters, gammaParameters, poissonParameter,
0043       drawsPerEvent, output);
0044 
0045   ACTS_PYTHON_DECLARE_ALGORITHM(HelloWhiteBoardAlgorithm, mex,
0046                                 "HelloWhiteBoardAlgorithm", input, output);
0047 }
0048 
0049 }  // namespace ActsPython