File indexing completed on 2025-01-18 09:12:13
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "ActsFatras/EventData/Particle.hpp"
0012 #include "ActsFatras/Selectors/detail/combine_selectors.hpp"
0013
0014 #include <functional>
0015 #include <limits>
0016
0017 namespace ActsFatras {
0018
0019
0020 template <typename cast_t>
0021 struct Min {
0022 double valMin = 0.;
0023
0024 template <typename T>
0025 bool operator()(const T &thing) const {
0026 return (valMin <= cast_t()(thing));
0027 }
0028 };
0029
0030
0031 template <typename cast_t>
0032 struct Max {
0033 double valMax = std::numeric_limits<double>::max();
0034
0035 template <typename T>
0036 bool operator()(const T &thing) const {
0037 return (cast_t()(thing) < valMax);
0038 }
0039 };
0040
0041
0042
0043
0044 template <typename cast_t>
0045 struct Range {
0046 double valMin = std::numeric_limits<double>::lowest();
0047 double valMax = std::numeric_limits<double>::max();
0048
0049 template <typename T>
0050 bool operator()(const T &thing) const {
0051 const auto val = cast_t()(thing);
0052 return ((valMin <= val) && (val < valMax));
0053 }
0054 };
0055
0056
0057 template <typename... selectors_t>
0058 using CombineAnd =
0059 detail::CombineSelectors<true, std::logical_and<bool>, selectors_t...>;
0060
0061
0062 template <typename... selectors_t>
0063 using CombineOr =
0064 detail::CombineSelectors<false, std::logical_or<bool>, selectors_t...>;
0065
0066 }