19Simple 'decorator for nodes'
22from __future__
import print_function
25__author__ =
"Vanya BELYAEV <Ivan.Belyaev@nikhef.nl>"
32with warnings.catch_warnings():
33 warnings.simplefilter(
"ignore")
39Decays = cppyy.gbl.Gaudi.Decays
41Gaudi = GaudiPython.gbl.Gaudi
48 Decorate the functions
52 if hasattr(opers,
"__call__"):
54 def _call_(self, arg):
58 >>> fun = ... # get the functor
59 >>> arg = ... # get the argument
62 result = opers.__call__(self, arg)
63 return True if result
else False
65 _call_.__doc__ = opers.__call__.__doc__
68 if hasattr(opers,
"__or__"):
74 >>> fun1 = ... # get the functor
75 >>> fun2 = ... # get the functor
78 return opers.__or__(self, arg)
80 _or_.__doc__ = opers.__or__.__doc__
83 if hasattr(opers,
"__ror__"):
89 >>> fun1 = ... # get the functor
90 >>> fun2 = ... # get the functor
93 return opers.__ror__(self, arg)
95 _or_.__doc__ = opers.__or__.__doc__
98 if hasattr(opers,
"__and__"):
100 def _and_(self, arg):
104 >>> fun1 = ... # get the functor
105 >>> fun2 = ... # get the functor
106 >>> fun = fun1 & fun2
108 return opers.__and__(self, arg)
110 _and_.__doc__ = opers.__and__.__doc__
113 if hasattr(opers,
"__rand__"):
115 def _rand_(self, arg):
119 >>> fun1 = ... # get the functor
120 >>> fun2 = ... # get the functor
121 >>> fun = fun1 & fun2
123 return opers.__rand__(self, arg)
125 _rand_.__doc__ = opers.__rand__.__doc__
128 if hasattr(opers,
"__invert__"):
130 def _invert_(self, *arg):
134 >>> fun1 = ... # get the functor
137 return opers.__invert__(self, *arg)
139 _invert_.__doc__ = opers.__invert__.__doc__
142 if hasattr(opers,
"__rshift__"):
144 def _rshift_(self, arg):
148 >>> fun1 = ... # get the functor
149 >>> fun1 = ... # get the functor
150 >>> fun = fun1 >> fun2
152 return opers.__rshift__(self, arg)
154 _rshift_.__doc__ = opers.__rshift__.__doc__
157 if hasattr(opers,
"__rrshift__"):
159 def _rrshift_(self, arg):
161 Evaluate the functor as streametr shift
163 >>> fun = ... # get the functor
164 >>> arg = ... # get the argument
167 result = opers.__rrshift__(self, arg)
168 return True if result
else False
170 _rrshift_.__doc__ = opers.__rrshift__.__doc__
174 node.__call__ = _call_
182 node.__rand__ = _rand_
184 node.__rshift__ = _rshift_
186 node.__rrshift__ = _rrshift_
188 node.__invert__ = _invert_
190 node.__repr__ =
lambda s: s.toString()
191 node.__str__ =
lambda s: s.toString()
241 opers=Decays.Dict.NodeOps,
291Xb =
HasQuark(Gaudi.ParticleID.bottom)
317if "__main__" == __name__:
318 print(
" decorated objects: %s " % str(_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