The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Decays::Nodes::Or Class Reference

the rather simple (but powerful) node in the decay tree: it matches .OR. More...

#include </builds/gaudi/Gaudi/GaudiPartProp/include/Gaudi/Decays/Nodes.h>

Inheritance diagram for Gaudi::Decays::Nodes::Or:
Collaboration diagram for Gaudi::Decays::Nodes::Or:

Public Member Functions

 Or (const Decays::iNode &n1, const Decays::iNode &n2)
 constructor from two nodes
 Or (const Decays::iNode &n1, const Decays::iNode &n2, const Decays::iNode &n3)
 constructor from three nodes
 Or (const Decays::iNode &n1, const Decays::iNode &n2, const Decays::iNode &n3, const Decays::iNode &n4)
 constructor from four nodes
 Or (const Decays::NodeList &nodes)
 constructor from list of nodes
Or * clone () const override
 MANDATORY: clone method ("virtual constructor").
bool operator() (const Gaudi::ParticleID &pid) const override
 MANDATORY: the only one essential method.
std::ostream & fillStream (std::ostream &s) const override
 MANDATORY: the specific printout.
bool valid () const override
 MANDATORY: check the validity.
StatusCode validate (const Gaudi::Interfaces::IParticlePropertySvc *svc) const override
 MANDATORY: the proper validation of the node.
Or & operator+= (const Decays::iNode &node)
Or & operator+= (const Decays::NodeList &node)
Public Member Functions inherited from Gaudi::Decays::iNode
virtual bool operator! () const
 invalid node?
virtual std::string toString () const
 the string representation of the node
virtual ~iNode ()=default
 virtual destructor

Protected Member Functions

size_t add (const Decays::iNode &node)
size_t add (const Decays::NodeList &nodes)

Private Member Functions

 Or ()
 the default constructor is disabled

Private Attributes

Decays::NodeList m_nodes
 the sub-nodes

Detailed Description

the rather simple (but powerful) node in the decay tree: it matches .OR.

for sub-nodes

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2008-04-12

Definition at line 227 of file Nodes.h.

Constructor & Destructor Documentation

◆ Or() [1/5]

Gaudi::Decays::Nodes::Or::Or ( const Decays::iNode & n1,
const Decays::iNode & n2 )

constructor from two nodes

Definition at line 68 of file Nodes.cpp.

68 {
69 add( n1 );
70 add( n2 );
71}
size_t add(const Decays::iNode &node)
Definition Nodes.cpp:89

◆ Or() [2/5]

Gaudi::Decays::Nodes::Or::Or ( const Decays::iNode & n1,
const Decays::iNode & n2,
const Decays::iNode & n3 )

constructor from three nodes

Definition at line 73 of file Nodes.cpp.

73 {
74 add( n1 );
75 add( n2 );
76 add( n3 );
77}

◆ Or() [3/5]

Gaudi::Decays::Nodes::Or::Or ( const Decays::iNode & n1,
const Decays::iNode & n2,
const Decays::iNode & n3,
const Decays::iNode & n4 )

constructor from four nodes

Definition at line 79 of file Nodes.cpp.

80 {
81 add( n1 );
82 add( n2 );
83 add( n3 );
84 add( n4 );
85}

◆ Or() [4/5]

Gaudi::Decays::Nodes::Or::Or ( const Decays::NodeList & nodes)

constructor from list of nodes

Definition at line 87 of file Nodes.cpp.

87{ add( nodes ); }

◆ Or() [5/5]

Gaudi::Decays::Nodes::Or::Or ( )
private

the default constructor is disabled

Member Function Documentation

◆ add() [1/2]

size_t Gaudi::Decays::Nodes::Or::add ( const Decays::iNode & node)
protected

Definition at line 89 of file Nodes.cpp.

