The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
TestConfig2.py
Go to the documentation of this file.
11from GaudiConfig2 import Configurables as C
12from GaudiConfig2 import mergeConfigs
13
14
16 algorithms = [
17 C.Gaudi.TestSuite.Counter.GaudiHistoAlgorithm(
18 "SimpleCounterHistos", OutputLevel=3
19 ),
20 ]
21 app = C.ApplicationMgr(TopAlg=algorithms)
22 return algorithms + [app]
23
24
26 return [C.AuditorSvc("AuditorSvc", Auditors=["ChronoAuditor"])]
27
28
29def setFakeEvents(nevt):
30 return [C.ApplicationMgr(EvtMax=nevt, EvtSel="NONE")]
31
32
33def histogramWriting(filename):
34 return [
35 C.ApplicationMgr(HistogramPersistency="ROOT"),
36 C.RootHistCnv.PersSvc("RootHistSvc", OutputFile=filename),
37 C.HistogramSvc(
38 "HistogramDataSvc",
39 OutputLevel=2,
40 ),
41 C.Gaudi.Histograming.Sink.Root(),
42 ]
43
44
45def adjustLogLevels(config):
46 config["ApplicationMgr"].TopAlg[0].OutputLevel = 2
47 return config
48
49
50def main(nevt=50000, outfile="histo-c2.root", OutputLevel=3):
51 msgSvc = C.MessageSvc(OutputLevel=3)
52 app = C.ApplicationMgr(MessageSvcType=msgSvc)
53 msgSvcSink = C.Gaudi.Monitoring.MessageSvcSink(
54 HistoStringsWidth=40, NamesToSave=["Prof.*", "Gauss.*"]
55 )
56 app.ExtSvc = [msgSvcSink]
57 return adjustLogLevels(
58 mergeConfigs(
59 [app, msgSvc, msgSvcSink],
62 setFakeEvents(nevt),
63 histogramWriting(outfile),
64 )
65 )
int main()
setFakeEvents(nevt)
histogramWriting(filename)
adjustLogLevels(config)