CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtAlgorithmEvaluation.h
Go to the documentation of this file.
1 #ifndef GlobalTrigger_L1GtAlgorithmEvaluation_h
2 #define GlobalTrigger_L1GtAlgorithmEvaluation_h
3 
18 // for L1GtLogicParser
20 
21 // system include files
22 #include <iostream>
23 
24 #include <string>
25 #include <vector>
26 #include <map>
27 #include <stack>
28 #include <queue>
29 
30 #include <boost/cstdint.hpp>
31 
32 // if hash map is used
33 
34 #include <ext/hash_map>
35 
36 // how to hash std::string, using a "template specialization"
37 namespace __gnu_cxx {
38 
43  template<> struct hash<std::string> {
44  size_t operator()(const std::string& x) const {
45  return hash<const char*> ()(x.c_str());
46  }
47  };
48 
49 }
50 // end hash map
51 
52 
53 // user include files
54 
55 // base class
57 
58 //
60 
61 // forward declarations
62 class L1GtAlgorithm;
64 
65 // class interface
67 
68 public:
70  typedef std::vector<TokenRPN> RpnVector;
72 
74  // L1GtAlgorithmEvaluation();
75 
77  explicit L1GtAlgorithmEvaluation(const L1GtAlgorithm&);
78 
80  // L1GtAlgorithmEvaluation(L1GtAlgorithmEvaluation&);
81 
83  // virtual ~L1GtAlgorithmEvaluation();
84 
85  //typedef std::map<std::string, L1GtConditionEvaluation*> ConditionEvaluationMap;
86  typedef __gnu_cxx ::hash_map<std::string, L1GtConditionEvaluation*>
88  typedef ConditionEvaluationMap::const_iterator CItEvalMap;
89  typedef ConditionEvaluationMap::iterator ItEvalMap;
90 
91 public:
92 
94  inline bool gtAlgoResult() const {
95  return m_algoResult;
96  }
97 
98  inline void setGtAlgoResult(const bool algoResult) {
99  m_algoResult = algoResult;
100  }
101 
103  void evaluateAlgorithm(const int chipNumber, const std::vector<
105 
108  inline std::vector<CombinationsInCond> & gtAlgoCombinationVector() {
110  }
111 
112  inline std::vector<L1GtLogicParser::OperandToken>& operandTokenVector() {
113  return m_operandTokenVector;
114  }
115 
116  void print(std::ostream& myCout) const;
117 
118 private:
119 
122 
123  // input
126 
127  std::vector<OperandToken> m_operandTokenVector;
128 
129  std::vector<CombinationsInCond> m_algoCombinationVector;
130 
131 };
132 
133 #endif
std::vector< TokenRPN > RpnVector
size_t operator()(const std::string &x) const
bool m_algoResult
algorithm result
L1GtLogicParser::TokenRPN TokenRPN
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
__gnu_cxx::hash_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
copy constructor
std::vector< L1GtLogicParser::OperandToken > & operandTokenVector()
std::vector< OperandToken > m_operandTokenVector
bool gtAlgoResult() const
get / set the result of the algorithm
L1GtLogicParser::OperandToken OperandToken
std::vector< CombinationsInCond > m_algoCombinationVector
void setGtAlgoResult(const bool algoResult)
ConditionEvaluationMap::iterator ItEvalMap
void print(std::ostream &myCout) const
L1GtAlgorithmEvaluation(const L1GtAlgorithm &)
constructor
Definition: DDAxes.h:10
std::string const & m_logicalExpression
ConditionEvaluationMap::const_iterator CItEvalMap
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm