CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
triggerExpression::Parser< Iterator > Class Template Reference

#include <TriggerExpressionParser.h>

Inheritance diagram for triggerExpression::Parser< Iterator >:

Public Member Functions

 Parser ()
 

Private Types

typedef qi::rule< Iterator, std::string(), ascii::space_type > name_rule
 
typedef qi::rule< Iterator, Evaluator *(), ascii::space_type > rule
 
typedef qi::rule< Iteratorterminal_rule
 

Private Attributes

rule argument_masking
 
rule element
 
rule expression
 
rule operand
 
terminal_rule operand_and
 
terminal_rule operand_masking
 
terminal_rule operand_not
 
terminal_rule operand_or
 
terminal_rule operand_xor
 
rule parenthesis
 
rule prescale
 
rule token
 
terminal_rule token_false
 
name_rule token_l1algo
 
rule token_masking
 
name_rule token_path
 
terminal_rule token_true
 
rule unary
 

Detailed Description

template<typename Iterator>
class triggerExpression::Parser< Iterator >

Definition at line 23 of file TriggerExpressionParser.h.

Member Typedef Documentation

◆ name_rule

template<typename Iterator>
typedef qi::rule<Iterator, std::string(), ascii::space_type> triggerExpression::Parser< Iterator >::name_rule
private

Definition at line 77 of file TriggerExpressionParser.h.

◆ rule

template<typename Iterator>
typedef qi::rule<Iterator, Evaluator *(), ascii::space_type> triggerExpression::Parser< Iterator >::rule
private

Definition at line 78 of file TriggerExpressionParser.h.

◆ terminal_rule

template<typename Iterator>
typedef qi::rule<Iterator> triggerExpression::Parser< Iterator >::terminal_rule
private

Definition at line 79 of file TriggerExpressionParser.h.

Constructor & Destructor Documentation

◆ Parser()

template<typename Iterator>
triggerExpression::Parser< Iterator >::Parser ( )
inline

Definition at line 25 of file TriggerExpressionParser.h.

References triggerExpression::Parser< Iterator >::argument_masking, filterCSVwithJSON::copy, makeHLTPrescaleTable::delimiter, triggerExpression::Parser< Iterator >::element, triggerExpression::Parser< Iterator >::expression, triggerExpression::Parser< Iterator >::operand, triggerExpression::Parser< Iterator >::operand_and, triggerExpression::Parser< Iterator >::operand_masking, triggerExpression::Parser< Iterator >::operand_not, triggerExpression::Parser< Iterator >::operand_or, triggerExpression::Parser< Iterator >::operand_xor, triggerExpression::Parser< Iterator >::parenthesis, triggerExpression::Parser< Iterator >::token, triggerExpression::Parser< Iterator >::token_false, triggerExpression::Parser< Iterator >::token_l1algo, triggerExpression::Parser< Iterator >::token_masking, triggerExpression::Parser< Iterator >::token_path, triggerExpression::Parser< Iterator >::token_true, and triggerExpression::Parser< Iterator >::unary.

