ATLAS Offline Software
Loading...
Searching...
No Matches
python.HLT.MET.METRecoSequencesConfig Namespace Reference

Functions

dict[str, Any] jetRecoDictForMET (**recoDict)
StepOutput cellInputCfg (flags, **recoDict)
StepOutput clusterInputCfg (flags, **recoDict)
StepOutput trackingInputCfg (flags, **recoDict)
StepOutput pfoInputCfg (flags, **recoDict)
StepOutput mergedPFOInputCfg (flags, **recoDict)
StepOutput cvfClusterInputCfg (flags, **recoDict)
StepOutput jetInputCfg (flags, bool force_tracks=False, **recoDict)

Detailed Description

Configuration sequences for the MET input reconstruction

By convention all of these functions return two values: first a defaultdict mapping from
reco step to the component accumulators containing the reconstruction sequences and
second the name(s) of the key outputs created. The names can either be a single string
if there is only one output or a tuple otherwise. Which outputs are returned and their
order should be clearly documented in the method documentation

Function Documentation

◆ cellInputCfg()

StepOutput python.HLT.MET.METRecoSequencesConfig.cellInputCfg ( flags,
** recoDict )
Create the cell inputs

Definition at line 61 of file METRecoSequencesConfig.py.

61def cellInputCfg(flags, **recoDict) -> StepOutput:
62 """Create the cell inputs"""
63 acc = hltCaloCellMakerCfg(flags, name="HLTCaloCellMakerFS", roisKey="")
64 return StepOutput.create(acc, Cells=acc.getPrimary().CellsName)
65
66
67@AccumulatorCache

◆ clusterInputCfg()

StepOutput python.HLT.MET.METRecoSequencesConfig.clusterInputCfg ( flags,
** recoDict )
Create the cluster inputs

Definition at line 68 of file METRecoSequencesConfig.py.

68def clusterInputCfg(flags, **recoDict) -> StepOutput:
69 """Create the cluster inputs"""
70 if recoDict["calib"] == "em":
71 acc = jetmetTopoClusteringCfg(flags, RoIs="")
72 clusters = em_clusters
73 elif recoDict["calib"] == "lcw":
74 acc = jetmetTopoClusteringCfg_LC(flags, RoIs="")
75 clusters = lc_clusters
76 else:
77 raise ValueError(f"Invalid cluster calibration '{recoDict['calib']}'")
78
79 if recoDict.get("constitmod"):
80 # Force the constituent type to topoclusters
81 jetRecoDict = jetRecoDictForMET(**(recoDict | {"constitType": "tc"}))
82 constit = defineJetConstit(jetRecoDict, clustersKey=clusters)
83 acc.addEventAlgo(
84 getConstitModAlg_nojetdef(
85 constit, flags, context=jetRecoDict.get("trkopt", "default"),
86 )
87 )
88 clusters = constit.containername
89
90 return StepOutput.create(acc, Clusters=clusters)
91
92
93@AccumulatorCache

◆ cvfClusterInputCfg()

StepOutput python.HLT.MET.METRecoSequencesConfig.cvfClusterInputCfg ( flags,
** recoDict )
Create the clusters with CVF decorated

Definition at line 162 of file METRecoSequencesConfig.py.

