File indexing completed on 2025-01-14 23:16:58
0001 #ifndef L1Trigger_L1TGlobal_AlgorithmEvaluation_h
0002 #define L1Trigger_L1TGlobal_AlgorithmEvaluation_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "DataFormats/L1TGlobal/interface/GlobalLogicParser.h"
0021 #include "DataFormats/L1TGlobal/interface/GlobalObjectMapFwd.h"
0022
0023 #include <iostream>
0024 #include <map>
0025 #include <memory>
0026 #include <queue>
0027 #include <stack>
0028 #include <string>
0029 #include <unordered_map>
0030 #include <vector>
0031
0032
0033 class GlobalAlgorithm;
0034
0035 namespace l1t {
0036
0037 class ConditionEvaluation;
0038
0039
0040 class AlgorithmEvaluation {
0041 public:
0042 typedef GlobalLogicParser::TokenRPN TokenRPN;
0043 typedef std::vector<TokenRPN> RpnVector;
0044 typedef GlobalLogicParser::OperandToken OperandToken;
0045
0046
0047
0048
0049
0050 explicit AlgorithmEvaluation(const GlobalAlgorithm&);
0051
0052
0053
0054
0055
0056
0057
0058
0059 typedef std::unordered_map<std::string, std::unique_ptr<ConditionEvaluation>> ConditionEvaluationMap;
0060
0061 public:
0062
0063 inline bool gtAlgoResult() const { return m_algoResult; }
0064
0065 inline void setGtAlgoResult(const bool algoResult) { m_algoResult = algoResult; }
0066
0067
0068 void evaluateAlgorithm(const int chipNumber, const std::vector<ConditionEvaluationMap>&);
0069
0070
0071 inline std::vector<CombinationsWithBxInCond>& gtAlgoCombinationVector() { return m_algoCombinationVector; }
0072
0073 inline std::vector<GlobalLogicParser::OperandToken>& operandTokenVector() { return m_operandTokenVector; }
0074
0075 void print(std::ostream& myCout) const;
0076
0077 private:
0078
0079 bool m_algoResult;
0080
0081
0082 std::string const& m_logicalExpression;
0083 RpnVector const& m_rpnVector;
0084
0085 std::vector<OperandToken> m_operandTokenVector;
0086
0087 std::vector<CombinationsWithBxInCond> m_algoCombinationVector;
0088 };
0089
0090 }
0091 #endif