CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
BinaryOP Struct Reference

#include <TrackerDetIdSelector.h>

Public Types

enum  OP {
  OP::GREATER, OP::GREATER_EQUAL, OP::EQUAL, OP::LESS_EQUAL,
  OP::LESS, OP::NOT_EQUAL, OP::AND, OP::OR
}
 

Public Member Functions

 BinaryOP (OP op, ExpressionAST const &left, ExpressionAST const &right)
 
int evaluate (const DetId &detId, const TrackerTopology &trackerTopology) const
 

Public Attributes

ExpressionAST left
 
enum BinaryOP::OP op
 
ExpressionAST right
 

Detailed Description

Definition at line 74 of file TrackerDetIdSelector.h.

Member Enumeration Documentation

◆ OP

enum BinaryOP::OP
strong
Enumerator
GREATER 
GREATER_EQUAL 
EQUAL 
LESS_EQUAL 
LESS 
NOT_EQUAL 
AND 
OR 

Definition at line 75 of file TrackerDetIdSelector.h.

75 { GREATER, GREATER_EQUAL, EQUAL, LESS_EQUAL, LESS, NOT_EQUAL, AND, OR } op;
enum BinaryOP::OP op

Constructor & Destructor Documentation

◆ BinaryOP()

BinaryOP::BinaryOP ( OP  op,
ExpressionAST const &  left,
ExpressionAST const &  right 
)
inline

Definition at line 79 of file TrackerDetIdSelector.h.

79 : op(op), left(left), right(right) {}
ExpressionAST left
ExpressionAST right
enum BinaryOP::OP op

Member Function Documentation

◆ evaluate()

int BinaryOP::evaluate ( const DetId detId,
const TrackerTopology trackerTopology 
) const
inline

Definition at line 81 of file TrackerDetIdSelector.h.

References AND, EQUAL, ExpressionAST::evaluate(), GREATER, GREATER_EQUAL, left, LESS, LESS_EQUAL, NOT_EQUAL, op, OR, and right.

Referenced by Accessor::operator()().

81  {
82  switch (op) {
83  case OP::GREATER:
84  return left.evaluate(detId, trackerTopology) > right.evaluate(detId, trackerTopology);
85  case OP::GREATER_EQUAL:
86  return left.evaluate(detId, trackerTopology) >= right.evaluate(detId, trackerTopology);
87  case OP::EQUAL:
88  return left.evaluate(detId, trackerTopology) == right.evaluate(detId, trackerTopology);
89  case OP::LESS_EQUAL:
90  return left.evaluate(detId, trackerTopology) <= right.evaluate(detId, trackerTopology);
91  case OP::LESS:
92  return left.evaluate(detId, trackerTopology) < right.evaluate(detId, trackerTopology);
93  case OP::NOT_EQUAL:
94  return left.evaluate(detId, trackerTopology) != right.evaluate(detId, trackerTopology);
95  case OP::AND:
96  return left.evaluate(detId, trackerTopology) && right.evaluate(detId, trackerTopology);
97  case OP::OR:
98  return left.evaluate(detId, trackerTopology) || right.evaluate(detId, trackerTopology);
99  }
100  return 0;
101  }
ExpressionAST left
ExpressionAST right
int evaluate(const DetId &detId, const TrackerTopology &trackerTopology) const
enum BinaryOP::OP op

Member Data Documentation

◆ left

ExpressionAST BinaryOP::left

◆ op

enum BinaryOP::OP BinaryOP::op

Referenced by evaluate().

◆ right

ExpressionAST BinaryOP::right