diff --git a/PhysicsTools/NanoAOD/python/jets_cff.py b/PhysicsTools/NanoAOD/python/jets_cff.py index 2c489c4cc2dcb..2b34d16c4d66b 100644 --- a/PhysicsTools/NanoAOD/python/jets_cff.py +++ b/PhysicsTools/NanoAOD/python/jets_cff.py @@ -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 * @@ -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), @@ -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"])) diff --git a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py index a2867d8374bfd..5a7541ece63cf 100644 --- a/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py +++ b/PhysicsTools/PatAlgos/python/slimming/applySubstructure_cff.py @@ -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', @@ -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