ATLAS Offline Software
Loading...
Searching...
No Matches
InDetOutputConfig.py
Go to the documentation of this file.
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
11from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
12#from AthenaConfiguration.ComponentFactory import CompFactory
13
14
15def 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
86 trkAnaInfo = "TrkAnaInfo"+getattr( flags.PhysVal.IDTPM, trkAnaName+'.anaTag' )
87 itemsToRecord.update({
88 'xAOD::BaseContainer#'+trkAnaInfo,
89 'xAOD::AuxContainerBase#'+trkAnaInfo+'Aux.',
90 })
91
92
93 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
94 acc.merge( OutputStreamCfg( flags, 'AOD_IDTPM',
95 ItemList = list( itemsToRecord ),
96 disableEventTag = True ) )
97
98 return acc
STL class.
InDetOutputCfg(flags, **kwargs)