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