File indexing completed on 2025-01-18 09:28:01
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "ActsExamples/Framework/ProcessCode.hpp"
0012 #include "ActsExamples/Framework/SequenceElement.hpp"
0013 #include <Acts/Utilities/Logger.hpp>
0014
0015 #include <memory>
0016 #include <string>
0017
0018 namespace ActsExamples {
0019 struct AlgorithmContext;
0020
0021
0022
0023
0024
0025
0026 class IAlgorithm : public SequenceElement {
0027 public:
0028
0029
0030
0031
0032 IAlgorithm(std::string name,
0033 Acts::Logging::Level level = Acts::Logging::INFO);
0034
0035
0036 std::string name() const override;
0037
0038
0039
0040
0041 virtual ProcessCode execute(const AlgorithmContext& context) const = 0;
0042
0043
0044
0045 ProcessCode internalExecute(const AlgorithmContext& context) final {
0046 return execute(context);
0047 };
0048
0049
0050 ProcessCode initialize() override { return ProcessCode::SUCCESS; }
0051
0052 ProcessCode finalize() override { return ProcessCode::SUCCESS; }
0053
0054 protected:
0055 const Acts::Logger& logger() const { return *m_logger; }
0056
0057 private:
0058 std::string m_name;
0059 std::unique_ptr<const Acts::Logger> m_logger;
0060 };
0061 }