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 // if hash map is used
31 
32 #include <ext/hash_map>
33 
34 // how to hash std::string, using a "template specialization"
35 namespace __gnu_cxx {
36 
41  template <>
42  struct hash<std::string> {
43  size_t operator()(const std::string &x) const { return hash<const char *>()(x.c_str()); }
44  };
45 
46 } // namespace __gnu_cxx
47 // end hash map
48 
49 // user include files
50 
51 // base class
53 
54 //
56 
57 // forward declarations
58 class L1GtAlgorithm;
60 
61 // class interface
63 public:
65  typedef std::vector<TokenRPN> RpnVector;
67 
69  // L1GtAlgorithmEvaluation();
70 
72  explicit L1GtAlgorithmEvaluation(const L1GtAlgorithm &);
73 
75  // L1GtAlgorithmEvaluation(L1GtAlgorithmEvaluation&);
76 
78  // virtual ~L1GtAlgorithmEvaluation();
79 
80  // typedef std::map<std::string, L1GtConditionEvaluation*>
81  // ConditionEvaluationMap;
82  typedef __gnu_cxx ::hash_map<std::string, L1GtConditionEvaluation *> ConditionEvaluationMap;
83  typedef ConditionEvaluationMap::const_iterator CItEvalMap;
84  typedef ConditionEvaluationMap::iterator ItEvalMap;
85 
86 public:
88  inline bool gtAlgoResult() const { return m_algoResult; }
89 
90  inline void setGtAlgoResult(const bool algoResult) { m_algoResult = algoResult; }
91 
93  void evaluateAlgorithm(const int chipNumber, const std::vector<ConditionEvaluationMap> &);
94 
97  inline std::vector<CombinationsInCond> &gtAlgoCombinationVector() { return m_algoCombinationVector; }
98 
99  inline std::vector<L1GtLogicParser::OperandToken> &operandTokenVector() { return m_operandTokenVector; }
100 
101  void print(std::ostream &myCout) const;
102 
103 private:
106 
107  // input
110 
111  std::vector<OperandToken> m_operandTokenVector;
112 
113  std::vector<CombinationsInCond> m_algoCombinationVector;
114 };
115 
116 #endif
L1GtConditionEvaluation
Definition: L1GtConditionEvaluation.h:37
L1GtLogicParser::OperandToken
Definition: L1GtLogicParser.h:33
__gnu_cxx::hash< std::string >::operator()
size_t operator()(const std::string &x) const
Definition: L1GtAlgorithmEvaluation.h:43
L1GtAlgorithmEvaluation::TokenRPN
L1GtLogicParser::TokenRPN TokenRPN
Definition: L1GtAlgorithmEvaluation.h:64
L1GtAlgorithmEvaluation::gtAlgoCombinationVector
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
Definition: L1GtAlgorithmEvaluation.h:97
cond::hash
Definition: Time.h:19
L1GtAlgorithmEvaluation::m_algoResult
bool m_algoResult
algorithm result
Definition: L1GtAlgorithmEvaluation.h:105
L1GtAlgorithmEvaluation::operandTokenVector
std::vector< L1GtLogicParser::OperandToken > & operandTokenVector()
Definition: L1GtAlgorithmEvaluation.h:99
L1GtAlgorithmEvaluation::gtAlgoResult
bool gtAlgoResult() const
get / set the result of the algorithm
Definition: L1GtAlgorithmEvaluation.h:88
L1GtAlgorithmEvaluation::m_operandTokenVector
std::vector< OperandToken > m_operandTokenVector
Definition: L1GtAlgorithmEvaluation.h:111
L1GtLogicParser::TokenRPN
Definition: L1GtLogicParser.h:50
L1GtAlgorithmEvaluation::OperandToken
L1GtLogicParser::OperandToken OperandToken
Definition: L1GtAlgorithmEvaluation.h:66
L1GtAlgorithmEvaluation::print
void print(std::ostream &myCout) const
Definition: L1GtAlgorithmEvaluation.cc:160
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1GtAlgorithmEvaluation::m_logicalExpression
const std::string & m_logicalExpression
Definition: L1GtAlgorithmEvaluation.h:108
__gnu_cxx
Definition: L1GtAlgorithmEvaluation.h:35
L1GtAlgorithm
Definition: L1GtAlgorithm.h:32
L1GtAlgorithmEvaluation::setGtAlgoResult
void setGtAlgoResult(const bool algoResult)
Definition: L1GtAlgorithmEvaluation.h:90
L1GtAlgorithmEvaluation::m_algoCombinationVector
std::vector< CombinationsInCond > m_algoCombinationVector
Definition: L1GtAlgorithmEvaluation.h:113
L1GtAlgorithmEvaluation::m_rpnVector
const RpnVector & m_rpnVector
Definition: L1GtAlgorithmEvaluation.h:109
std
Definition: JetResolutionObject.h:76
L1GtAlgorithmEvaluation
Definition: L1GtAlgorithmEvaluation.h:62
L1GlobalTriggerObjectMapFwd.h
L1GtLogicParser.h
L1GtAlgorithmEvaluation::L1GtAlgorithmEvaluation
L1GtAlgorithmEvaluation(const L1GtAlgorithm &)
constructor
Definition: L1GtAlgorithmEvaluation.cc:43
L1GtAlgorithmEvaluation::ConditionEvaluationMap
__gnu_cxx ::hash_map< std::string, L1GtConditionEvaluation * > ConditionEvaluationMap
copy constructor
Definition: L1GtAlgorithmEvaluation.h:82
L1GtAlgorithmEvaluation::CItEvalMap
ConditionEvaluationMap::const_iterator CItEvalMap
Definition: L1GtAlgorithmEvaluation.h:83
L1GtAlgorithmEvaluation::ItEvalMap
ConditionEvaluationMap::iterator ItEvalMap
Definition: L1GtAlgorithmEvaluation.h:84
L1GtAlgorithmEvaluation::evaluateAlgorithm
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
Definition: L1GtAlgorithmEvaluation.cc:51
L1GtAlgorithmEvaluation::RpnVector
std::vector< TokenRPN > RpnVector
Definition: L1GtAlgorithmEvaluation.h:65