1 #ifndef PhysicsTools_PatUtils_RefHelper_h 2 #define PhysicsTools_PatUtils_RefHelper_h 26 bool isRoot(
const Ref &ref)
const ;
29 bool isAncestorOf(
const Ref &old,
const Ref &young)
const ;
36 template<
typename V,
typename SomeRef>
41 template<
typename V,
typename SomeRef>
76 if (test.
isNull())
return ret;
91 if (test == old)
return true;
103 template<
typename V,
typename SomeRef>
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>
Code categoryCode() const
const edm::ValueMap< Ref > & backRefMap_
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.
RefHelper(const edm::ValueMap< Ref > &backRefMap)
Constructor taking a ValueMap of back-references daughter => mother.
bool contains(ProductID id) const
bool isNull() const
Checks for null.
Ref parentOrNull(const Ref &ref) const
Returns a Ref to the direct parent of "ref", or a null Ref if "ref" is already root.
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)
bool isNonnull() const
Checks for non-null.
bool isRoot(const Ref &ref) const
ProductID id() const
Accessor for product ID.
V ancestorLookup(const SomeRef &ref, const edm::ValueMap< V > &map) const
V recursiveLookup(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". ...