| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Properties.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # =============================================================================
00003 # $Id: Properties.py,v 1.4 2007/05/24 14:36:37 hmd Exp $
00004 # =============================================================================
00005 # CVS tag $Name: GAUDI_v20r4-pre $, version $Revision: 1.4 $
00006 # =============================================================================
00007 """
00008 *******************************************************************************
00009 *                                                                             *
00010 * Simple example (identical to C++ Properties.opts) which illustrated         *
00011 * the basic job-properties and theinr C++/Python intercommunication           *
00012 *                                                                             *
00013 *******************************************************************************
00014 """
00015 # =============================================================================
00016 __author__ = 'Vanya BELYAEV ibelyaev@physics.syr.edu'
00017 # =============================================================================
00018 ## @file
00019 #  Simple example (identical to C++ Properties.opts) which illustrated         
00020 #  the basic job-properties and theinr C++/Python intercommunication
00021 #  @author Vanya BELYAEV ibelyaev@physics.syr.edu
00022 #  @date 2007-02-13
00023 # =============================================================================
00024 
00025 import gaudimodule
00026 
00027 SUCCESS = gaudimodule.SUCCESS 
00028 
00029 # =============================================================================
00030 ## the configurtaion of the job
00031 def configure ( gaudi = None ) :
00032     """ the configurtaion of the job """
00033 
00034     ## create applictaion manager if not done yet 
00035     if not gaudi : gaudi = gaudimodule.AppMgr()
00036 
00037     ## read main configuration files 
00038     gaudi.config ( files = [ '../options/Common.opts' ] )
00039     
00040     ## private algorithm configuration options
00041     
00042     gaudi.TopAlg = [ 'PropertyAlg' ]
00043     
00044     # test for the multiple inclusion of the same alg
00045     gaudi.TopAlg  += [ "PropertyAlg", "PropertyProxy" ]
00046     
00047     # test for the removal of an algorithm
00048     gaudi.TopAlg.remove("PropertyAlg") 
00049     
00050     # Set output level threshold
00051     #    (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
00052     msgSvc = gaudi.service('MessageSvc')
00053     msgSvc.OutputLevel = 3
00054     
00055     ## event related parameters
00056     gaudi.EvtSel = 'NONE'
00057     gaudi.HistogramPersistency = 'NONE'
00058     
00059     # Algorithms Private Options
00060 
00061     alg = gaudi.algorithm('PropertyAlg')
00062     
00063     alg.OutputLevel = 3;
00064     
00065     alg.Int    = 101 
00066     alg.Double = 101.1e+10
00067     alg.String = "hundred one"
00068     alg.Bool   = False
00069 
00070     alg.IntArray    = [ 1, 2, 3, 5 ] 
00071     alg.DoubleArray = [ -11.0 , 2., 3.3, 0.4e-03 ]
00072     alg.StringArray = [ "one" , "two" , "four" ]
00073     alg.BoolArray   = [ False , True , False ] 
00074     alg.EmptyArray  = []
00075     
00076     alg.PInt    = 101 
00077     alg.PDouble = 101.E5
00078     alg.PString = "hundred one"
00079     alg.PBool   = True
00080     
00081 
00082     alg.PIntArray    = [ 1, 2, 3, 5 ]
00083     alg.PDoubleArray = [ 1.1 , 2., 3.3 ]
00084     alg.PStringArray = [ "one", "two", "four" ]
00085     alg.PBoolArray   = [  True , False , True , False ]
00086 
00087     proxy = gaudi.algorithm( "PropertyProxy" )
00088     proxy.String = "This is set by the proxy"
00089     
00090     msgSvc.setDebug   = [ "EventLoopMgr" ]
00091     msgSvc.setVerbose = [ "MsgTest"      ]
00092 
00093     return SUCCESS 
00094 # =============================================================================
00095 
00096 
00097 # =============================================================================
00098 # The actual job excution 
00099 # =============================================================================
00100 if '__main__' == __name__ :
00101     
00102     print __doc__ , __author__
00103     
00104     gaudi = gaudimodule.AppMgr()
00105     configure( gaudi )
00106     gaudi.run(1)
00107 
00108     alg = gaudi.algorithm( 'PropertyAlg' )
00109 
00110     props = alg.properties()
00111     print 'Properties of %s ' % alg.name()
00112     for p in props :
00113         v = props[p].value() 
00114         print "Python: Name/Value:  '%s' / '%s' "%(p,v)
00115         
00116 # =============================================================================
00117 # The END 
00118 # =============================================================================
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:59:39 2011 for GaudiExamples by doxygen 1.4.7