162def cvfClusterInputCfg(flags, **recoDict) -> StepOutput:
163 """Create the clusters with CVF decorated"""
164 inputs = StepOutput.merge(
165 clusterInputCfg(flags, **recoDict),
166 trackingInputCfg(flags),
167 )
168 acc = ComponentAccumulator()
169 acc.addEventAlgo(
170 CompFactory.HLT.MET.CVFAlg(
171 f"{recoDict['calib']}ftfClusterCVFAlg",
172 InputClusterKey=inputs["Clusters"],
173 InputTrackKey=inputs["Tracks"],
174 InputVertexKey=inputs["Vertices"],
175 OutputCVFKey="CVF",
176 TrackSelectionTool=CompFactory.InDet.InDetTrackSelectionTool(
177 CutLevel="TightPrimary"
178 ),
179 TVATool=acc.popToolsAndMerge(
180 CVF_TTVAToolCfg(
181 flags,
182 TrackContName=inputs["Tracks"],
183 VertexContName=inputs["Vertices"]
184 )
185 ),
186 ExtensionTool=CompFactory.ApproximateTrackToLayerTool(),
187 )
188 )
189 acc.addEventAlgo(
190 CompFactory.HLT.MET.CVFPrepAlg(
191 f"{recoDict['calib']}ftfClusterCVFPrepAlg",
192 InputClusterKey=inputs["Clusters"],
193 InputCVFKey="CVF",
194 OutputCategoryKey="PUClassification",
195 )
196 )
197 return StepOutput.create(acc, inputs, CVF="CVF", PUCategory="PUClassification")
198
199
200@AccumulatorCache

◆ jetInputCfg()

StepOutput python.HLT.MET.METRecoSequencesConfig.jetInputCfg ( flags,
bool force_tracks = False,
** recoDict )
Create the input jets

Set force_tracks to True to require tracks and ensure that they are ghost-associated
to the jets.

Returns the accumulators and (jets, jetDef)

Definition at line 201 of file METRecoSequencesConfig.py.

201def jetInputCfg(flags, force_tracks: bool = False, **recoDict) -> StepOutput:
202 """Create the input jets
203
204 Set force_tracks to True to require tracks and ensure that they are ghost-associated
205 to the jets.
206
207 Returns the accumulators and (jets, jetDef)
208 """
209 if force_tracks:
210 recoDict["trkopt"] = "ftf"
211 # hard code to em (for now) - there are no LC jets in EDM
212 jrd = jetRecoDictForMET(
213 **(
214 recoDict
215 | {"calib": "em"}
216 )
217 )
218
219 inputs = StepOutput()
220 if jrd["trkopt"] == "ftf":
221 inputs.merge_other(trackingInputCfg(flags))
222 if jrd["constitType"] == "pf":
223 inputs.merge_other(pfoInputCfg(flags))
224 else:
225 # Always use EM clusters for jets
226 inputs.merge_other(clusterInputCfg(flags, calib="em"))
227
228 acc = ComponentAccumulator()
229 jetDefDict = JetRecoDataDeps(flags, **jrd)
230 jetName, jetDef = jetDefDict['final']
231 jet_acc = JetRecoCfg(flags, **jetDefDict)
232 acc.merge(jet_acc)
233 return StepOutput.create(
234 acc, inputs, Jets=jetName, JetDef=jetDef, **jetDef._contextDic
235 )

◆ jetRecoDictForMET()

dict[str, Any] python.HLT.MET.METRecoSequencesConfig.jetRecoDictForMET ( ** recoDict)
Get a jet reco dict that's usable for the MET slice

Definition at line 34 of file METRecoSequencesConfig.py.

34def jetRecoDictForMET(**recoDict) -> dict[str, Any]:
35 """Get a jet reco dict that's usable for the MET slice"""
36 from ..Jet.JetRecoCommon import getJetCalibDefaultString, jetRecoDictToString
37 from ..Jet.JetRecoCommon import recoKeys as jetRecoKeys
38 from ..Menu.SignatureDicts import JetChainParts_Default
39
40 jrd = {k: recoDict.get(k, JetChainParts_Default[k]) for k in jetRecoKeys}
41 # Rename the cluster calibration
42 try:
43 jrd["clusterCalib"] = recoDict["calib"]
44 except KeyError:
45 pass
46 # Fill constitMod
47 jrd["constitMod"] = recoDict.get("constitmod", "")
48 # We only use em calibration for PFOs
49 if jrd["constitType"] == "pf":
50 jrd["clusterCalib"] = "em"
51 # Interpret jet calibration
52 if jrd["jetCalib"] == "default":
53 jrd["jetCalib"] = getJetCalibDefaultString(jrd['recoAlg'],jrd['constitType'],jrd['trkopt'])
54 if jrd["constitType"] != "tc" or "gsc" in jrd["jetCalib"]:
55 jrd["trkopt"] = "ftf"
56 jrd["jetDefStr"] = jetRecoDictToString(jrd)
57 return jrd
58
59
60@AccumulatorCache

