combination
More...
#include <AnalysisCombination.h>
|
| | Combination (COLL *coll, const unsigned int nElement) |
| | constructor More...
|
| |
| | ~Combination () |
| | destructor More...
|
| |
| void | reset () |
| | reset internal indices More...
|
| |
| template<class OUT > |
| bool | get (OUT &comb) |
| | get a combination. More...
|
| |
| template<class CALLER , class OUT , class CRITERIA > |
| bool | goodOnes (CALLER *caller, OUT &comb, CRITERIA criteria) |
| | get a combination which passes a selection criteria More...
|
| |
| template<class OUT > |
| bool | get (OUT &comb, OUT &remain) |
| | get a combination and the remaining elements More...
|
| |
| template<class CALLER , class OUT , class CRITERIA > |
| bool | goodOnes (CALLER *caller, OUT &comb, OUT &remain, CRITERIA criteria) |
| | get a combination and the remaining elements. More...
|
| |
template<class COLL>
class AnalysisUtils::Combination< COLL >
combination
Definition at line 20 of file AnalysisCombination.h.
◆ Combination()
template<class COLL >
| Combination::Combination |
( |
COLL * |
coll, |
|
|
const unsigned int |
nElement |
|
) |
| |
|
inline |
constructor
- Parameters
-
| coll | [in] collection |
| nElement | [in] number of element to be selected |
Definition at line 153 of file AnalysisCombination.h.
158 for (
unsigned int i=0;
i<nElement; ++
i)
◆ ~Combination()
◆ get() [1/2]
template<class COLL >
template<class OUT >
get a combination.
internal indices are incremented
- Parameters
-
| comb | [out] combination of elements |
- Returns
- true:success false:end of selection
Definition at line 43 of file AnalysisCombination.h.
◆ get() [2/2]
template<class COLL >
template<class OUT >
get a combination and the remaining elements
Definition at line 85 of file AnalysisCombination.h.
91 if (!ret)
return false;
94 unsigned int sIndex = 0;
95 std::vector<unsigned int>::const_iterator
it =
m_index.begin();
96 std::vector<unsigned int>::const_iterator
itE =
m_index.end();
105 for (
unsigned int i=sIndex;
i<eIndex; ++
i)
106 remain.push_back((*
m_coll)[
i]);
109 if (
it ==
itE)
break;
◆ goodOnes() [1/2]
template<class COLL >
template<class CALLER , class OUT , class CRITERIA >
get a combination which passes a selection criteria
- Parameters
-
| caller | |
| comb | [out] combination of elements |
| criteria | [in] a function pointer of selection criteria |
- Returns
- true:success false:end of selection
Definition at line 70 of file AnalysisCombination.h.
73 if (!ret)
return false;
76 if (criteria(caller, comb))
return true;
79 return goodOnes(caller, comb, criteria);
◆ goodOnes() [2/2]
template<class COLL >
template<class CALLER , class OUT , class CRITERIA >
get a combination and the remaining elements.
the combination passes a selection criteria
Definition at line 119 of file AnalysisCombination.h.
121 bool ret =
get(comb, remain);
122 if (!ret)
return false;
125 if (criteria(caller, comb))
return true;
128 return goodOnes(caller, comb, remain, criteria);
◆ reset()
◆ setNewIndex()
template<class COLL >
| bool Combination::setNewIndex |
( |
int |
iElement | ) |
|
|
inlineprivate |
◆ m_coll
◆ m_first
◆ m_index
◆ m_nElement
The documentation for this class was generated from the following file: