The Gaudi Framework  v36r1 (3e2fb5a8)
ArrayProperties.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
13 """
14 *******************************************************************************
15 * *
16 * Simple example which illustrate the 'array'-like job-properties and their *
17 * C++/Python intercommunications *
18 * *
19 *******************************************************************************
20 """
21 from __future__ import print_function
22 # =============================================================================
23 __author__ = 'Vanya BELYAEV Ivan.Belyaev@nikhef.nl'
24 # =============================================================================
25 # @file
26 # Simple which illustrates
27 # the 'array-like' job-properties and their C++/Python intercommunication
28 # @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
29 # @date 2007-02-13
30 # =============================================================================
31 from Gaudi.Configuration import *
32 
33 from Configurables import ApplicationMgr
34 
35 from Configurables import Gaudi__Examples__ArrayProperties as AP
36 
37 ap = AP(
38  'ArrayProps', Strings=('a', 'bb', 'ccc', 'dddd'), Doubles=(1, 2, 3, 4, 5))
39 
40 ApplicationMgr(EvtSel="NONE", TopAlg=[ap], EvtMax=10)
41 
42 # =============================================================================
43 # The actual job excution
44 # =============================================================================
45 if '__main__' == __name__:
46 
47  print(__doc__, __author__)
48 
49  # make sure cling can generate all required methods in Gaudi::Property
50  # Workaround for ROOT-10769
51  import warnings
52  with warnings.catch_warnings():
53  warnings.simplefilter("ignore")
54  import cppyy
55  cppyy.gbl.gInterpreter.Declare('#define NO_C_ARRAY_AS_PROPERTY_WARNING')
56  cppyy.gbl.gInterpreter.Declare('#include "GaudiKernel/CArrayAsProperty.h"')
57 
58  from GaudiPython.Bindings import AppMgr
59 
60  gaudi = AppMgr()
61 
62  gaudi.run(5)
63 
64  ap = gaudi.algorithm('ArrayProps')
65 
66  ap.PropertiesPrint = True
67 
68  ap.Strings = ['qu-qu', 'qu-qu', 'qu-qu', 'qu-qu']
69  ap.Doubles = [0, -1, 2, -3, 4]
70 
71  ap.PropertiesPrint = True
72 
73 # =============================================================================
74 # The END
75 # =============================================================================
GaudiPython.Bindings.AppMgr
Definition: Bindings.py:842
GaudiPython.Bindings
Definition: Bindings.py:1
Gaudi.Configuration
Definition: Configuration.py:1