Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:34

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