Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate ECF variables #31213

Merged
merged 4 commits into from
Aug 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions PhysicsTools/NanoAOD/python/jets_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv1_cff import run2_nanoAOD_94XMiniAODv1
from Configuration.Eras.Modifier_run2_nanoAOD_94XMiniAODv2_cff import run2_nanoAOD_94XMiniAODv2
from Configuration.Eras.Modifier_run2_nanoAOD_102Xv1_cff import run2_nanoAOD_102Xv1
from Configuration.Eras.Modifier_run2_nanoAOD_106Xv1_cff import run2_nanoAOD_106Xv1

from PhysicsTools.NanoAOD.common_cff import *
from RecoJets.JetProducers.ak4PFJetsBetaStar_cfi import *
Expand Down Expand Up @@ -414,8 +415,8 @@
tau2 = Var("userFloat('NjettinessAK8Puppi:tau2')",float, doc="Nsubjettiness (2 axis)",precision=10),
tau3 = Var("userFloat('NjettinessAK8Puppi:tau3')",float, doc="Nsubjettiness (3 axis)",precision=10),
tau4 = Var("userFloat('NjettinessAK8Puppi:tau4')",float, doc="Nsubjettiness (4 axis)",precision=10),
n2b1 = Var("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2')", float, doc="N2 with beta=1", precision=10),
n3b1 = Var("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3')", float, doc="N3 with beta=1", precision=10),
n2b1 = Var("?hasUserFloat('nb1AK8PuppiSoftDrop:ecfN2')?userFloat('nb1AK8PuppiSoftDrop:ecfN2'):-99999.", float, doc="N2 with beta=1 (for jets with raw pT>250 GeV)", precision=10),
n3b1 = Var("?hasUserFloat('nb1AK8PuppiSoftDrop:ecfN3')?userFloat('nb1AK8PuppiSoftDrop:ecfN3'):-99999.", float, doc="N3 with beta=1 (for jets with raw pT>250 GeV)", precision=10),
msoftdrop = Var("groomedMass('SoftDropPuppi')",float, doc="Corrected soft drop mass with PUPPI",precision=10),
btagCMVA = Var("bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc="CMVA V2 btag discriminator",precision=10),
btagDeepB = Var("bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc="DeepCSV b+bb tag discriminator",precision=10),
Expand Down Expand Up @@ -469,6 +470,9 @@
run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, n3b1 = None)
for modifier in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
modifier.toModify( fatJetTable.variables, jetId = Var("userInt('tightId')*2+userInt('looseId')",int,doc="Jet ID flags bit1 is loose, bit2 is tight"))
for modifier in run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1:
modifier.toModify( fatJetTable.variables.n2b1, expr = cms.string("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2')"),)
modifier.toModify( fatJetTable.variables.n3b1, expr = cms.string("userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3')"),)

run2_jme_2016.toModify( bjetNN, weightFile = cms.FileInPath("PhysicsTools/NanoAOD/data/breg_training_2016.pb") )
run2_jme_2016.toModify( bjetNN,outputFormulas = cms.vstring(["at(0)*0.31976690888404846+1.047176718711853","0.5*(at(2)-at(1))*0.31976690888404846"]))
Expand Down
27 changes: 0 additions & 27 deletions PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,27 +110,6 @@ def applySubstructure( process, postfix="" ) :
e.toModify(getattr(process,'nb1AK8PuppiSoftDropSubjets'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] )
e.toModify(getattr(process,'nb2AK8PuppiSoftDropSubjets'+postfix), cuts = ['pt > 999999', 'pt > 999999', 'pt > 999999'] )

# rekey the groomed ECF value maps to the ungroomed reco jets, which will then be picked
# up by PAT in the user floats.
addToProcessAndTask("ak8PFJetsPuppiSoftDropValueMap"+postfix,
cms.EDProducer("RecoJetToPatJetDeltaRValueMapProducer",
src = cms.InputTag("ak8PFJetsPuppi"+postfix),
matched = cms.InputTag("patJetsAK8PFPuppiSoftDrop"+postfix),
distMax = cms.double(0.8),
values = cms.vstring([
'userFloat("nb1AK8PuppiSoftDrop'+postfix+':ecfN2")',
'userFloat("nb1AK8PuppiSoftDrop'+postfix+':ecfN3")',
'userFloat("nb2AK8PuppiSoftDrop'+postfix+':ecfN2")',
'userFloat("nb2AK8PuppiSoftDrop'+postfix+':ecfN3")',
]),
valueLabels = cms.vstring( [
'nb1AK8PuppiSoftDropN2',
'nb1AK8PuppiSoftDropN3',
'nb2AK8PuppiSoftDropN2',
'nb2AK8PuppiSoftDropN3',
]) ),
process, task)


# Patify AK8 PF PUPPI
addJetCollection(process, postfix=postfix, labelName = 'AK8Puppi',
Expand Down Expand Up @@ -167,12 +146,6 @@ def applySubstructure( process, postfix="" ) :
## now add AK8 groomed masses and ECF
getattr(process,"patJetsAK8Puppi"+postfix).userData.userFloats.src += ['ak8PFJetsPuppiSoftDropMass'+postfix]
getattr(process,"patJetsAK8Puppi"+postfix).addTagInfos = cms.bool(False)
getattr(process,"patJetsAK8Puppi"+postfix).userData.userFloats.src += [
cms.InputTag('ak8PFJetsPuppiSoftDropValueMap'+postfix,'nb1AK8PuppiSoftDropN2'),
cms.InputTag('ak8PFJetsPuppiSoftDropValueMap'+postfix,'nb1AK8PuppiSoftDropN3'),
cms.InputTag('ak8PFJetsPuppiSoftDropValueMap'+postfix,'nb2AK8PuppiSoftDropN2'),
cms.InputTag('ak8PFJetsPuppiSoftDropValueMap'+postfix,'nb2AK8PuppiSoftDropN3'),
]


# add PUPPI Njetiness
Expand Down