The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
StringKeyEx.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 
13 """
14 *******************************************************************************
15 * *
16 * Simple example which illustrates the usage of class StringKey *
17 * *
18 *******************************************************************************
19 """
20 # =============================================================================
21 __author__ = "Vanya BELYAEV Ivan.Belyaev@nikhef.nl"
22 from Configurables import ApplicationMgr
23 from Configurables import Gaudi__Examples__StringKeyEx as SKE
24 
25 # =============================================================================
26 # @file
27 # Simple example which illustrates the usage of class StringKey
28 # @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
29 # @date 2009-10-07
30 # =============================================================================
31 
32 ske = SKE("StringKeys", Key="key", Keys=["a", "b", "key", "c", "d"])
33 
34 ApplicationMgr(EvtSel="NONE", TopAlg=[ske], EvtMax=10)
35 
36 # =============================================================================
37 # The actual job excution
38 # =============================================================================
39 if "__main__" == __name__:
40 
41  print(__doc__)
42  print(__author__)
43 
44  from GaudiPython.Bindings import AppMgr
45 
46  gaudi = AppMgr()
47 
48  gaudi.run(1)
49 
50  ske = gaudi.algorithm("StringKeys")
51 
52  ske.PropertiesPrint = True
53 
54  from GaudiPython.Bindings import gbl as cpp
55 
56  SK = cpp.Gaudi.StringKey
57 
58  key = SK("new Key")
59 
60  print("set new key: ", key)
61 
62  ske.Key = key
63 
64  keys = [key, "rrr", SK("s")]
65 
66  print("set new keys: ", keys)
67 
68  ske.Keys = keys
69 
70  ske.PropertiesPrint = True
71 
72  gaudi.run(1)
73 
74 # =============================================================================
75 # The END
76 # =============================================================================
GaudiPython.Bindings.AppMgr
Definition: Bindings.py:869
GaudiPython.Bindings
Definition: Bindings.py:1
StringKeyEx.SK
SK
Definition: StringKeyEx.py:56