28 #include <boost/algorithm/string.hpp>
29 #include <ext/hash_map>
47 m_logicalExpression(alg.algoLogicalExpression()),
48 m_rpnVector(alg.algoRpnVector()){
59 const std::vector<ConditionEvaluationMap>& conditionResultMaps) {
67 <<
"\nEmpty RPN vector for the logical expression = "
81 std::stack<bool, std::vector<bool> > resultStack;
93 switch (it->operation) {
97 CItEvalMap itCond = (conditionResultMaps.at(chipNumber)).
find(it->operand);
98 if (itCond != (conditionResultMaps[chipNumber]).end()) {
100 if (0 == itCond->second) {
104 <<
" NULL pointer found in condition map"
109 bool condResult = (itCond->second)->condLastResult();
111 resultStack.push(condResult);
124 CombinationsInCond const & combInCondition = (itCond->second)->getCombinationsInCond();
132 <<
"\nCondition " << (it->operand) <<
" not found in condition map"
141 b1 = resultStack.top();
143 resultStack.push(!b1);
148 b1 = resultStack.top();
150 b2 = resultStack.top();
152 resultStack.push(b1 || b2);
157 b1 = resultStack.top();
159 b2 = resultStack.top();
161 resultStack.push(b1 && b2);
187 myCout <<
" Algorithm result: " <<
m_algoResult << std::endl;
193 myCout <<
" Operand token vector size: " << operandTokenVectorSize;
195 if (operandTokenVectorSize == 0) {
196 myCout <<
" - not properly initialized! " << std::endl;
201 for (
int i = 0;
i < operandTokenVectorSize; ++
i) {
RpnVector const & m_rpnVector
bool m_algoResult
algorithm result
std::vector< OperandToken > m_operandTokenVector
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< CombinationsInCond > m_algoCombinationVector
void print(std::ostream &myCout) const
L1GtAlgorithmEvaluation(const L1GtAlgorithm &)
constructor
volatile std::atomic< bool > shutdown_flag false
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
std::string const & m_logicalExpression
ConditionEvaluationMap::const_iterator CItEvalMap
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm