Skip to content

Commit

Permalink
Fix some merging mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
kdlong committed Jun 16, 2022
1 parent 683d57a commit 7f66633
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 28 deletions.
14 changes: 1 addition & 13 deletions PhysicsTools/NanoAOD/python/electrons_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,25 +614,13 @@ def _get_bitmapVIDForEle_docstring(modules,WorkingPoints):
for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
_withTo106XAndUpdateAnd80XLegacyScale_sequence = _withTo106XAndUpdate_sequence.copy()
_withTo106XAndUpdateAnd80XLegacyScale_sequence.replace(slimmedElectronsWithUserData, bitmapVIDForEleSpring15 +bitmapVIDForEleSum16 + slimmedElectronsWithUserData)
modifier.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd80XLegacyScale_sequence)

_withTo106XAndUpdateAnd94XScale_sequence = _withTo106XAndUpdate_sequence.copy()
for modifier in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_102Xv1:
modifier.toReplaceWith(electronSequence, _withTo106XAndUpdate_sequence)
_withTo106XAndUpdateAnd94XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons94X + slimmedElectronsWithUserData)
run2_nanoAOD_94XMiniAODv1.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd94XScale_sequence)
run2_nanoAOD_94XMiniAODv2.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd94XScale_sequence)

_withTo106XAndUpdateAndLowPUScale_sequence = _withTo106XAndUpdate_sequence.copy()
_withTo106XAndUpdateAndLowPUScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectronsLowPU + slimmedElectronsWithUserData)
run2_nanoAOD_LowPU.toReplaceWith(electronSequence, _withTo106XAndUpdateAndLowPUScale_sequence)

_withTo106XAndUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence = _withTo106XAndUpdate_sequence.copy()
_withTo106XAndUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence.replace(slimmedElectronsWithUserData, bitmapVIDForEleSpring15 + bitmapVIDForEleSum16 + slimmedElectronsWithUserData)
run2_nanoAOD_94X2016.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd_bitmapVIDForEleSpring15AndSum16_sequence)

_withTo106XAndUpdateAnd102XScale_sequence = _withTo106XAndUpdate_sequence.copy()
_withTo106XAndUpdateAnd102XScale_sequence.replace(slimmedElectronsWithUserData, calibratedPatElectrons102X + slimmedElectronsWithUserData)
run2_nanoAOD_102Xv1.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd102XScale_sequence)
run2_nanoAOD_LowPU.toReplaceWith(electronSequence, _withTo106XAndUpdateAnd80XLegacyScale_sequence)

electronSequence.replace(slimmedElectronsWithUserData,calibratedPatElectronsNano + slimmedElectronsWithUserData)
1 change: 0 additions & 1 deletion PhysicsTools/NanoAOD/python/isotracks_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
isPFcand = Var("packedCandRef().isNonnull()",bool,doc="if isolated track is a PF candidate"),
fromPV = Var("fromPV", int, doc="isolated track comes from PV"),
pdgId = Var("pdgId",int,doc="PDG id of PF cand"),
charge = Var("charge", int, doc="electric charge"),
isHighPurityTrack = Var("isHighPurityTrack",bool,doc="track is high purity"),
charge = Var("charge", int, doc="electric charge"),
),
Expand Down
20 changes: 11 additions & 9 deletions PhysicsTools/NanoAOD/python/nano_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ def nanoAOD_addDeepMET(process, addDeepMETProducer, ResponseTune_Graph):
process.deepMETsResponseTune = process.deepMETProducer.clone()
#process.deepMETsResponseTune.graph_path = 'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb'
process.deepMETsResponseTune.graph_path = ResponseTune_Graph.value()
# modify the graph for the low PU era
run2_nanoAOD_LowPU.toModify(process.deepMETsResolutionTune, graph_path='PhysicsTools/NanoAOD/data/deepmetmodel/deepmet_lowPU.pb')
run2_nanoAOD_LowPU.toModify(process.deepMETsResponseTune, graph_path='PhysicsTools/NanoAOD/data/deepmetmodel/deepmet_lowPU_Resp.pb')
# no leptons in the training. so remove leptons from the dnn input
run2_nanoAOD_LowPU.toModify(process.deepMETsResolutionTune, ignore_leptons=cms.bool(True))
run2_nanoAOD_LowPU.toModify(process.deepMETsResponseTune, ignore_leptons=cms.bool(True))

