ATLAS Offline Software
Loading...
Searching...
No Matches
python.runGSFCaloFromESD Namespace Reference

Functions

 _run (args)

Variables

 statusCode = None
 parser = ArgumentParser("egammaFromESD")
 default
 type
 help
 nargs
 args = parser.parse_args()
 status_code = _run(args)

Function Documentation

◆ _run()

python.runGSFCaloFromESD._run ( args)
protected

Definition at line 20 of file runGSFCaloFromESD.py.

20def _run(args):
21 from AthenaConfiguration.AllConfigFlags import initConfigFlags
22 from AthenaConfiguration.TestDefaults import defaultTestFiles
23 from AthenaConfiguration.Enums import ProductionStep
24
25 flags = initConfigFlags()
26
27 # Input
28 flags.Exec.MaxEvents = args.maxEvents
29 flags.Input.Files = args.inputFileList or defaultTestFiles.ESD_RUN3_MC
30 flags.Input.isMC = True
31
32 # Reconstruction setup
33 flags.Common.ProductionStep = ProductionStep.Reconstruction
34
35 # Disable detectors we do not need
36 flags.Detector.GeometryMuon = False
37 flags.Detector.EnableAFP = False
38 flags.Detector.EnableLucid = False
39 flags.Detector.EnableZDC = False
40
41 # Output
42 flags.Output.AODFileName = args.outputAODFile
43
44 # Setup detector flags
45 from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
46 setupDetectorFlags(
47 flags,
48 None,
49 use_metadata=True,
50 toggle_geometry=True,
51 keep_beampipe=True,
52 )
53
54 flags.lock()
55
56 # Main services
57 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
58
59 acc = MainServicesCfg(flags)
60
61 # Geometry and input reading
62 from AtlasGeoModel.GeoModelConfig import GeoModelCfg
63 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
64
65 acc.merge(GeoModelCfg(flags))
66 acc.merge(PoolReadCfg(flags))
67
68 if flags.Detector.EnablePixel:
69 from PixelGeoModel.PixelGeoModelConfig import PixelReadoutGeometryCfg
70
71 acc.merge(PixelReadoutGeometryCfg(flags))
72
73 if flags.Detector.EnableSCT:
74 from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
75
76 acc.merge(SCT_ReadoutGeometryCfg(flags))
77
78 if flags.Detector.EnableTRT:
79 from TRT_GeoModel.TRT_GeoModelConfig import TRT_ReadoutGeometryCfg
80
81 acc.merge(TRT_ReadoutGeometryCfg(flags))
82
83 if flags.Detector.EnableLAr:
84 from LArBadChannelTool.LArBadChannelConfig import LArBadFebCfg
85
86 acc.merge(LArBadFebCfg(flags))
87
88 # Special message service configuration
89 from DigitizationConfig.DigitizationSteering import DigitizationMessageSvcCfg
90
91 acc.merge(DigitizationMessageSvcCfg(flags))
92
93 # Needed to read pre-Run-3 data with Trk objects
94 from TrkEventCnvTools.TrkEventCnvToolsConfig import TrkEventCnvSuperToolCfg
95
96 acc.merge(TrkEventCnvSuperToolCfg(flags))
97
98 # GSF + EMCal augmentation
99
100 from DerivationFrameworkEGamma.EGammaGSFCalo import EGammaGSFCaloToolsCfg
101
102 GSFCaloTool = acc.popToolsAndMerge(
103 EGammaGSFCaloToolsCfg(flags, "GSFCaloImprovement")
104 )
105 acc.addPublicTool(GSFCaloTool)
106
107 from AthenaConfiguration.ComponentFactory import CompFactory
108
109 acc.addEventAlgo(
110 CompFactory.DerivationFramework.DerivationKernel(
111 "GSFRefitAlgo",
112 AugmentationTools=[GSFCaloTool],
113 SkimmingTools=None,
114 ThinningTools=None,
115 )
116 )
117
118 # Standard egamma output
119 from AthenaConfiguration.Utils import setupLoggingLevels
120
121 setupLoggingLevels(flags, acc)
122
123 # Output collections + keep original collections
124
125 ItemList = [
126 "xAOD::ElectronContainer#Electrons",
127 "xAOD::ElectronAuxContainer#Electrons"
128 f"Aux.{flags.Egamma.Keys.Output.ElectronsSuppAOD}",
129 "xAOD::TrackParticleContainer#GSFTrackParticles",
130 "xAOD::TrackParticleAuxContainer#GSFTrackParticles"
131 f"Aux.{flags.Egamma.Keys.Output.GSFTrackParticlesSuppAOD}",
132 "xAOD::TrackParticleContainer#GSFCaloContainer",
133 "xAOD::TrackParticleAuxContainer#GSFCaloContainer"
134 f"Aux.{flags.Egamma.Keys.Output.GSFTrackParticlesSuppAOD}",
135 "TrackCollection#Tracks",
136 "TrackCollection#GSFTracks"
137 ]
138
139 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
140 from AthenaConfiguration.Enums import MetadataCategory
141 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
142
143 stream_name = "AOD_GSFRefit"
144
145 acc.merge(
146 OutputStreamCfg(
147 flags,
148 stream_name,
149 ItemList=ItemList,
150 AcceptAlgs=["GSFRefitAlgo"],
151 )
152 )
153
154 acc.merge(
155 SetupMetaDataForStreamCfg(
156 flags,
157 stream_name,
158 AcceptAlgs=["GSFRefitAlgo"],
159 createMetadata=[
160 MetadataCategory.CutFlowMetaData,
161 MetadataCategory.FileMetaData,
162 MetadataCategory.EventStreamInfo,
163 ],
164 )
165 )
166
167 acc.printConfig(
168 withDetails=True,
169 summariseProps=True,
170 onlyComponents=[],
171 printDefaults=True,
172 )
173
174 # Run it
175 statusCode = acc.run()
176 return statusCode
177
178

Variable Documentation

◆ args

python.runGSFCaloFromESD.args = parser.parse_args()

Definition at line 208 of file runGSFCaloFromESD.py.

◆ default

python.runGSFCaloFromESD.default

Definition at line 189 of file runGSFCaloFromESD.py.

◆ help

python.runGSFCaloFromESD.help

Definition at line 191 of file runGSFCaloFromESD.py.

◆ nargs

python.runGSFCaloFromESD.nargs

Definition at line 197 of file runGSFCaloFromESD.py.

◆ parser

python.runGSFCaloFromESD.parser = ArgumentParser("egammaFromESD")

Definition at line 184 of file runGSFCaloFromESD.py.

◆ status_code

python.runGSFCaloFromESD.status_code = _run(args)

Definition at line 210 of file runGSFCaloFromESD.py.

◆ statusCode

python.runGSFCaloFromESD.statusCode = None

Definition at line 180 of file runGSFCaloFromESD.py.

◆ type

python.runGSFCaloFromESD.type

Definition at line 190 of file runGSFCaloFromESD.py.