125 """This build the standard heavy ion style jet.
127 This is similar to JetRecConfig.getJetDefAlgs(). However due to how the alg flow is organized in the
128 chain steps, we can't use this function directly.
130 - construct a JetDefinition
131 - use lower-level function in JetRecConfig with this JetDefinition to get the necessary algs and build our sequence manually.
136 if jetRecoDict[
"ionopt"] ==
"noion":
137 raise ValueError(
"Jet reco for heavy ion called without a ion option!")
139 dataSource =
"mc" if configFlags.Input.isMC
else "data"
141 jetHIEvtShapeSequence, eventShapeKey, eventShapeMapTool =
jetHIEventShapeSequenceCA(configFlags, clustersKey=clustersKey, towerKey=towerKey)
142 acc.merge(jetHIEvtShapeSequence)
144 jetNamePrefix = JetRecoCommon.getHLTPrefix()
145 jetDef = JetRecoCommon.defineHIJets(jetRecoDict,clustersKey=clustersKey,prefix=jetNamePrefix,suffix=
"_Unsubtracted")
146 jetsFullName_Unsub = jetDef.fullname()
149 pjgalg = CompFactory.PseudoJetAlgorithm(
151 InputContainer = clustersKey,
152 OutputContainer =
"PseudoJet"+clustersKey,
154 SkipNegativeEnergy =
False,
155 TreatNegativeEnergyAsGhost=
True
157 acc.addEventAlgo(pjgalg)
158 finalpjs =
str(pjgalg.OutputContainer)
161 jetDef._internalAtt[
'finalPJContainer'] = finalpjs
164 from JetRec
import JetOnlineMon
168 jetRecAlg =
getHIJetRecAlg(jetDef, jetsFullName_Unsub, monTool=monTool)
169 acc.addEventAlgo(jetRecAlg)
171 associationName =
"%s_DR8Assoc" % (clustersKey)
173 jetsInUnsub = jetsFullName_Unsub
177 if jetRecoDict[
"jetCalib"].endswith(
"IS")
and (dataSource==
"data"):
179 calib_seq +=
"_Insitu"
182 jetDef_seed0 = jetDef.clone()
183 jetDef_seed0.suffix = jetDef.suffix.replace(
"Unsubtracted",
"seed0")
184 jetDef_seed0.radius = 0.2
185 jetsFullName_seed0 = jetDef_seed0.fullname()
186 stdJetModifiers.update(
188 HLTHIJetAssoc = JetModifier(
"HIJetDRAssociationTool",
"HIJetDRAssociation", ContainerKey=clustersKey, DeltaR=0.8, AssociationName=associationName),
189 HLTHIJetMaxOverMean = JetModifier(
"HIJetMaxOverMeanTool",
"HIJetMaxOverMean", JetContainer = jetsFullName_seed0),
190 HLTHIJetDiscrim = JetModifier(
"HIJetDiscriminatorTool",
"HIJetDiscriminator", MaxOverMeanCut = 4, MinimumETMaxCut=3000),
192 jetDef_seed0.modifiers=[
"HLTHIJetAssoc",
"HLTHIJetMaxOverMean",
"HLTHIJetDiscrim",
"Filter:5000"]
193 copySeed0Alg =
getJetCopyAlg(jetsin=jetsInUnsub,jetsoutdef=jetDef_seed0,decorations=[],shallowcopy=
False,shallowIO=
False,monTool=monTool)
194 acc.addEventAlgo(copySeed0Alg)
197 iter0=
HLTAddIteration(configFlags, jetsFullName_seed0, eventShapeKey, clustersKey, map_tool=eventShapeMapTool, assoc_name=associationName, suffix=
"iter0")
198 acc.addEventAlgo(
HLTRunTools([iter0],
"jetalgHI_iter0"))
199 modulator0=iter0.Modulator
200 subtractor0=iter0.Subtractor
202 HLTMakeSubtractionTool(configFlags, iter0.OutputEventShapeKey, Modulator=modulator0, EventShapeMapTool=eventShapeMapTool, Subtractor=subtractor0, label=
"HLTHIJetConstSub_iter0")
204 cluster_key_iter0_deep=clustersKey+
"_iter0_temp"
205 happy_iter0_Tool =
ApplySubtractionToClustersHLT(configFlags, EventShapeKey=
"HLTHIEventShapeWeighted_iter0", ClusterKey=clustersKey, OutClusterKey=cluster_key_iter0_deep, Modulator=modulator0, EventShapeMapTool=eventShapeMapTool, Subtractor=subtractor0, SetMoments=
False, ApplyOriginCorrection=
False)
206 acc.addEventAlgo(
HLTRunTools([happy_iter0_Tool],
"jetalgHI_clusterSub_iter0"))
208 GetConstituentsModifierToolHLT(configFlags, name=
"HIJetConstituentModifierTool", ClusterKey=cluster_key_iter0_deep, ApplyOriginCorrection=
False, label=
"HLTHIJetJetConstMod_iter0")
211 jetDef_seed1 = jetDef.clone()
212 jetDef_seed1.suffix = jetDef_seed0.suffix.replace(
"_seed0",
"_seed1")
213 jetDef_seed1.radius = 0.2
214 jetDef_seed1.modifiers=[
"HLTHIJetAssoc",
"HLTHIJetConstSub_iter0:iter0",
"HLTHIJetSeedCalib:{}___{}".
format(calib_seq, JES_is_data),
"Filter:25000"]
215 jetsFullName_seed1 = jetDef_seed1.fullname()
216 copySeed1Alg =
getJetCopyAlg(jetsin=jetsInUnsub,jetsoutdef=jetDef_seed1,decorations=[],shallowcopy=
False,shallowIO=
False,monTool=monTool)
217 acc.addEventAlgo(copySeed1Alg)
219 iter1=
HLTAddIteration(configFlags, jetsFullName_seed1, eventShapeKey, clustersKey, map_tool=eventShapeMapTool, assoc_name=associationName, sub_tool=subtractor0, suffix=
"iter1")
220 iter1.OutputEventShapeKey=
"HLTHIEventShape_iter1"
221 modulator1=iter1.Modulator
222 subtractor1=iter1.Subtractor
224 HLTMakeSubtractionTool(configFlags, iter1.OutputEventShapeKey, Modulator=modulator1, EventShapeMapTool=eventShapeMapTool, label=
"HLTHIJetConstSub_iter1")
226 acc.addEventAlgo(
HLTRunTools([iter1],
"jetalgHI_clusterSub_egamma"))
229 cluster_key_final_deep=clustersKey+
"_final"
230 subToClusterTool =
ApplySubtractionToClustersHLT(configFlags, EventShapeKey=
"HLTHIEventShape_iter1", ClusterKey=clustersKey, OutClusterKey=cluster_key_final_deep, Modulator=modulator1, EventShapeMapTool=eventShapeMapTool, Subtractor=subtractor1, SetMoments=
False, ApplyOriginCorrection=
False)
231 acc.addEventAlgo(
HLTRunTools([subToClusterTool],
"jetalgHI_clusterSub"))
233 GetConstituentsModifierToolHLT(configFlags, name=
"HIJetConstituentModifierTool", ClusterKey=cluster_key_final_deep, ApplyOriginCorrection=
False, label=
"HLTHIJetJetConstMod_iter1")
235 jetDef_final = jetDef.clone()
236 jetDef_final.suffix = jetDef.suffix.replace(
"_Unsubtracted",
"")
237 jetDef_final.modifiers=[
"HLTHIJetConstSub_iter1:iter1",
"HLTHIJetJetConstMod_iter1",
"HLTHIJetCalib:{}___{}".
format(calib_seq, JES_is_data),
"Sort",
"Filter:20000"]
238 copyAlg_final=
getJetCopyAlg(jetsin=jetsInUnsub,jetsoutdef=jetDef_final,decorations=[],shallowcopy=
False,shallowIO=
False,monTool=monTool)
239 acc.addEventAlgo(copyAlg_final)
241 jetsFinal =
recordable(jetDef_final.fullname())
244 return acc, jetsOut, jetDef_final