EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimParticle.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SimParticle.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018 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 
9 #pragma once
10 
13 
14 #include <boost/container/flat_set.hpp>
15 
16 namespace ActsExamples {
17 namespace detail {
20  constexpr bool operator()(const ActsFatras::Particle& lhs,
21  const ActsFatras::Particle& rhs) const {
22  return lhs.particleId() < rhs.particleId();
23  }
24  constexpr bool operator()(ActsFatras::Barcode lhs,
25  const ActsFatras::Particle& rhs) const {
26  return lhs < rhs.particleId();
27  }
28  constexpr bool operator()(const ActsFatras::Particle& lhs,
29  ActsFatras::Barcode rhs) const {
30  return lhs.particleId() < rhs;
31  }
32 };
35  const ActsFatras::Particle& particle) const {
37  particle.particleId().vertexPrimary());
38  }
39 };
42  const ActsFatras::Particle& particle) const {
43  return ActsFatras::Barcode(0u)
45  .setVertexSecondary(particle.particleId().vertexSecondary());
46  }
47 };
48 } // namespace detail
49 
53  ::boost::container::flat_set<::ActsFatras::Particle,
55 
57 inline GroupBy<SimParticleContainer::const_iterator,
60  return makeGroupBy(container, detail::PrimaryVertexIdGetter());
61 }
62 
68 inline GroupBy<SimParticleContainer::const_iterator,
69  detail::SecondaryVertexIdGetter>
71  return makeGroupBy(container, detail::SecondaryVertexIdGetter());
72 }
73 
74 } // namespace ActsExamples