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
31 __author__ =
'Vanya BELYAEV Ivan.Belyaev@lapp.in2p3.fr'
37 Rndm = GaudiPython.gbl.Rndm
38 Math = GaudiPython.gbl.ROOT.Math
39 SUCCESS = GaudiPython.SUCCESS
53 Simple algorithm for advanced N-Tuple columns
59 TupleAlgo.__init__(self, name)
63 """ The major method 'execute', it is invoked for each event """
70 tup = self.nTuple(
'Vectors-4D',
'N-tuple with 4D-vectors')
71 for i
in range(0, 100):
73 lv1 = Math.PxPyPzEVector()
80 tup.column(
'lv1', lv1)
85 tup = self.nTuple(
'Vectors-3D',
'N-tuple with 3D-vectors')
86 for i
in range(0, 100):
98 tup = self.nTuple(
'Points-3D',
'N-tuple with 3D-points')
99 for i
in range(0, 100):
122 Configuration of the job
128 gaudi.JobOptionsType =
'NONE'
129 gaudi.EvtSel =
'NONE'
130 gaudi.HistogramPersistency =
'ROOT'
132 gaudi.ExtSvc += [
"NTupleSvc"]
134 ntSvc = gaudi.service(
'NTupleSvc')
135 ntSvc.Output = [
"MYLUN DATAFILE='TupleEx2.root' OPT='NEW' TYP='ROOT'"]
145 gaudi.setAlgorithms([alg])
148 alg.NTupleLUN =
'MYLUN'
158 if '__main__' == __name__: