CMS 3D CMS Logo

AlgorithmEvaluation.h
Go to the documentation of this file.
1 #ifndef L1Trigger_L1TGlobal_AlgorithmEvaluation_h
2 #define L1Trigger_L1TGlobal_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 
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 //
63 
64 // forward declarations
65 class GlobalAlgorithm;
66 
67 namespace l1t {
68 
70 
71 // class interface
73 
74 public:
76  typedef std::vector<TokenRPN> RpnVector;
78 
80  // AlgorithmEvaluation();
81 
83  explicit AlgorithmEvaluation(const GlobalAlgorithm&);
84 
86  // AlgorithmEvaluation(AlgorithmEvaluation&);
87 
89  // virtual ~AlgorithmEvaluation();
90 
91  //typedef std::map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
92  typedef __gnu_cxx ::hash_map<std::string, ConditionEvaluation*>
94  typedef ConditionEvaluationMap::const_iterator CItEvalMap;
95  typedef ConditionEvaluationMap::iterator ItEvalMap;
96 
97 public:
98 
100  inline bool gtAlgoResult() const {
101  return m_algoResult;
102  }
103 
104  inline void setGtAlgoResult(const bool algoResult) {
105  m_algoResult = algoResult;
106  }
107 
109  void evaluateAlgorithm(const int chipNumber, const std::vector<
111 
114  inline std::vector<CombinationsInCond> & gtAlgoCombinationVector() {
115  return m_algoCombinationVector;
116  }
117 
118  inline std::vector<GlobalLogicParser::OperandToken>& operandTokenVector() {
119  return m_operandTokenVector;
120  }
121 
122  void print(std::ostream& myCout) const;
123 
124 private:
125 
128 
129  // input
131  RpnVector const & m_rpnVector;
132 
133  std::vector<OperandToken> m_operandTokenVector;
134 
135  std::vector<CombinationsInCond> m_algoCombinationVector;
136 
137 };
138 
139 }
140 #endif
bool gtAlgoResult() const
get / set the result of the algorithm
size_t operator()(const std::string &x) const
ConditionEvaluationMap::const_iterator CItEvalMap
void setGtAlgoResult(const bool algoResult)
__gnu_cxx::hash_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
delete x;
Definition: CaloConfig.h:22
std::vector< CombinationsInCond > m_algoCombinationVector
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
ConditionEvaluationMap::iterator ItEvalMap
std::string const & m_logicalExpression
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
std::vector< TokenRPN > RpnVector
GlobalLogicParser::TokenRPN TokenRPN
GlobalLogicParser::OperandToken OperandToken
std::vector< GlobalLogicParser::OperandToken > & operandTokenVector()
bool m_algoResult
algorithm result
std::vector< OperandToken > m_operandTokenVector