Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:17

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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/Detector/DetectorVolume.hpp"
0012 #include "Acts/Geometry/TrackingVolume.hpp"
0013 #include "Acts/Utilities/TypeTraits.hpp"
0014 
0015 namespace Acts::Concepts {
0016 
0017 // Types to check compatibility of
0018 template <typename propagator_state_t, typename navigator_t>
0019 using ReturnTypeCurrentVolume =
0020     decltype(std::declval<navigator_t>().currentVolume(
0021         std::declval<propagator_state_t>().navigation));
0022 
0023 /// @brief Concept ensuring compatibility TrackingGeometry
0024 /// and Detector navigation interfaces with the client code
0025 /// @tparam propagator_state_t Type of the object for navigation state
0026 /// @tparam navigator_t Type of the navigator object
0027 template <typename propagator_state_t, typename navigator_t>
0028 struct NavigationCompatibilityConceptImpl {
0029   /// @brief Ensure that the currentVolume method
0030   /// returns one of the known volume types
0031   constexpr static bool isCurrentVolumePtr =
0032       (Acts::Concepts::identical_to<const TrackingVolume*,
0033                                     ReturnTypeCurrentVolume, propagator_state_t,
0034                                     navigator_t> ||
0035        Acts::Concepts::identical_to<const Acts::Experimental::DetectorVolume*,
0036                                     ReturnTypeCurrentVolume, propagator_state_t,
0037                                     navigator_t>);
0038 
0039   static_assert(isCurrentVolumePtr,
0040                 "Return type is not a known volume pointer type");
0041 
0042   constexpr static bool value = Acts::Concepts::require<isCurrentVolumePtr>;
0043 };
0044 
0045 template <typename propagator_state_t, typename navigator_t>
0046 constexpr bool NavigationCompatibilityConcept =
0047     NavigationCompatibilityConceptImpl<propagator_state_t, navigator_t>::value;
0048 
0049 }  // namespace Acts::Concepts