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_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
4 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff import run2_miniAOD_94XFall17
5 from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016
6 from Configuration.Eras.Modifier_run2_jme_2017_cff import run2_jme_2017
7 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
8 
10 
11 _chsalgos_81x = cms.VPSet(full_81x_chs,cutbased)
12 _chsalgos_94x = cms.VPSet(full_94x_chs,cutbased)
13 _chsalgos_102x = cms.VPSet(full_102x_chs,cutbased)
14 _chsalgos_106X_UL17 = cms.VPSet(full_106x_UL17_chs,cutbased)
15 _chsalgos_106X_UL18 = cms.VPSet(full_106x_UL18_chs,cutbased)
16 
17 _stdalgos = _chsalgos_106X_UL18
18 
19 # Calculate+store variables and run MVAs
20 pileupJetId = cms.EDProducer('PileupJetIdProducer',
21  produceJetIds = cms.bool(True),
22  jetids = cms.InputTag(""),
23  runMvas = cms.bool(True),
24  jets = cms.InputTag("ak4PFJetsCHS"),
25  vertexes = cms.InputTag("offlinePrimaryVertices"),
26  algos = cms.VPSet(_stdalgos),
27  rho = cms.InputTag("fixedGridRhoFastjetAll"),
28  jec = cms.string("AK4PFchs"),
29  applyJec = cms.bool(True),
30  inputIsCorrected = cms.bool(False),
31  residualsFromTxt = cms.bool(False),
32  usePuppi = cms.bool(False),
33 # residualsTxt = cms.FileInPath("RecoJets/JetProducers/data/download.url") # must be an existing file
34 )
35 
36 # set algos for re-miniAOD campaign
37 run2_miniAOD_80XLegacy.toModify(pileupJetId, algos = _chsalgos_81x)
38 run2_miniAOD_94XFall17.toModify(pileupJetId, algos = _chsalgos_94x)
39 (run2_miniAOD_UL & run2_jme_2017).toModify(pileupJetId, algos = _chsalgos_106X_UL17)
40 
41 # Calculate variables, but don't run MVAs
42 pileupJetIdCalculator = pileupJetId.clone(
43  runMvas = False,
44  algos = cms.VPSet(cutbased),
45 )
46 
47 # Run MVAs on precalculated variables
48 pileupJetIdEvaluator = pileupJetId.clone(
49  produceJetIds = False,
50  jetids = "pileupJetIdCalculator",
51 )
52 
53 pileUpJetIDTask = cms.Task(pileupJetId,
54  pileupJetIdCalculator,
55  pileupJetIdEvaluator
56 )
PileupJetIDParams_cfi