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

the conversion key for comparison operators for Event Selection Algorithms More...

Enumerations

enum  ComparisonOperator {
  LT , GT , EQ , GE ,
  LE
}
 all possible comparison user inputs More...

Functions

template<typename T>
bool checkValue (T reference, ComparisonOperator sign, T test)
 the comparison test given the specified sign and two test values

Variables

static const std::map< std::string, ComparisonOperatorstringToOperator
 the map between user inputs and comparison operators

Detailed Description

the conversion key for comparison operators for Event Selection Algorithms

Author
Baptiste Ravina

Enumeration Type Documentation

◆ ComparisonOperator

all possible comparison user inputs

Enumerator
LT 
GT 
EQ 
GE 
LE 

Definition at line 18 of file SignEnums.h.

18 {
19 LT,
20 GT,
21 EQ,
22 GE,
23 LE
24 };

Function Documentation

◆ checkValue()

template<typename T>
bool SignEnum::checkValue ( T reference,
ComparisonOperator sign,
T test )

the comparison test given the specified sign and two test values

Definition at line 37 of file SignEnums.h.

37 {
38 switch (sign) {
40 return test < reference;
42 return test > reference;
44 return test == reference;
46 return test >= reference;
48 return test <= reference;
49 }
50 throw std::runtime_error("SignEnum::checkValue did not recognise the sign argument! Make sure it is listed within SignEnum::ComparisonOperator.");
51 }
int sign(int a)

Variable Documentation

◆ stringToOperator

const std::map<std::string, ComparisonOperator> SignEnum::stringToOperator
static
Initial value:

the map between user inputs and comparison operators

Definition at line 27 of file SignEnums.h.

27 {
28 {"LT", ComparisonOperator::LT}, // <
29 {"GT", ComparisonOperator::GT}, // >
30 {"EQ", ComparisonOperator::EQ}, // ==
31 {"GE", ComparisonOperator::GE}, // >=
32 {"LE", ComparisonOperator::LE} // <=
33 };