2 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory
import CompFactory
6 """Configure the EVNT->xAOD converter alg"""
13 if flags.Input.SpecialConfiguration.get(
"HasLHERecord",
"False") ==
"True":
14 kwargs.setdefault(
'xAODTruthLHEParticleContainerName',
'TruthLHEParticles')
16 xAODTruthCnvAlg = CompFactory.xAODMaker.xAODTruthCnvAlg
17 acc.addEventAlgo(xAODTruthCnvAlg(name,**kwargs))
23 writeInTimePileUpTruth=
False
27 if flags.Digitization.PileUp
and flags.Digitization.DigiSteeringConf
in [
'StandardPileUpToolsAlg',
'StandardInTimeOnlyTruthPileUpToolsAlg',
'StandardInTimeOnlyGeantinoTruthPileUpToolsAlg']:
28 writeInTimePileUpTruth =
True
30 kwargs.setdefault(
'WriteInTimePileUpTruth', writeInTimePileUpTruth)
31 kwargs.setdefault(
'AODContainerName',
'TruthEvent')
33 algo = CompFactory.xAODMaker.xAODTruthCnvAlg(name, **kwargs)
34 acc.addEventAlgo(algo, primary =
True)
36 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD,addToAOD
37 toAOD = [
"xAOD::TruthEventContainer#TruthEvents",
"xAOD::TruthEventAuxContainer#TruthEventsAux.",
38 "xAOD::TruthVertexContainer#TruthVertices",
"xAOD::TruthVertexAuxContainer#TruthVerticesAux.",
39 "xAOD::TruthParticleContainer#TruthParticles",
"xAOD::TruthParticleAuxContainer#TruthParticlesAux.",
42 if "xAOD::TruthParticleContainer#TruthPileupParticles" in flags.Input.TypedCollections:
43 toAOD.append(
"xAOD::TruthParticleContainer#TruthPileupParticles")
44 toAOD.append(
"xAOD::TruthParticleAuxContainer#TruthPileupParticlesAux.")
46 if writeInTimePileUpTruth:
47 toAOD.append(
"xAOD::TruthPileupEventContainer#TruthPileupEvents")
48 toAOD.append(
"xAOD::TruthPileupEventAuxContainer#TruthPileupEventsAux.")
50 if flags.Input.SpecialConfiguration.get(
"HasLHERecord",
"False") ==
"True":
51 kwargs.setdefault(
'xAODTruthLHEParticleContainerName',
'TruthLHEParticles')
52 toAOD.append(
"xAOD::TruthParticleContainer#TruthLHEParticles")
53 toAOD.append(
"xAOD::TruthParticleContainer#TruthLHEParticlesAux.")
57 if flags.Output.doWriteESD:
58 acc.merge(
addToESD(flags, toAOD+toESD))
59 if flags.Output.doWriteAOD:
66 HepMCTruthReader = CompFactory.HepMCTruthReader(
68 HepMCContainerKey = flags.HepMCContainerKey,
69 Do4momPtEtaPhi = flags.Do4momPtEtaPhi
71 acc.addEventAlgo(HepMCTruthReader)
76 xAODTruthReader = CompFactory.xAODReader.xAODTruthReader(
78 xAODTruthEventContainerKey = flags.xAODTruthEventContainerKey,
80 DoPUEventPrintout = flags.DoPUEventPrintout,
81 Do4momPtEtaPhi = flags.Do4momPtEtaPhi
83 acc.addEventAlgo(xAODTruthReader)