Iterator used to loop over multi-particle combinations. More...
#include <ComboIterator.h>
Public Member Functions | |
ComboIterator (const std::vector< TEVec > &tes, const TrigNavStructure *nav) | |
Constructor; gets a vector of TE vectors and a pointer to Navigation as arguments. | |
bool | rewind () |
Rewind method, resetting the iterator to the first element. | |
TEVec & | operator* () |
Unary * operator, used to recover the current combination. | |
bool | isValid () const |
Validity check for the iterator. | |
TEVec & | combination () |
Accessor method for the current combination. | |
ComboIterator & | operator++ (int) |
Post increment operator. | |
ComboIterator & | operator++ () |
Pre increment operator. | |
Protected Member Functions | |
virtual bool | overlaps (const TriggerElement *t1, const TriggerElement *t2) const |
Method used to test overlaps between two TEs. | |
bool | overlaps (const TriggerElement *t1, const TEVec &teVec, int idx=-1) const |
Method used to test overlaps between a TE and a vector of TEs. | |
bool | incrementByOne (int pos, bool &ok) |
Private increment method. | |
bool | increment (int pos) |
Private increment method. | |
bool | reset (int pos) |
Private reset method. | |
void | invalidate () |
Method used to invalidate the current combination. | |
void | print () const |
Debug dump to std::cout. | |
Protected Attributes | |
TEVec | m_comb |
Current combination of TEs. | |
std::vector< int > | m_idx |
Vector of indexes keeping track of the loop over combinations. | |
std::vector< TEVec > | m_tes |
Vector of vectors of TEs to be combined. | |
bool | m_valid |
Validity status variable. | |
const TrigNavStructure * | m_nav |
Pointer to the navigation service. |
Iterator used to loop over multi-particle combinations.
This iterator class is used by HLT algorithms to iterate over multi-particle combinations. Given a set of TEs, passed in the constructor, the iterator can be used to move over all the possible combinations of TEs. These combinations are built taking one TE from each of the vector of TEs passed in the constructor. So, as an example, to build all possible couples of TEs of the same type, the starting point will be a vector containing twice the same vector of TEs.
HLT::ComboIterator::ComboIterator | ( | const std::vector< TEVec > & | tes, | |
const TrigNavStructure * | nav | |||
) |
Constructor; gets a vector of TE vectors and a pointer to Navigation as arguments.
tes | vector of subvectors of TEs, one for each input type. Each subvector is the list of all TEs of a given type in the event. The same type may appear multiple times in the case of identical input particle types. | |
nav | pointer to the navigation service. |
bool HLT::ComboIterator::isValid | ( | ) | const [inline, virtual] |
Validity check for the iterator.
Implements HLT::ComboIteratorBase.
bool HLT::ComboIterator::overlaps | ( | const TriggerElement * | t1, | |
const TEVec & | teVec, | |||
int | idx = -1 | |||
) | const [protected] |
Method used to test overlaps between a TE and a vector of TEs.
t1 | TE to check. | |
teVec | TE vector to check. | |
idx | optional integer parameter, limiting the check over the 0..idx-1 range of the vector. |
bool HLT::ComboIterator::overlaps | ( | const TriggerElement * | t1, | |
const TriggerElement * | t2 | |||
) | const [protected, virtual] |
Method used to test overlaps between two TEs.
t1 | first TE to check. | |
t2 | second TE to check. |
Reimplemented in HLT::ComboIteratorTopo.