2 from AthenaConfiguration.AthConfigFlags
import AthConfigFlags
3 from AthenaConfiguration.Enums
import HIMode
9 "Muon",
"CombinedMuon",
13 "TrackCellAssociation",
14 "PFlow",
"Jet",
"BTagging",
27 """Return an AthConfigFlags object with required flags"""
28 flags = AthConfigFlags()
36 flags.addFlag(
"Reco.EnableTracking",
37 lambda prevFlags: prevFlags.Detector.EnableID
or
38 prevFlags.Detector.EnableITk)
40 flags.addFlag(
"Reco.EnableHGTDExtension",
41 lambda prevFlags: prevFlags.Reco.EnableTracking
and
42 prevFlags.Detector.EnableHGTD)
44 flags.addFlag(
"Reco.EnableEgamma",
45 lambda prevFlags: prevFlags.Detector.EnableCalo)
48 flags.addFlag(
"Reco.EnableCaloExtension",
lambda prevFlags: (
50 prevFlags.Reco.EnablePFlow
51 or prevFlags.Reco.EnableTau
52 or prevFlags.Reco.EnableCombinedMuon
54 and prevFlags.Detector.EnableCalo
55 and prevFlags.Reco.EnableTracking))
57 flags.addFlag(
"Reco.EnableCombinedMuon",
58 lambda prevFlags: prevFlags.Detector.EnableMuon
and
59 prevFlags.Reco.EnableTracking)
61 flags.addFlag(
"Reco.EnableTrackOverlay",
lambda prevFlags:
False)
63 flags.addFlag(
"Reco.EnablePFlow",
lambda prevFlags: (
64 prevFlags.Reco.EnableTracking
65 and prevFlags.Detector.EnableCalo
66 and prevFlags.Tracking.doVertexFinding))
68 flags.addFlag(
"Reco.EnableIsolation",
lambda prevFlags: (
69 prevFlags.Tracking.doVertexFinding
70 and (prevFlags.Reco.EnableCombinedMuon
71 or prevFlags.Reco.EnableEgamma)))
73 flags.addFlag(
"Reco.EnableJet",
lambda prevFlags: (
74 prevFlags.Detector.EnableCalo
75 and prevFlags.Reco.EnableTracking
76 and prevFlags.Reco.EnableEgamma
77 and prevFlags.Reco.EnableCombinedMuon
78 and prevFlags.Reco.EnablePFlow
79 and prevFlags.Reco.HIMode
is not HIMode.HI))
82 flags.addFlag(
"Reco.EnableTau",
lambda prevFlags: prevFlags.Reco.EnableJet)
84 flags.addFlag(
"Reco.EnableBTagging",
85 lambda prevFlags: prevFlags.Reco.EnableJet
or
86 (prevFlags.Reco.EnableHI
and prevFlags.HeavyIon.doJet))
88 flags.addFlag(
"Reco.EnableMet",
lambda prevFlags: (
89 prevFlags.Reco.EnableJet
90 and prevFlags.Reco.EnableTau))
94 flags.addFlag(
"Reco.EnableGlobalFELinking",
95 lambda prevFlags: prevFlags.Reco.EnableJet
and
96 prevFlags.Reco.EnableTau
and prevFlags.Reco.EnablePFlow
and
97 prevFlags.Reco.EnableEgamma
and
98 prevFlags.Reco.EnableCombinedMuon)
100 flags.addFlag(
"Reco.EnableTrackCellAssociation",
101 lambda prevFlags: prevFlags.Detector.EnableCalo
and
102 prevFlags.Reco.EnableTracking)
104 flags.addFlag(
"Reco.EnableCaloRinger",
105 lambda prevFlags: prevFlags.Reco.EnableEgamma
and
106 not prevFlags.Reco.EnableHI)
111 flags.addFlag(
"Reco.EnableTrigger",
112 lambda prevFlags: prevFlags.Trigger.EDMVersion > 0)
115 flags.addFlag(
"Reco.EnableHI",
116 lambda prevFlags: prevFlags.Reco.HIMode
is not HIMode.pp)
118 flags.addFlag(
"Reco.HIMode", _hiModeChoice, type=HIMode)
122 flags.addFlag(
"Reco.EnableBeamSpotDecoration",
123 lambda prevFlags:
not prevFlags.Common.isOnline)
126 flags.addFlag(
"Reco.EnableZDC",_recoZDC)
129 flags.addFlag(
"Reco.EnablePostProcessing",
True)
130 flags.addFlag(
"Reco.PostProcessing.ThinNegativeClusters",
131 lambda prevFlags: prevFlags.Reco.EnablePostProcessing
and
132 prevFlags.Detector.EnableCalo
and
133 prevFlags.Output.doWriteAOD
and
134 prevFlags.Calo.Thin.NegativeEnergyCaloClusters
and
135 not prevFlags.Reco.EnableHI)
137 flags.addFlag(
"Reco.PostProcessing.TRTAloneThinning",
138 lambda prevFlags: prevFlags.Reco.EnablePostProcessing
and
139 prevFlags.Reco.EnableTracking
and
140 prevFlags.Output.doWriteAOD)
141 flags.addFlag(
"Reco.PostProcessing.GeantTruthThinning",
142 lambda prevFlags: prevFlags.Reco.EnablePostProcessing
and
143 prevFlags.Input.isMC
and
144 prevFlags.Output.doWriteAOD)
145 flags.addFlag(
"Reco.PostProcessing.InDetForwardTrackParticleThinning",
146 lambda prevFlags: prevFlags.Reco.EnablePostProcessing
and
147 prevFlags.Reco.EnableTracking
and
148 prevFlags.Reco.EnableCombinedMuon
and
149 prevFlags.Output.doWriteAOD)
155 from AthenaCommon.Logging
import logging
156 log = logging.getLogger(
'RecoSteering')
159 flags._loadDynaFlags(
'Detector')
160 flags._loadDynaFlags(
'Reco')
164 format_common = f
'%-{item_len}s'
167 for d
in _all_domains:
168 domain_len =
max(domain_len, len(d) + 2)
171 for d
in _all_domains:
172 if flags.hasFlag(f
'Detector.Enable{d}'):
173 name = f
'Detector.Enable{d}'
174 elif flags.hasFlag(f
'Reco.Enable{d}'):
175 name = f
'Reco.Enable{d}'
177 raise RuntimeError(f
'Unknown reconstruction domain {d}')
179 if flags[name]
is not False:
184 format_header = f
'%{domain_len}s ' + format_common
185 format = f
'%{domain_len}s : ' + format_common
186 data = [_all_domains, enabled]
187 data =
list(map(list, zip(*data)))
190 log.info(format_header, *([
'',
'Enbl.']))
193 log.info(format, *row)
197 if hasattr(runArgs,
"runNumber")
and not flags.Input.isMC
and runArgs.runNumber
not in flags.Input.RunNumbers:
198 flags.Input.RunNumbers = [runArgs.runNumber]
199 flags.Input.OverrideRunNumber =
True
201 if hasattr(runArgs,
"projectName"):
202 flags.Input.projectName = runArgs.projectName
217 if prevFlags.Input.isMC:
218 return prevFlags.Detector.EnableZDC
220 from AthenaConfiguration.AutoConfigFlags
import GetFileMD
221 from libpyeformat_helper
import SubDetector, DetectorMask
222 maskbits=
GetFileMD(prevFlags.Input.Files).
get(
"detectorMask",[0x0])
224 detMask=DetectorMask(maskbits & 0xFFFFFFFFFFFFFFFF, maskbits >> 64)
225 return detMask.is_set(SubDetector.FORWARD_ZDC)
231 if (
"_hip" in prevFlags.Input.ProjectName):
233 elif (
"_hi" in prevFlags.Input.ProjectName):
234 if (prevFlags.Input.TriggerStream ==
"physics_UPC"):