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 // 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 
45  template <>
46  struct hash<std::string> {
47  size_t operator()(const std::string& x) const { return hash<const char*>()(x.c_str()); }
48  };
49 
50 } // namespace __gnu_cxx
51 // end hash map
52 
53 // user include files
54 
55 // base class
57 
58 //
59 
60 // forward declarations
61 class GlobalAlgorithm;
62 
63 namespace l1t {
64 
65  class ConditionEvaluation;
66 
67  // class interface
69  public:
71  typedef std::vector<TokenRPN> RpnVector;
73 
75  // AlgorithmEvaluation();
76 
78  explicit AlgorithmEvaluation(const GlobalAlgorithm&);
79 
81  // AlgorithmEvaluation(AlgorithmEvaluation&);
82 
84  // virtual ~AlgorithmEvaluation();
85 
86  //typedef std::map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
87  typedef __gnu_cxx ::hash_map<std::string, ConditionEvaluation*> ConditionEvaluationMap;
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) { m_algoResult = algoResult; }
96 
98  void evaluateAlgorithm(const int chipNumber, const std::vector<ConditionEvaluationMap>&);
99 
102  inline std::vector<CombinationsInCond>& gtAlgoCombinationVector() { return m_algoCombinationVector; }
103 
104  inline std::vector<GlobalLogicParser::OperandToken>& operandTokenVector() { return m_operandTokenVector; }
105 
106  void print(std::ostream& myCout) const;
107 
108  private:
111 
112  // input
114  RpnVector const& m_rpnVector;
115 
116  std::vector<OperandToken> m_operandTokenVector;
117 
118  std::vector<CombinationsInCond> m_algoCombinationVector;
119  };
120 
121 } // namespace l1t
122 #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:66
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