Go to the documentation of this file. 1 #ifndef PhysicsTools_PatUtils_RefHelper_h
2 #define PhysicsTools_PatUtils_RefHelper_h
36 template<
typename V,
typename SomeRef>
41 template<
typename V,
typename SomeRef>
50 if (backRefMap_.contains(ref.
id())) {
52 return backRefMap_[ref];
67 Ref ret = parentOrNull(ref);
68 return ret.isNonnull() ?
ret : ref;
84 return parentOrNull(ref).isNull();
91 if (
test == old)
return true;
93 }
while (
test.isNonnull());
99 return ( ancestorOrSelf(ref1) == ancestorOrSelf(ref2) );
103 template<
typename V,
typename SomeRef>
117 }
while (
test.isNonnull());
119 "RefHelper: recursive Lookup failed: neither the specified ref nor any of its parents are in the map.\n";
123 template<
typename V,
typename SomeRef>
126 return map[ancestorOrSelf(tref)];
ret
prodAgent to be discontinued
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t V
bool isAncestorOf(const Ref &old, const Ref &young) const
true if old is some ancestor of young (it does not have to be the root)
Ref parentOrNull(const Ref &ref) const
Returns a Ref to the direct parent of "ref", or a null Ref if "ref" is already root.
RefHelper(const edm::ValueMap< Ref > &backRefMap)
Constructor taking a ValueMap of back-references daughter => mother.
ProductID id() const
Accessor for product ID.
const edm::ValueMap< Ref > & backRefMap_
bool isRoot(const Ref &ref) const
V recursiveLookup(const SomeRef &ref, const edm::ValueMap< V > &map) const
bool sharedAncestor(const Ref &ref1, const Ref &ref2) const
true if the two share the same root
Ref parentOrSelf(const Ref &ref) const
Returns a Ref to the direct parent of "ref", or "ref" itself if it's already root.
edm::Ref< Container > Ref
V ancestorLookup(const SomeRef &ref, const edm::ValueMap< V > &map) const
Ref ancestorOrSelf(const Ref &ref) const
Climbs back the Ref chain and returns the root of the branch starting from "ref".