5#ifndef ANALYSISUTILS_ANALYSISSELECTION_H
6#define ANALYSISUTILS_ANALYSISSELECTION_H
20 template <
class CRITERIA>
struct Selection :
public CRITERIA
28 template <
class COLL>
void getObjects(
const COLL *coll, std::vector<typename COLL::value_type> &out)
33 typename COLL::const_iterator it = coll->begin();
34 typename COLL::const_iterator itE = coll->end();
35 for (; it != itE; ++it)
37 if (CRITERIA::isAccepted(*it))
46 template <
class COLL>
void getIndices(
const COLL *coll, std::vector<int> &out)
52 typename COLL::const_iterator it = coll->begin();
53 typename COLL::const_iterator itE = coll->end();
54 for (; it != itE; ++it)
57 if (CRITERIA::isAccepted(*it))
utility class to select combination of elements in a collection
void getIndices(const COLL *coll, std::vector< int > &out)
get indices of the objects which pass the selection criteria
void getObjects(const COLL *coll, std::vector< typename COLL::value_type > &out)
get objects which pass the selection criteria