ATLAS Offline Software
Functions
PhiFilterRange.cxx File Reference
#include <cmath>
#include <boost/numeric/interval/compare/explicit.hpp>
#include "AnalysisUtils/PhiFilterRange.h"
Include dependency graph for PhiFilterRange.cxx:

Go to the source code of this file.

Functions

bool operator== (const PhiFilterRange &r1, const PhiFilterRange &r2)
 
bool operator!= (const PhiFilterRange &r1, const PhiFilterRange &r2)
 
bool operator< (const PhiFilterRange &r1, const PhiFilterRange &r2)
 
bool operator>= (const PhiFilterRange &r1, const PhiFilterRange &r2)
 
bool operator> (const PhiFilterRange &r1, const PhiFilterRange &r2)
 
bool operator<= (const PhiFilterRange &r1, const PhiFilterRange &r2)
 

Function Documentation

◆ operator!=()

bool operator!= ( const PhiFilterRange r1,
const PhiFilterRange r2 
)

Definition at line 124 of file PhiFilterRange.cxx.

125 {
126  return !( operator==(r1,r2));
127 }

◆ operator<()

bool operator< ( const PhiFilterRange r1,
const PhiFilterRange r2 
)

!isActive <==> range= [-inf, +inf]

Definition at line 129 of file PhiFilterRange.cxx.

130 {
131  if ( r1.isActive() != r2.isActive() ) {
133  if ( r2.isActive() ) {
134  // case r1 = [-inf, +inf] and r2 = [a,b]
135  return false;
136  } else {
137  // case r1 = [a, b] and r2 = [-inf, +inf]
138  return true;
139  }
140  }
141 
142  if ( false == r1.isActive() &&
143  false == r2.isActive() ) {
144  return false;
145  }
146 
147  return ( r1.upper() < r2.lower() );
148 }

◆ operator<=()

bool operator<= ( const PhiFilterRange r1,
const PhiFilterRange r2 
)

Definition at line 176 of file PhiFilterRange.cxx.

177 {
178  return !( operator>(r1,r2) );
179 }

◆ operator==()

bool operator== ( const PhiFilterRange r1,
const PhiFilterRange r2 
)

Definition at line 107 of file PhiFilterRange.cxx.

108 {
109  if ( r1.isActive() != r2.isActive() ) {
110  return false;
111  }
112 
113  if ( false == r1.isActive() &&
114  false == r2.isActive() ) {
115  return true;
116  }
117 
118  const double precision = std::min( r1.precision(), r2.precision() );
119 
120  return ( (std::fabs(r1.lower() - r2.lower()) <= precision ) &&
121  (std::fabs(r1.upper() - r2.upper()) <= precision ) );
122 }

◆ operator>()

bool operator> ( const PhiFilterRange r1,
const PhiFilterRange r2 
)

!isActive <==> range= [-inf, +inf]

Definition at line 155 of file PhiFilterRange.cxx.

156 {
157  if ( r1.isActive() != r2.isActive() ) {
159  if ( r2.isActive() ) {
160  // case r1 = [-inf, +inf] and r2 = [a,b]
161  return true;
162  } else {
163  // case r1 = [a, b] and r2 = [-inf, +inf]
164  return false;
165  }
166  }
167 
168  if ( false == r1.isActive() &&
169  false == r2.isActive() ) {
170  return false;
171  }
172 
173  return ( r1.lower() > r2.upper() );
174 }

◆ operator>=()

bool operator>= ( const PhiFilterRange r1,
const PhiFilterRange r2 
)

Definition at line 150 of file PhiFilterRange.cxx.

151 {
152  return !( operator<(r1,r2) );
153 }
operator>
bool operator>(const PhiFilterRange &r1, const PhiFilterRange &r2)
Definition: PhiFilterRange.cxx:155
operator<
bool operator<(const PhiFilterRange &r1, const PhiFilterRange &r2)
Definition: PhiFilterRange.cxx:129
operator==
bool operator==(const PhiFilterRange &r1, const PhiFilterRange &r2)
Definition: PhiFilterRange.cxx:107
MCP::ScaleSmearParam::r2
@ r2
min
#define min(a, b)
Definition: cfImp.cxx:40
MCP::ScaleSmearParam::r1
@ r1