The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
WriteWhiteBoard.py
Go to the documentation of this file.
1 
14 
15 from Configurables import AlgResourcePool, 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 AlgResourcePool(OutputLevel=DEBUG)
57 GaudiPersistency()
58 
59 product_name = "MyCollision"
60 product_name_full_path = "/Event/" + product_name
61 
62 writer = WriteHandleAlg("Writer", UseHandle=True, Cardinality=1, OutputLevel=WARNING)
63 
64 writer.Output.Path = "/Event/" + product_name
65 
66 evtslots = 1
67 algoparallel = 1
68 
69 whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
70 
71 eventloopmgr = HiveSlimEventLoopMgr(OutputLevel=INFO)
72 
73 # We must put the full path in this deprecated expression of dependencies.
74 # Using a controlflow for the output would be the way to go
75 scheduler = AvalancheSchedulerSvc(ThreadPoolSize=algoparallel, OutputLevel=INFO)
76 
77 # Application setup
79  TopAlg=[writer, dst],
80  EvtMax=500,
81  EvtSel="NONE", # do not use any event input
82  HistogramPersistency="NONE",
83  ExtSvc=[whiteboard],
84  EventLoop=eventloopmgr,
85 )
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