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 
4 // work-around for missing dependency - force checkout...
5 
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>
38 
39 // how to hash std::string, using a "template specialization"
40 // DMP Comment out for not to prevent conflicts
41 /* namespace __gnu_cxx { */
42 
43 /* /\** */
44 /* Explicit template specialization of hash of a string class, */
45 /* which just uses the internal char* representation as a wrapper. */
46 /* *\/ */
47 /* template<> struct hash<std::string> { */
48 /* size_t operator()(const std::string& x) const { */
49 /* return hash<const char*> ()(x.c_str()); */
50 /* } */
51 /* }; */
52 
53 /* } */
54 // end hash map
55 
56 
57 // user include files
58 
59 // base class
61 
62 //
64 
65 // forward declarations
66 class L1GtAlgorithm;
67 
68 namespace l1t {
69 
71 
72 // class interface
74 
75 public:
77  typedef std::vector<TokenRPN> RpnVector;
79 
81  // AlgorithmEvaluation();
82 
84  explicit AlgorithmEvaluation(const L1GtAlgorithm&);
85 
87  // AlgorithmEvaluation(AlgorithmEvaluation&);
88 
90  // virtual ~AlgorithmEvaluation();
91 
92  //typedef std::map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
93  typedef __gnu_cxx ::hash_map<std::string, ConditionEvaluation*>
95  typedef ConditionEvaluationMap::const_iterator CItEvalMap;
96  typedef ConditionEvaluationMap::iterator ItEvalMap;
97 
98 public:
99 
101  inline bool gtAlgoResult() const {
102  return m_algoResult;
103  }
104 
105  inline void setGtAlgoResult(const bool algoResult) {
106  m_algoResult = algoResult;
107  }
108 
110  void evaluateAlgorithm(const int chipNumber, const std::vector<
112 
115  inline std::vector<CombinationsInCond> & gtAlgoCombinationVector() {
117  }
118 
119  inline std::vector<L1GtLogicParser::OperandToken>& operandTokenVector() {
120  return m_operandTokenVector;
121  }
122 
123  void print(std::ostream& myCout) const;
124 
125 private:
126 
129 
130  // input
133 
134  std::vector<OperandToken> m_operandTokenVector;
135 
136  std::vector<CombinationsInCond> m_algoCombinationVector;
137 
138 };
139 
140 }
141 #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