Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SelectorList.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SelectorList.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 
17 
18 namespace Fatras {
19 
25 template <bool inclusive, typename... selectors>
26 struct SelectorListAXOR : private Acts::detail::Extendable<selectors...> {
27 private:
28  static_assert(not Acts::detail::has_duplicates_v<selectors...>,
29  "same selector type specified several times");
30 
31  using Acts::detail::Extendable<selectors...>::tuple;
32 
33 public:
34  using Acts::detail::Extendable<selectors...>::get;
35 
46  template <typename detector_t, typename particle_t>
47  bool operator()(const detector_t &detector,
48  const particle_t &particle) const {
49  // clang-format off
50  static_assert(Acts::detail::all_of_v<detail::selector_list_signature_check_v<selectors, detector_t, particle_t>...>,
51  "not all particle selectors support the specified interface");
52  // clang-format on
53 
54  // create an emtpy particle vector
55  typedef detail::selector_list_impl<selectors...> impl;
56  return impl::select(tuple(), detector, particle, inclusive);
57  }
58 };
59 
60 template <typename... selectors>
61 using SelectorListOR = SelectorListAXOR<true, selectors...>;
62 
63 template <typename... selectors>
64 using SelectorListAND = SelectorListAXOR<false, selectors...>;
65 
66 } // namespace Fatras