◆ mergedPFOInputCfg()

StepOutput python.HLT.MET.METRecoSequencesConfig.mergedPFOInputCfg ( flags,
** recoDict )
Create the merged PFO inputs

Definition at line 144 of file METRecoSequencesConfig.py.

144def mergedPFOInputCfg(flags, **recoDict) -> StepOutput:
145 """Create the merged PFO inputs"""
146 pfos = pfoInputCfg(flags, **recoDict)
147 alg = CompFactory.HLT.MET.FlowElementPrepAlg(
148 f"{pfos['PFOPrefix']}METTrigPFOPrepAlg",
149 InputNeutralKey=pfos["nPFOs"],
150 InputChargedKey=pfos["cPFOs"],
151 OutputKey=f"{pfos['PFOPrefix']}METTrigCombinedParticleFlowObjects",
152 OutputCategoryKey="PUClassification",
153 )
154 acc = ComponentAccumulator()
155 acc.addEventAlgo(alg, primary=True)
156 return StepOutput.create(
157 acc, pfos, MergedPFOs=alg.OutputKey, PUCategory=alg.OutputCategoryKey
158 )
159
160
161@AccumulatorCache

◆ pfoInputCfg()

StepOutput python.HLT.MET.METRecoSequencesConfig.pfoInputCfg ( flags,
** recoDict )
Get the PFO inputs

Definition at line 104 of file METRecoSequencesConfig.py.

104def pfoInputCfg(flags, **recoDict) -> StepOutput:
105 """Get the PFO inputs"""
106 inputs = StepOutput.merge(
107 cellInputCfg(flags),
108 clusterInputCfg(flags, calib="em"),
109 trackingInputCfg(flags),
110 )
111 acc = PFCfg(
112 flags,
113 tracktype="ftf",
114 clustersin=inputs["Clusters"],
115 calclustersin="",
116 tracksin=inputs["Tracks"],
117 verticesin=inputs["Vertices"],
118 cellsin=inputs["Cells"],
119 )
120
121 # The jet constituent modifier sequence here is to apply the correct weights and
122 # decorate the PV matching decoration. If we've specified constituent modifiers
123 # those are also applied.
124 jetRecoDict = jetRecoDictForMET(
125 **(recoDict | {"trkopt": "ftf", "constitType": "pf"})
126 )
127 constit = defineJetConstit(jetRecoDict, pfoPrefix="HLT_ftf")
128 acc.addEventAlgo(
129 getConstitModAlg_nojetdef(constit, flags, context=jetRecoDict.get("trkopt", "default"))
130 )
131 pfoPrefix = constit.containername
132 if pfoPrefix.endswith("ParticleFlowObjects"):
133 pfoPrefix = pfoPrefix[:-19]
134 return StepOutput.create(
135 acc,
136 inputs,
137 PFOPrefix=pfoPrefix,
138 cPFOs=pfoPrefix + "ChargedParticleFlowObjects",
139 nPFOs=pfoPrefix + "NeutralParticleFlowObjects",
140 )
141
142
143@AccumulatorCache
Definition PFCfg.py:1

◆ trackingInputCfg()

StepOutput python.HLT.MET.METRecoSequencesConfig.trackingInputCfg ( flags,
** recoDict )
Get the tracking inputs

Definition at line 94 of file METRecoSequencesConfig.py.

94def trackingInputCfg(flags, **recoDict) -> StepOutput:
95 """Get the tracking inputs"""
96 return StepOutput.create(
97 JetFSTrackingCfg(flags, "ftf", RoIs=trkFSRoI),
98 step_idx=2,
99 **flags.Jet.Context.ftf,
100 )
101
102
103@AccumulatorCache