CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
pat::OverlapDistance< Comparator > Struct Template Reference

#include <GenericOverlapFinder.h>

Public Member Functions

template<typename T1 , typename T2 >
double operator() (const T1 &t1, const T2 &t2) const
 
 OverlapDistance ()
 
 OverlapDistance (const Comparator &comp)
 

Private Attributes

Comparator comp_
 

Detailed Description

template<typename Comparator>
struct pat::OverlapDistance< Comparator >

Turn a comparator in a distance for uses of overlap comparator(x,y) = true <-> x and y overlap the associated distance would work as dist(x,y) = 1.0 - comparator(x,y) [0 if overlap, 1 otherwise] if the constructor of your Comparator does not need parameters, then the associated distance will not need parameters too.

Definition at line 24 of file GenericOverlapFinder.h.

Constructor & Destructor Documentation

◆ OverlapDistance() [1/2]

template<typename Comparator >
pat::OverlapDistance< Comparator >::OverlapDistance ( )
inline

Definition at line 26 of file GenericOverlapFinder.h.

26 {}

◆ OverlapDistance() [2/2]

template<typename Comparator >
pat::OverlapDistance< Comparator >::OverlapDistance ( const Comparator comp)
inline

Definition at line 27 of file GenericOverlapFinder.h.

27 : comp_(comp) {}

Member Function Documentation

◆ operator()()

template<typename Comparator >
template<typename T1 , typename T2 >
double pat::OverlapDistance< Comparator >::operator() ( const T1 &  t1,
const T2 &  t2 
) const
inline

Definition at line 29 of file GenericOverlapFinder.h.

29  {
30  return 1.0 - comp_(t1, t2);
31  }

References pat::OverlapDistance< Comparator >::comp_, RandomServiceHelper::t1, and RandomServiceHelper::t2.

Member Data Documentation

◆ comp_

template<typename Comparator >
Comparator pat::OverlapDistance< Comparator >::comp_
private
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
AlCaHLTBitMon_QueryRunRegistry.comp
string comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
pat::OverlapDistance::comp_
Comparator comp_
Definition: GenericOverlapFinder.h:34