Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-01 05:02:15

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016
0004 from Configuration.Eras.Modifier_run2_jme_2017_cff import run2_jme_2017
0005 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
0006 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016
0007 
0008 from RecoJets.JetProducers.PileupJetIDParams_cfi import *
0009 
0010 _chsalgos_106X_UL17 = cms.VPSet(full_106x_UL17_chs,cutbased)
0011 _chsalgos_106X_UL18 = cms.VPSet(full_106x_UL18_chs,cutbased)
0012 _chsalgos_106X_UL16 = cms.VPSet(full_106x_UL16_chs,cutbased)
0013 _chsalgos_106X_UL16APV = cms.VPSet(full_106x_UL16APV_chs,cutbased)
0014 
0015 _stdalgos    = _chsalgos_106X_UL18
0016 
0017 # Calculate+store variables and run MVAs
0018 pileupJetId = cms.EDProducer('PileupJetIdProducer',
0019      produceJetIds = cms.bool(True),
0020      jetids = cms.InputTag(""),
0021      runMvas = cms.bool(True),
0022      jets = cms.InputTag("ak4PFJetsCHS"),
0023      vertexes = cms.InputTag("offlinePrimaryVertices"),
0024      algos = cms.VPSet(_stdalgos),
0025      rho     = cms.InputTag("fixedGridRhoFastjetAll"),
0026      jec     = cms.string("AK4PFchs"),
0027      applyJec = cms.bool(True),
0028      inputIsCorrected = cms.bool(False),
0029      residualsFromTxt = cms.bool(False),
0030      srcConstituentWeights = cms.InputTag(""),
0031 #     residualsTxt     = cms.FileInPath("RecoJets/JetProducers/data/download.url") # must be an existing file
0032 )
0033 
0034 # set algos for re-miniAOD campaign
0035 (run2_miniAOD_UL & run2_jme_2017).toModify(pileupJetId, algos = _chsalgos_106X_UL17)
0036 (run2_miniAOD_UL & run2_jme_2016 & ~tracker_apv_vfp30_2016).toModify(pileupJetId, algos = _chsalgos_106X_UL16)
0037 (run2_miniAOD_UL & run2_jme_2016 & tracker_apv_vfp30_2016).toModify(pileupJetId, algos = _chsalgos_106X_UL16APV)
0038 
0039 # Calculate variables, but don't run MVAs
0040 pileupJetIdCalculator = pileupJetId.clone(
0041     runMvas = False,
0042     algos   = cms.VPSet(cutbased),
0043 )
0044 
0045 # Run MVAs on precalculated variables
0046 pileupJetIdEvaluator = pileupJetId.clone(
0047     produceJetIds = False,
0048     jetids        = "pileupJetIdCalculator",
0049 )
0050 
0051 pileUpJetIDTask = cms.Task(pileupJetId,
0052                            pileupJetIdCalculator,
0053                            pileupJetIdEvaluator
0054 )
0055 
0056 #
0057 #
0058 #
0059 _puppiV18algos_133X_Winter24 = cms.VPSet(full_133x_Winter24_puppi_v18_wp,cutbased)
0060 
0061 pileupJetIdPuppi = pileupJetId.clone(
0062     jets = "ak4PFJetsPuppi",
0063     jec  = "AK4PFPuppi",
0064     srcConstituentWeights = "puppi",
0065     algos = cms.VPSet(_puppiV18algos_133X_Winter24),
0066 )
0067 
0068 pileUpJetIDPuppiTask = cms.Task(pileupJetIdPuppi)
0069