ATLAS Offline Software
Loading...
Searching...
No Matches
BuildCombinations.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DERIVATIONFRAMEWORKTRIGGER_BUILDCOMBINATIONS_H
6#define DERIVATIONFRAMEWORKTRIGGER_BUILDCOMBINATIONS_H
7
8#include "RangedItr.h"
9
11
24 template <typename T, typename PROJ = std::identity >
25 bool insertIntoSortedVector(std::vector<T>& vec, const T& ele,
26 PROJ proj = {});
27
36 template <typename R, typename PROJ = std::identity>
37 std::vector<typename R::value_type> sorted(const R& r, PROJ proj = {});
38
49 // First, a note on the type of the argument. This is essentially a way of
50 // passing a vector of vectors but only with iterators over the vectors.
51 template <typename T,
52 typename INNERPROJ = std::identity,
53 typename OUTERPROJ = std::identity>
54 std::vector<std::vector<T>> getAllDistinctCombinations(
55 std::vector<RangedItr<typename std::vector<T>::const_iterator>>& inputs,
56 INNERPROJ innerproj = {},
57 OUTERPROJ outerproj = {});
58
59}} //> end namespace DerivationFramework::TriggerMatchingUtils
60#include "BuildCombinations.icc"
61#endif //> !DERIVATIONFRAMEWORKTRIGGER_BUILDCOMBINATIONS_H
std::vector< size_t > vec
utility class that acts wraps a bidirectional iterator.
Definition RangedItr.h:18
int r
Definition globals.cxx:22
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
std::vector< std::vector< T > > getAllDistinctCombinations(std::vector< RangedItr< typename std::vector< T >::const_iterator > > &inputs, INNERPROJ innerproj={}, OUTERPROJ outerproj={})
Get all valid, unique combinations of distinct elements from the input ranges.
bool insertIntoSortedVector(std::vector< T > &vec, const T &ele, PROJ proj={})
Helper function for inserting an element into a sorted vector.
THE reconstruction tool.