ATLAS Offline Software
Loading...
Searching...
No Matches
AnalysisUtils Namespace Reference

utility class to select combination of elements in a collection More...

Namespaces

namespace  Classify
 classify
namespace  Delta
 compute \( \Delta \)
namespace  Imass
 compute Invariant mass
namespace  Match
 find the closest element in a collection to an INavigable4Momentum
namespace  Sort
 sort

Classes

class  Combination
 combination More...
class  Permutation
 permutation More...
struct  Selection

Functions

template<class In, class Out, class Pred>
Out copy_if (In first, const In &last, Out res, const Pred &p)

Detailed Description

utility class to select combination of elements in a collection

IFilterUtils : Implements a copy iterator (STL is missing this utility, though one could use the std::remove_if with the negative predicate).

Utility class to get elements which pass a selection criteria.

utility class to return permutation of a collection

Tools collection.

Author
Tadashi Maeno

User must provide a class for the selection critaria. The class must have a public method "bool isAccepted(Collection::value_type e)".

Author
Tadashi Maeno

The output destination container is filled with the current iterator on the input container, only if the predicate is true. Example:

AnalysisUtils::copy_if( in.begin(), in.end(),
std::back_inserter(out), filter );
Out copy_if(In first, const In &last, Out res, const Pred &p)

where in and out are STL-like containers and filter is a predicate (in our case, it could be a reference toward an IFilter).

Function Documentation

◆ copy_if()

template<class In, class Out, class Pred>
Out AnalysisUtils::copy_if ( In first,
const In & last,
Out res,
const Pred & p )

Definition at line 30 of file IFilterUtils.h.

31{
32 for ( ; first != last; ++first ) {
33 if ( p(*first) ) {
34 *res++ = *first;
35 }
36 }
37 return res;
38}
std::pair< std::vector< unsigned int >, bool > res