28 #include <boost/algorithm/string.hpp> 43 : m_algoResult(
false), m_logicalExpression(alg.algoLogicalExpression()), m_rpnVector(alg.algoRpnVector()) {
51 const std::vector<ConditionEvaluationMap> &conditionResultMaps) {
69 std::stack<bool, std::vector<bool>> resultStack;
80 switch (
it->operation) {
83 if (itCond != (conditionResultMaps[chipNumber]).end()) {
84 if (
nullptr == itCond->second) {
87 <<
"\nCondition " << (
it->operand) <<
" NULL pointer found in condition map" << std::endl;
91 bool condResult = (itCond->second)->condLastResult();
93 resultStack.push(condResult);
106 CombinationsInCond const &combInCondition = (itCond->second)->getCombinationsInCond();
112 <<
"\nCondition " << (
it->operand) <<
" not found in condition map" << std::endl;
119 b1 = resultStack.top();
121 resultStack.push(!
b1);
126 b1 = resultStack.top();
128 b2 = resultStack.top();
130 resultStack.push(
b1 ||
b2);
135 b1 = resultStack.top();
137 b2 = resultStack.top();
139 resultStack.push(
b1 &&
b2);
162 myCout <<
" Algorithm result: " <<
m_algoResult << std::endl;
168 myCout <<
" Operand token vector size: " << operandTokenVectorSize;
170 if (operandTokenVectorSize == 0) {
171 myCout <<
" - not properly initialized! " << std::endl;
175 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)
void print(std::ostream &myCout) const
std::vector< CombinationsInCond > m_algoCombinationVector
L1GtAlgorithmEvaluation(const L1GtAlgorithm &)
constructor
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
std::string const & m_logicalExpression
ConditionEvaluationMap::const_iterator CItEvalMap
static constexpr float b1
void evaluateAlgorithm(const int chipNumber, const std::vector< ConditionEvaluationMap > &)
evaluate an algorithm