CMS 3D CMS Logo

List of all members | Public Member Functions
muonisolation::Range< T > Class Template Reference

#include <Range.h>

Inheritance diagram for muonisolation::Range< T >:

Public Member Functions

bool empty () const
 
bool inside (const T &value) const
 
const Tmax () const
 
T mean () const
 
const Tmin () const
 
 Range ()
 
 Range (const std::pair< T, T > &aPair)
 
 Range (const T &aMin, const T &aMax)
 
void sort ()
 

Detailed Description

template<class T>
class muonisolation::Range< T >

Define a range [aMin,aMax]

Definition at line 15 of file Range.h.

Constructor & Destructor Documentation

◆ Range() [1/3]

template<class T>
muonisolation::Range< T >::Range ( void  )
inline

Definition at line 17 of file Range.h.

17 {}

◆ Range() [2/3]

template<class T>
muonisolation::Range< T >::Range ( const T aMin,
const T aMax 
)
inline

Definition at line 19 of file Range.h.

19 : std::pair<T, T>(aMin, aMax) {}

◆ Range() [3/3]

template<class T>
muonisolation::Range< T >::Range ( const std::pair< T, T > &  aPair)
inline

Definition at line 21 of file Range.h.

21 : std::pair<T, T>(aPair) {}

Member Function Documentation

◆ empty()

template<class T>
bool muonisolation::Range< T >::empty ( void  ) const
inline

Definition at line 29 of file Range.h.

29 { return (this->second < this->first); }

Referenced by muonisolation::Range< float >::sort().

◆ inside()

template<class T>
bool muonisolation::Range< T >::inside ( const T value) const
inline

Definition at line 31 of file Range.h.

31  {
32  if (value < this->first || this->second < value)
33  return false;
34  else
35  return true;
36  }

◆ max()

template<class T>
const T& muonisolation::Range< T >::max ( ) const
inline

Definition at line 25 of file Range.h.

25 { return this->second; }

◆ mean()

template<class T>
T muonisolation::Range< T >::mean ( ) const
inline

Definition at line 27 of file Range.h.

27 { return (this->first + this->second) / 2.; }

◆ min()

template<class T>
const T& muonisolation::Range< T >::min ( ) const
inline

Definition at line 23 of file Range.h.

23 { return this->first; }

◆ sort()

template<class T>
void muonisolation::Range< T >::sort ( )
inline

Definition at line 38 of file Range.h.

38  {
39  if (empty())
40  std::swap(this->first, this->second);
41  }
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
dqmdumpme.first
first
Definition: dqmdumpme.py:55
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
muonisolation::Range::empty
bool empty() const
Definition: Range.h:29
value
Definition: value.py:1