Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:09:08

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2018 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Utilities/detail/MPL/type_collector.hpp"
0012 #include <type_traits>
0013 
0014 namespace Fatras {
0015 
0016 /// The following operator has to be inplemented in order to satisfy
0017 /// as an sampler for fast simulation
0018 ///
0019 /// @code
0020 ///  bool
0021 ///  operator()(generator_t& generator,
0022 ///             const detector_t& detector,
0023 ///             const particle_t& in,
0024 ///             std::vector<particle_t>& out) const { return false; }
0025 ///
0026 /// @endcode
0027 namespace detail {
0028 
0029 namespace {
0030 template <typename T, typename generator_t, typename detector_t,
0031           typename particle_t,
0032           typename = decltype(std::declval<T>().operator()(
0033               std::declval<generator_t &>(), std::declval<const detector_t &>(),
0034               std::declval<particle_t &>(),
0035               std::declval<std::vector<particle_t> &>()))>
0036 
0037 std::true_type test_physics_list(int);
0038 
0039 template <typename, typename, typename, typename>
0040 std::false_type test_physics_list(...);
0041 
0042 template <typename T, typename generator_t, typename detector_t,
0043           typename particle_t>
0044 struct process_signature_check
0045     : decltype(test_physics_list<T, generator_t, detector_t, particle_t>(0)) {};
0046 
0047 // clang-format on
0048 } // end of anonymous namespace
0049 
0050 template <typename T, typename generator_t, typename detector_t,
0051           typename particle_t>
0052 constexpr bool process_signature_check_v =
0053     process_signature_check<T, generator_t, detector_t, particle_t>::value;
0054 
0055 } // namespace detail
0056 
0057 } // namespace Fatras