ATLAS Offline Software
Functions
python.TRUTH0 Namespace Reference

Functions

def TRUTH0Cfg (flags)
 

Function Documentation

◆ TRUTH0Cfg()

def python.TRUTH0.TRUTH0Cfg (   flags)
Main config for TRUTH0

Definition at line 8 of file TRUTH0.py.

8 def TRUTH0Cfg(flags):
9  """Main config for TRUTH0"""
10  acc = ComponentAccumulator()
11 
12  # Ensure EventInfoCnvAlg is scheduled
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))
16 
17  # Decide what kind of input HepMC container we are dealing with
18  # and schedule the xAOD converter appropriately
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"))
24  else:
25  raise RuntimeError("No recognised HepMC truth information found in the input")
26 
27  # Contents
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'}
34 
35  TRUTH0SlimmingHelper.AllVariables = [ 'EventInfo',
36  'TruthEvents',
37  'TruthVertices',
38  'TruthParticles']
39 
40  # Create output stream
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]))
46 
47  return acc
python.TRUTH0.TRUTH0Cfg
def TRUTH0Cfg(flags)
Definition: TRUTH0.py:8
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
xAODTruthCnvConfig.GEN_EVNT2xAODCfg
def GEN_EVNT2xAODCfg(flags, name="GEN_EVNT2xAOD", **kwargs)
Definition: xAODTruthCnvConfig.py:5
python.xAODEventInfoCnvConfig.EventInfoCnvAlgCfg
def EventInfoCnvAlgCfg(flags, name="EventInfoCnvAlg", inputKey="McEventInfo", outputKey="EventInfo", disableBeamSpot=False, **kwargs)
Definition: xAODEventInfoCnvConfig.py:11
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
SlimmingHelper
Definition: SlimmingHelper.py:1