22 *******************************************************************************
24 * Simple example which illustrate the usage of useful *
25 * algorithm base class for N-Tuple manipulations *
27 *******************************************************************************
29 from __future__
import print_function
32 __author__ =
"Vanya BELYAEV Ivan.Belyaev@lapp.in2p3.fr"
39 Rndm = GaudiPython.gbl.Rndm
40 Math = GaudiPython.gbl.ROOT.Math
41 SUCCESS = GaudiPython.SUCCESS
55 Simple algorithm for advanced N-Tuple columns
61 TupleAlgo.__init__(self, name)
65 """The major method 'execute', it is invoked for each event"""
72 tup = self.nTuple(
"Vectors-4D",
"N-tuple with 4D-vectors")
73 for i
in range(0, 100):
75 lv1 = Math.PxPyPzEVector()
82 tup.column(
"lv1", lv1)
87 tup = self.nTuple(
"Vectors-3D",
"N-tuple with 3D-vectors")
88 for i
in range(0, 100):
100 tup = self.nTuple(
"Points-3D",
"N-tuple with 3D-points")
101 for i
in range(0, 100):
124 Configuration of the job
130 gaudi.JobOptionsType =
"NONE"
131 gaudi.EvtSel =
"NONE"
132 gaudi.HistogramPersistency =
"ROOT"
134 gaudi.ExtSvc += [
"NTupleSvc"]
136 ntSvc = gaudi.service(
"NTupleSvc")
137 ntSvc.Output = [
"MYLUN DATAFILE='TupleEx2.root' OPT='NEW' TYP='ROOT'"]
147 gaudi.setAlgorithms([alg])
150 alg.NTupleLUN =
"MYLUN"
160 if "__main__" == __name__: