Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r5 (befafb8a)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 # =============================================================================
24 __author__ = "Vanya BELYAEV Ivan.Belyaev@nikhef.nl"
25 from Configurables import ApplicationMgr
26 from Configurables import Gaudi__Examples__ArrayProperties as AP
27 
28 # =============================================================================
29 # @file
30 # Simple which illustrates
31 # the 'array-like' job-properties and their C++/Python intercommunication
32 # @author Vanya BELYAEV Ivan.Belyaev@nikhef.nl
33 # @date 2007-02-13
34 # =============================================================================
35 from Gaudi.Configuration import *
36 
37 ap = AP("ArrayProps", Strings=("a", "bb", "ccc", "dddd"), Doubles=(1, 2, 3, 4, 5))
38 
39 ApplicationMgr(EvtSel="NONE", TopAlg=[ap], EvtMax=10)
40 
41 # =============================================================================
42 # The actual job excution
43 # =============================================================================
44 if "__main__" == __name__:
45 
46  print(__doc__, __author__)
47 
48  # make sure cling can generate all required methods in Gaudi::Property
49  # Workaround for ROOT-10769
50  import warnings
51 
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:873
GaudiPython.Bindings
Definition: Bindings.py:1
Gaudi.Configuration
Definition: Configuration.py:1