35 template <
typename Iterator>
37 return std::all_of( begin, end, [](
const auto& i ) {
return i.valid(); } );
39 template <
typename Container>
40 bool valid( Container
const& c ) {
41 return valid( c.begin(), c.end() );
52 template <
class Iterator>
54 for ( ; begin != end; ++begin ) {
62 return validate( tree.begin(), tree.end(), svc );
83 std::ostream&
fillStream( std::ostream& s )
const override;
85 bool valid()
const override;
110 return m_node.node().validate( svc );
172 typedef std::vector<Decays::Nodes::_Node>
Nodes_;
242 std::ostream&
fillStream( std::ostream& s )
const override;
244 bool valid()
const override;
285 std::ostream&
fillStream( std::ostream& s )
const override;
287 bool valid()
const override;
318 std::ostream&
fillStream( std::ostream& s )
const override;
320 bool valid()
const override;
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
the helper representation of the item in the decay chain
The generic class to hold the pointer to other node.
NodeList & operator+=(const NodeList &nodes)
Nodes_::iterator iterator
std::vector< Decays::Nodes::_Node > Nodes_
the actual type of the sequence of nodes
NodeList & operator+=(const Nodes_ &nodes)
const_iterator end() const
Nodes_::value_type value_type
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)
const_iterator begin() const
NodeList & operator+=(const Decays::Nodes::_Node &node)
NodeList & operator+=(const Decays::iNode &node)
Helper structure (especially it is light version node-holder the default constructor.
_Node & operator=(const _Node &right)
pseudo-assignment from arbitrary node
bool valid() const
Check the validity.
const Decays::iNode & node() const
the accessor to the node
_Node & op_or(const NodeList &right)
Decays::Node m_node
the node holder itself
_Node & operator&=(const _Node &right)
_Node & operator&=(const iNode &right)
bool operator!=(const Gaudi::ParticleID &pid) const
_Node & operator&=(const NodeList &right)
StatusCode validate(const Gaudi::Interfaces::IParticlePropertySvc *svc) const
The proper validation of the node.
_Node & operator=(const iNode &right)
pseudo-assignment from arbitrary node
_Node(const _Node &node)=default
bool operator==(const Gaudi::ParticleID &pid) const
bool operator()(const Gaudi::ParticleID &pid) const
The major method.
_Node & operator|=(const _Node &right)
_Node & operator=(const Node &right)
pseudo-assignment operator:
_Node()
the default constructor
_Node & operator|=(const iNode &right)
_Node(const Node &node)
the constructor from Node
_Node & op_and(const NodeList &right)
_Node & operator|=(const NodeList &right)
_Node(const iNode &node)
the constructor from iNode
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.
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....
A trivial class to hold information about a single particle properties.
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
Decays::Nodes::Not operator!(const Decays::Nodes::Not &o)
Create the "NOT" for the node.
std::ostream & operator<<(std::ostream &s, const Decays::Nodes::_Node &n)
output operator
bool valid(Iterator begin, Iterator end)
check the validness of the trees or nodes
Decays::Nodes::And operator&&(const Decays::iNode &o1, const Decays::iNode &o2)
Create the "AND" of two nodes.
Decays::Nodes::Not operator~(const Decays::iNode &o)
Create the "NOT" for the node.
Decays::Nodes::And operator&(const Decays::iNode &o1, const Decays::iNode &o2)
Create the "AND" of two nodes.
StatusCode validate(Iterator begin, Iterator end, const Gaudi::Interfaces::IParticlePropertySvc *svc)
validate trees/nodes
Decays::Nodes::Or operator|(const Decays::iNode &o1, const Decays::iNode &o2)
Create the "OR" of two nodes.
Decays::Nodes::Or operator||(const Decays::iNode &o1, const Decays::iNode &o2)
Create the "OR" of two nodes.