CMS 3D CMS Logo

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 <map>
25 #include <queue>
26 #include <stack>
27 #include <string>
28 #include <vector>
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 } // namespace __gnu_cxx
50 // end hash map
51 
52 // user include files
53 
54 // base class
56 
57 //
59 
60 // forward declarations
61 class L1GtAlgorithm;
63 
64 // class interface
66 
67 public:
69  typedef std::vector<TokenRPN> RpnVector;
71 
73  // L1GtAlgorithmEvaluation();
74 
76  explicit L1GtAlgorithmEvaluation(const L1GtAlgorithm &);
77 
79  // L1GtAlgorithmEvaluation(L1GtAlgorithmEvaluation&);
80 
82  // virtual ~L1GtAlgorithmEvaluation();
83 
84  // typedef std::map<std::string, L1GtConditionEvaluation*>
85  // ConditionEvaluationMap;
86  typedef __gnu_cxx ::hash_map<std::string, L1GtConditionEvaluation *>
88  typedef ConditionEvaluationMap::const_iterator CItEvalMap;
89  typedef ConditionEvaluationMap::iterator ItEvalMap;
90 
91 public:
93  inline bool gtAlgoResult() const { return m_algoResult; }
94 
95  inline void setGtAlgoResult(const bool algoResult) {
96  m_algoResult = algoResult;
97  }
98 
100  void evaluateAlgorithm(const int chipNumber,
101  const std::vector<ConditionEvaluationMap> &);
102 
105  inline std::vector<CombinationsInCond> &gtAlgoCombinationVector() {
106  return m_algoCombinationVector;
107  }
108 
109  inline std::vector<L1GtLogicParser::OperandToken> &operandTokenVector() {
110  return m_operandTokenVector;
111  }
112 
113  void print(std::ostream &myCout) const;
114 
115 private:
118 
119  // input
121  RpnVector const &m_rpnVector;
122 
123  std::vector<OperandToken> m_operandTokenVector;
124 
125  std::vector<CombinationsInCond> m_algoCombinationVector;
126 };
127 
128 #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()
std::vector< L1GtLogicParser::OperandToken > & operandTokenVector()
std::vector< OperandToken > m_operandTokenVector
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
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
__gnu_cxx::hash_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
copy constructor
std::string const & m_logicalExpression
ConditionEvaluationMap::const_iterator CItEvalMap