The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
Check.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2
19"""
20The trivial example to inspect the particle data table from the data base
21"""
22
23# =============================================================================
24__author__ = "Vanya BELYAEV vanya@nikhef.nl"
25__verison__ = " "
26# =============================================================================
27
28from Configurables import ApplicationMgr, Gaudi__ParticlePropertySvc
29
30
31ApplicationMgr().ExtSvc += [Gaudi__ParticlePropertySvc()]
32
33# The following is misunderstood by flake8 - the import is needed as it
34# has necessary side effects
35import GaudiPartProp.Service # noqa: F401
36from GaudiKernel.SystemOfUnits import micrometer
37
38
39from GaudiPython.Bindings import AppMgr
40
41# instantiate the actual (C++) application manager
42gaudi = AppMgr()
43
44# switch off all algorithms
45gaudi.TopAlg = []
46
47# initialize everything properly
48gaudi.run(1)
49
50# get the actual (C++) particle properties service
51ppsvc = gaudi.gaudiPartProp()
52
53# finally: play with the service
54
55# get all a self-conjugated particles
56print(" Self-charge conjugated particles ")
57selfcc = ppsvc.get(lambda x: x.selfcc())
58print(selfcc)
59
60# set self-charge conjugated conjugated mesons:
61print(" CC-neutral mesons")
62mesonscc = ppsvc.get(lambda x: (x.selfcc() and x.isMeson()))
63print(mesonscc)
64
65# set self-charge conjugated conjugated mesons:
66print(" CC-neutral beauty mesons")
67mesonscc = ppsvc.get(lambda x: (x.isMeson() and x.hasBottom()))
68print(mesonscc)
69
70# get "stable" particles ( lifetime in excess of 1 micrometer
71print(" STABLE particles (c*tau> 1 um)")
72stable = ppsvc.get(lambda x: (x.ctau() > micrometer))
73print(stable)
The Application Manager class.