89 {
90 const Decays::iNode* right = &node;
91 const Or* _or = dynamic_cast<const Or*>( right );
92 if ( 0 != _or ) { return add( _or->m_nodes ); } // RETURN
93 // holder ?
94 const Node* _no = dynamic_cast<const Node*>( right );
95 if ( 0 != _no ) { return add( _no->node() ); } // RETURN
96 // just add the node
97 m_nodes.push_back( node );
98 return m_nodes.size();
99}
Or(const Decays::iNode &n1, const Decays::iNode &n2)
constructor from two nodes
Definition Nodes.cpp:68
Decays::NodeList m_nodes
the sub-nodes
Definition Nodes.h:261

◆ add() [2/2]

size_t Gaudi::Decays::Nodes::Or::add ( const Decays::NodeList & nodes)
protected

Definition at line 101 of file Nodes.cpp.

101 {
102 for ( const auto& n : nodes ) add( n );
103 return m_nodes.size();
104}

◆ clone()

Decays::Nodes::Or * Gaudi::Decays::Nodes::Or::clone ( ) const
overridevirtual

MANDATORY: clone method ("virtual constructor").

Implements Gaudi::Decays::iNode.

Definition at line 106 of file Nodes.cpp.

106{ return new Or( *this ); }
Or()
the default constructor is disabled

◆ fillStream()

std::ostream & Gaudi::Decays::Nodes::Or::fillStream ( std::ostream & s) const
overridevirtual

MANDATORY: the specific printout.

Implements Gaudi::Decays::iNode.

Definition at line 113 of file Nodes.cpp.

113 {
114 s << " (";
115 for ( Decays::NodeList::const_iterator node = m_nodes.begin(); m_nodes.end() != node; ++node ) {
116 if ( m_nodes.begin() != node ) { s << "|"; }
117 s << *node;
118 }
119 return s << ") ";
120}
Nodes_::const_iterator const_iterator
Definition Nodes.h:173

◆ operator()()

bool Gaudi::Decays::Nodes::Or::operator() ( const Gaudi::ParticleID & pid) const
overridevirtual

MANDATORY: the only one essential method.

Implements Gaudi::Decays::iNode.

Definition at line 108 of file Nodes.cpp.

108 {
109 return m_nodes.end() != std::find_if( m_nodes.begin(), m_nodes.end(),
110 [&]( const Decays::Nodes::_Node& node ) { return node( pid ); } );
111}

◆ operator+=() [1/2]

Decays::Nodes::Or & Gaudi::Decays::Nodes::Or::operator+= ( const Decays::iNode & node)

Definition at line 199 of file Nodes.cpp.

199 {
200 add( node );
201 return *this;
202}

◆ operator+=() [2/2]

Decays::Nodes::Or & Gaudi::Decays::Nodes::Or::operator+= ( const Decays::NodeList & node)

Definition at line 207 of file Nodes.cpp.

207 {
208 add( nodes );
209 return *this;
210}

◆ valid()

bool Gaudi::Decays::Nodes::Or::valid ( ) const
overridevirtual

MANDATORY: check the validity.

Implements Gaudi::Decays::iNode.

Definition at line 122 of file Nodes.cpp.

122{ return !m_nodes.empty() && Decays::valid( m_nodes.begin(), m_nodes.end() ); }
bool valid(Iterator begin, Iterator end)
check the validness of the trees or nodes
Definition Nodes.h:36

◆ validate()

StatusCode Gaudi::Decays::Nodes::Or::validate ( const Gaudi::Interfaces::IParticlePropertySvc * svc) const
overridevirtual

MANDATORY: the proper validation of the node.

Implements Gaudi::Decays::iNode.

Definition at line 124 of file Nodes.cpp.

124 {
125 if ( m_nodes.empty() ) { return StatusCode::FAILURE; }
126 return Decays::validate( m_nodes.begin(), m_nodes.end(), svc );
127}
constexpr static const auto FAILURE
Definition StatusCode.h:100
StatusCode validate(Iterator begin, Iterator end, const Gaudi::Interfaces::IParticlePropertySvc *svc)
validate trees/nodes
Definition Nodes.h:53

Member Data Documentation

◆ m_nodes

Decays::NodeList Gaudi::Decays::Nodes::Or::m_nodes
private

the sub-nodes

Definition at line 261 of file Nodes.h.


The documentation for this class was generated from the following files: