CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 from Configuration.Eras.Modifier_tracker_apv_vfp30_2016_cff import tracker_apv_vfp30_2016
9 
11 
12 _chsalgos_81x = cms.VPSet(full_81x_chs,cutbased)
13 _chsalgos_94x = cms.VPSet(full_94x_chs,cutbased)
14 _chsalgos_102x = cms.VPSet(full_102x_chs,cutbased)
15 _chsalgos_106X_UL17 = cms.VPSet(full_106x_UL17_chs,cutbased)
16 _chsalgos_106X_UL18 = cms.VPSet(full_106x_UL18_chs,cutbased)
17 _chsalgos_106X_UL16 = cms.VPSet(full_106x_UL16_chs,cutbased)
18 _chsalgos_106X_UL16APV = cms.VPSet(full_106x_UL16APV_chs,cutbased)
19 
20 _stdalgos = _chsalgos_106X_UL18
21 
22 # Calculate+store variables and run MVAs
23 pileupJetId = cms.EDProducer('PileupJetIdProducer',
24  produceJetIds = cms.bool(True),
25  jetids = cms.InputTag(""),
26  runMvas = cms.bool(True),
27  jets = cms.InputTag("ak4PFJetsCHS"),
28  vertexes = cms.InputTag("offlinePrimaryVertices"),
29  algos = cms.VPSet(_stdalgos),
30  rho = cms.InputTag("fixedGridRhoFastjetAll"),
31  jec = cms.string("AK4PFchs"),
32  applyJec = cms.bool(True),
33  inputIsCorrected = cms.bool(False),
34  residualsFromTxt = cms.bool(False),
35  usePuppi = cms.bool(False),
36 # residualsTxt = cms.FileInPath("RecoJets/JetProducers/data/download.url") # must be an existing file
37 )
38 
39 # set algos for re-miniAOD campaign
40 run2_miniAOD_80XLegacy.toModify(pileupJetId, algos = _chsalgos_81x)
41 run2_miniAOD_94XFall17.toModify(pileupJetId, algos = _chsalgos_94x)
42 (run2_miniAOD_UL & run2_jme_2017).toModify(pileupJetId, algos = _chsalgos_106X_UL17)
43 (run2_miniAOD_UL & run2_jme_2016 & ~tracker_apv_vfp30_2016).toModify(pileupJetId, algos = _chsalgos_106X_UL16)
44 (run2_miniAOD_UL & run2_jme_2016 & tracker_apv_vfp30_2016).toModify(pileupJetId, algos = _chsalgos_106X_UL16APV)
45 
46 # Calculate variables, but don't run MVAs
47 pileupJetIdCalculator = pileupJetId.clone(
48  runMvas = False,
49  algos = cms.VPSet(cutbased),
50 )
51 
52 # Run MVAs on precalculated variables
53 pileupJetIdEvaluator = pileupJetId.clone(
54  produceJetIds = False,
55  jetids = "pileupJetIdCalculator",
56 )
57 
58 pileUpJetIDTask = cms.Task(pileupJetId,
59  pileupJetIdCalculator,
60  pileupJetIdEvaluator
61 )