CMS 3D CMS Logo

PileupJetID_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
3 from Configuration.Eras.Modifier_run2_miniAOD_devel_cff import run2_miniAOD_devel
4 from Configuration.Eras.Modifier_run2_jme_2017_cff import run2_jme_2017
5 from Configuration.Eras.Modifier_run2_jme_2016_cff import run2_jme_2016
7 
8 #_stdalgos_4x = cms.VPSet(full, cutbased,PhilV1)
9 _stdalgos_5x = cms.VPSet(full_5x,cutbased,PhilV1)
10 
11 #_chsalgos_4x = cms.VPSet(full, cutbased)
12 _chsalgos_5x = cms.VPSet(full_5x_chs,cutbased)
13 _chsalgos_74x = cms.VPSet(full_74x_chs,cutbased)
14 _chsalgos_76x = cms.VPSet(full_76x_chs,cutbased)
15 _chsalgos_80x = cms.VPSet(full_80x_chs,cutbased)
16 _chsalgos_81x = cms.VPSet(full_81x_chs,cutbased)
17 _chsalgos_94x = cms.VPSet(full_94x_chs,cutbased)
18 _chsalgos_102x = cms.VPSet(full_102x_chs,cutbased)
19 _chsalgos_106X_UL17 = cms.VPSet(full_106x_UL17_chs,cutbased)
20 _chsalgos_106X_UL18 = cms.VPSet(full_106x_UL18_chs,cutbased)
21 
22 _stdalgos = _chsalgos_81x
23 
24 # Calculate+store variables and run MVAs
25 pileupJetId = cms.EDProducer('PileupJetIdProducer',
26  produceJetIds = cms.bool(True),
27  jetids = cms.InputTag(""),
28  runMvas = cms.bool(True),
29  jets = cms.InputTag("ak4PFJetsCHS"),
30  vertexes = cms.InputTag("offlinePrimaryVertices"),
31  algos = cms.VPSet(_stdalgos),
32  rho = cms.InputTag("fixedGridRhoFastjetAll"),
33  jec = cms.string("AK4PFchs"),
34  applyJec = cms.bool(True),
35  inputIsCorrected = cms.bool(False),
36  residualsFromTxt = cms.bool(False),
37  usePuppi = cms.bool(False),
38 # residualsTxt = cms.FileInPath("RecoJets/JetProducers/data/download.url") # must be an existing file
39 )
40 run2_miniAOD_UL.toModify(pileupJetId, algos = _chsalgos_106X_UL17)
41 (run2_miniAOD_devel & (~run2_jme_2016) & (~run2_jme_2017)).toModify(pileupJetId, algos = _chsalgos_106X_UL18)
42 
43 # Calculate variables, but don't run MVAs
44 pileupJetIdCalculator = pileupJetId.clone(
45  runMvas = cms.bool(False),
46  algos = cms.VPSet(cutbased),
47 )
48 
49 # Run MVAs on precalculated variables
50 pileupJetIdEvaluator = pileupJetId.clone(
51  produceJetIds = cms.bool(False),
52  jetids = cms.InputTag("pileupJetIdCalculator"),
53 )
54 
55 pileUpJetIDTask = cms.Task(pileupJetId,
56  pileupJetIdCalculator,
57  pileupJetIdEvaluator
58 )