The Gaudi Framework  v36r9p1 (5c15b2bb)
ReadAndWriteWhiteBoard.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  HiveReadAlgorithm,
20  HiveSlimEventLoopMgr,
21  HiveWhiteBoard,
22  ReadHandleAlg,
23  WriteHandleAlg,
24 )
25 from Gaudi.Configuration import *
26 
27 # Output Levels
28 MessageSvc(OutputLevel=WARNING)
29 IncidentSvc(OutputLevel=DEBUG)
30 RootCnvSvc(OutputLevel=INFO)
31 SequencerTimerTool(OutputLevel=WARNING)
32 
33 # Output setup
34 # - DST
35 dst = OutputStream("RootDst")
36 dst.ItemList = ["/Event#999"]
37 dst.Output = (
38  "DATAFILE='PFN:HandleWB_ROOTOutput.dst' SVC='Gaudi::RootCnvSvc' OPT='RECREATE'"
39 )
40 dst.NeededResources = ["ROOTIO"]
41 
42 GaudiPersistency()
43 
45  OutputLevel=DEBUG,
46  PrintFreq=50,
47  FirstEvent=1,
48  Input=[
49  "DATAFILE='PFN:HandleWB_ROOTIO.dst' SVC='Gaudi::RootEvtSelector' OPT='READ'"
50  ],
51 )
52 FileCatalog(Catalogs=["xmlcatalog_file:HandleWB_ROOTIO.xml"])
53 
54 product_name = "MyCollision"
55 product_name_full_path = "/Event/" + product_name
56 
57 loader = HiveReadAlgorithm("Loader", OutputLevel=INFO, NeededResources=["ROOTIO"])
58 
59 reader = ReadHandleAlg("Reader", OutputLevel=INFO, NeededResources=["ROOTIO"])
60 reader.Input.Path = product_name
61 
62 evtslots = 6
63 algoparallel = 20
64 
65 whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
66 
67 eventloopmgr = HiveSlimEventLoopMgr(OutputLevel=INFO)
68 
69 # We must put the full path in this deprecated expression of dependencies.
70 # Using a controlflow for the output would be the way to go
71 scheduler = AvalancheSchedulerSvc(
72  ThreadPoolSize=algoparallel,
73  OutputLevel=WARNING,
74  CheckDependencies=True,
75  DataLoaderAlg=loader.name(),
76 )
77 
79  TopAlg=[loader, reader, dst],
80  EvtMax=44,
81  HistogramPersistency="NONE",
82  ExtSvc=[whiteboard],
83  EventLoop=eventloopmgr,
84 )
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
SequencerTimerTool
Definition: SequencerTimerTool.h:35
ApplicationMgr
Definition: ApplicationMgr.h:57
EventSelector
Definition of class EventSelector.
Definition: EventSelector.h:63