The Gaudi Framework  v38r2 (5b3c9e4d)
FullExperiment.py
Go to the documentation of this file.
1 
11 import sys
12 
13 
14 def config(evtslots=12, threads=10):
15  from Configurables import ApplicationMgr, AvalancheSchedulerSvc
16  from Configurables import Gaudi__Example__TinyExperiment__CheckerAlg as CheckerAlg
17  from Configurables import (
18  Gaudi__Example__TinyExperiment__DigitizationAlg as DigitizationAlg,
19  )
20  from Configurables import (
21  Gaudi__Example__TinyExperiment__GeneratorAlg as GeneratorAlg,
22  )
23  from Configurables import (
24  Gaudi__Example__TinyExperiment__SimulationAlg as SimulationAlg,
25  )
26  from Configurables import Gaudi__Example__TinyExperiment__TrackingAlg as TrackingAlg
27  from Configurables import Gaudi__Monitoring__MessageSvcSink as MessageSvcSink
28  from Configurables import HiveSlimEventLoopMgr, HiveWhiteBoard, RandomGenSvc
29 
30  evtslots = 12
31  threads = 10
32 
33  # infrastructure and services
34  RandomGenSvc(RandomSeed=1234)
35  whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
36  scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads)
37  slimeventloopmgr = HiveSlimEventLoopMgr(SchedulerName=scheduler.name())
38 
39  # - Algorithms
40  gen = GeneratorAlg("GeneratorAlg", NbTracksToGenerate=10)
41  sim = SimulationAlg(
42  "SimulationAlg", NbHitsPerTrack=15, MCTracksLocation=gen.MCTracksLocation
43  )
44  digi = DigitizationAlg(
45  "DigitizationAlg", SigmaNoise=0.1, MCHitsLocation=sim.MCHitsLocation
46  )
47  track = TrackingAlg(
48  "TrackingAlg", NumberBins=100, Sensibility=6, HitsLocation=digi.HitsLocation
49  )
50  check = CheckerAlg(
51  "CheckerAlg", DeltaThetaMax=0.01, TracksLocation=track.TracksLocation
52  )
53 
54  # this printout is useful to check that the type information is passed to python correctly
55  for configurable in [gen, sim, digi, track, check]:
56  print(configurable)
57  # this is to make sure the output is actually printed
58  sys.stdout.flush()
59 
60  # Application setup
62  ExtSvc=[MessageSvcSink(), whiteboard],
63  TopAlg=[gen, sim, digi, track, check],
64  EvtMax=10000,
65  EvtSel="NONE",
66  EventLoop=slimeventloopmgr,
67  )
GaudiExamples.TinyExperiment.FullExperiment.config
def config(evtslots=12, threads=10)
Definition: FullExperiment.py:14
AvalancheSchedulerSvc
Definition: AvalancheSchedulerSvc.h:112
HiveSlimEventLoopMgr
Definition: HiveSlimEventLoopMgr.h:32
ApplicationMgr
Definition: ApplicationMgr.h:57
HiveWhiteBoard
Definition: HiveWhiteBoard.cpp:128