25  : Parser::base_type(expression) {
26  auto delimiter = qi::copy(qi::eoi | !qi::char_("a-zA-Z0-9_*?"));
27 
28  operand_not = qi::lexeme[qi::lit("NOT") >> delimiter];
29  operand_and = qi::lexeme[qi::lit("AND") >> delimiter];
30  operand_or = qi::lexeme[qi::lit("OR") >> delimiter];
31  operand_xor = qi::lexeme[qi::lit("XOR") >> delimiter];
32  operand_masking = qi::lexeme[qi::lit("MASKING") >> delimiter];
33 
34  // "TRUE": keyword to accept all events
35  token_true = qi::lexeme[qi::lit("TRUE") >> delimiter];
36 
37  // "FALSE": keyword to reject all events
38  token_false = qi::lexeme[qi::lit("FALSE") >> delimiter];
39 
40  // Level-1 Global Trigger decisions: must begin with characters "L1_"
41  token_l1algo %= qi::raw[qi::lexeme["L1_" >> +(qi::char_("a-zA-Z0-9_*?"))]];
42 
43  // Decisions of Paths in the CMSSW configuration (e.g. high-level triggers):
44  // any alphanumeric pattern except for "TRUE", "FALSE", "NOT", "AND", "OR", "XOR" and "MASKING"
45  token_path %= qi::raw[qi::lexeme[+(qi::char_("a-zA-Z0-9_*?"))] - token_true - token_false - operand_not -
47 
48  token = (token_true[qi::_val = new_<Constant>(true)] | token_false[qi::_val = new_<Constant>(false)] |
49  token_l1algo[qi::_val = new_<L1uGTReader>(qi::_1)] | token_path[qi::_val = new_<PathReader>(qi::_1)]);
50 
51  parenthesis %= ('(' >> expression >> ')');
52 
53  element %= (token | parenthesis);
54 
55  prescale = (element >> '/' >> qi::uint_)[qi::_val = new_<Prescaler>(qi::_1, qi::_2)];
56 
57  operand %= (prescale | element);
58 
59  unary = ((operand_not >> unary)[qi::_val = new_<OperatorNot>(qi::_1)] | operand[qi::_val = qi::_1]);
60 
61  // token_masking is used to restrict the argument (rhs) of the "MASKING"
62  // operation to Constant[FALSE], L1uGTReader and PathReader evaluators
64  (token_false[qi::_val = new_<Constant>(false)] | token_l1algo[qi::_val = new_<L1uGTReader>(qi::_1)] |
65  token_path[qi::_val = new_<PathReader>(qi::_1)]);
66 
67  argument_masking %= (token_masking | ('(' >> argument_masking >> ')'));
68 
69  expression = unary[qi::_val = qi::_1] >>
70  *((operand_and >> unary)[qi::_val = new_<OperatorAnd>(qi::_val, qi::_1)] |
71  (operand_or >> unary)[qi::_val = new_<OperatorOr>(qi::_val, qi::_1)] |
72  (operand_xor >> unary)[qi::_val = new_<OperatorXor>(qi::_val, qi::_1)] |
73  (operand_masking >> argument_masking)[qi::_val = new_<OperatorMasking>(qi::_val, qi::_1)]);
74  }

Member Data Documentation

◆ argument_masking

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::argument_masking
private

◆ element

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::element
private

◆ expression

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::expression
private

◆ operand

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::operand
private

◆ operand_and

template<typename Iterator>
terminal_rule triggerExpression::Parser< Iterator >::operand_and
private

◆ operand_masking

template<typename Iterator>
terminal_rule triggerExpression::Parser< Iterator >::operand_masking
private

◆ operand_not

template<typename Iterator>
terminal_rule triggerExpression::Parser< Iterator >::operand_not
private

◆ operand_or

template<typename Iterator>
terminal_rule triggerExpression::Parser< Iterator >::operand_or
private

◆ operand_xor

template<typename Iterator>
terminal_rule triggerExpression::Parser< Iterator >::operand_xor
private

◆ parenthesis

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::parenthesis
private

◆ prescale

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::prescale
private

Definition at line 96 of file TriggerExpressionParser.h.

◆ token

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::token
private

◆ token_false

template<typename Iterator>
terminal_rule triggerExpression::Parser< Iterator >::token_false
private

◆ token_l1algo

template<typename Iterator>
name_rule triggerExpression::Parser< Iterator >::token_l1algo
private

◆ token_masking

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::token_masking
private

◆ token_path

template<typename Iterator>
name_rule triggerExpression::Parser< Iterator >::token_path
private

◆ token_true

template<typename Iterator>
terminal_rule triggerExpression::Parser< Iterator >::token_true
private

◆ unary

template<typename Iterator>
rule triggerExpression::Parser< Iterator >::unary
private