22 Useful decorator for Gaudi::(I)ParticlePropertySvc
26 __author__ =
"Vanya BELYAEV Ivan.Belyaev@nikhef.nl"
29 __all__ = (
"iParticlePropertySvc",)
37 cpp = GaudiPython.Bindings.gbl
39 Helper = GaudiPython.Bindings.Helper
42 Gaudi = GaudiPython.gbl.Gaudi
49 Class iParticlePropertySvc: 'python'-twin for C++ class
51 Gaudi::Interfaces::IParticlePropertySvc
57 Constructor from the name and the service
59 iService.__init__(self, name, isvc)
65 iService.retrieveInterface(self)
66 iParticlePropertySvc.__init__(self, self._name, self._isvc)
71 Find the Particle Property by particle name or particle ID
73 >>> svc = ... # get the service
74 >>> pp1 = svc.find ( 'pi0' ) # find by name
75 >>> pp2 = svc.find ( Gaudi.ParticleID( 511 ) ) # find by Particle ID
80 return self._ipps.
find(what)
83 def get(self, cut, asList=False):
85 Simple 'get' method for Gaudi::Interfaces::IParticlePropertySvc
86 service to extract the properties which satisfy some criteria
88 >>> svc = ... # get service (Gaudi::Interfaces::IParticlePropertySvc) or vector
89 >>> leptons = svc.get ( lambda s : s.pid().isLepton() ) # get all leptons
90 >>> longlived = svc.get ( lambda s : s.ctau() > 0.001 ) # get longlived
95 return self._ipps.
get(cut, asList)
100 Get the begin-iterator for the sequence of particle proeprties
102 >>> svc = ... # get the service
103 >>> begin = svc.begin()
108 return self._ipps.
begin()
113 Get the end-iterator for the sequence of particle proeprties
115 >>> svc = ... # get the service
121 return self._ipps.
end()
124 def all(self, asList=False):
126 Get all particle properties form the service
128 >>> svc = ... # get the service
129 >>> all = svc.all () # get all properties
134 return self._ipps.
all(asList)
139 Dump the particle property table
146 Get CC-conjugationfor decay -descriptor
148 >>> svc = ... # get the service
149 >>> cc = svc.cc ( 'B0 -> K- pi+' ) # get CC-conjugation
154 return self._ipps.
cc(decay)
162 >>> svccpp = svc.svc ()
175 >>> svccpp = svc.service ()
183 Validate the node/decay/tree
185 >>> svc = ... # get the service
186 >>> node = ... # get the node
187 >>> sc = svc.validate ( node )
189 return obj.validate(self.
svc())
194 Make an iteration over all known particle properties:
196 >>> svc = ... # get the service
197 >>> for pp i svc : # make an iteration
203 _list = self._ipps.
all(
False)
213 Get the length(size) of known particle properties
217 return self._ipps.
size()
222 Get the length(size) of known particle properties
228 iParticlePropertySvc.ParticleIDs = Gaudi.Interfaces.IParticlePropertySvc.ParticleIDs
229 iParticlePropertySvc.Decay = Gaudi.Interfaces.IParticlePropertySvc.Decay
230 iParticlePropertySvc.Decays = Gaudi.Interfaces.IParticlePropertySvc.Decays
231 iParticlePropertySvc.Item = Gaudi.Interfaces.IParticlePropertySvc.Item
232 iParticlePropertySvc.Items = Gaudi.Interfaces.IParticlePropertySvc.Items
237 def _ppSvc_(self, name="Gaudi::ParticlePropertySvc
"):
239 Get particle property service form application manager
242 >>> pps = gaudi.gaudiPartProp()
245 svc = Helper.service(self._svcloc, name)
249 AppMgr.gaudiPartProp = _ppSvc_
250 AppMgr.gaudiPartProp = _ppSvc_