HepChooser


The HepChooser class is a combinatoric engine which, given lists of objects, successively generates a list of objects which form a unique combination.

A HepChooser can take between 1 and 6 lists of objects. Then, the next() method or operator() will return the next set of objects, or 0 if done. The set is returned as a HepAList.

On each successive call to next(), HepChooser tries to find a new unique combination of objects. It uses locks (see HepLockable) to make certain that the same (fundamental) object is not used more than once anywhere in the list. For example, if A, B, C, and D are fundamental "track" objects, and E = A + B, then E and B or A cannot be in the same combination.

HepChooser respects locks, and therefore, any objects locked by a HepLock (which is turned on!) will not be used in a combination.

If a HepChooser is given the same list more than once, it will take the appropriate action so that the same combination (in a different) order does not occur more than once. The method orderMatters() will turn off this feature.

Author

Paul Rensing

See also

HepCombiner, HepLock, HepLockable

Declaration

#include "CLHEP/Combination/Chooser.h"

template <class TYPE>
class HepChooser

Public Member Functions

Constructor
inline HepChooser(
HepAList<TYPE> *l1, HepAList<TYPE> *l2=0,
HepAList<TYPE> *l3=0, HepAList<TYPE> *l4=0,
HepAList<TYPE> *l5=0, HepAList<TYPE> *l6=0 )
Constructor taking up to six pointers to lists as argument.
Constructor
inline HepChooser(HepAList< HepAList<TYPE> > &ll)
Constructor from a list of lists.
Destructor
inline ~HepChooser()
()
inline HepAList<TYPE>* operator () ()
Returns a pointer to a list with the next combination of objects or zero if all combinations are done.
next
inline HepAList<TYPE>* next()
Returns a pointer to a list with the next combination of objects or zero if all combinations are done.


29 September 1997
EVC