ATLAS Offline Software
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 
10 namespace DerivationFramework { namespace TriggerMatchingUtils {
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
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
beamspotman.r
def r
Definition: beamspotman.py:674
DerivationFramework::TriggerMatchingUtils::insertIntoSortedVector
bool insertIntoSortedVector(std::vector< T > &vec, const T &ele, PROJ proj={})
Helper function for inserting an element into a sorted vector.
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
DerivationFramework::TriggerMatchingUtils::getAllDistinctCombinations
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.
RangedItr.h
DerivationFramework::TriggerMatchingUtils::RangedItr
utility class that acts wraps a bidirectional iterator.
Definition: RangedItr.h:18
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
make_coralServer_rep.proj
proj
Definition: make_coralServer_rep.py:48
BuildCombinations.icc