19Simple 'decorator for nodes'
23__author__ =
"Vanya BELYAEV <Ivan.Belyaev@nikhef.nl>"
30with warnings.catch_warnings():
31 warnings.simplefilter(
"ignore")
37Decays = cppyy.gbl.Gaudi.Decays
39Gaudi = GaudiPython.gbl.Gaudi
46 Decorate the functions
50 if hasattr(opers,
"__call__"):
52 def _call_(self, arg):
56 >>> fun = ... # get the functor
57 >>> arg = ... # get the argument
60 result = opers.__call__(self, arg)
61 return True if result
else False
63 _call_.__doc__ = opers.__call__.__doc__
66 if hasattr(opers,
"__or__"):
72 >>> fun1 = ... # get the functor
73 >>> fun2 = ... # get the functor
76 return opers.__or__(self, arg)
78 _or_.__doc__ = opers.__or__.__doc__
81 if hasattr(opers,
"__ror__"):
87 >>> fun1 = ... # get the functor
88 >>> fun2 = ... # get the functor
91 return opers.__ror__(self, arg)
93 _or_.__doc__ = opers.__or__.__doc__
96 if hasattr(opers,
"__and__"):
102 >>> fun1 = ... # get the functor
103 >>> fun2 = ... # get the functor
104 >>> fun = fun1 & fun2
106 return opers.__and__(self, arg)
108 _and_.__doc__ = opers.__and__.__doc__
111 if hasattr(opers,
"__rand__"):
113 def _rand_(self, arg):
117 >>> fun1 = ... # get the functor
118 >>> fun2 = ... # get the functor
119 >>> fun = fun1 & fun2
121 return opers.__rand__(self, arg)
123 _rand_.__doc__ = opers.__rand__.__doc__
126 if hasattr(opers,
"__invert__"):
128 def _invert_(self, *arg):
132 >>> fun1 = ... # get the functor
135 return opers.__invert__(self, *arg)
137 _invert_.__doc__ = opers.__invert__.__doc__
140 if hasattr(opers,
"__rshift__"):
142 def _rshift_(self, arg):
146 >>> fun1 = ... # get the functor
147 >>> fun1 = ... # get the functor
148 >>> fun = fun1 >> fun2
150 return opers.__rshift__(self, arg)
152 _rshift_.__doc__ = opers.__rshift__.__doc__
155 if hasattr(opers,
"__rrshift__"):
157 def _rrshift_(self, arg):
159 Evaluate the functor as streametr shift
161 >>> fun = ... # get the functor
162 >>> arg = ... # get the argument
165 result = opers.__rrshift__(self, arg)
166 return True if result
else False
168 _rrshift_.__doc__ = opers.__rrshift__.__doc__
172 node.__call__ = _call_
180 node.__rand__ = _rand_
182 node.__rshift__ = _rshift_
184 node.__rrshift__ = _rrshift_
186 node.__invert__ = _invert_
188 node.__repr__ =
lambda s: s.toString()
189 node.__str__ =
lambda s: s.toString()
239 opers=Decays.Dict.NodeOps,
289Xb =
HasQuark(Gaudi.ParticleID.bottom)
315if "__main__" == __name__:
316 print(f
" decorated objects: {_decorated} ")
The generic class to hold the pointer to other node.
Helper structure (especially it is light version node-holder the default constructor.
the rather simple (but powerful) node in the decay tree: it matches .AND.
the most simple node in the decay tree: it matches to all valid the Gaudi::Particles
The trivial node : it match the Baryon.
The simple node in the decay tree: it matches to a certain particle ID or its antiparticle.
simple pid-checker for particle lifetime (in c*tau units)
The trivial node : it match the Charged.
The trivial node : it match any charged lepton.
The trivial node : it match any negative lepton.
The trivial node : it match any positive lepton.
The trivial node : it match the Hadron.
The trivial node : it match the quark content.
simple pid-checker for particle mass
the most simple node to represent the invalid node it matches to all valid the Gaudi::Particles
The trivial node : it match the 2J+1 spin.
The trivial node : it match the 2L+1 spin.
The trivial node : it match the Lepton.
simple pid-checker for particle mass
simple pid-checker for particle mass
The trivial node : it match the meson.
The trivial node : it match the negatively charged particles.
The trivial node : it match the Neutral.
Simple node which match "NOT" for the subnode.
The trivial node : it match any neutral lepton.
The trivial node : it match the Nucleus.
the rather simple (but powerful) node in the decay tree: it matches .OR.
The simple node in the decay tree: it matches to a certain particle ID.
The trivial node : it match the positively charged particles.
The trivial node : it match the 2S+1 spin.
represent simple predicate for short-lived particles
represent simple predicate for Stable+Charged particles
represent simple predicate for Stable particles
The abstract class which represents the single "node" of decay tree.
_decorate(nodes, opers)
Decorate the nodes.
represent simple predicate for Long-lived particles