91 const Or* _or =
dynamic_cast<const Or*
>( right );
92 if ( 0 != _or ) {
return add( _or->
m_nodes ); }
94 const Node* _no =
dynamic_cast<const Node*
>( right );
95 if ( 0 != _no ) {
return add( _no->
node() ); }
102 for (
const auto& n : nodes )
add( n );
116 if (
m_nodes.begin() != node ) { s <<
"|"; }
153 const And* _and =
dynamic_cast<const And*
>( right );
154 if ( 0 != _and ) {
return add( _and->
m_nodes ); }
156 const Node* _no =
dynamic_cast<const Node*
>( right );
157 if ( 0 != _no ) {
return add( _no->
node() ); }
164 for (
const auto& n : nodes )
add( n );
171 if (
m_nodes.empty() ) {
return false; }
194 return m_node.validate( svc );
Helper general purpose utilities to deal with decay nodes.
Provide serialization function (output only) for some common STL classes (vectors,...
The generic class to hold the pointer to other node.
const iNode & node() const
NodeList & operator=(const Decays::Nodes::_Node &node)
std::vector< Decays::Nodes::_Node > Nodes_
the actual type of the sequence of nodes
Nodes_::const_iterator const_iterator
Nodes_ m_nodes
the actual list of nodes
NodeList(const Nodes_ &nodes=Nodes_())
constructor from the list of Nodes
void push_back(const Decays::Nodes::_Node &node)
Helper structure (especially it is light version node-holder the default constructor.
_Node & op_or(const NodeList &right)
Decays::Node m_node
the node holder itself
_Node()
the default constructor
_Node & op_and(const NodeList &right)
the rather simple (but powerful) node in the decay tree: it matches .AND.
bool valid() const override
MANDATORY: check the validity.
size_t add(const Decays::iNode &node)
NodeList m_nodes
the sub-nodes
And & operator+=(const Decays::iNode &node)
StatusCode validate(const Gaudi::Interfaces::IParticlePropertySvc *svc) const override
MANDATORY: the proper validation of the node.
And * clone() const override
MANDATORY: clone method ("virtual constructor")
And(const Decays::iNode &n1, const Decays::iNode &n2)
constructor from two nodes
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.
the most simple node to represent the invalid node it matches to all valid the Gaudi::Particles
std::ostream & fillStream(std::ostream &s) const override
MANDATORY: the specific printout.
Invalid()=default
MANDATORY: default constructor.
bool valid() const override
MANDATORY: check the validity.
bool operator()(const Gaudi::ParticleID &) const override
MANDATORY: the only one essential method.
StatusCode validate(const Gaudi::Interfaces::IParticlePropertySvc *svc) const override
MANDATORY: the proper validation of the node.
Invalid * clone() const override
MANDATORY: clone method ("virtual constructor")
Simple node which match "NOT" for the subnode.
bool valid() const override
MANDATORY: check the validity.
const Decays::iNode & node() const
get the underlying node
Not * clone() const override
MANDATORY: clone method ("virtual constructor")
std::ostream & fillStream(std::ostream &s) const override
MANDATORY: the specific printout.
StatusCode validate(const Gaudi::Interfaces::IParticlePropertySvc *svc) const override
MANDATORY: the proper validation of the node.
Not(const Decays::iNode &node)
constructor from the node
bool operator()(const Gaudi::ParticleID &pid) const override
MANDATORY: the only one essential method.
Decays::Node m_node
the node itself
the rather simple (but powerful) node in the decay tree: it matches .OR.
StatusCode validate(const Gaudi::Interfaces::IParticlePropertySvc *svc) const override
MANDATORY: the proper validation of the node.
Or(const Decays::iNode &n1, const Decays::iNode &n2)
constructor from two nodes
Or & operator+=(const Decays::iNode &node)
Decays::NodeList m_nodes
the sub-nodes
Or()
the default constructor is disabled
bool valid() const override
MANDATORY: check the validity.
size_t add(const Decays::iNode &node)
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.
Or * clone() const override
MANDATORY: clone method ("virtual constructor")
The abstract class which represents the single "node" of decay tree.
The abstract interface to Particle Property Service.
Holds PDG + LHCb extension particle code, following the PDG particle numbering scheme (pdg....
This class is used for returning status codes from appropriate routines.
constexpr static const auto FAILURE
bool valid(Iterator begin, Iterator end)
check the validness of the trees or nodes
StatusCode validate(Iterator begin, Iterator end, const Gaudi::Interfaces::IParticlePropertySvc *svc)
validate trees/nodes
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})