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 
20 // for L1GtLogicParser
22 
23 // system include files
24 #include <iostream>
25 
26 #include <string>
27 #include <vector>
28 #include <map>
29 #include <stack>
30 #include <queue>
31 
32 #include <boost/cstdint.hpp>
33 
34 // if hash map is used
35 
36 #include <ext/hash_map>
37 
38 // how to hash std::string, using a "template specialization"
39 namespace __gnu_cxx {
40 
45  template<> struct hash<std::string> {
46  size_t operator()(const std::string& x) const {
47  return hash<const char*> ()(x.c_str());
48  }
49  };
50 
51 }
52 // end hash map
53 
54 
55 // user include files
56 
57 // base class
59 
60 //
62 
63 // forward declarations
64 class L1GtAlgorithm;
66 
67 // class interface
69 
70 public:
72  typedef std::vector<TokenRPN> RpnVector;
74 
76  // L1GtAlgorithmEvaluation();
77 
79  explicit L1GtAlgorithmEvaluation(const L1GtAlgorithm&);
80 
82  // L1GtAlgorithmEvaluation(L1GtAlgorithmEvaluation&);
83 
85  // virtual ~L1GtAlgorithmEvaluation();
86 
87  //typedef std::map<std::string, L1GtConditionEvaluation*> ConditionEvaluationMap;
88  typedef __gnu_cxx ::hash_map<std::string, L1GtConditionEvaluation*>
90  typedef ConditionEvaluationMap::const_iterator CItEvalMap;
91  typedef ConditionEvaluationMap::iterator ItEvalMap;
92 
93 public:
94 
96  inline bool gtAlgoResult() const {
97  return m_algoResult;
98  }
99 
100  inline void setGtAlgoResult(const bool algoResult) {
101  m_algoResult = algoResult;
102  }
103 
105  void evaluateAlgorithm(const int chipNumber, const std::vector<
107 
110  inline std::vector<CombinationsInCond> & gtAlgoCombinationVector() {
112  }
113 
114  inline std::vector<L1GtLogicParser::OperandToken>& operandTokenVector() {
115  return m_operandTokenVector;
116  }
117 
118  void print(std::ostream& myCout) const;
119 
120 private:
121 
124 
125  // input
126  std::string const & m_logicalExpression;
128 
129  std::vector<OperandToken> m_operandTokenVector;
130 
131  std::vector<CombinationsInCond> m_algoCombinationVector;
132 
133 };
134 
135 #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