Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-05 05:20:43

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.PatAlgos.tools.puppiJetMETReclusteringTools import puppiAK4METReclusterFromMiniAOD
0003 from PhysicsTools.PatAlgos.tools.puppiJetMETReclusteringTools import puppiAK8ReclusterFromMiniAOD
0004 
0005 def setupPuppiAK4AK8METReclustering(process, runOnMC, useExistingWeights=False, reclusterAK4MET=True, reclusterAK8=True, btagDiscriminatorsAK4=None, btagDiscriminatorsAK8=None, btagDiscriminatorsAK8Subjets=None):
0006 
0007   if reclusterAK4MET:
0008     process = puppiAK4METReclusterFromMiniAOD(process, runOnMC,
0009       useExistingWeights=useExistingWeights,
0010       btagDiscriminatorsAK4=btagDiscriminatorsAK4
0011     )
0012 
0013   if reclusterAK8:
0014     process = puppiAK8ReclusterFromMiniAOD(process, runOnMC,
0015       useExistingWeights=useExistingWeights,
0016       btagDiscriminatorsAK8=btagDiscriminatorsAK8,
0017       btagDiscriminatorsAK8Subjets=btagDiscriminatorsAK8Subjets
0018     )
0019 
0020   return process
0021 
0022 def puppiJetMETReclusterFromMiniAOD(process, runOnMC, useExistingWeights=False, reclusterAK4MET=True, reclusterAK8=True):
0023 
0024   # AK4 taggers
0025   from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll as pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll
0026   from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsAll as pfParticleNetFromMiniAODAK4PuppiForwardJetTagsAll
0027   from RecoBTag.ONNXRuntime.pfUnifiedParticleTransformerAK4_cff import _pfUnifiedParticleTransformerAK4JetTagsAll as pfUnifiedParticleTransformerAK4JetTagsAll
0028 
0029   btagDiscriminatorsAK4 = cms.PSet(
0030    names=cms.vstring(
0031     'pfDeepFlavourJetTags:probb',
0032     'pfDeepFlavourJetTags:probbb',
0033     'pfDeepFlavourJetTags:problepb',
0034     'pfDeepFlavourJetTags:probc',
0035     'pfDeepFlavourJetTags:probuds',
0036     'pfDeepFlavourJetTags:probg')
0037     + pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll
0038     + pfParticleNetFromMiniAODAK4PuppiForwardJetTagsAll
0039     + pfUnifiedParticleTransformerAK4JetTagsAll
0040   )
0041 
0042   # AK8 taggers
0043   from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetJetTagsAll as pfParticleNetJetTagsAll
0044   from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetMassRegressionOutputs as pfParticleNetMassRegressionOutputs
0045   from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetMassCorrelatedJetTagsAll as pfParticleNetMassCorrelatedJetTagsAll
0046   from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK8_cff import _pfParticleNetFromMiniAODAK8JetTagsAll as pfParticleNetFromMiniAODAK8JetTagsAll
0047   from RecoBTag.ONNXRuntime.pfGlobalParticleTransformerAK8_cff import _pfGlobalParticleTransformerAK8JetTagsAll as pfGlobalParticleTransformerAK8JetTagsAll
0048   btagDiscriminatorsAK8 = cms.PSet(names = cms.vstring(
0049       pfParticleNetMassCorrelatedJetTagsAll+
0050       pfGlobalParticleTransformerAK8JetTagsAll+
0051       pfParticleNetFromMiniAODAK8JetTagsAll+
0052       pfParticleNetJetTagsAll+
0053       pfParticleNetMassRegressionOutputs
0054     )
0055   )
0056 
0057   # AK8 Subjets taggers
0058   btagDiscriminatorsAK8Subjets = cms.PSet(names = cms.vstring(
0059       'pfDeepFlavourJetTags:probb',
0060       'pfDeepFlavourJetTags:probbb',
0061       'pfDeepFlavourJetTags:problepb',
0062       'pfUnifiedParticleTransformerAK4DiscriminatorsJetTags:BvsAll'
0063     )
0064   )
0065   process = setupPuppiAK4AK8METReclustering(process, runOnMC,
0066     useExistingWeights=useExistingWeights,
0067     reclusterAK4MET=reclusterAK4MET, reclusterAK8=reclusterAK8,
0068     btagDiscriminatorsAK4=btagDiscriminatorsAK4,
0069     btagDiscriminatorsAK8=btagDiscriminatorsAK8,
0070     btagDiscriminatorsAK8Subjets=btagDiscriminatorsAK8Subjets
0071   )
0072 
0073   return process
0074 
0075 def puppiJetMETReclusterFromMiniAOD_MC(process):
0076   process = puppiJetMETReclusterFromMiniAOD(process, runOnMC=True)
0077   return process
0078 
0079 def puppiJetMETReclusterFromMiniAOD_Data(process):
0080   process = puppiJetMETReclusterFromMiniAOD(process, runOnMC=False)
0081   return process
0082