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

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

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

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

Public Member Functions

 And (const Decays::iNode &n1, const Decays::iNode &n2)
 constructor from two nodes
 And (const Decays::iNode &n1, const Decays::iNode &n2, const Decays::iNode &n3)
 constructor from three nodes
 And (const Decays::iNode &n1, const Decays::iNode &n2, const Decays::iNode &n3, const Decays::iNode &n4)
 constructor from four nodes
 And (const Decays::NodeList &nodes)
 constructor from list of nodes
And * clone () const override
 MANDATORY: clone method ("virtual constructor").
bool operator() (const Gaudi::ParticleID &p) 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.
And & operator+= (const Decays::iNode &node)
And & operator+= (const Decays::NodeList &nodes)
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 Attributes

NodeList m_nodes
 the sub-nodes

Detailed Description

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

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 270 of file Nodes.h.

Constructor & Destructor Documentation

◆ And() [1/4]

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

constructor from two nodes

Definition at line 130 of file Nodes.cpp.

130 {
131 add( n1 );
132 add( n2 );
133}
size_t add(const Decays::iNode &node)
Definition Nodes.cpp:151

◆ And() [2/4]

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

constructor from three nodes

Definition at line 135 of file Nodes.cpp.

135 {
136 add( n1 );
137 add( n2 );
138 add( n3 );
139}

◆ And() [3/4]

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

constructor from four nodes

Definition at line 141 of file Nodes.cpp.

142 {
143 add( n1 );
144 add( n2 );
145 add( n3 );
146 add( n4 );
147}

◆ And() [4/4]

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

constructor from list of nodes

Definition at line 149 of file Nodes.cpp.

149{ add( nodes ); }

Member Function Documentation

◆ add() [1/2]

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

Definition at line 151 of file Nodes.cpp.

151 {
152 const Decays::iNode* right = &node;
153 const And* _and = dynamic_cast<const And*>( right );
154 if ( 0 != _and ) { return add( _and->m_nodes ); } // RETURN
155 // holder ?
156 const Node* _no = dynamic_cast<const Node*>( right );
157 if ( 0 != _no ) { return add( _no->node() ); } // RETURN
158 // just add the node
159 m_nodes.push_back( node );
160 return m_nodes.size();
161}
NodeList m_nodes
the sub-nodes
Definition Nodes.h:301
And(const Decays::iNode &n1, const Decays::iNode &n2)
constructor from two nodes
Definition Nodes.cpp:130

◆ add() [2/2]

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

Definition at line 163 of file Nodes.cpp.

163 {
164 for ( const auto& n : nodes ) add( n );
165 return m_nodes.size();
166}

◆ clone()

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

MANDATORY: clone method ("virtual constructor").

Implements Gaudi::Decays::iNode.

Definition at line 168 of file Nodes.cpp.

168{ return new And( *this ); }

◆ fillStream()

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

MANDATORY: the specific printout.

Implements Gaudi::Decays::iNode.

Definition at line 175 of file Nodes.cpp.

175 {
176 return GaudiUtils::details::ostream_joiner( s << " (", m_nodes, "&" ) << ") ";
177}
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})

◆ operator()()

bool Gaudi::Decays::Nodes::And::operator() ( const Gaudi::ParticleID & p) const
overridevirtual

MANDATORY: the only one essential method.

Implements Gaudi::Decays::iNode.

Definition at line 170 of file Nodes.cpp.

170 {
171 if ( m_nodes.empty() ) { return false; }
172 return std::all_of( m_nodes.begin(), m_nodes.end(), [&]( const Decays::Nodes::_Node& n ) { return n == pid; } );
173}

◆ operator+=() [1/2]

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

Definition at line 203 of file Nodes.cpp.

203 {
204 add( node );
205 return *this;
206}

◆ operator+=() [2/2]

Decays::Nodes::And & Gaudi::Decays::Nodes::And::operator+= ( const Decays::NodeList & nodes)

Definition at line 211 of file Nodes.cpp.

211 {
212 add( nodes );
213 return *this;
214}

◆ valid()

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

MANDATORY: check the validity.

Implements Gaudi::Decays::iNode.

Definition at line 179 of file Nodes.cpp.

179{ 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::And::validate ( const Gaudi::Interfaces::IParticlePropertySvc * svc) const
overridevirtual

MANDATORY: the proper validation of the node.

Implements Gaudi::Decays::iNode.

Definition at line 181 of file Nodes.cpp.

181 {
182 if ( m_nodes.empty() ) { return StatusCode::FAILURE; }
183 return Decays::validate( m_nodes.begin(), m_nodes.end(), svc );
184}
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

NodeList Gaudi::Decays::Nodes::And::m_nodes
private

the sub-nodes

Definition at line 301 of file Nodes.h.


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