The Gaudi Framework  master (594c33fa)
Gaudi::Decays::Nodes::Or Class Reference

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

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 More...
 

Private Attributes

Decays::NodeList m_nodes
 the sub-nodes More...
 

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 }

◆ 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 }

◆ 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 ); }

◆ 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 }

◆ 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() ); }

◆ 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 }

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:
Gaudi::Decays::NodeList::size
size_t size() const
Definition: Nodes.h:206
Gaudi::Decays::Nodes::Or::Or
Or()
the default constructor is disabled
Gaudi::Decays::NodeList::empty
bool empty() const
Definition: Nodes.h:207
Gaudi::Decays::NodeList::end
iterator end()
Definition: Nodes.h:209
Gaudi::Decays::NodeList::const_iterator
Nodes_::const_iterator const_iterator
Definition: Nodes.h:173
gaudirun.s
string s
Definition: gaudirun.py:346
std::find_if
T find_if(T... args)
GaudiPartProp.Nodes._Node
_Node
Definition: Nodes.py:273
GaudiPartProp.Nodes.Node
Node
Definition: Nodes.py:247
Gaudi::Decays::NodeList::begin
iterator begin()
Definition: Nodes.h:208
Gaudi::Decays::Nodes::Or::add
size_t add(const Decays::iNode &node)
Definition: Nodes.cpp:89
Gaudi::Decays::Nodes::Or::m_nodes
Decays::NodeList m_nodes
the sub-nodes
Definition: Nodes.h:261
Gaudi::Decays::validate
StatusCode validate(Iterator begin, Iterator end, const Gaudi::Interfaces::IParticlePropertySvc *svc)
validate trees/nodes
Definition: Nodes.h:53
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:234
std::right
T right(T... args)
Gaudi::Decays::valid
bool valid(Iterator begin, Iterator end)
check the validness of the trees or nodes
Definition: Nodes.h:36
Gaudi::Decays::iNode
Definition: iNode.h:35
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::Decays::NodeList::push_back
void push_back(const Decays::Nodes::_Node &node)
Definition: Nodes.cpp:26