9 """Main config for TRUTH0"""
13 if "EventInfo#McEventInfo" in flags.Input.TypedCollections
and "xAOD::EventInfo#EventInfo" not in flags.Input.TypedCollections:
14 from xAODEventInfoCnv.xAODEventInfoCnvConfig
import EventInfoCnvAlgCfg
15 acc.merge(
EventInfoCnvAlgCfg(flags, inputKey=
"McEventInfo", outputKey=
"EventInfo", disableBeamSpot=
True))
19 from xAODTruthCnv.xAODTruthCnvConfig
import GEN_EVNT2xAODCfg
20 if "McEventCollection#GEN_EVENT" in flags.Input.TypedCollections:
21 acc.merge(
GEN_EVNT2xAODCfg(flags,name=
"GEN_EVNT2xAOD",AODContainerName=
"GEN_EVENT"))
22 elif "McEventCollection#TruthEvent" in flags.Input.TypedCollections:
23 acc.merge(
GEN_EVNT2xAODCfg(name=
"GEN_EVNT2xAOD",AODContainerName=
"TruthEvent"))
25 raise RuntimeError(
"No recognised HepMC truth information found in the input")
28 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
29 TRUTH0SlimmingHelper =
SlimmingHelper(
"TRUTH0SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
30 TRUTH0SlimmingHelper.AppendToDictionary = {
'EventInfo':
'xAOD::EventInfo',
'EventInfoAux':
'xAOD::EventAuxInfo',
31 'TruthEvents':
'xAOD::TruthEventContainer',
'TruthEventsAux':
'xAOD::TruthEventAuxContainer',
32 'TruthVertices':
'xAOD::TruthVertexContainer',
'TruthVerticesAux':
'xAOD::TruthVertexAuxContainer',
33 'TruthParticles':
'xAOD::TruthParticleContainer',
'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer'}
35 TRUTH0SlimmingHelper.AllVariables = [
'EventInfo',
41 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
42 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
43 TRUTH0ItemList = TRUTH0SlimmingHelper.GetItemList()
44 acc.merge(
OutputStreamCfg(flags,
"DAOD_TRUTH0", ItemList=TRUTH0ItemList))
45 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_TRUTH0", createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))