CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlgorithmEvaluation.h
Go to the documentation of this file.
1 #ifndef GlobalTrigger_AlgorithmEvaluation_h
2 #define GlobalTrigger_AlgorithmEvaluation_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>
36 
37 // how to hash std::string, using a "template specialization"
38 // DMP Comment out for not to prevent conflicts
39 /* namespace __gnu_cxx { */
40 
41 /* /\** */
42 /* Explicit template specialization of hash of a string class, */
43 /* which just uses the internal char* representation as a wrapper. */
44 /* *\/ */
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;
65 
66 namespace l1t {
67 
69 
70 // class interface
72 
73 public:
75  typedef std::vector<TokenRPN> RpnVector;
77 
79  // AlgorithmEvaluation();
80 
82  explicit AlgorithmEvaluation(const L1GtAlgorithm&);
83 
85  // AlgorithmEvaluation(AlgorithmEvaluation&);
86 
88  // virtual ~AlgorithmEvaluation();
89 
90  //typedef std::map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
91  typedef __gnu_cxx ::hash_map<std::string, ConditionEvaluation*>
93  typedef ConditionEvaluationMap::const_iterator CItEvalMap;
94  typedef ConditionEvaluationMap::iterator ItEvalMap;
95 
96 public:
97 
99  inline bool gtAlgoResult() const {
100  return m_algoResult;
101  }
102 
103  inline void setGtAlgoResult(const bool algoResult) {
104  m_algoResult = algoResult;
105  }
106 
108  void evaluateAlgorithm(const int chipNumber, const std::vector<
110 
113  inline std::vector<CombinationsInCond> & gtAlgoCombinationVector() {
115  }
116 
117  inline std::vector<L1GtLogicParser::OperandToken>& operandTokenVector() {
118  return m_operandTokenVector;
119  }
120 
121  void print(std::ostream& myCout) const;
122 
123 private:
124 
127 
128  // input
131 
132  std::vector<OperandToken> m_operandTokenVector;
133 
134  std::vector<CombinationsInCond> m_algoCombinationVector;
135 
136 };
137 
138 }
139 #endif
bool gtAlgoResult() const
get / set the result of the algorithm
ConditionEvaluationMap::const_iterator CItEvalMap
void print(std::ostream &myCout) const
std::vector< L1GtLogicParser::OperandToken > & operandTokenVector()
void setGtAlgoResult(const bool algoResult)
__gnu_cxx::hash_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
std::vector< CombinationsInCond > m_algoCombinationVector
ConditionEvaluationMap::iterator ItEvalMap
L1GtLogicParser::TokenRPN TokenRPN
std::string const & m_logicalExpression
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
std::vector< TokenRPN > RpnVector
L1GtLogicParser::OperandToken OperandToken
AlgorithmEvaluation(const L1GtAlgorithm &)
constructor
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
bool m_algoResult
algorithm result
std::vector< OperandToken > m_operandTokenVector