4from AthenaConfiguration.ComponentFactory
import CompFactory
5from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
14 result = ComponentAccumulator()
15 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoCnvAlgCfg
16 EICA = EventInfoCnvAlgCfg(flags, inputKey=
"McEventInfo", outputKey=
"EventInfo", disableBeamSpot=
True, OutputLevel=DEBUG)
17 result.merge(EICA, sequenceName=
"AthAlgSeq")
19 result.setAppProperty(
"HistogramPersistency",
"ROOT")
24 result = ComponentAccumulator()
28 alg = CompFactory.AthEx.Hist(
"Hist", OutputLevel=DEBUG )
29 result.addEventAlgo(alg)
32 svc = CompFactory.THistSvc(
"THistSvc", OutputLevel=INFO)
33 svc.Output += [
"stat DATAFILE='hist.root' OPT='RECREATE'" ]
34 result.addService(svc)
39 result = ComponentAccumulator()
43 alg = CompFactory.AthEx.Ntup(
"Ntup", OutputLevel=DEBUG)
44 result.addEventAlgo(alg)
46 svc = CompFactory.THistSvc(
"THistSvc", OutputLevel=INFO)
48 svc.Output += [
"rec DATAFILE='ntuple.root' OPT='RECREATE'" ]
50 result.addService(svc)
55if __name__ ==
"__main__":
57 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
58 flags = initConfigFlags()
59 flags.Input.Files = []
60 flags.Input.RunNumbers = [12345]
61 flags.Input.TimeStamps = [1]
62 flags.Input.TypedCollections = []
63 flags.Exec.MaxEvents = 10
64 flags.Scheduler.ShowControlFlow =
True
65 flags.Scheduler.ShowDataDeps =
True
70 from AthenaCommon.Logging
import log
71 log.setLevel(flags.Exec.OutputLevel)
74 from AthenaConfiguration.MainServicesConfig
import MainEvgenServicesCfg
75 cfg = MainEvgenServicesCfg(flags,withSequences=
True)
78 msgSvc = CompFactory.MessageSvc(
"MessageSvc", useColors=
True)
79 cfg.addService(msgSvc)
87 sys.exit(cfg.run().isFailure())