Nodeclass with two AbstractBooleanNode as children and a Boolean Operator (AND, OR) Check() method evaluates the child nodes and returns the result of the boolean operation.
More...
#include <CutNodes.h>
|
typedef AVariableManager::Var | Var |
| Template argument dependent Variable type definition.
|
|
|
bool | check (const Object *p) const override |
| Check if object passes this subexpression of the cut by calling check on the children nodes.
|
|
void | print () const override |
| Print node.
|
|
std::string | decompile () const override |
| Decompile Node back to a string.
|
|
| ~BinaryBooleanNode () |
| Destructor.
|
|
|
typedef AVariableManager::Object | Object |
| Template argument dependent Particle type definition.
|
|
template<class AVariableManager>
class Belle2::BinaryBooleanNode< AVariableManager >
Nodeclass with two AbstractBooleanNode as children and a Boolean Operator (AND, OR) Check() method evaluates the child nodes and returns the result of the boolean operation.
Definition at line 274 of file CutNodes.h.
◆ Object
template<class AVariableManager>
typedef AVariableManager::Object Object |
|
private |
◆ Var
template<class AVariableManager>
typedef AVariableManager::Var Var |
|
inherited |
Template argument dependent Variable type definition.
Definition at line 39 of file AbstractNodes.h.
◆ ~BinaryBooleanNode()
template<class AVariableManager>
◆ BinaryBooleanNode()
template<class AVariableManager>
- Parameters
-
left_node | (const boost::python::tuple&): tuple from which the left boolean child node is constructed |
right_node | (const boost::python::tuple&): tuple from which the right boolean child node is constructed |
boperator | (BooleanOperator): determines the boolean operation in check(const Object* p) |
Definition at line 336 of file CutNodes.h.
337 : m_left_bnode{NodeFactory::compile_boolean_node<AVariableManager>(left_node)}, m_right_bnode{NodeFactory::compile_boolean_node<AVariableManager>(right_node)},
338 m_boperator{boperator}
339 {
340 }
◆ check()
template<class AVariableManager>
bool check |
( |
const Object * | p | ) |
const |
|
inlineoverridevirtual |
Check if object passes this subexpression of the cut by calling check on the children nodes.
Boolean results are evaluated with the BooleanOperator(AND/OR) the node object.
- Parameters
-
p | pointer to the object, that should be checked. |
Implements AbstractBooleanNode< AVariableManager >.
Definition at line 285 of file CutNodes.h.
286 {
287
288 switch (m_boperator) {
289 case BooleanOperator::AND:
290 return m_left_bnode->check(p) && m_right_bnode->check(p);
291 break;
292 case BooleanOperator::OR:
293 return m_left_bnode->check(p) || m_right_bnode->check(p);
294 break;
295 default:
296 throw std::runtime_error("BinaryBooleanNode has an invalid BooleanOperator");
297 }
298 return false;
299 }
◆ decompile()
template<class AVariableManager>
std::string decompile |
( |
| ) |
const |
|
inlineoverridevirtual |
Decompile Node back to a string.
decompile(compile) should give the same result.
Implements AbstractBooleanNode< AVariableManager >.
Definition at line 315 of file CutNodes.h.
316 {
317 std::stringstream stringstream;
318 stringstream << m_left_bnode->decompile();
320 stringstream << m_right_bnode->decompile();
321
322 return stringstream.str();
323 }
void injectBooleanOperatorToStream(std::ostream &stream, const BooleanOperator &boperator)
Helper functions for AbstractBooleanNode and AbstractExpressionNode print() and decompile() members S...
◆ print()
template<class AVariableManager>
◆ NodeFactory
template<class AVariableManager>
◆ m_boperator
template<class AVariableManager>
Boolean operation to be applied to the check() results of the child nodes.
Definition at line 343 of file CutNodes.h.
◆ m_left_bnode
template<class AVariableManager>
boolean subexpression of a cut
Definition at line 341 of file CutNodes.h.
◆ m_right_bnode
template<class AVariableManager>
boolean subexpression of a cut
Definition at line 342 of file CutNodes.h.
The documentation for this class was generated from the following file: