Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PrototracksToSeeds.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PrototracksToSeeds.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
16 
17 #include <algorithm>
18 
19 namespace ActsExamples {
20 
22  : IAlgorithm("PrototracksToSeeds", lvl), m_cfg(std::move(cfg)) {
27 }
28 
30  auto prototracks = m_inputProtoTracks(ctx);
31 
32  const auto nBefore = prototracks.size();
33  prototracks.erase(std::remove_if(prototracks.begin(), prototracks.end(),
34  [](const auto& t) { return t.size() < 3; }),
35  prototracks.end());
36  ACTS_DEBUG("Discarded " << prototracks.size() - nBefore
37  << " prototracks with less then 3 hits");
38 
39  SimSeedContainer seeds;
40  seeds.reserve(prototracks.size());
41 
42  const auto& sps = m_inputSpacePoints(ctx);
43  std::transform(prototracks.begin(), prototracks.end(),
44  std::back_inserter(seeds),
45  [&](const auto& pt) { return prototrackToSeed(pt, sps); });
46 
47  m_outputSeeds(ctx, std::move(seeds));
48  m_outputProtoTracks(ctx, std::move(prototracks));
49 
50  return ProcessCode::SUCCESS;
51 }
52 
53 } // namespace ActsExamples