The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
iNode.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#include <
Gaudi/Decays/Nodes.h
>
12
#include <
Gaudi/Decays/iNode.h
>
13
#include <
GaudiKernel/StatusCode.h
>
14
#include <sstream>
15
#include <typeinfo>
16
17
namespace
Decays
=
Gaudi::Decays
;
18
24
std::string
Decays::iNode::toString
()
const
{
25
std::ostringstream s;
26
fillStream
( s );
27
return
s.str();
28
}
29
30
bool
Decays::iNode::operator!
()
const
{
return
!( this->
valid
() ); }
31
32
Decays::Node::Node
(
const
Decays::iNode
&
node
) {
33
if
(
typeid
(
Decays::Node
) ==
typeid
(
node
) ) {
34
const
Node
& _node =
dynamic_cast<
const
Node
&
>
(
node
);
35
m_node
.reset( _node.
m_node
->clone() );
36
}
else
{
37
m_node
.reset(
node
.clone() );
38
}
39
}
40
41
Decays::Node::Node
(
const
Decays::Node
& right ) :
Decays
::
iNode
( right ),
m_node
( right.
m_node
->
clone
() ) {}
42
43
bool
Decays::Node::operator()
(
const
Gaudi::ParticleID
& pid )
const
{
return
node
( pid ); }
44
45
std::ostream&
Decays::Node::fillStream
( std::ostream& s )
const
{
return
m_node
->fillStream( s ); }
46
47
bool
Decays::Node::valid
()
const
{
return
m_node
->valid(); }
48
49
StatusCode
Decays::Node::validate
(
const
Gaudi::Interfaces::IParticlePropertySvc
* svc )
const
{
50
return
m_node
->validate( svc );
51
}
52
53
Decays::Node
&
Decays::Node::operator=
(
const
Decays::Node
& right ) {
54
if
( &right ==
this
) {
return
*
this
; }
55
m_node
.reset( right.
m_node
->clone() );
56
return
*
this
;
57
}
58
59
Decays::Node
&
Decays::Node::operator=
(
const
Decays::iNode
& right ) {
60
if
( &right ==
this
) {
return
*
this
; }
61
Decays::iNode
*
node
=
nullptr
;
62
if
(
typeid
(
Decays::Node
) ==
typeid
( right ) ) {
63
const
Node
& _node =
dynamic_cast<
const
Node
&
>
( right );
64
node
= _node.
m_node
->clone();
65
}
else
{
66
node
= right.
clone
();
67
}
68
m_node
.reset(
node
);
69
return
*
this
;
70
}
71
72
Decays::Node
*
Decays::Node::clone
()
const
{
return
new
Decays::Node
( *
this
); }
73
74
Decays::Node
&
Decays::Node::op_and
(
const
Decays::iNode
& right ) {
return
( *
this
= ( *
m_node
&& right ) ); }
75
76
Decays::Node
&
Decays::Node::op_or
(
const
Decays::iNode
& right ) {
return
( *
this
= ( *
m_node
|| right ) ); }
Nodes.h
Helper general purpose utilities to deal with decay nodes.
StatusCode.h
Gaudi::Decays::Node
The generic class to hold the pointer to other node.
Definition
iNode.h:74
Gaudi::Decays::Node::op_or
Node & op_or(const iNode &right)
Definition
iNode.cpp:76
Gaudi::Decays::Node::clone
Node * clone() const override
MANDATORY: clone method ("virtual constructor").
Definition
iNode.cpp:72
Gaudi::Decays::Node::op_and
Node & op_and(const iNode &right)
Definition
iNode.cpp:74
Gaudi::Decays::Node::valid
bool valid() const override
MANDATORY: check the validity of the node.
Definition
iNode.cpp:47
Gaudi::Decays::Node::m_node
std::unique_ptr< iNode > m_node
the node itself:
Definition
iNode.h:111
Gaudi::Decays::Node::Node
Node(const Decays::iNode &node)
constructor from the node
Definition
iNode.cpp:32
Gaudi::Decays::Node::operator()
bool operator()(const Gaudi::ParticleID &p) const override
MANDATORY: the only one essential method.
Definition
iNode.cpp:43
Gaudi::Decays::Node::fillStream
std::ostream & fillStream(std::ostream &s) const override
MANDATORY: the specific printout.
Definition
iNode.cpp:45
Gaudi::Decays::Node::node
const iNode & node() const
Definition
iNode.h:96
Gaudi::Decays::Node::validate
StatusCode validate(const Gaudi::Interfaces::IParticlePropertySvc *svc) const override
MANDATORY: the proper validation of the node.
Definition
iNode.cpp:49
Gaudi::Decays::Node::operator=
Node & operator=(const Node &right)
assignment operator:
Definition
iNode.cpp:53
Gaudi::Decays::iNode
The abstract class which represents the single "node" of decay tree.
Definition
iNode.h:35
Gaudi::Decays::iNode::toString
virtual std::string toString() const
the string representation of the node
Definition
iNode.cpp:24
Gaudi::Decays::iNode::operator!
virtual bool operator!() const
invalid node?
Definition
iNode.cpp:30
Gaudi::Decays::iNode::fillStream
virtual std::ostream & fillStream(std::ostream &s) const =0
printout of the stream
Gaudi::Decays::iNode::clone
virtual iNode * clone() const =0
clone method ("virtual constructor")
Gaudi::Interfaces::IParticlePropertySvc
The abstract interface to Particle Property Service.
Definition
IParticlePropertySvc.h:29
Gaudi::ParticleID
Holds PDG + LHCb extension particle code, following the PDG particle numbering scheme (pdg....
Definition
ParticleID.h:43
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
iNode.h
Gaudi::Decays
Definition
CC.h:17
Gaudi::Decays::valid
bool valid(Iterator begin, Iterator end)
check the validness of the trees or nodes
Definition
Nodes.h:36
GaudiPartProp
src
iNode.cpp
Generated on
for The Gaudi Framework by
1.17.0