File indexing completed on 2025-01-18 09:11:49
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "HelloWhiteBoardAlgorithm.hpp"
0010
0011 #include "ActsExamples/Framework/WhiteBoard.hpp"
0012
0013 #include "HelloData.hpp"
0014
0015 ActsExamples::HelloWhiteBoardAlgorithm::HelloWhiteBoardAlgorithm(
0016 const Config& cfg, Acts::Logging::Level level)
0017 : ActsExamples::IAlgorithm("HelloWhiteBoard", level), m_cfg(cfg) {
0018
0019 if (m_cfg.input.empty()) {
0020 throw std::invalid_argument("Missing input collection");
0021 }
0022 m_readHandle.initialize(m_cfg.input);
0023 if (m_cfg.output.empty()) {
0024 throw std::invalid_argument("Missing output collection");
0025 }
0026 m_writeHandle.initialize(m_cfg.output);
0027 }
0028
0029 ActsExamples::ProcessCode ActsExamples::HelloWhiteBoardAlgorithm::execute(
0030 const ActsExamples::AlgorithmContext& ctx) const {
0031
0032 ACTS_INFO("Reading HelloDataCollection " << m_cfg.input);
0033 const auto& in = m_readHandle(ctx);
0034 ACTS_VERBOSE("Read HelloDataCollection with size " << in.size());
0035
0036
0037 HelloDataCollection copy(in);
0038
0039
0040
0041 ACTS_INFO("Writing HelloDataCollection " << m_cfg.output);
0042 m_writeHandle(ctx, std::move(copy));
0043
0044 return ActsExamples::ProcessCode::SUCCESS;
0045 }