CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
22 
23 #include <iostream>
24 #include <map>
25 #include <queue>
26 #include <stack>
27 #include <string>
28 #include <unordered_map>
29 #include <vector>
30 
31 // forward declarations
32 class GlobalAlgorithm;
33 
34 namespace l1t {
35 
36  class ConditionEvaluation;
37 
38  // class interface
40  public:
42  typedef std::vector<TokenRPN> RpnVector;
44 
46  // AlgorithmEvaluation();
47 
49  explicit AlgorithmEvaluation(const GlobalAlgorithm&);
50 
52  // AlgorithmEvaluation(AlgorithmEvaluation&);
53 
55  // virtual ~AlgorithmEvaluation();
56 
57  //typedef std::map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
58  typedef std::unordered_map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
59  typedef ConditionEvaluationMap::const_iterator CItEvalMap;
60  typedef ConditionEvaluationMap::iterator ItEvalMap;
61 
62  public:
64  inline bool gtAlgoResult() const { return m_algoResult; }
65 
66  inline void setGtAlgoResult(const bool algoResult) { m_algoResult = algoResult; }
67 
69  void evaluateAlgorithm(const int chipNumber, const std::vector<ConditionEvaluationMap>&);
70 
73  inline std::vector<CombinationsInCond>& gtAlgoCombinationVector() { return m_algoCombinationVector; }
74 
75  inline std::vector<GlobalLogicParser::OperandToken>& operandTokenVector() { return m_operandTokenVector; }
76 
77  void print(std::ostream& myCout) const;
78 
79  private:
82 
83  // input
86 
87  std::vector<OperandToken> m_operandTokenVector;
88 
89  std::vector<CombinationsInCond> m_algoCombinationVector;
90  };
91 
92 } // namespace l1t
93 #endif
bool gtAlgoResult() const
get / set the result of the algorithm
ConditionEvaluationMap::const_iterator CItEvalMap
void print(std::ostream &myCout) const
void setGtAlgoResult(const bool algoResult)
std::vector< CombinationsInCond > m_algoCombinationVector
ConditionEvaluationMap::iterator ItEvalMap
std::string const & m_logicalExpression
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
std::vector< TokenRPN > RpnVector
AlgorithmEvaluation(const GlobalAlgorithm &)
constructor
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
RpnVector const & m_rpnVector
GlobalLogicParser::TokenRPN TokenRPN
GlobalLogicParser::OperandToken OperandToken
std::vector< GlobalLogicParser::OperandToken > & operandTokenVector()
std::unordered_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
bool m_algoResult
algorithm result
std::vector< OperandToken > m_operandTokenVector