22 Useful decorator for Gaudi::(I)ParticlePropertySvc
25 __author__ =
"Vanya BELYAEV Ivan.Belyaev@nikhef.nl"
28 __all__ = (
"iParticlePropertySvc",)
36 cpp = GaudiPython.Bindings.gbl
38 Helper = GaudiPython.Bindings.Helper
41 Gaudi = GaudiPython.gbl.Gaudi
48 Class iParticlePropertySvc: 'python'-twin for C++ class
50 Gaudi::Interfaces::IParticlePropertySvc
56 Constructor from the name and the service
58 iService.__init__(self, name, isvc)
64 iService.retrieveInterface(self)
65 iParticlePropertySvc.__init__(self, self._name, self._isvc)
70 Find the Particle Property by particle name or particle ID
72 >>> svc = ... # get the service
73 >>> pp1 = svc.find ( 'pi0' ) # find by name
74 >>> pp2 = svc.find ( Gaudi.ParticleID( 511 ) ) # find by Particle ID
79 return self._ipps.
find(what)
82 def get(self, cut, asList=False):
84 Simple 'get' method for Gaudi::Interfaces::IParticlePropertySvc
85 service to extract the properties which satisfy some criteria
87 >>> svc = ... # get service (Gaudi::Interfaces::IParticlePropertySvc) or vector
88 >>> leptons = svc.get ( lambda s : s.pid().isLepton() ) # get all leptons
89 >>> longlived = svc.get ( lambda s : s.ctau() > 0.001 ) # get longlived
94 return self._ipps.
get(cut, asList)
99 Get the begin-iterator for the sequence of particle proeprties
101 >>> svc = ... # get the service
102 >>> begin = svc.begin()
107 return self._ipps.
begin()
112 Get the end-iterator for the sequence of particle proeprties
114 >>> svc = ... # get the service
120 return self._ipps.
end()
123 def all(self, asList=False):
125 Get all particle properties form the service
127 >>> svc = ... # get the service
128 >>> all = svc.all () # get all properties
133 return self._ipps.
all(asList)
138 Dump the particle property table
145 Get CC-conjugationfor decay -descriptor
147 >>> svc = ... # get the service
148 >>> cc = svc.cc ( 'B0 -> K- pi+' ) # get CC-conjugation
153 return self._ipps.
cc(decay)
161 >>> svccpp = svc.svc ()
174 >>> svccpp = svc.service ()
182 Validate the node/decay/tree
184 >>> svc = ... # get the service
185 >>> node = ... # get the node
186 >>> sc = svc.validate ( node )
188 return obj.validate(self.
svc())
193 Make an iteration over all known particle properties:
195 >>> svc = ... # get the service
196 >>> for pp i svc : # make an iteration
202 _list = self._ipps.
all(
False)
212 Get the length(size) of known particle properties
216 return self._ipps.
size()
221 Get the length(size) of known particle properties
227 iParticlePropertySvc.ParticleIDs = Gaudi.Interfaces.IParticlePropertySvc.ParticleIDs
228 iParticlePropertySvc.Decay = Gaudi.Interfaces.IParticlePropertySvc.Decay
229 iParticlePropertySvc.Decays = Gaudi.Interfaces.IParticlePropertySvc.Decays
230 iParticlePropertySvc.Item = Gaudi.Interfaces.IParticlePropertySvc.Item
231 iParticlePropertySvc.Items = Gaudi.Interfaces.IParticlePropertySvc.Items
236 def _ppSvc_(self, name="Gaudi::ParticlePropertySvc
"):
238 Get particle property service form application manager
241 >>> pps = gaudi.gaudiPartProp()
244 svc = Helper.service(self._svcloc, name)
248 AppMgr.gaudiPartProp = _ppSvc_
249 AppMgr.gaudiPartProp = _ppSvc_