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

Functions

 _run (args)

Variables

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

Function Documentation

◆ _run()

python.runEgammaOnlyESD._run ( args)
protected

Definition at line 19 of file runEgammaOnlyESD.py.

19def _run(args):
20 from AthenaConfiguration.AllConfigFlags import initConfigFlags
21
22 flags = initConfigFlags()
23 # input
24 from AthenaConfiguration.TestDefaults import defaultTestFiles
25
26 flags.Exec.MaxEvents = args.maxEvents
27 if not args.inputFileList:
28 flags.Input.Files = defaultTestFiles.ESD_RUN3_MC
29 else:
30 flags.Input.Files = args.inputFileList
31
32 from AthenaConfiguration.Enums import ProductionStep
33
34 flags.Common.ProductionStep = ProductionStep.Reconstruction
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 flags.Input.isMC = True
41
42 # output
43 flags.Output.AODFileName = args.outputAODFile
44
45 #
46 flags.Egamma.Keys.Output.CaloClusters = "new_egammaClusters"
47 flags.Egamma.Keys.Output.Electrons = "new_Electrons"
48 flags.Egamma.Keys.Output.Photons = "new_Photons"
49
50 # Setup detector flags
51 from AthenaConfiguration.DetectorConfigFlags import setupDetectorFlags
52
53 setupDetectorFlags(
54 flags, None, use_metadata=True, toggle_geometry=True, keep_beampipe=True
55 )
56
57 flags.lock()
58
59 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
60
61 acc = MainServicesCfg(flags)
62
63 from AtlasGeoModel.GeoModelConfig import GeoModelCfg
64
65 acc.merge(GeoModelCfg(flags))
66
67 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
68
69 acc.merge(PoolReadCfg(flags))
70
71 if flags.Detector.EnablePixel:
72 from PixelGeoModel.PixelGeoModelConfig import PixelReadoutGeometryCfg
73
74 acc.merge(PixelReadoutGeometryCfg(flags))
75 if flags.Detector.EnableSCT:
76 from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
77
78 acc.merge(SCT_ReadoutGeometryCfg(flags))
79 if flags.Detector.EnableTRT:
80 from TRT_GeoModel.TRT_GeoModelConfig import TRT_ReadoutGeometryCfg
81
82 acc.merge(TRT_ReadoutGeometryCfg(flags))
83
84 if flags.Detector.EnableLAr:
85 from LArBadChannelTool.LArBadChannelConfig import LArBadFebCfg
86
87 acc.merge(LArBadFebCfg(flags))
88
89 # Special message service configuration
90 from DigitizationConfig.DigitizationSteering import DigitizationMessageSvcCfg
91
92 acc.merge(DigitizationMessageSvcCfg(flags))
93
94 # Algorithms to run
95
96 # For being able to read pre Run-3 data w/ Trk objects
97 from TrkEventCnvTools.TrkEventCnvToolsConfig import TrkEventCnvSuperToolCfg
98
99 acc.merge(TrkEventCnvSuperToolCfg(flags))
100
101 # Redo topo
102 from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
103
104 acc.merge(CaloTopoClusterCfg(flags))
105
106 from egammaAlgs.egammaTopoClusterCopierConfig import egammaTopoClusterCopierCfg
107
108 acc.merge(egammaTopoClusterCopierCfg(flags))
109
110 from egammaAlgs.egammaRecBuilderConfig import egammaRecBuilderCfg
111
112 acc.merge(egammaRecBuilderCfg(flags))
113
114 from egammaAlgs.egammaSuperClusterBuilderConfig import (
115 electronSuperClusterBuilderCfg,
116 photonSuperClusterBuilderCfg,
117 )
118
119 acc.merge(electronSuperClusterBuilderCfg(flags))
120 acc.merge(photonSuperClusterBuilderCfg(flags))
121
122 from egammaAlgs.xAODEgammaBuilderConfig import xAODEgammaBuilderCfg
123
124 acc.merge(xAODEgammaBuilderCfg(flags, name="xAODEgammaBuilder", sequenceName=None))
125
126 from egammaConfig.egammaOutputConfig import egammaOutputCfg
127
128 acc.merge(egammaOutputCfg(flags))
129
130 from AthenaConfiguration.Utils import setupLoggingLevels
131
132 setupLoggingLevels(flags, acc)
133
134 if args.doCopyOriginalCollections:
135 from OutputStreamAthenaPool.OutputStreamConfig import addToAOD
136
137 toAOD = [
138 "xAOD::PhotonContainer#Photons",
139 "xAOD::PhotonAuxContainer#Photons"
140 f"Aux.{flags.Egamma.Keys.Output.PhotonsSuppAOD}",
141 "xAOD::ElectronContainer#Electrons",
142 "xAOD::ElectronAuxContainer#Electrons"
143 f"Aux.{flags.Egamma.Keys.Output.ElectronsSuppAOD}",
144 ]
145 acc.merge(addToAOD(flags, toAOD))
146
147 # running
148 statusCode = acc.run()
149 return statusCode
150
151

Variable Documentation

◆ action

python.runEgammaOnlyESD.action

Definition at line 175 of file runEgammaOnlyESD.py.

◆ args

python.runEgammaOnlyESD.args = parser.parse_args()

Definition at line 178 of file runEgammaOnlyESD.py.

◆ default

python.runEgammaOnlyESD.default

Definition at line 162 of file runEgammaOnlyESD.py.

◆ help

python.runEgammaOnlyESD.help

Definition at line 164 of file runEgammaOnlyESD.py.

◆ nargs

python.runEgammaOnlyESD.nargs

Definition at line 167 of file runEgammaOnlyESD.py.

◆ parser

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

Definition at line 158 of file runEgammaOnlyESD.py.

◆ statusCode

python.runEgammaOnlyESD.statusCode = None

Definition at line 153 of file runEgammaOnlyESD.py.

◆ type

python.runEgammaOnlyESD.type

Definition at line 163 of file runEgammaOnlyESD.py.