Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:43

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 "ActsExamples/Utilities/SeedsToPrototracks.hpp"
0010 
0011 #include "ActsExamples/EventData/ProtoTrack.hpp"
0012 #include "ActsExamples/EventData/SimSeed.hpp"
0013 #include "ActsExamples/Utilities/EventDataTransforms.hpp"
0014 
0015 #include <utility>
0016 
0017 namespace ActsExamples {
0018 struct AlgorithmContext;
0019 
0020 SeedsToPrototracks::SeedsToPrototracks(Config cfg, Acts::Logging::Level lvl)
0021     : IAlgorithm("SeedsToPrototracks", lvl), m_cfg(std::move(cfg)) {
0022   m_inputSeeds.initialize(m_cfg.inputSeeds);
0023   m_outputProtoTracks.initialize(m_cfg.outputProtoTracks);
0024 }
0025 
0026 ProcessCode SeedsToPrototracks::execute(const AlgorithmContext& ctx) const {
0027   const auto seeds = m_inputSeeds(ctx);
0028 
0029   ProtoTrackContainer tracks;
0030   tracks.reserve(seeds.size());
0031 
0032   std::transform(seeds.begin(), seeds.end(), std::back_inserter(tracks),
0033                  seedToPrototrack);
0034 
0035   m_outputProtoTracks(ctx, std::move(tracks));
0036 
0037   return ProcessCode::SUCCESS;
0038 }
0039 }  // namespace ActsExamples