18 return os <<
info.source <<
", (" <<
info.link.persKey() <<
", " <<
info.link.persIndex() <<
")";
22 std::ostream &
operator<<(std::ostream &os,
const std::vector<T> &v)
27 for (
auto itr =
v.begin(); itr !=
v.end() - 1; ++itr)
39 std::set<const xAOD::IParticle *> seen;
40 for (
const auto &info : links)
41 if (!seen.insert(*info.link).second)
48 const EventContext& ctx = Gaudi::Hive::currentContext();
49 std::set<std::pair<uint32_t, uint32_t>> seen;
50 for (
const auto &info : links)
62 const EventContext& ctx = Gaudi::Hive::currentContext();
63 std::set<std::pair<uint32_t, uint32_t>> seen;
64 for (
const auto &info : links)
78 return [](
const VecLInfo_t &) {
return true; };
84 throw std::runtime_error(
"Unhandled FilterType enum value!");
91 const std::vector<std::tuple<std::size_t, LInfoItr_t, LInfoItr_t>> &pieces,
95 std::vector<KFromNItr> idxItrs;
96 idxItrs.reserve(pieces.size());
99 for (
const auto &tup : pieces)
101 std::size_t multiplicity = std::get<0>(tup);
104 idxItrs.emplace_back(multiplicity, std::distance(begin, end));
106 size += multiplicity;
114 const std::vector<std::tuple<std::size_t, LInfoItr_t, LInfoItr_t>> &pieces,
135 throw std::runtime_error(
"Dereferencing past-the-end iterator");
142 throw std::runtime_error(
"Dereferencing past-the-end iterator");
173 return !(*
this == other);
183 for (std::size_t iLeg = 0; iLeg <
nLegs(); ++iLeg)
185 std::vector<std::size_t> indices = *(*m_idxItr)[iLeg];
186 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::vector< LinkInfo< xAOD::IParticleContainer > > VecLInfo_t
const value_type & reference
std::function< bool(const IPartCombItr::VecLInfo_t &)> FilterFunc_t
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.
static FilterFunc_t getFilter(FilterType filter)
Get a function corresponding to the specified FilterType enum.
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 function 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.
bool uniqueInitialRoIs(const std::vector< LinkInfo< xAOD::IParticleContainer > > &links)
Helper function that returns true if no objects share an initial RoI.
LinkInfo< T > findLink(const EventContext &ctx, 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...
@ UniqueRoIs
Do not allow any two objects to share an RoI.
@ All
Allow all combinations.
@ UniqueObjects
Do not allow any repeated objects.
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.