CMS 3D CMS Logo

puppiJetMETReclusteringFromMiniAOD_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from PhysicsTools.PatAlgos.tools.puppiJetMETReclusteringTools import puppiAK4METReclusterFromMiniAOD
3 from PhysicsTools.PatAlgos.tools.puppiJetMETReclusteringTools import puppiAK8ReclusterFromMiniAOD
4 
5 def setupPuppiAK4AK8METReclustering(process, runOnMC, useExistingWeights=False, reclusterAK4MET=True, reclusterAK8=True, btagDiscriminatorsAK4=None, btagDiscriminatorsAK8=None, btagDiscriminatorsAK8Subjets=None):
6 
7  if reclusterAK4MET:
8  process = puppiAK4METReclusterFromMiniAOD(process, runOnMC,
9  useExistingWeights=useExistingWeights,
10  btagDiscriminatorsAK4=btagDiscriminatorsAK4
11  )
12 
13  if reclusterAK8:
14  process = puppiAK8ReclusterFromMiniAOD(process, runOnMC,
15  useExistingWeights=useExistingWeights,
16  btagDiscriminatorsAK8=btagDiscriminatorsAK8,
17  btagDiscriminatorsAK8Subjets=btagDiscriminatorsAK8Subjets
18  )
19 
20  return process
21 
22 def puppiJetMETReclusterFromMiniAOD(process, runOnMC, useExistingWeights=False, reclusterAK4MET=True, reclusterAK8=True):
23 
24  # AK4 taggers
25  from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import _pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll as pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll
26  from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK4_cff import _pfParticleNetFromMiniAODAK4PuppiForwardJetTagsAll as pfParticleNetFromMiniAODAK4PuppiForwardJetTagsAll
27  from RecoBTag.ONNXRuntime.pfUnifiedParticleTransformerAK4_cff import _pfUnifiedParticleTransformerAK4JetTagsAll as pfUnifiedParticleTransformerAK4JetTagsAll
28 
29  btagDiscriminatorsAK4 = cms.PSet(
30  names=cms.vstring(
31  'pfDeepFlavourJetTags:probb',
32  'pfDeepFlavourJetTags:probbb',
33  'pfDeepFlavourJetTags:problepb',
34  'pfDeepFlavourJetTags:probc',
35  'pfDeepFlavourJetTags:probuds',
36  'pfDeepFlavourJetTags:probg')
37  + pfParticleNetFromMiniAODAK4PuppiCentralJetTagsAll
38  + pfParticleNetFromMiniAODAK4PuppiForwardJetTagsAll
39  + pfUnifiedParticleTransformerAK4JetTagsAll
40  )
41 
42  # AK8 taggers
43  from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetJetTagsAll as pfParticleNetJetTagsAll
44  from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetMassRegressionOutputs as pfParticleNetMassRegressionOutputs
45  from RecoBTag.ONNXRuntime.pfParticleNet_cff import _pfParticleNetMassCorrelatedJetTagsAll as pfParticleNetMassCorrelatedJetTagsAll
46  from RecoBTag.ONNXRuntime.pfParticleNetFromMiniAODAK8_cff import _pfParticleNetFromMiniAODAK8JetTagsAll as pfParticleNetFromMiniAODAK8JetTagsAll
47  btagDiscriminatorsAK8 = cms.PSet(names = cms.vstring(
48  pfParticleNetMassCorrelatedJetTagsAll+
49  pfParticleNetFromMiniAODAK8JetTagsAll+
50  pfParticleNetJetTagsAll+
51  pfParticleNetMassRegressionOutputs
52  )
53  )
54 
55  # AK8 Subjets taggers
56  btagDiscriminatorsAK8Subjets = cms.PSet(names = cms.vstring(
57  'pfDeepFlavourJetTags:probb',
58  'pfDeepFlavourJetTags:probbb',
59  'pfDeepFlavourJetTags:problepb',
60  'pfUnifiedParticleTransformerAK4DiscriminatorsJetTags:BvsAll'
61  )
62  )
63  process = setupPuppiAK4AK8METReclustering(process, runOnMC,
64  useExistingWeights=useExistingWeights,
65  reclusterAK4MET=reclusterAK4MET, reclusterAK8=reclusterAK8,
66  btagDiscriminatorsAK4=btagDiscriminatorsAK4,
67  btagDiscriminatorsAK8=btagDiscriminatorsAK8,
68  btagDiscriminatorsAK8Subjets=btagDiscriminatorsAK8Subjets
69  )
70 
71  return process
72 
74  process = puppiJetMETReclusterFromMiniAOD(process, runOnMC=True)
75  return process
76 
78  process = puppiJetMETReclusterFromMiniAOD(process, runOnMC=False)
79  return process
80 
def puppiJetMETReclusterFromMiniAOD(process, runOnMC, useExistingWeights=False, reclusterAK4MET=True, reclusterAK8=True)
def puppiAK8ReclusterFromMiniAOD(process, runOnMC, useExistingWeights, btagDiscriminatorsAK8=None, btagDiscriminatorsAK8Subjets=None)
def puppiAK4METReclusterFromMiniAOD(process, runOnMC, useExistingWeights, btagDiscriminatorsAK4=None)
def setupPuppiAK4AK8METReclustering(process, runOnMC, useExistingWeights=False, reclusterAK4MET=True, reclusterAK8=True, btagDiscriminatorsAK4=None, btagDiscriminatorsAK8=None, btagDiscriminatorsAK8Subjets=None)