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