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