4 if sys.platform ==
'linux2' : sys.setdlopenflags(0x100|0x2)
6 import gaudimodule
as gaudi
8 g.JobOptionsType =
'NONE'
12 print '**************GaudiPython Job has been configured*************'
14 g.DLLs = [
'GaudiAlg',
'GaudiIntrospection']
15 g.ExtSvc = [
'IntrospectionSvc']
17 g.service(
'IntrospectionSvc').Dictionaries = [
'TestDict']
21 seq1 = g.algorithm(
'seq1')
22 seq1.members = [
'HelloWorld',
'WriteAlg' ]
24 g.topAlg += [
'Sequencer/seq1']
27 print '**************GaudiPython Job has been initialized*************'
29 print '**************GaudiPython Job has been run ********************'
32 evt = gaudi.DataSvc(g.service(
'EventDataSvc'))
33 header = evt[
'/Event']
34 print '***The event header is: ', header.values()
35 tracks = evt[
'/Event/MyTracks']
36 print '***I got ', len(tracks),
' tracks'
38 his = gaudi.HistoSvc(g.service(
'HistogramDataSvc'))
39 h1 = his.book(
'h1',
'histogram title 1D', 10, 0, 10)
40 print '***Created 1D histogram'
42 h2 = his.book(
'h2',
'histogram title 1D', 10, 0, 10, 20, 0, 10)
43 print '***Created 2D histogram'
46 print '**************Histograms Tested ********************'
52 self.
evt = gaudi.DataSvc(g.service(
'EventDataSvc'))
53 self.
his = gaudi.HistoSvc(g.service(
'HistogramDataSvc'))
54 print 'Initializing User Analysis...'
55 self.
h1 = self.his.book(
'myhisto1',
'Histogram 1D for tests', 20, 0., 40.)
56 self.
h2 = self.his.book(
'myhisto2',
'Histogram 2D for test2', 20, 0., 40., 20, 0., 10.)
57 print '....User Analysis Initialized'
60 tks = self.evt.object(
'MyTracks')
61 print 'MyTracks collection contains ' + `len(tks)` +
' Tracks'
63 self.h1.fill( math.sqrt(t.px*t.px + t.py*t.py + t.pz*t.pz), 1)
64 self.h2.fill( t.px, t.py )
67 print 'Finalizing User Analysis...'
69 print self.h1.entries()
71 print '....User Analysis Finalized'
74 print '**************Testing Python Algorithms ********************'
76 g.topAlg = g.topAlg + [
'PythonAlgorithm' ]