process.metTables += process.deepMetTables
return process

Expand All @@ -223,13 +230,7 @@ def nanoAOD_recalibrateMETs(process,isData):
process = nanoAOD_addDeepMET(process,
addDeepMETProducer=nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch,
ResponseTune_Graph=nanoAOD_DeepMET_switch.ResponseTune_Graph)
# modify the graph for the low PU era
run2_nanoAOD_LowPU.toModify(process.deepMETsResolutionTune, graph_path='PhysicsTools/NanoAOD/data/deepmetmodel/deepmet_lowPU.pb')
run2_nanoAOD_LowPU.toModify(process.deepMETsResponseTune, graph_path='PhysicsTools/NanoAOD/data/deepmetmodel/deepmet_lowPU_Resp.pb')
# no leptons in the training. so remove leptons from the dnn input
run2_nanoAOD_LowPU.toModify(process.deepMETsResolutionTune, ignore_leptons=cms.bool(True))
run2_nanoAOD_LowPU.toModify(process.deepMETsResponseTune, ignore_leptons=cms.bool(True))


# if included in Nano, and not computed in the fly, then it should be extracted from minAOD
extractDeepMETs = nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch and not nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch

Expand Down Expand Up @@ -427,9 +428,10 @@ def nanoAOD_customizeCommon(process):
nanoAOD_addBoostedTauIds_switch = cms.untracked.bool(False)
)
run2_miniAOD_80XLegacy.toModify(addTauIds_switch, nanoAOD_addTauIds_switch = cms.untracked.bool(False))
((run2_miniAOD_devel | run2_tau_ul_2016 | run2_tau_ul_2018) & \
((run2_nanoAOD_106Xv2 | run2_miniAOD_devel | run2_tau_ul_2016 | run2_tau_ul_2018) & \
(~(run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1 | run2_nanoAOD_LowPU))).toModify(addTauIds_switch,
nanoAOD_addTauIds_switch = cms.untracked.bool(False))
nanoAOD_addTauIds_switch = False, nanoAOD_addBoostedTauIds_switch = True)

if addTauIds_switch.nanoAOD_addTauIds_switch:
process = nanoAOD_addTauIds(process)
if addTauIds_switch.nanoAOD_addBoostedTauIds_switch:
Expand Down
1 change: 0 additions & 1 deletion PhysicsTools/NanoAOD/python/taus_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || (tauID('chargedIsoPtSumdR03')+max(0.,tauID('neutralIsoPtSumdR03')-0.072*tauID('puCorrPtSum'))<2.5) || tauID('byVVVLooseDeepTau2017v2p1VSjet'))")
)

<<<<<<< HEAD
for era in [run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_94X2016, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1, run2_nanoAOD_LowPU]:
era.toModify(finalTaus,
cut = cms.string("pt > 18 && tauID('decayModeFindingNewDMs') && (tauID('byLooseCombinedIsolationDeltaBetaCorr3Hits') || tauID('byVLooseIsolationMVArun2v1DBoldDMwLT2015') || tauID('byVLooseIsolationMVArun2v1DBnewDMwLT') || tauID('byVLooseIsolationMVArun2v1DBdR03oldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT') || tauID('byVVLooseIsolationMVArun2v1DBoldDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBnewDMwLT2017v2') || tauID('byVVLooseIsolationMVArun2v1DBdR03oldDMwLT2017v2') || tauID('byVVVLooseDeepTau2017v2p1VSjet'))")
Expand Down
4 changes: 0 additions & 4 deletions PhysicsTools/NanoAOD/python/triggerObjects_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@
selections = selections_lowPU
)


from PhysicsTools.PatUtils.L1ECALPrefiringWeightProducer_cff import prefiringweight
run2_HLTconditions_2016.toModify(prefiringweight, DataEra = cms.string("2016BtoH"))

l1PreFiringEventWeightTable = cms.EDProducer("GlobalVariablesTableProducer",
name = cms.string("L1PreFiringWeight"),
variables = cms.PSet(
Expand Down

0 comments on commit 7f66633

Please sign in to comment.