ATLAS Offline Software
InDetOutputConfig.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 '''@file InDetOutputConfig.py
6 @author M. Aparo
7 @date 13-03-20234
8 @brief CA-based python configurations to add the output stream of the AOD_IDTPM file
9 '''
10 
11 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
12 #from AthenaConfiguration.ComponentFactory import CompFactory
13 
14 
15 def InDetOutputCfg( flags, **kwargs ):
16  '''
17  Write output file in AOD_IDTPM format, on top of the
18  histogram output file, for reprocessing
19  '''
20  acc = ComponentAccumulator()
21 
22 
26 
27 
36 
37 
38  itemsToRecord = set()
39 
40  for trkAnaName in flags.PhysVal.IDTPM.trkAnaNames:
41 
42  offTracks = getattr( flags.PhysVal.IDTPM, trkAnaName+'.OfflineTrkKey' )
43  trigTracks = getattr( flags.PhysVal.IDTPM, trkAnaName+'.TrigTrkKey' )
44  itemsToRecord.update({
45  'xAOD::TrackParticleContainer#'+offTracks,
46  'xAOD::TrackParticleAuxContainer#'+offTracks+'Aux.',#+truthVars+'.'+objVars,
47  'xAOD::TrackParticleContainer#'+trigTracks,
48  'xAOD::TrackParticleAuxContainer#'+trigTracks+'Aux.',#+truthVars,
49  })
50 
51 
52  truthParticles = getattr( flags.PhysVal.IDTPM, trkAnaName+'.TruthPartKey' )
53  itemsToRecord.update({
54  'xAOD::TruthParticleContainer#'+truthParticles,
55  'xAOD::TruthParticleAuxContainer#'+truthParticles+'Aux.',
56  })
57 
58 
59  objStr = getattr( flags.PhysVal.IDTPM, trkAnaName+".SelectOfflineObject" )
60 
61 
62  if objStr == 'Electron':
63  itemsToRecord.update({
64  'xAOD::ElectronContainer#Electrons',
65  # TODO - uncomment to store xAOD::Electron decorations
66  #'xAOD::ElectronAuxContainer#ElectronsAux.',
67  })
68 
69 
70  if objStr == 'Muon':
71  itemsToRecord.update({
72  'xAOD::MuonContainer#Muons',
73  # TODO - uncomment to store xAOD::Muon decorations
74  #'xAOD::MuonAuxContainer#MuonsAux.',
75  })
76 
77 
78  if objStr == 'Tau':
79  itemsToRecord.update({
80  'xAOD::TauJetContainer#TauJets',
81  # TODO - uncomment to store xAOD::TauJets decorations
82  #'xAOD::TauJetAuxContainer#TauJetsAux.',
83  })
84 
85  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
86  acc.merge( OutputStreamCfg( flags, 'AOD_IDTPM',
87  ItemList = list( itemsToRecord ),
88  disableEventTag = True ) )
89 
90  return acc
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
InDetOutputConfig.InDetOutputCfg
def InDetOutputCfg(flags, **kwargs)
Definition: InDetOutputConfig.py:15
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224