133 """This build the standard heavy ion style jet.
135 This is similar to JetRecConfig.getJetDefAlgs(). However due to how the alg flow is organized in the
136 chain steps, we can't use this function directly.
138 - construct a JetDefinition
139 - use lower-level function in JetRecConfig with this JetDefinition to get the necessary algs and build our sequence manually.
144 if jetRecoDict[
"ionopt"] ==
"noion":
145 raise ValueError(
"Jet reco for heavy ion called without a ion option!")
147 dataSource =
"mc" if configFlags.Input.isMC
else "data"
149 jetHIEvtShapeSequence, eventShapeKey, eventShapeMapTool =
jetHIEventShapeSequenceCA(configFlags, clustersKey=clustersKey, towerKey=towerKey)
150 acc.merge(jetHIEvtShapeSequence)
152 jetNamePrefix = JetRecoCommon.getHLTPrefix()
153 jetDef = JetRecoCommon.defineHIJets(jetRecoDict,clustersKey=clustersKey,prefix=jetNamePrefix,suffix=
"_Unsubtracted")
154 jetsFullName_Unsub = jetDef.fullname()
157 jet_collection_name = jetsFullName_Unsub.split(
'_')[1].
replace(
"Jets",
"")
160 pjgalg = CompFactory.PseudoJetAlgorithm(
162 InputContainer = clustersKey,
163 OutputContainer =
"PseudoJet"+clustersKey,
165 SkipNegativeEnergy =
False,
166 TreatNegativeEnergyAsGhost=
True
168 acc.addEventAlgo(pjgalg)
169 finalpjs =
str(pjgalg.OutputContainer)
172 jetDef._internalAtt[
'finalPJContainer'] = finalpjs
175 from JetRec
import JetOnlineMon
179 jetRecAlg =
getHIJetRecAlg(jetDef, jetsFullName_Unsub, monTool=monTool)
180 acc.addEventAlgo(jetRecAlg)
182 associationName =
"%s_DR8Assoc" % (clustersKey)
184 jetsInUnsub = jetsFullName_Unsub
188 if jetRecoDict[
"jetCalib"].endswith(
"IS")
and (dataSource==
"data"):
190 calib_seq +=
"_Insitu"
192 target_jetReco = f
'_for_{jetRecoDict["jetDefStr"]}'
195 jetDef_seed0 = jetDef.clone()
196 jetDef_seed0.suffix = jetDef.suffix.replace(
"Unsubtracted",
"seed0"+target_jetReco)
197 jetDef_seed0.radius = 0.2
198 jetsFullName_seed0 = jetDef_seed0.fullname()
199 jetDef_seed0.modifiers=[
200 JetModifier(
"HIJetDRAssociationTool",
"HIJetDRAssociation", ContainerKey=clustersKey, DeltaR=0.8, AssociationName=associationName),
201 JetModifier(
"HIJetMaxOverMeanTool",
"HIJetMaxOverMean"+target_jetReco, JetContainer = jetsFullName_seed0),
202 JetModifier(
"HIJetDiscriminatorTool",
"HIJetDiscriminator", MaxOverMeanCut = 4, MinimumETMaxCut=3000),
206 copySeed0Alg =
getJetCopyAlg(jetsin=jetsInUnsub,jetsoutdef=jetDef_seed0,decorations=[],shallowcopy=
False,shallowIO=
False,monTool=monTool)
207 acc.addEventAlgo(copySeed0Alg)
210 iter0=
HLTAddIteration(configFlags, jetsFullName_seed0, eventShapeKey, clustersKey, map_tool=eventShapeMapTool, assoc_name=associationName, suffix=
"iter0"+target_jetReco)
211 acc.addEventAlgo(
HLTRunTools([iter0],
"jetalgHI_iter0"+target_jetReco))
212 modulator0=iter0.Modulator
213 subtractor0=iter0.Subtractor
215 HLTMakeSubtractionTool(configFlags, iter0.OutputEventShapeKey, Modulator=modulator0, EventShapeMapTool=eventShapeMapTool, Subtractor=subtractor0, label=
"HLTHIJetConstSub_iter0"+target_jetReco)
217 cluster_key_iter0_deep=clustersKey+
"_iter0_temp"+target_jetReco
218 happy_iter0_Tool =
ApplySubtractionToClustersHLT(configFlags, EventShapeKey=
"HLTHIEventShapeWeighted_iter0"+target_jetReco, ClusterKey=clustersKey, OutClusterKey=cluster_key_iter0_deep, Modulator=modulator0, EventShapeMapTool=eventShapeMapTool, Subtractor=subtractor0, SetMoments=
False, ApplyOriginCorrection=
False)
219 acc.addEventAlgo(
HLTRunTools([happy_iter0_Tool],
"jetalgHI_clusterSub_iter0"+target_jetReco))
221 GetConstituentsModifierToolHLT(configFlags, name=
"HIJetConstituentModifierTool", ClusterKey=cluster_key_iter0_deep, ApplyOriginCorrection=
False, label=
"HLTHIJetJetConstMod_iter0"+target_jetReco)
224 jetDef_seed1 = jetDef.clone()
225 jetDef_seed1.suffix = jetDef_seed0.suffix.replace(
"_seed0",
"_seed1")
226 jetDef_seed1.radius = 0.2
227 jetDef_seed1.modifiers=[
"HLTHIJetAssoc", f
"HLTHIJetConstSub_iter0{target_jetReco}:iter0",
"HLTHIJetSeedCalib:{}___{}".
format(calib_seq, JES_is_data),
"Filter:25000"]
228 jetsFullName_seed1 = jetDef_seed1.fullname()
229 copySeed1Alg =
getJetCopyAlg(jetsin=jetsInUnsub,jetsoutdef=jetDef_seed1,decorations=[],shallowcopy=
False,shallowIO=
False,monTool=monTool)
230 acc.addEventAlgo(copySeed1Alg)
232 iter1=
HLTAddIteration(configFlags, jetsFullName_seed1, eventShapeKey, clustersKey, map_tool=eventShapeMapTool, assoc_name=associationName, sub_tool=subtractor0, suffix=
"iter1"+target_jetReco)
233 iter1.OutputEventShapeKey=
"HLTHIEventShape_iter1"+target_jetReco
234 modulator1=iter1.Modulator
235 subtractor1=iter1.Subtractor
237 HLTMakeSubtractionTool(configFlags, iter1.OutputEventShapeKey, Modulator=modulator1, EventShapeMapTool=eventShapeMapTool, label=
"HLTHIJetConstSub_iter1"+target_jetReco)
239 acc.addEventAlgo(
HLTRunTools([iter1],
"jetalgHI_clusterSub_egamma"+target_jetReco))
242 cluster_key_final_deep=clustersKey+
"_final"+target_jetReco
243 subToClusterTool =
ApplySubtractionToClustersHLT(configFlags, EventShapeKey=
"HLTHIEventShape_iter1"+target_jetReco, ClusterKey=clustersKey, OutClusterKey=cluster_key_final_deep, Modulator=modulator1, EventShapeMapTool=eventShapeMapTool, Subtractor=subtractor1, SetMoments=
False, ApplyOriginCorrection=
False)
244 acc.addEventAlgo(
HLTRunTools([subToClusterTool],
"jetalgHI_clusterSub"+target_jetReco))
246 GetConstituentsModifierToolHLT(configFlags, name=
"HIJetConstituentModifierTool", ClusterKey=cluster_key_final_deep, ApplyOriginCorrection=
False, label=
"HLTHIJetJetConstMod_iter1"+target_jetReco)
248 jetDef_final = jetDef.clone()
249 jetDef_final.suffix = jetDef.suffix.replace(
"_Unsubtracted",
"")
250 jetDef_final.modifiers=[f
"HLTHIJetConstSub_iter1{target_jetReco}:iter1",
"HLTHIJetJetConstMod_iter1"+target_jetReco,
"HLTHIJetCalib:{}___{}___{}".
format(calib_seq, JES_is_data, jet_collection_name),
"Sort",
"Filter:20000"]
251 copyAlg_final=
getJetCopyAlg(jetsin=jetsInUnsub,jetsoutdef=jetDef_final,decorations=[],shallowcopy=
False,shallowIO=
False,monTool=monTool)
252 acc.addEventAlgo(copyAlg_final)
254 jetsFinal =
recordable(jetDef_final.fullname())
258 return acc, jetsOut, jetDef_final