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