1 import FWCore.ParameterSet.Config
as cms
4 bJetVars = cms.EDProducer(
"JetRegressionVarProducer",
5 pvsrc = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
6 src = cms.InputTag(
"slimmedJets"),
7 svsrc = cms.InputTag(
"slimmedSecondaryVertices"),
8 gpsrc = cms.InputTag(
"prunedGenParticles"),
13 slimmedJetsWithUserData = cms.EDProducer(
"PATJetUserDataEmbedder",
14 src = cms.InputTag(
"slimmedJets"),
15 userFloats = cms.PSet(
16 leadTrackPt = cms.InputTag(
"bJetVars:leadTrackPt"),
17 leptonPtRel = cms.InputTag(
"bJetVars:leptonPtRel"),
18 leptonPtRatio = cms.InputTag(
"bJetVars:leptonPtRatio"),
19 leptonPtRelInv = cms.InputTag(
"bJetVars:leptonPtRelInv"),
20 leptonPtRelv0 = cms.InputTag(
"bJetVars:leptonPtRelv0"),
21 leptonPtRatiov0 = cms.InputTag(
"bJetVars:leptonPtRatiov0"),
22 leptonPtRelInvv0 = cms.InputTag(
"bJetVars:leptonPtRelInvv0"),
23 leptonDeltaR = cms.InputTag(
"bJetVars:leptonDeltaR"),
24 leptonPt = cms.InputTag(
"bJetVars:leptonPt"),
25 vtxPt = cms.InputTag(
"bJetVars:vtxPt"),
26 vtxMass = cms.InputTag(
"bJetVars:vtxMass"),
27 vtx3dL = cms.InputTag(
"bJetVars:vtx3dL"),
28 vtx3deL = cms.InputTag(
"bJetVars:vtx3deL"),
29 ptD = cms.InputTag(
"bJetVars:ptD"),
30 genPtwNu = cms.InputTag(
"bJetVars:genPtwNu"),
34 vtxNtrk = cms.InputTag(
"bJetVars:vtxNtrk"),
35 leptonPdgId = cms.InputTag(
"bJetVars:leptonPdgId"),
39 bjetNN= cms.EDProducer(
"BJetEnergyRegressionMVA",
40 backend = cms.string(
"TF"),
41 src = cms.InputTag(
"slimmedJetsWithUserData"),
42 pvsrc = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
43 svsrc = cms.InputTag(
"slimmedSecondaryVertices"),
44 rhosrc = cms.InputTag(
"fixedGridRhoFastjetAll"),
46 weightFile = cms.FileInPath(
"PhysicsTools/NanoAOD/data/breg_training_2017.pb"),
47 name = cms.string(
"JetRegNN"),
48 isClassifier = cms.bool(
False),
49 variablesOrder = cms.vstring([
"Jet_pt",
"Jet_eta",
"rho",
"Jet_mt",
"Jet_leadTrackPt",
"Jet_leptonPtRel",
"Jet_leptonDeltaR",
"Jet_neHEF",
"Jet_neEmEF",
"Jet_vtxPt",
"Jet_vtxMass",
"Jet_vtx3dL",
"Jet_vtxNtrk",
"Jet_vtx3deL",
"Jet_numDaughters_pt03",
"Jet_energyRing_dR0_em_Jet_rawEnergy",
"Jet_energyRing_dR1_em_Jet_rawEnergy",
"Jet_energyRing_dR2_em_Jet_rawEnergy",
"Jet_energyRing_dR3_em_Jet_rawEnergy",
"Jet_energyRing_dR4_em_Jet_rawEnergy",
"Jet_energyRing_dR0_neut_Jet_rawEnergy",
"Jet_energyRing_dR1_neut_Jet_rawEnergy",
"Jet_energyRing_dR2_neut_Jet_rawEnergy",
"Jet_energyRing_dR3_neut_Jet_rawEnergy",
"Jet_energyRing_dR4_neut_Jet_rawEnergy",
"Jet_energyRing_dR0_ch_Jet_rawEnergy",
"Jet_energyRing_dR1_ch_Jet_rawEnergy",
"Jet_energyRing_dR2_ch_Jet_rawEnergy",
"Jet_energyRing_dR3_ch_Jet_rawEnergy",
"Jet_energyRing_dR4_ch_Jet_rawEnergy",
"Jet_energyRing_dR0_mu_Jet_rawEnergy",
"Jet_energyRing_dR1_mu_Jet_rawEnergy",
"Jet_energyRing_dR2_mu_Jet_rawEnergy",
"Jet_energyRing_dR3_mu_Jet_rawEnergy",
"Jet_energyRing_dR4_mu_Jet_rawEnergy",
"Jet_chHEF",
"Jet_chEmEF",
"Jet_leptonPtRelInv",
"isEle",
"isMu",
"isOther",
"Jet_mass",
"Jet_ptd"]),
51 Jet_pt = cms.string(
"pt*jecFactor('Uncorrected')"),
52 Jet_mt = cms.string(
"mt*jecFactor('Uncorrected')"),
53 Jet_eta = cms.string(
"eta"),
54 Jet_mass = cms.string(
"mass*jecFactor('Uncorrected')"),
55 Jet_ptd = cms.string(
"userFloat('ptD')"),
56 Jet_leadTrackPt = cms.string(
"userFloat('leadTrackPt')"),
57 Jet_vtxNtrk = cms.string(
"userInt('vtxNtrk')"),
58 Jet_vtxMass = cms.string(
"userFloat('vtxMass')"),
59 Jet_vtx3dL = cms.string(
"userFloat('vtx3dL')"),
60 Jet_vtx3deL = cms.string(
"userFloat('vtx3deL')"),
61 Jet_vtxPt = cms.string(
"userFloat('vtxPt')"),
63 Jet_leptonPtRel = cms.string(
"userFloat('leptonPtRelv0')"),
64 Jet_leptonPtRelInv = cms.string(
"userFloat('leptonPtRelInvv0')*jecFactor('Uncorrected')"),
65 Jet_leptonDeltaR = cms.string(
"userFloat('leptonDeltaR')"),
67 Jet_neHEF = cms.string(
"neutralHadronEnergyFraction()"),
68 Jet_neEmEF = cms.string(
"neutralEmEnergyFraction()"),
69 Jet_chHEF = cms.string(
"chargedHadronEnergyFraction()"),
70 Jet_chEmEF = cms.string(
"chargedEmEnergyFraction()"),
71 isMu = cms.string(
"?abs(userInt('leptonPdgId'))==13?1:0"),
72 isEle = cms.string(
"?abs(userInt('leptonPdgId'))==11?1:0"),
73 isOther = cms.string(
"?userInt('leptonPdgId')==0?1:0"),
75 inputTensorName = cms.string(
"ffwd_inp"),
76 outputTensorName = cms.string(
"ffwd_out/BiasAdd"),
77 outputNames = cms.vstring([
"corr",
"res"]),
78 outputFormulas = cms.vstring([
"at(0)*0.28492164611816406+1.0596693754196167",
"0.5*(at(2)-at(1))*0.28492164611816406"]),
79 nThreads = cms.uint32(1),
80 singleThreadPool = cms.string(
"no_threads"),
83 slimmedJetsWithUserDataWithReg = cms.EDProducer(
"PATJetUserDataEmbedder",
84 src = cms.InputTag(
"slimmedJetsWithUserData"),
85 userFloats = cms.PSet(
86 bJetRegCorr = cms.InputTag(
"bjetNN:corr"),
87 bJetRegRes = cms.InputTag(
"bjetNN:res"),
91 BJetRegression = cms.Task()
92 BJetRegression.add(bJetVars)
93 BJetRegression.add(slimmedJetsWithUserData)
94 BJetRegression.add(bjetNN)
95 BJetRegression.add(slimmedJetsWithUserDataWithReg)