#include <RefHelper.h>
Public Types | |
typedef edm::Ptr< T > | Ref |
Public Member Functions | |
template<typename V , typename SomeRef > | |
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". More... | |
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) More... | |
bool | isRoot (const Ref &ref) const |
Ref | parentOrNull (const Ref &ref) const |
Returns a Ref to the direct parent of "ref", or a null Ref if "ref" is already root. More... | |
Ref | parentOrSelf (const Ref &ref) const |
Returns a Ref to the direct parent of "ref", or "ref" itself if it's already root. More... | |
template<typename V , typename SomeRef > | |
V | recursiveLookup (const SomeRef &ref, const edm::ValueMap< V > &map) const |
RefHelper (const edm::ValueMap< Ref > &backRefMap) | |
Constructor taking a ValueMap of back-references daughter => mother. More... | |
bool | sharedAncestor (const Ref &ref1, const Ref &ref2) const |
true if the two share the same root More... | |
Private Attributes | |
const edm::ValueMap< Ref > & | backRefMap_ |
Definition at line 10 of file RefHelper.h.
typedef edm::Ptr<T> pat::helper::RefHelper< T >::Ref |
Definition at line 12 of file RefHelper.h.
|
inline |
Constructor taking a ValueMap of back-references daughter => mother.
Definition at line 15 of file RefHelper.h.
References pat::helper::RefHelper< T >::ancestorLookup(), pat::helper::RefHelper< T >::ancestorOrSelf(), pat::helper::RefHelper< T >::isAncestorOf(), pat::helper::RefHelper< T >::isRoot(), genParticles_cff::map, pat::helper::RefHelper< T >::parentOrNull(), pat::helper::RefHelper< T >::parentOrSelf(), pat::helper::RefHelper< T >::recursiveLookup(), and pat::helper::RefHelper< T >::sharedAncestor().
V pat::helper::RefHelper< T >::ancestorLookup | ( | const SomeRef & | ref, |
const edm::ValueMap< V > & | map | ||
) | const |
Looks up map to find something associated to the root ancestor of "ref" Throws edm::Exception(edm::errors::InvalidReference) if there's no match
Definition at line 124 of file RefHelper.h.
References pat::helper::RefHelper< T >::ancestorOrSelf().
Referenced by pat::helper::RefHelper< T >::RefHelper().
RefHelper< T >::Ref pat::helper::RefHelper< T >::ancestorOrSelf | ( | const Ref & | ref | ) | const |
Climbs back the Ref chain and returns the root of the branch starting from "ref".
Definition at line 72 of file RefHelper.h.
References edm::Ptr< T >::isNull(), pat::helper::RefHelper< T >::parentOrNull(), and PFTauMVAInputDiscriminatorTranslator_cfi::test.
Referenced by pat::helper::RefHelper< T >::ancestorLookup(), pat::helper::RefHelper< T >::RefHelper(), and pat::helper::RefHelper< T >::sharedAncestor().
bool pat::helper::RefHelper< T >::isAncestorOf | ( | const Ref & | old, |
const Ref & | young | ||
) | const |
true if old is some ancestor of young (it does not have to be the root)
Definition at line 88 of file RefHelper.h.
References edm::Ptr< T >::isNonnull(), and pat::helper::RefHelper< T >::parentOrNull().
Referenced by pat::helper::RefHelper< T >::RefHelper().
bool pat::helper::RefHelper< T >::isRoot | ( | const Ref & | ref | ) | const |
Definition at line 83 of file RefHelper.h.
References edm::Ptr< T >::isNull(), and pat::helper::RefHelper< T >::parentOrNull().
Referenced by pat::helper::RefHelper< T >::RefHelper().
RefHelper< T >::Ref pat::helper::RefHelper< T >::parentOrNull | ( | const Ref & | ref | ) | const |
Returns a Ref to the direct parent of "ref", or a null Ref if "ref" is already root.
Definition at line 49 of file RefHelper.h.
References pat::helper::RefHelper< T >::backRefMap_, edm::Exception::categoryCode(), MillePedeFileConverter_cfg::e, edm::Ptr< T >::id(), and edm::errors::InvalidReference.
Referenced by pat::helper::RefHelper< T >::ancestorOrSelf(), pat::helper::RefHelper< T >::isAncestorOf(), pat::helper::RefHelper< T >::isRoot(), pat::helper::RefHelper< T >::parentOrSelf(), pat::helper::RefHelper< T >::recursiveLookup(), and pat::helper::RefHelper< T >::RefHelper().
RefHelper< T >::Ref pat::helper::RefHelper< T >::parentOrSelf | ( | const Ref & | ref | ) | const |
Returns a Ref to the direct parent of "ref", or "ref" itself if it's already root.
Definition at line 66 of file RefHelper.h.
References edm::Ptr< T >::isNonnull(), and pat::helper::RefHelper< T >::parentOrNull().
Referenced by pat::helper::RefHelper< T >::RefHelper().
V pat::helper::RefHelper< T >::recursiveLookup | ( | const SomeRef & | ref, |
const edm::ValueMap< V > & | map | ||
) | const |
Recursively looks up map to find something associated to ref, or one of its parents. Throws edm::Exception(edm::errors::InvalidReference) if there's no match
Definition at line 104 of file RefHelper.h.
References edm::Exception::categoryCode(), edm::ValueMap< T >::contains(), MillePedeFileConverter_cfg::e, Exception, edm::Ptr< T >::id(), edm::errors::InvalidReference, edm::Ptr< T >::isNonnull(), pat::helper::RefHelper< T >::parentOrNull(), and PFTauMVAInputDiscriminatorTranslator_cfi::test.
Referenced by pat::helper::RefHelper< T >::RefHelper().
bool pat::helper::RefHelper< T >::sharedAncestor | ( | const Ref & | ref1, |
const Ref & | ref2 | ||
) | const |
true if the two share the same root
Definition at line 98 of file RefHelper.h.
References pat::helper::RefHelper< T >::ancestorOrSelf().
Referenced by pat::helper::RefHelper< T >::RefHelper().
|
private |
Definition at line 45 of file RefHelper.h.
Referenced by pat::helper::RefHelper< T >::parentOrNull().