1 #ifndef CondFormats_HcalObjects_HcalObjectAddons
2 #define CondFormats_HcalObjects_HcalObjectAddons
8 namespace HcalObjectAddons {
9 template <
class Item,
class Less>
10 const Item*
findByT(
const Item*
target,
const std::vector<const Item*>& itemsByT) {
13 if (
item == itemsByT.end() || !less.equal(*
item, target)) {
20 template <
class Item,
class Less>
21 static void sortByT(
const std::vector<Item>&
items, std::vector<const Item*>& itemsByT) {
23 itemsByT.reserve(items.size());
25 for (
const auto&
i : items) {
27 itemsByT.push_back(&
i);
29 std::sort(itemsByT.begin(), itemsByT.end(), less);
const Item * findByT(const Item *target, const std::vector< const Item * > &itemsByT)
static void sortByT(const std::vector< Item > &items, std::vector< const Item * > &itemsByT)
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})