HLT::ComboIterator Class Reference

Iterator used to loop over multi-particle combinations. More...

#include <ComboIterator.h>

Inheritance diagram for HLT::ComboIterator:
HLT::ComboIteratorBase HLT::ComboIteratorTopo

List of all members.

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.
ComboIteratoroperator++ (int)
 Post increment operator.
ComboIteratoroperator++ ()
 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 TrigNavStructurem_nav
 Pointer to the navigation service.

Detailed Description

Iterator used to loop over multi-particle combinations.

Author:
Nicolas Berger <Nicolas.Berger@cern.ch> - CERN

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.


Constructor & Destructor Documentation

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.

Parameters:
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.

Member Function Documentation

bool HLT::ComboIterator::isValid (  )  const [inline, virtual]

Validity check for the iterator.

Returns:
result of the validity check; returns false if iterator is at end, true otherwise.

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.

Returns:
result of the overlap test; returns true if the TE corresponds to the same RoI as one of the TEs in the vector, false otherwise.
Parameters:
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.

Returns:
result of the overlap test; returns true if the two TEs correspond to the same RoI, false otherwise.
Parameters:
t1 first TE to check.
t2 second TE to check.

Reimplemented in HLT::ComboIteratorTopo.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1