20The set of basic decorators for objects from GaudiPartProp package
24__author__ =
"Vanya BELYAEV <Ivan.Belyaev@nikhef.nl>"
32std = GaudiPython.gbl.std
33Decays = GaudiPython.gbl.Gaudi.Decays
34Gaudi = GaudiPython.gbl.Gaudi
40 Get all particle properties from the service
42 >>> svc = ... # get the service
43 >>> all = svc.all () # get all properties
53Gaudi.Interfaces.IParticlePropertySvc.all = _get_all_
59 Simple 'get' method for Gaudi::Interfaces::IParticlePropertySvc
60 service to extract the properties which satisfy some criteria
62 >>> svc = ... # get service (Gaudi::Interfaces::IParticlePropertySvc) or vector
63 >>> leptons = svc.get ( lambda s : s.pid().isLepton() ) # get all leptons
64 >>> longlived = svc.get ( lambda s : s.ctau() > 0.001 ) # get longlived
68 return _all.get(cut, asList)
74 Simple 'get' method for Gaudi::Interfaces::IParticlePropertySvc
75 service to extract the properties which satisfy some criteria
77 >>> svc = ... # get service (Gaudi::Interfaces::IParticlePropertySvc) or vector
78 >>> leptons = svc.get ( lambda s : s.pid().isLepton() ) # get all leptons
79 >>> longlived = svc.get ( lambda s : s.ctau() > 0.001 ) # get longlived
94Gaudi.Interfaces.IParticlePropertySvc.get = _get_pp_
95Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.get = _get_ppv_
96Gaudi.Interfaces.IParticlePropertySvc.__len__ = (
97 Gaudi.Interfaces.IParticlePropertySvc.size
105 Convert Gaudi::Interfaces::IParticlePropertySvc::ParticleProperties into python list
107 >>> ppv = ... # get the vector
108 >>> lst = ppv.toList () # convert it to the list
125 Append the iterable sequence 'lst' to the vector of
128 >>> Vct = std.vector('const Gaudi::ParticleProperty*')
129 >>> lst = [ pp1 , pp2 , pp3 ]
131 >>> vct.fromList ( lst )
142 Print vector of particle properties in a form of table
144 >>> print vct.asTable()
154 Delegate the evaluation of unknown atrributes to Gaudi.ParticleID class
161 if hasattr(_pid, attr):
162 return getattr(_pid, attr)
163 raise AttributeError(
"Unknown attribute: %s " % attr)
167Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.toList = _ppv_2_list_
168Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.toLst = _ppv_2_list_
170Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.fromList = _ppv_from_lst_
171Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.fromLst = _ppv_from_lst_
173Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.__repr__ = (
176Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.__str__ = _prnt_as_table_
177Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.__len__ = (
178 Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties.size
182Gaudi.ParticleProperty.__str__ = Gaudi.ParticleProperty.toString
183Gaudi.ParticleProperty.__repr__ = Gaudi.ParticleProperty.toString
186Gaudi.ParticleProperty.__getattr__ = _get_attr_from_PID_
189Gaudi.ParticleID.__str__ = Gaudi.ParticleID.toString
190Gaudi.ParticleID.__repr__ = Gaudi.ParticleID.toString
194 """Comparison for ParticleProperty objects."""
198 return -1
if comparator(pp1, pp2)
else 1
202 """Comparison `<` for ParticleProperty objects."""
206Gaudi.ParticleProperty.__cmp__ = _pp_cmp_
207Gaudi.ParticleProperty.__lt__ = _pp_lt_
213 Absolute value for the PID
227 Absolute value for the ParticleProperty
234 _pid = self.particleID()
235 if self.selfcc()
or 0 <= _pid.pid():
239 if _anti
and 0 <= _anti.particleID().pid():
245Gaudi.ParticleID.__abs__ = _abs_1_
246Gaudi.ParticleProperty.__abs__ = _abs_2_
255 Get particleID objects which satisfy some criteria
257 >>> pids = ... # vector of LCHb::ParticleID objects
258 >>> good = pids.get( lambda s : s.isLepton() ) # get leptons
259 >>> scalar = pids.get( lambda s : 1 == s.jSpin() ) # get scalars
274Gaudi.ParticleIDs.toList = _ppv_2_list_
275Gaudi.ParticleIDs.toLst = _ppv_2_list_
277Gaudi.ParticleIDs.fromList = _ppv_from_lst_
278Gaudi.ParticleIDs.fromLst = _ppv_from_lst_
280Gaudi.ParticleIDs.__repr__ =
lambda s: s.toList().
__repr__()
281Gaudi.ParticleIDs.__str__ =
lambda s: s.toList().
__str__()
283Gaudi.ParticleIDs.get = _get_pid_
285Decays.Decay.Item.__str__ =
lambda s: s.name()
286Decays.Decay.Item.__repr__ =
lambda s: s.name()
288Decays.Decay.__str__ =
lambda s: s.toString()
289Decays.Decay.__repr__ =
lambda s: s.toString()
292_items.toList =
lambda s: [i
for i
in s]
293_items.toLst =
lambda s: [i
for i
in s]
294_items.__str__ =
lambda s: s.toList().
__str__()
295_items.__repr__ =
lambda s: s.toList().
__repr__()
297_decays.toList =
lambda s: [i
for i
in s]
298_decays.toLst =
lambda s: [i
for i
in s]
299_decays.__str__ =
lambda s: s.toList().
__str__()
300_decays.__repr__ =
lambda s: s.toList().
__repr__()
302Gaudi.Interfaces.IParticlePropertySvc.ParticleIDs = Gaudi.ParticleIDs
303Gaudi.Interfaces.IParticlePropertySvc.Decays = _decays
304Gaudi.Interfaces.IParticlePropertySvc.Items = _items
311 Validate the vector of items/decays
313 >>> vct = ... # get the vector of items/decays
314 >>> svc = ... # get the service
315 >>> vcs.vaildate ( svc ) # validate
321 return cpp.StatusCode(cpp.StatusCode.SUCCESS)
324_decays.validate = _validate_
325_items.validate = _validate_
327_old_symbols_ = Decays.Symbols.symbols
328_old_particles_ = Decays.Symbols.particles
333 Get all known predefined symbols:
335 >>> syms = ... # get the table of symbols
336 >>> s = syms.symbols() # get the list of symbols
339 strings = std.vector(
"std::string")()
349 Iteration over all known symbols
351 >>> syms = ... # get the table of symbols
353 ... print ' help for %s :' % s , syms.symbol ( s )
355 _list = self.symbols()
357 while _i < len(_list):
362Decays.Symbols.symbols = _symbols_
363Decays.Symbols.__iter__ = _sym_iter_
366Symbols = Decays.Symbols.instance()
the helper representation of the item in the decay chain
The simple representation of "simple 1-step" decay (there are no trees!
std::vector< const Gaudi::ParticleProperty * > ParticleProperties
the actual type of (ordered) container of particle properties
Holds PDG + LHCb extension particle code, following the PDG particle numbering scheme (pdg....
Gaudi::Interfaces::IParticlePropertySvc::ParticleProperties allProperties(const Gaudi::Interfaces::IParticlePropertySvc *service)
get all the properties at once
GAUDI_API std::string printAsTable(const std::vector< const Gaudi::ParticleProperty * > &particles, const Gaudi::Interfaces::IParticlePropertySvc *service=0)
print a list of properties in a form of the table
_ppv_2_list_(self)
Convert Gaudi.Interfaces.IParticlePropertySvc.ParticleProperties into python list.
_ppv_from_lst_(self, lst)
convert python list into Gaudi.IParticlePropertisvc.ParticleProperties
_get_ppv_(self, cut, asList=False)
simple "get" method for the service
_get_attr_from_PID_(self, attr)
__repr__
decorate the vector of properties
_get_pp_(self, cut, asList=False)
simple "get" method for the service
__str__
decorate the printout for Gaudi.ParticleProperty
_get_pid_(self, cut)
get particleID objects whcih satisfy some criteria
_get_all_(self, asList=False)
get all particle properties form the service
_abs_2_(self)
abs for ParticleProperty
_prnt_as_table_(self, *args)
Print vector of particle properties in a form of table.
_abs_1_(self)
abs for ParticleID
The comparison criteria for particle properties.