22 *******************************************************************************
24 * Simple example which illustrate the usage of useful *
25 * algorithm base class for N-Tuple manipulations *
27 *******************************************************************************
30 __author__ =
"Vanya BELYAEV Ivan.Belyaev@lapp.in2p3.fr"
35 Rndm = GaudiPython.gbl.Rndm
36 Math = GaudiPython.gbl.ROOT.Math
37 SUCCESS = GaudiPython.SUCCESS
51 Simple algorithm for advanced N-Tuple columns
57 TupleAlgo.__init__(self, name)
61 """The major method 'execute', it is invoked for each event"""
66 tup = self.nTuple(
"Vectors-4D",
"N-tuple with 4D-vectors")
67 for i
in range(0, 100):
69 lv1 = Math.PxPyPzEVector()
76 tup.column(
"lv1", lv1)
81 tup = self.nTuple(
"Vectors-3D",
"N-tuple with 3D-vectors")
82 for i
in range(0, 100):
94 tup = self.nTuple(
"Points-3D",
"N-tuple with 3D-points")
95 for i
in range(0, 100):
118 Configuration of the job
124 gaudi.JobOptionsType =
"NONE"
125 gaudi.EvtSel =
"NONE"
126 gaudi.HistogramPersistency =
"ROOT"
128 gaudi.ExtSvc += [
"NTupleSvc"]
130 ntSvc = gaudi.service(
"NTupleSvc")
131 ntSvc.Output = [
"MYLUN DATAFILE='TupleEx2.root' OPT='NEW' TYP='ROOT'"]
141 gaudi.setAlgorithms([alg])
144 alg.NTupleLUN =
"MYLUN"
154 if "__main__" == __name__: