15 return os <<
info.source <<
", (" <<
info.link.persKey() <<
", " <<
info.link.persIndex() <<
")";
19 std::ostream &
operator<<(std::ostream &os,
const std::vector<T> &v)
24 for (
auto itr =
v.begin(); itr !=
v.end() - 1; ++itr)
36 std::set<const xAOD::IParticle *> seen;
37 for (
const auto &info : links)
38 if (!seen.insert(*info.link).second)
45 std::set<std::pair<uint32_t, uint32_t>> seen;
46 for (
const auto &info : links)
58 std::set<std::pair<uint32_t, uint32_t>> seen;
59 for (
const auto &info : links)
74 return [](
const std::vector<LinkInfo<xAOD::IParticleContainer>> &) {
return true; };
80 throw std::runtime_error(
"Unhandled FilterType enum value!");
88 const std::vector<std::tuple<std::size_t, LInfoItr_t, LInfoItr_t>> &pieces,
89 std::function<
bool(
const VecLInfo_t &)> filter)
92 std::vector<KFromNItr> idxItrs;
93 idxItrs.reserve(pieces.size());
96 for (
const auto &tup : pieces)
98 std::size_t multiplicity = std::get<0>(tup);
101 idxItrs.emplace_back(multiplicity, std::distance(begin, end));
103 size += multiplicity;
111 const std::vector<std::tuple<std::size_t, LInfoItr_t, LInfoItr_t>> &pieces,
132 throw std::runtime_error(
"Dereferencing past-the-end iterator");
139 throw std::runtime_error(
"Dereferencing past-the-end iterator");
170 return !(*
this == other);
180 for (std::size_t iLeg = 0; iLeg <
nLegs(); ++iLeg)
182 std::vector<std::size_t> indices = *(*m_idxItr)[iLeg];
183 for (std::size_t idx : indices)
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
stored_index_type persIndex() const
Return the index of the link.
sgkey_t persKey() const
Return the SG key that we reference, as a hash.
const value_type * pointer
void reset()
Reset the iterator to its starting point.
std::vector< LInfoItr_t > m_linkInfoItrs
pointer operator->() const
std::size_t size() const
The size of each combination.
IPartCombItr()
A default constructed iterator acts as a past-the-end iterator.
bool operator!=(const IPartCombItr &other) const
std::function< bool(const VecLInfo_t &)> m_filter
std::vector< LinkInfo< xAOD::IParticleContainer > > VecLInfo_t
const value_type & reference
IPartCombItr & operator++()
Pre-increment operator.
std::size_t nLegs() const
The number of legs.
VecLInfo_t::const_iterator LInfoItr_t
reference operator*() const
Dereference.
ProductItr< KFromNItr > m_idxItr
bool exhausted() const
True if this iterator is past the end.
bool operator==(const IPartCombItr &other) const
Iterator comparison functions.
Iterates over all combinations of the provided input iterators.
bool uniqueObjects(const std::vector< LinkInfo< xAOD::IParticleContainer > > &links)
Helper fucntion that returns true if no objects are repeated.
bool uniqueRoIs(const std::vector< LinkInfo< xAOD::IParticleContainer > > &links)
Helper function that returns true if no objects share a final RoI.
std::function< bool(const std::vector< LinkInfo< xAOD::IParticleContainer > > &)> getFilter(FilterType filter)
Get a lambda corresponding to the specified FilterType enum.
bool uniqueInitialRoIs(const std::vector< LinkInfo< xAOD::IParticleContainer > > &links)
Helper function that returns true if no objects share an initial RoI.
@ UniqueRoIs
Do not allow any two objects to share an RoI.
@ All
Allow all combinations.
@ UniqueObjects
Do not allow any repeated objects.
LinkInfo< T > findLink(const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision obj...
const std::string & initialRoIString()
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
ElementLink< T > link
Link to the feature.