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
115 
116  std::vector<OperandToken> m_operandTokenVector;
117 
118  std::vector<CombinationsInCond> m_algoCombinationVector;
119  };
120 
121 } // namespace l1t
122 #endif
l1t::AlgorithmEvaluation::ConditionEvaluationMap
__gnu_cxx ::hash_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
Definition: AlgorithmEvaluation.h:87
__gnu_cxx::hash< std::string >::operator()
size_t operator()(const std::string &x) const
Definition: AlgorithmEvaluation.h:47
l1t::AlgorithmEvaluation::ItEvalMap
ConditionEvaluationMap::iterator ItEvalMap
Definition: AlgorithmEvaluation.h:89
l1t::AlgorithmEvaluation::RpnVector
std::vector< TokenRPN > RpnVector
Definition: AlgorithmEvaluation.h:71
l1t::AlgorithmEvaluation::AlgorithmEvaluation
AlgorithmEvaluation(const GlobalAlgorithm &)
constructor
Definition: AlgorithmEvaluation.cc:42
l1t::AlgorithmEvaluation::operandTokenVector
std::vector< GlobalLogicParser::OperandToken > & operandTokenVector()
Definition: AlgorithmEvaluation.h:104
l1t::AlgorithmEvaluation::m_logicalExpression
std::string const & m_logicalExpression
Definition: AlgorithmEvaluation.h:113
cond::hash
Definition: Time.h:19
GlobalObjectMapFwd.h
l1t::AlgorithmEvaluation::m_algoResult
bool m_algoResult
algorithm result
Definition: AlgorithmEvaluation.h:110
l1t::AlgorithmEvaluation::TokenRPN
GlobalLogicParser::TokenRPN TokenRPN
Definition: AlgorithmEvaluation.h:70
GlobalLogicParser.h
GlobalAlgorithm
Definition: GlobalAlgorithm.h:32
l1t::AlgorithmEvaluation::setGtAlgoResult
void setGtAlgoResult(const bool algoResult)
Definition: AlgorithmEvaluation.h:95
l1t::AlgorithmEvaluation::gtAlgoResult
bool gtAlgoResult() const
get / set the result of the algorithm
Definition: AlgorithmEvaluation.h:93
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::AlgorithmEvaluation::m_algoCombinationVector
std::vector< CombinationsInCond > m_algoCombinationVector
Definition: AlgorithmEvaluation.h:118
__gnu_cxx
Definition: L1GtAlgorithmEvaluation.h:35
l1t
delete x;
Definition: CaloConfig.h:22
l1t::AlgorithmEvaluation
Definition: AlgorithmEvaluation.h:68
l1t::AlgorithmEvaluation::m_operandTokenVector
std::vector< OperandToken > m_operandTokenVector
Definition: AlgorithmEvaluation.h:116
l1t::AlgorithmEvaluation::m_rpnVector
RpnVector const & m_rpnVector
Definition: AlgorithmEvaluation.h:114
l1t::AlgorithmEvaluation::evaluateAlgorithm
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm
Definition: AlgorithmEvaluation.cc:50
l1t::AlgorithmEvaluation::OperandToken
GlobalLogicParser::OperandToken OperandToken
Definition: AlgorithmEvaluation.h:72
std
Definition: JetResolutionObject.h:76
l1t::AlgorithmEvaluation::CItEvalMap
ConditionEvaluationMap::const_iterator CItEvalMap
Definition: AlgorithmEvaluation.h:88
l1t::AlgorithmEvaluation::gtAlgoCombinationVector
std::vector< CombinationsInCond > & gtAlgoCombinationVector()
Definition: AlgorithmEvaluation.h:102
ConditionEvaluation
GlobalLogicParser::TokenRPN
Definition: GlobalLogicParser.h:37
GlobalLogicParser::OperandToken
Definition: GlobalLogicParser.h:19
l1t::AlgorithmEvaluation::print
void print(std::ostream &myCout) const
Definition: AlgorithmEvaluation.cc:164