CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
btagbtvdeep::SortingClass< T > Class Template Reference

#include <sorting_modules.h>

Public Types

enum  compareResult { cmp_smaller, cmp_greater, cmp_invalid }
 

Public Member Functions

const Tget () const
 
 SortingClass ()
 
 SortingClass (const T &t, float sortA, float sortB=0, float sortC=0)
 

Static Public Member Functions

static compareResult compare (const SortingClass &a, const SortingClass &b, int validx=0)
 
static bool compareByABC (const SortingClass &a, const SortingClass &b)
 
static bool compareByABCInv (const SortingClass &a, const SortingClass &b)
 

Private Attributes

float sortValA
 
float sortValB
 
float sortValC
 
T t_
 

Detailed Description

template<class T>
class btagbtvdeep::SortingClass< T >

Definition at line 18 of file sorting_modules.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

template<class T >
btagbtvdeep::SortingClass< T >::SortingClass ( )
inline
template<class T >
btagbtvdeep::SortingClass< T >::SortingClass ( const T t,
float  sortA,
float  sortB = 0,
float  sortC = 0 
)
inline

Member Function Documentation

template<class T >
static compareResult btagbtvdeep::SortingClass< T >::compare ( const SortingClass< T > &  a,
const SortingClass< T > &  b,
int  validx = 0 
)
inlinestatic

Definition at line 31 of file sorting_modules.h.

References btagbtvdeep::SortingClass< T >::cmp_greater, btagbtvdeep::SortingClass< T >::cmp_invalid, btagbtvdeep::SortingClass< T >::cmp_smaller, edm::isFinite(), btagbtvdeep::SortingClass< T >::sortValA, btagbtvdeep::SortingClass< T >::sortValB, and btagbtvdeep::SortingClass< T >::sortValC.

Referenced by btagbtvdeep::SortingClass< T >::compareByABC().

31  {
32  float vala=a.sortValA;
33  float valb=b.sortValA;
34  if(validx==1){
35  vala=a.sortValB;
36  valb=b.sortValB;
37  }else if(validx==2){
38  vala=a.sortValC;
39  valb=b.sortValC;
40  }
41  if(edm::isFinite(vala) && edm::isFinite(valb) && valb!=vala){
42  if(vala>valb) return cmp_greater;
43  else return cmp_smaller;
44  }
45  if(edm::isFinite(vala) && !edm::isFinite(valb))
46  return cmp_greater;
47  if(!edm::isFinite(vala) && edm::isFinite(valb))
48  return cmp_smaller;
49  return cmp_invalid;
50  }
constexpr bool isFinite(T x)
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
template<class T >
static bool btagbtvdeep::SortingClass< T >::compareByABC ( const SortingClass< T > &  a,
const SortingClass< T > &  b 
)
inlinestatic

Definition at line 53 of file sorting_modules.h.

References btagbtvdeep::SortingClass< T >::cmp_greater, btagbtvdeep::SortingClass< T >::cmp_smaller, and btagbtvdeep::SortingClass< T >::compare().

Referenced by btagbtvdeep::SortingClass< T >::compareByABCInv().

53  {
54 
55  compareResult tmpres=compare(a,b,0);
56  if(tmpres==cmp_smaller) return true;
57  if(tmpres==cmp_greater) return false;
58 
59  tmpres=compare(a,b,1);
60  if(tmpres==cmp_smaller) return true;
61  if(tmpres==cmp_greater) return false;
62 
63  tmpres=compare(a,b,2);
64  if(tmpres==cmp_smaller) return true;
65  if(tmpres==cmp_greater) return false;
66 
67  return false;
68 
69  }
double b
Definition: hdecay.h:120
static compareResult compare(const SortingClass &a, const SortingClass &b, int validx=0)
double a
Definition: hdecay.h:121
template<class T >
static bool btagbtvdeep::SortingClass< T >::compareByABCInv ( const SortingClass< T > &  a,
const SortingClass< T > &  b 
)
inlinestatic

Definition at line 71 of file sorting_modules.h.

References btagbtvdeep::SortingClass< T >::compareByABC().

71  {
72  return compareByABC(b,a);
73  }
static bool compareByABC(const SortingClass &a, const SortingClass &b)
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
template<class T >
const T& btagbtvdeep::SortingClass< T >::get ( ) const
inline

Member Data Documentation

template<class T >
float btagbtvdeep::SortingClass< T >::sortValA
private

Definition at line 78 of file sorting_modules.h.

Referenced by btagbtvdeep::SortingClass< T >::compare().

template<class T >
float btagbtvdeep::SortingClass< T >::sortValB
private

Definition at line 78 of file sorting_modules.h.

Referenced by btagbtvdeep::SortingClass< T >::compare().

template<class T >
float btagbtvdeep::SortingClass< T >::sortValC
private

Definition at line 78 of file sorting_modules.h.

Referenced by btagbtvdeep::SortingClass< T >::compare().

template<class T >
T btagbtvdeep::SortingClass< T >::t_
private

Definition at line 77 of file sorting_modules.h.

Referenced by btagbtvdeep::SortingClass< T >::get().