CMS 3D CMS Logo

PileupJetID_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016
4 from Configuration.Eras.Modifier_run2_jme_2017_cff import run2_jme_2017
5 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
6 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016
7 
9 
10 _chsalgos_106X_UL17 = cms.VPSet(full_106x_UL17_chs,cutbased)
11 _chsalgos_106X_UL18 = cms.VPSet(full_106x_UL18_chs,cutbased)
12 _chsalgos_106X_UL16 = cms.VPSet(full_106x_UL16_chs,cutbased)
13 _chsalgos_106X_UL16APV = cms.VPSet(full_106x_UL16APV_chs,cutbased)
14 
15 _stdalgos = _chsalgos_106X_UL18
16 
17 # Calculate+store variables and run MVAs
18 pileupJetId = cms.EDProducer('PileupJetIdProducer',
19  produceJetIds = cms.bool(True),
20  jetids = cms.InputTag(""),
21  runMvas = cms.bool(True),
22  jets = cms.InputTag("ak4PFJetsCHS"),
23  vertexes = cms.InputTag("offlinePrimaryVertices"),
24  algos = cms.VPSet(_stdalgos),
25  rho = cms.InputTag("fixedGridRhoFastjetAll"),
26  jec = cms.string("AK4PFchs"),
27  applyJec = cms.bool(True),
28  inputIsCorrected = cms.bool(False),
29  residualsFromTxt = cms.bool(False),
30  srcConstituentWeights = cms.InputTag(""),
31 # residualsTxt = cms.FileInPath("RecoJets/JetProducers/data/download.url") # must be an existing file
32 )
33 
34 # set algos for re-miniAOD campaign
35 (run2_miniAOD_UL & run2_jme_2017).toModify(pileupJetId, algos = _chsalgos_106X_UL17)
36 (run2_miniAOD_UL & run2_jme_2016 & ~tracker_apv_vfp30_2016).toModify(pileupJetId, algos = _chsalgos_106X_UL16)
37 (run2_miniAOD_UL & run2_jme_2016 & tracker_apv_vfp30_2016).toModify(pileupJetId, algos = _chsalgos_106X_UL16APV)
38 
39 # Calculate variables, but don't run MVAs
40 pileupJetIdCalculator = pileupJetId.clone(
41  runMvas = False,
42  algos = cms.VPSet(cutbased),
43 )
44 
45 # Run MVAs on precalculated variables
46 pileupJetIdEvaluator = pileupJetId.clone(
47  produceJetIds = False,
48  jetids = "pileupJetIdCalculator",
49 )
50 
51 pileUpJetIDTask = cms.Task(pileupJetId,
52  pileupJetIdCalculator,
53  pileupJetIdEvaluator
54 )