Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:09:59

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/Definitions/TrackParametrization.hpp"
0012 #include "Acts/EventData/Types.hpp"
0013 #include "Acts/Surfaces/Surface.hpp"
0014 #include "Acts/Utilities/HashedString.hpp"
0015 
0016 #include <any>
0017 #include <type_traits>
0018 
0019 #if defined(__cpp_concepts)
0020 #include <concepts>
0021 
0022 namespace Acts {
0023 
0024 template <typename C>
0025 concept ChargeConcept = requires(C c, float f, double d) {
0026   {C{f}};
0027 
0028   { c == c } -> std::same_as<bool>;
0029   { c != c } -> std::same_as<bool>;
0030 
0031   { c.absQ() } -> std::same_as<float>;
0032   { c.extractCharge(d) } -> std::same_as<float>;
0033   { c.extractMomentum(d) } -> std::same_as<double>;
0034   { c.qOverP(d, d) } -> std::same_as<double>;
0035 };
0036 
0037 }  // namespace Acts
0038 
0039 #endif