ATLAS Offline Software
Loading...
Searching...
No Matches
IDTPM2::PdgAncestorFinder< T > Class Template Reference

now a specific selector using the above PDG ID helper so we can select whatever sort we want - even exotics type with non standard pdg ids More...

#include <AncestorFinder.h>

Inheritance diagram for IDTPM2::PdgAncestorFinder< T >:
Collaboration diagram for IDTPM2::PdgAncestorFinder< T >:

Public Member Functions

 PdgAncestorFinder (int i)
bool predicate (const T *t) const override
const T * findAncestor (const T *t) const

Private Attributes

PdgIdHelper< T > m_predicate

Detailed Description

template<typename T>
class IDTPM2::PdgAncestorFinder< T >

now a specific selector using the above PDG ID helper so we can select whatever sort we want - even exotics type with non standard pdg ids

Definition at line 167 of file AncestorFinder.h.

Constructor & Destructor Documentation

◆ PdgAncestorFinder()

template<typename T>
IDTPM2::PdgAncestorFinder< T >::PdgAncestorFinder ( int i)
inline

Definition at line 169 of file AncestorFinder.h.

now a specific selector using the above PDG ID helper so we can select whatever sort we want - even e...

Member Function Documentation

◆ findAncestor()

template<typename T>
const T * IDTPM2::IFinder< T >::findAncestor ( const T * t) const
inlineinherited

successful stopping condition ...

isn't recursion great boys and girls ?

Definition at line 33 of file AncestorFinder.h.

33 {
34
35 // reached the end ...
36 if (!t) return 0;
37
39 if ( predicate(t) ) return t;
40
41 for ( size_t p=0 ; p<t->nParents() ; p++ ) {
42 const T* parent = t->parent(p);
43
44 if ( parent==t ) continue;
45
47 if ( const T* found = findAncestor(parent) ) return found;
48 }
49
50 return 0;
51 }
const T * findAncestor(const T *t) const
virtual bool predicate(const T *t) const =0

◆ predicate()

bool IDTPM2::GenericAncestorFinder< T, PdgIdHelper< T > >::predicate ( const T * t) const
inlineoverridevirtualinherited

Implements IDTPM2::IFinder< T >.

Definition at line 68 of file AncestorFinder.h.

68{ return m_predicate(t); }
allow generic predicate types ...

Member Data Documentation

◆ m_predicate

PdgIdHelper< T > IDTPM2::GenericAncestorFinder< T, PdgIdHelper< T > >::m_predicate
privateinherited

Definition at line 72 of file AncestorFinder.h.


The documentation for this class was generated from the following file: