14 *******************************************************************************
16 * Simple example which illustrate the usage of useful *
17 * algorithm base class for writing of EventTag Collections *
19 *******************************************************************************
22 __author__ =
"Vanya BELYAEV ibelyaev@physics.syr.edu"
27 Rndm = GaudiPython.gbl.Rndm
29 SUCCESS = GaudiPython.SUCCESS
39 """Simple algorithm which implicitely book&Fill Event Tag collection"""
43 TupleAlgo.__init__(self, name)
48 """The major method 'execute', it is invoked for each event"""
62 address = self.get(
"/Event")
63 address = address.registry().address()
66 tup = self.evtCol(
"COL1",
"My trivial N-tuple")
68 tup.column(
"Address", address)
70 tup.column(
"evtNum", self.
s_nEvt)
71 tup.column(
"runNum", self.
s_nRun)
73 tup.column(
"gauss",
gauss())
74 tup.column(
"flat", flat())
75 tup.column(
"expo", expo())
76 tup.column(
"poisson", int(poisson()))
77 tup.column(
"binom", int(binom()))
78 tup.column(
"flag", 0 >
gauss())
88 GaudiPython.AppMgr.evtcolsvc = _evtcolsvc_
96 """Configuration of the job"""
101 gaudi.HistogramPersistency =
"ROOT"
102 gaudi.DLLs += [
"GaudiAlg",
"RootHistCnv"]
103 gaudi.ExtSvc += [
"RndmGenSvc",
"NTupleSvc",
"TagCollectionSvc/EvtTupleSvc"]
106 gaudi.setAlgorithms([alg])
108 alg.EvtColLUN =
"EVTTAGS"
109 alg.EvtColsProduce =
True
110 alg.EvtColsPrint =
True
111 alg.NTupleProduce =
False
112 alg.HistoProduce =
False
114 gaudi.OutStream = [
"EvtCollectionStream/TagsWriter"]
115 tagsWriter = gaudi.algorithm(
"TagsWriter")
116 tagsWriter.ItemList = [
"/NTUPLES/EVTTAGS/Fill/COL1"]
117 tagsWriter.EvtDataSvc =
"EvtTupleSvc"
119 evtColSvc = gaudi.evtcolsvc()
120 evtColSvc.defineOutput({
"EVTTAGS":
"PFN:EvtTags1.root"}, typ=
"Gaudi::RootCnvSvc")
121 evtColSvc.OutputLevel = 2
123 evtSel = gaudi.evtSel()
124 evtSel.PrintFreq = 1000
125 evtSel.open([
"EvtColsEx.dst"])
133 if "__main__" == __name__:
136 from Configurables
import ApplicationMgr, FileCatalog, GaudiPersistency
139 ApplicationMgr().ExtSvc.append(
140 FileCatalog(Catalogs=[
"xmlcatalog_file:EvtColsEx.xml"])