The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
WriteAndReadHandleWhiteBoard.py
Go to the documentation of this file.
1 
14 
15 from Configurables import AvalancheSchedulerSvc
16 from Configurables import Gaudi__RootCnvSvc as RootCnvSvc
17 from Configurables import (
18  GaudiPersistency,
19  HiveSlimEventLoopMgr,
20  HiveWhiteBoard,
21  ReadHandleAlg,
22  WriteHandleAlg,
23 )
24 from Gaudi.Configuration import *
25 
26 # Output setup
27 # - DST
28 dst = OutputStream("RootDst")
29 
30 dst.ItemList = ["/Event#999"]
31 dst.Output = (
32  "DATAFILE='PFN:HandleWB_ROOTIO.dst' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'"
33 )
34 
35 # - MiniDST
36 mini = OutputStream("RootMini")
37 mini.ItemList = ["/Event#1"]
38 mini.Output = (
39  "DATAFILE='PFN:HandleWB_ROOTIO.mdst' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'"
40 )
41 mini.OutputLevel = VERBOSE
42 
43 # - File Summary Record
44 fsr = RecordStream("FileRecords")
45 fsr.ItemList = ["/FileRecords#999"]
46 fsr.Output = dst.Output
47 fsr.EvtDataSvc = FileRecordDataSvc()
48 fsr.EvtConversionSvc = FileRecordPersistencySvc()
49 
50 FileCatalog(Catalogs=["xmlcatalog_file:HandleWB_ROOTIO.xml"])
51 
52 # Output Levels
53 MessageSvc(OutputLevel=WARNING)
54 IncidentSvc(OutputLevel=DEBUG)
55 RootCnvSvc(OutputLevel=INFO)
56 
57 GaudiPersistency()
58 
59 product_name = "MyCollision"
60 
61 writer = WriteHandleAlg("Writer", OutputLevel=DEBUG, UseHandle=True)
62 writer.Output.Path = "/Event/" + product_name
63 
64 reader = ReadHandleAlg("Reader", OutputLevel=DEBUG)
65 reader.Input.Path = product_name
66 
67 evtslots = 15
68 algoparallel = 10
69 
70 whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
71 
72 slimeventloopmgr = HiveSlimEventLoopMgr()
73 
74 scheduler = AvalancheSchedulerSvc(ThreadPoolSize=algoparallel, OutputLevel=WARNING)
75 
76 # Application setup
78 # - I/O
79 # Do not put them here, but as normal algorithms.
80 # Putting two of them in the top alg list will not work if more than one
81 # algo is allowed to be in flight: at some point they will write to disk
82 # simultaneously, with catastrophic effects.
83 
84 # app.OutStream += [ mini ]
85 # - Algorithms
86 app.TopAlg = [writer, reader, mini]
87 # - Events
88 app.EvtMax = 50
89 app.EvtSel = "NONE" # do not use any event input
90 app.HistogramPersistency = "NONE"
91 app.ExtSvc = [whiteboard]
92 app.EventLoop = slimeventloopmgr
OutputStream
A small to stream Data I/O.
Definition: OutputStream.h:38
IncidentSvc
Default implementation of the IIncidentSvc interface.
Definition: IncidentSvc.h:48
Gaudi.Configuration
Definition: Configuration.py:1
MessageSvc
Definition: MessageSvc.h:40
FileRecordDataSvc
Definition: FileRecordDataSvc.cpp:48
ApplicationMgr
Definition: ApplicationMgr.h:57
RecordStream
Definition: RecordStream.h:23