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