Commit c3921aa7 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'pvFix-200626' into 'master'

Support jet reconstruction with no PV container

Closes ATLASRECTS-5519

See merge request atlas/athena!34376
parents ace0562c 1b192814
......@@ -61,8 +61,12 @@ def addJetRecoToAlgSequence(job =None, useTruth =None, eventShapeTools =None,
}
if jetFlags.useTracks():
evsDict["emtopo"] = ("EMTopoOriginEventShape", jtm.emoriginget)
evsDict["lctopo"] = ("LCTopoOriginEventShape", jtm.lcoriginget)
if jetFlags.useVertices():
evsDict["emtopo"] = ("EMTopoOriginEventShape", jtm.emoriginget)
evsDict["lctopo"] = ("LCTopoOriginEventShape", jtm.lcoriginget)
else:
evsDict["emtopo"] = ("EMTopoOriginEventShape", jtm.emget)
evsDict["lctopo"] = ("LCTopoOriginEventShape", jtm.lcget)
jetlog.info( myname + "Event shape tools: " + str(eventShapeTools) )
from RecExConfig.AutoConfiguration import IsInInputFile
......@@ -94,10 +98,9 @@ def addJetRecoToAlgSequence(job =None, useTruth =None, eventShapeTools =None,
## if jetFlags.useCells():
## ctools += [jtm.missingcells] commented out : incompatible with trigger : ATR-9696
if jetFlags.useTracks:
ctools += [jtm.tracksel,
jtm.tvassoc,
jtm.trackselloose_trackjets,
]
ctools += [jtm.tracksel, jtm.trackselloose_trackjets]
if jetFlags.useVertices:
ctools += [jtm.tvassoc]
# LCOriginTopoClusters and EMOriginTopoClusters are shallow copies
# of CaloCalTopoClusters. This means that if CaloCalTopoClusters gets
......@@ -112,7 +115,7 @@ def addJetRecoToAlgSequence(job =None, useTruth =None, eventShapeTools =None,
if AODFlags.ThinNegativeEnergyCaloClusters:
thinneg = True
if jetFlags.useTracks:
if jetFlags.useTracks and jetFlags.useVertices:
if not IsInInputFile("xAOD::CaloClusterContainer","LCOriginTopoClusters"):
ctools += [jtm.JetConstitSeq_LCOrigin]
if thinneg:
......
......@@ -105,8 +105,12 @@ trackgetters = [jtm.trackget]
emgetters = [jtm.emget]
lcgetters = [jtm.lcget]
if jetFlags.useTracks():
emgetters = [jtm.emoriginget]
lcgetters = [jtm.lcoriginget]
if jetFlags.useVertices():
emgetters = [jtm.emoriginget]
lcgetters = [jtm.lcoriginget]
else:
emgetters = [jtm.emget]
lcgetters = [jtm.lcget]
emgetters += [jtm.gtrackget]
lcgetters += [jtm.gtrackget]
empfgetters += [jtm.gtrackget]
......@@ -200,13 +204,15 @@ ungroomed_modifiers += [jtm.ecpsfrac]
if jetFlags.useCaloQualityTool():
ungroomed_modifiers += [jtm.caloqual_cluster]
if jetFlags.useTracks():
ungroomed_modifiers += [jtm.trkmoms]
ungroomed_modifiers += [jtm.trksummoms]
ungroomed_modifiers += [jtm.jvf]
ungroomed_modifiers += [jtm.jvt]
if jetFlags.useVertices():
ungroomed_modifiers += [jtm.trkmoms]
ungroomed_modifiers += [jtm.trksummoms]
ungroomed_modifiers += [jtm.jvf]
ungroomed_modifiers += [jtm.jvt]
ungroomed_modifiers += [jtm.jetorigin_setpv]
ungroomed_modifiers += [jtm.charge]
ungroomed_modifiers += ["trackassoc"]
ungroomed_modifiers += [jtm.jetorigin_setpv]
if jetFlags.useTruth():
if jetFlags.detailLevel()>=JetContentDetail.Full:
# only at this detail level are the truth jets build. We can then schedule the TruthAssociation calculation :
......
......@@ -338,7 +338,7 @@ ctm.add( ChargedHadronSubtractionTool("CHSTool", InputType = xAODType.ParticleFl
# Options to disable dependence on primary vertex container
# for PFO corrections (e.g. when running cosmics)
if not jetFlags.useTracks:
if not (jetFlags.useTracks and jetFlags.useVertices):
ctm.modifiersMap['correctPFO'].CorrectNeutral=False
ctm.modifiersMap['chsPFO'].IgnoreVertex=True
......@@ -696,7 +696,7 @@ jtm += JetConstitFourMomTool(
jtm += JetConstitFourMomTool(
"constitfourmom_emtopo",
JetScaleNames = ["DetectorEtaPhi","JetLCScaleMomentum"],
AltConstitColls = ["CaloCalTopoClusters","LCOriginTopoClusters" if jetFlags.useTracks() else "CaloCalTopoClusters"],
AltConstitColls = ["CaloCalTopoClusters","LCOriginTopoClusters" if (jetFlags.useTracks() and jetFlags.useVertices()) else "CaloCalTopoClusters"],
AltConstitScales = [CaloClusterStates["UNCALIBRATED"],CaloClusterStates["CALIBRATED"]],
AltJetScales = ["",""]
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment