1 import FWCore.ParameterSet.Config
as cms
9 jetCorrFactorsAK8 = patJetCorrFactors.clone(src=
'slimmedJetsAK8',
10 levels = cms.vstring(
'L1FastJet',
14 payload = cms.string(
'AK8PFPuppi'),
15 primaryVertices = cms.InputTag(
"offlineSlimmedPrimaryVertices"),
17 run2_miniAOD_80XLegacy.toModify(jetCorrFactorsAK8, payload = cms.string(
'AK8PFchs'))
20 updatedJetsAK8 = updatedPatJets.clone(
22 jetSource=
'slimmedJetsAK8',
23 jetCorrFactorsSource=cms.VInputTag(cms.InputTag(
"jetCorrFactorsAK8") ),
29 looseJetIdAK8 = cms.EDProducer(
"PatJetIDValueMapProducer",
30 filterParams=cms.PSet(
31 version = cms.string(
'WINTER16'),
32 quality = cms.string(
'LOOSE'),
34 src = cms.InputTag(
"updatedJetsAK8")
36 tightJetIdAK8 = cms.EDProducer(
"PatJetIDValueMapProducer",
37 filterParams=cms.PSet(
38 version = cms.string(
'RUN2ULPUPPI'),
39 quality = cms.string(
'TIGHT'),
41 src = cms.InputTag(
"updatedJetsAK8")
43 tightJetIdLepVetoAK8 = cms.EDProducer(
"PatJetIDValueMapProducer",
44 filterParams=cms.PSet(
45 version = cms.string(
'RUN2ULPUPPI'),
46 quality = cms.string(
'TIGHTLEPVETO'),
48 src = cms.InputTag(
"updatedJetsAK8")
51 run2_jme_2016.toModify( tightJetIdAK8.filterParams, version =
"RUN2UL16PUPPI" )
52 run2_jme_2016.toModify( tightJetIdLepVetoAK8.filterParams, version =
"RUN2UL16PUPPI" )
53 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
54 modifier.toModify( tightJetIdAK8.filterParams, version =
"WINTER16" )
55 modifier.toModify( tightJetIdLepVetoAK8.filterParams, version =
"WINTER16" )
56 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
57 modifier.toModify( tightJetIdAK8.filterParams, version =
"WINTER17PUPPI" )
58 modifier.toModify( tightJetIdLepVetoAK8.filterParams, version =
"WINTER17PUPPI" )
59 run2_nanoAOD_102Xv1.toModify( tightJetIdAK8.filterParams, version =
"SUMMER18PUPPI" )
60 run2_nanoAOD_102Xv1.toModify( tightJetIdLepVetoAK8.filterParams, version =
"SUMMER18PUPPI" )
62 updatedJetsAK8WithUserData = cms.EDProducer(
"PATJetUserDataEmbedder",
63 src = cms.InputTag(
"updatedJetsAK8"),
64 userFloats = cms.PSet(),
66 tightId = cms.InputTag(
"tightJetIdAK8"),
67 tightIdLepVeto = cms.InputTag(
"tightJetIdLepVetoAK8"),
70 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
71 modifier.toModify(updatedJetsAK8WithUserData.userInts,
72 looseId = cms.InputTag(
"looseJetIdAK8"),
76 finalJetsAK8 = cms.EDFilter(
"PATJetRefSelector",
77 src = cms.InputTag(
"updatedJetsAK8WithUserData"),
78 cut = cms.string(
"pt > 170")
82 lepInAK8JetVars = cms.EDProducer(
"LepInJetProducer",
83 src = cms.InputTag(
"updatedJetsAK8WithUserData"),
84 srcEle = cms.InputTag(
"finalElectrons"),
85 srcMu = cms.InputTag(
"finalMuons")
88 fatJetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
89 src = cms.InputTag(
"finalJetsAK8"),
90 cut = cms.string(
" pt > 170"),
91 name = cms.string(
"FatJet"),
92 doc = cms.string(
"slimmedJetsAK8, i.e. ak8 fat jets for boosted analysis"),
93 singleton = cms.bool(
False),
94 extension = cms.bool(
False),
95 variables = cms.PSet(P4Vars,
96 jetId =
Var(
"userInt('tightId')*2+4*userInt('tightIdLepVeto')",int,doc=
"Jet ID flags bit1 is loose (always false in 2017 since it does not exist), bit2 is tight, bit3 is tightLepVeto"),
97 area =
Var(
"jetArea()", float, doc=
"jet catchment area, for JECs",precision=10),
98 rawFactor =
Var(
"1.-jecFactor('Uncorrected')",float,doc=
"1 - Factor to get back to raw pT",precision=6),
99 tau1 =
Var(
"userFloat('NjettinessAK8Puppi:tau1')",float, doc=
"Nsubjettiness (1 axis)",precision=10),
100 tau2 =
Var(
"userFloat('NjettinessAK8Puppi:tau2')",float, doc=
"Nsubjettiness (2 axis)",precision=10),
101 tau3 =
Var(
"userFloat('NjettinessAK8Puppi:tau3')",float, doc=
"Nsubjettiness (3 axis)",precision=10),
102 tau4 =
Var(
"userFloat('NjettinessAK8Puppi:tau4')",float, doc=
"Nsubjettiness (4 axis)",precision=10),
103 n2b1 =
Var(
"?hasUserFloat('nb1AK8PuppiSoftDrop:ecfN2')?userFloat('nb1AK8PuppiSoftDrop:ecfN2'):-99999.", float, doc=
"N2 with beta=1 (for jets with raw pT>250 GeV)", precision=10),
104 n3b1 =
Var(
"?hasUserFloat('nb1AK8PuppiSoftDrop:ecfN3')?userFloat('nb1AK8PuppiSoftDrop:ecfN3'):-99999.", float, doc=
"N3 with beta=1 (for jets with raw pT>250 GeV)", precision=10),
105 msoftdrop =
Var(
"groomedMass('SoftDropPuppi')",float, doc=
"Corrected soft drop mass with PUPPI",precision=10),
106 btagDeepB =
Var(
"?(bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb'))>=0?bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb'):-1",float,doc=
"DeepCSV b+bb tag discriminator",precision=10),
107 btagCSVV2 =
Var(
"bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=
" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10),
108 btagHbb =
Var(
"bDiscriminator('pfBoostedDoubleSecondaryVertexAK8BJetTags')",float,doc=
"Higgs to BB tagger discriminator",precision=10),
109 btagDDBvLV2 =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleBvLV2JetTags:probHbb')",float,doc=
"DeepDoubleX V2(mass-decorrelated) discriminator for H(Z)->bb vs QCD",precision=10),
110 btagDDCvLV2 =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleCvLV2JetTags:probHcc')",float,doc=
"DeepDoubleX V2 (mass-decorrelated) discriminator for H(Z)->cc vs QCD",precision=10),
111 btagDDCvBV2 =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleCvBV2JetTags:probHcc')",float,doc=
"DeepDoubleX V2 (mass-decorrelated) discriminator for H(Z)->cc vs H(Z)->bb",precision=10),
112 deepTag_TvsQCD =
Var(
"bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:TvsQCD')",float,doc=
"DeepBoostedJet tagger top vs QCD discriminator",precision=10),
113 deepTag_WvsQCD =
Var(
"bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:WvsQCD')",float,doc=
"DeepBoostedJet tagger W vs QCD discriminator",precision=10),
114 deepTag_ZvsQCD =
Var(
"bDiscriminator('pfDeepBoostedDiscriminatorsJetTags:ZvsQCD')",float,doc=
"DeepBoostedJet tagger Z vs QCD discriminator",precision=10),
115 deepTag_H =
Var(
"bDiscriminator('pfDeepBoostedJetTags:probHbb')+bDiscriminator('pfDeepBoostedJetTags:probHcc')+bDiscriminator('pfDeepBoostedJetTags:probHqqqq')",float,doc=
"DeepBoostedJet tagger H(bb,cc,4q) sum",precision=10),
116 deepTag_QCD =
Var(
"bDiscriminator('pfDeepBoostedJetTags:probQCDbb')+bDiscriminator('pfDeepBoostedJetTags:probQCDcc')+bDiscriminator('pfDeepBoostedJetTags:probQCDb')+bDiscriminator('pfDeepBoostedJetTags:probQCDc')+bDiscriminator('pfDeepBoostedJetTags:probQCDothers')",float,doc=
"DeepBoostedJet tagger QCD(bb,cc,b,c,others) sum",precision=10),
117 deepTag_QCDothers =
Var(
"bDiscriminator('pfDeepBoostedJetTags:probQCDothers')",float,doc=
"DeepBoostedJet tagger QCDothers value",precision=10),
118 deepTagMD_TvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:TvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger top vs QCD discriminator",precision=10),
119 deepTagMD_WvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:WvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger W vs QCD discriminator",precision=10),
120 deepTagMD_ZvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z vs QCD discriminator",precision=10),
121 deepTagMD_ZHbbvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZHbbvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z/H->bb vs QCD discriminator",precision=10),
122 deepTagMD_ZbbvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZbbvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z->bb vs QCD discriminator",precision=10),
123 deepTagMD_HbbvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:HbbvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger H->bb vs QCD discriminator",precision=10),
124 deepTagMD_ZHccvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ZHccvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z/H->cc vs QCD discriminator",precision=10),
125 deepTagMD_H4qvsQCD =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:H4qvsQCD')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger H->4q vs QCD discriminator",precision=10),
126 deepTagMD_bbvsLight =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:bbvsLight')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z/H/gluon->bb vs light flavour discriminator",precision=10),
127 deepTagMD_ccvsLight =
Var(
"bDiscriminator('pfMassDecorrelatedDeepBoostedDiscriminatorsJetTags:ccvsLight')",float,doc=
"Mass-decorrelated DeepBoostedJet tagger Z/H/gluon->cc vs light flavour discriminator",precision=10),
128 particleNet_TvsQCD =
Var(
"bDiscriminator('pfParticleNetDiscriminatorsJetTags:TvsQCD')",float,doc=
"ParticleNet tagger top vs QCD discriminator",precision=10),
129 particleNet_WvsQCD =
Var(
"bDiscriminator('pfParticleNetDiscriminatorsJetTags:WvsQCD')",float,doc=
"ParticleNet tagger W vs QCD discriminator",precision=10),
130 particleNet_ZvsQCD =
Var(
"bDiscriminator('pfParticleNetDiscriminatorsJetTags:ZvsQCD')",float,doc=
"ParticleNet tagger Z vs QCD discriminator",precision=10),
131 particleNet_HbbvsQCD =
Var(
"bDiscriminator('pfParticleNetDiscriminatorsJetTags:HbbvsQCD')",float,doc=
"ParticleNet tagger H(->bb) vs QCD discriminator",precision=10),
132 particleNet_HccvsQCD =
Var(
"bDiscriminator('pfParticleNetDiscriminatorsJetTags:HccvsQCD')",float,doc=
"ParticleNet tagger H(->cc) vs QCD discriminator",precision=10),
133 particleNet_H4qvsQCD =
Var(
"bDiscriminator('pfParticleNetDiscriminatorsJetTags:H4qvsQCD')",float,doc=
"ParticleNet tagger H(->VV->qqqq) vs QCD discriminator",precision=10),
134 particleNet_QCD =
Var(
"bDiscriminator('pfParticleNetJetTags:probQCDbb')+bDiscriminator('pfParticleNetJetTags:probQCDcc')+bDiscriminator('pfParticleNetJetTags:probQCDb')+bDiscriminator('pfParticleNetJetTags:probQCDc')+bDiscriminator('pfParticleNetJetTags:probQCDothers')",float,doc=
"ParticleNet tagger QCD(bb,cc,b,c,others) sum",precision=10),
135 particleNet_mass =
Var(
"bDiscriminator('pfParticleNetMassRegressionJetTags:mass')",float,doc=
"ParticleNet mass regression",precision=10),
136 particleNetMD_Xbb =
Var(
"bDiscriminator('pfMassDecorrelatedParticleNetJetTags:probXbb')",float,doc=
"Mass-decorrelated ParticleNet tagger raw X->bb score. For X->bb vs QCD tagging, use Xbb/(Xbb+QCD)",precision=10),
137 particleNetMD_Xcc =
Var(
"bDiscriminator('pfMassDecorrelatedParticleNetJetTags:probXcc')",float,doc=
"Mass-decorrelated ParticleNet tagger raw X->cc score. For X->cc vs QCD tagging, use Xcc/(Xcc+QCD)",precision=10),
138 particleNetMD_Xqq =
Var(
"bDiscriminator('pfMassDecorrelatedParticleNetJetTags:probXqq')",float,doc=
"Mass-decorrelated ParticleNet tagger raw X->qq (uds) score. For X->qq vs QCD tagging, use Xqq/(Xqq+QCD). For W vs QCD tagging, use (Xcc+Xqq)/(Xcc+Xqq+QCD)",precision=10),
139 particleNetMD_QCD =
Var(
"bDiscriminator('pfMassDecorrelatedParticleNetJetTags:probQCDbb')+bDiscriminator('pfMassDecorrelatedParticleNetJetTags:probQCDcc')+bDiscriminator('pfMassDecorrelatedParticleNetJetTags:probQCDb')+bDiscriminator('pfMassDecorrelatedParticleNetJetTags:probQCDc')+bDiscriminator('pfMassDecorrelatedParticleNetJetTags:probQCDothers')",float,doc=
"Mass-decorrelated ParticleNet tagger raw QCD score",precision=10),
140 subJetIdx1 =
Var(
"?nSubjetCollections()>0 && subjets('SoftDropPuppi').size()>0?subjets('SoftDropPuppi')[0].key():-1", int,
141 doc=
"index of first subjet"),
142 subJetIdx2 =
Var(
"?nSubjetCollections()>0 && subjets('SoftDropPuppi').size()>1?subjets('SoftDropPuppi')[1].key():-1", int,
143 doc=
"index of second subjet"),
144 nConstituents =
Var(
"numberOfDaughters()",
"uint8",doc=
"Number of particles in the jet"),
146 externalVariables = cms.PSet(
147 lsf3 =
ExtVar(cms.InputTag(
"lepInAK8JetVars:lsf3"),float, doc=
"Lepton Subjet Fraction (3 subjets)",precision=10),
148 muonIdx3SJ =
ExtVar(cms.InputTag(
"lepInAK8JetVars:muIdx3SJ"),int, doc=
"index of muon matched to jet"),
149 electronIdx3SJ =
ExtVar(cms.InputTag(
"lepInAK8JetVars:eleIdx3SJ"),int,doc=
"index of electron matched to jet"),
154 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1:
155 modifier.toModify( fatJetTable.variables.n2b1, expr = cms.string(
"userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN2')"),)
156 modifier.toModify( fatJetTable.variables.n3b1, expr = cms.string(
"userFloat('ak8PFJetsPuppiSoftDropValueMap:nb1AK8PuppiSoftDropN3')"),)
158 modifier.toModify( fatJetTable.variables,
159 btagCMVA =
Var(
"bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc=
"CMVA V2 btag discriminator",precision=10),
160 btagDDBvL_noMD =
Var(
"bDiscriminator('pfDeepDoubleBvLJetTags:probHbb')",float,doc=
"DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->bb vs QCD",precision=10),
161 btagDDCvL_noMD =
Var(
"bDiscriminator('pfDeepDoubleCvLJetTags:probHcc')",float,doc=
"DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs QCD",precision=10),
162 btagDDCvB_noMD =
Var(
"bDiscriminator('pfDeepDoubleCvBJetTags:probHcc')",float,doc=
"DeepDoubleX discriminator (no mass-decorrelation) for H(Z)->cc vs H(Z)->bb",precision=10),
163 btagDDBvL =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleBvLJetTags:probHbb')",float,doc=
"DeepDoubleX (mass-decorrelated) discriminator for H(Z)->bb vs QCD",precision=10),
164 btagDDCvL =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleCvLJetTags:probHcc')",float,doc=
"DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs QCD",precision=10),
165 btagDDCvB =
Var(
"bDiscriminator('pfMassIndependentDeepDoubleCvBJetTags:probHcc')",float,doc=
"DeepDoubleX (mass-decorrelated) discriminator for H(Z)->cc vs H(Z)->bb",precision=10),
167 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, msoftdrop_chs =
Var(
"userFloat('ak8PFJetsCHSSoftDropMass')",float, doc=
"Legacy uncorrected soft drop mass with CHS",precision=10))
168 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau1, expr = cms.string(
"userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau1\')"),)
169 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau2, expr = cms.string(
"userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau2\')"),)
170 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables.tau3, expr = cms.string(
"userFloat(\'ak8PFJetsPuppiValueMap:NjettinessAK8PuppiTau3\')"),)
171 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, tau4 =
None)
172 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, n2b1 =
None)
173 run2_miniAOD_80XLegacy.toModify( fatJetTable.variables, n3b1 =
None)
174 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
175 modifier.toModify( fatJetTable.variables, jetId =
Var(
"userInt('tightId')*2+userInt('looseId')",int,doc=
"Jet ID flags bit1 is loose, bit2 is tight"))
182 def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload):
183 _btagDiscriminators=[]
185 print(
"Updating process to run DeepCSV btag to AK8 jets")
186 _btagDiscriminators += [
'pfDeepCSVJetTags:probb',
'pfDeepCSVJetTags:probbb']
187 if addDeepBoostedJet:
188 print(
"Updating process to run DeepBoostedJet on datasets before 103X")
190 _btagDiscriminators += pfDeepBoostedJetTagsAll
192 print(
"Updating process to run ParticleNet before it's included in MiniAOD")
194 _btagDiscriminators += pfParticleNetJetTagsAll
195 if addParticleNetMass:
197 _btagDiscriminators += _pfParticleNetMassRegressionOutputs
199 print(
"Updating process to run DeepDoubleX on datasets before 104X")
200 _btagDiscriminators += [
'pfDeepDoubleBvLJetTags:probHbb', \
201 'pfDeepDoubleCvLJetTags:probHcc', \
202 'pfDeepDoubleCvBJetTags:probHcc', \
203 'pfMassIndependentDeepDoubleBvLJetTags:probHbb',
'pfMassIndependentDeepDoubleCvLJetTags:probHcc',
'pfMassIndependentDeepDoubleCvBJetTags:probHcc']
205 print(
"Updating process to run DeepDoubleXv2 on datasets before 11X")
206 _btagDiscriminators += [
207 'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb',
208 'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc',
209 'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc' 211 if len(_btagDiscriminators)==0:
return process
212 print(
"Will recalculate the following discriminators on AK8 jets: "+
", ".
join(_btagDiscriminators))
215 jetSource = cms.InputTag(
'slimmedJetsAK8'),
216 pvSource = cms.InputTag(
'offlineSlimmedPrimaryVertices'),
217 svSource = cms.InputTag(
'slimmedSecondaryVertices'),
219 jetCorrections = (jecPayload.value(), cms.vstring([
'L1FastJet',
'L2Relative',
'L3Absolute',
'L2L3Residual']),
'None'),
220 btagDiscriminators = _btagDiscriminators,
221 postfix=
'AK8WithDeepInfo',
224 process.jetCorrFactorsAK8.src=
"selectedUpdatedPatJetsAK8WithDeepInfo" 225 process.updatedJetsAK8.jetSource=
"selectedUpdatedPatJetsAK8WithDeepInfo" 228 nanoAOD_addDeepInfoAK8_switch = cms.PSet(
229 nanoAOD_addDeepBTag_switch = cms.untracked.bool(
False),
230 nanoAOD_addDeepBoostedJet_switch = cms.untracked.bool(
False),
231 nanoAOD_addDeepDoubleX_switch = cms.untracked.bool(
False),
232 nanoAOD_addDeepDoubleXV2_switch = cms.untracked.bool(
False),
233 nanoAOD_addParticleNet_switch = cms.untracked.bool(
False),
234 nanoAOD_addParticleNetMass_switch = cms.untracked.bool(
False),
235 jecPayload = cms.untracked.string(
'AK8PFPuppi')
238 run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfoAK8_switch,
239 nanoAOD_addDeepBTag_switch =
True,
240 jecPayload =
'AK8PFchs' 243 (run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1).toModify(
244 nanoAOD_addDeepInfoAK8_switch,
245 nanoAOD_addDeepBoostedJet_switch =
True,
246 nanoAOD_addDeepDoubleX_switch =
True,
247 nanoAOD_addDeepDoubleXV2_switch =
True,
248 nanoAOD_addParticleNet_switch =
True,
249 nanoAOD_addParticleNetMass_switch =
True,
252 run2_nanoAOD_106Xv1.toModify(
253 nanoAOD_addDeepInfoAK8_switch,
254 nanoAOD_addDeepDoubleXV2_switch =
True,
255 nanoAOD_addParticleNet_switch =
True,
256 nanoAOD_addParticleNetMass_switch =
True,
259 run2_nanoAOD_106Xv2.toModify(
260 nanoAOD_addDeepInfoAK8_switch,
261 nanoAOD_addParticleNetMass_switch =
True,
267 subJetTable = cms.EDProducer(
"SimpleCandidateFlatTableProducer",
268 src = cms.InputTag(
"slimmedJetsAK8PFPuppiSoftDropPacked",
"SubJets"),
269 cut = cms.string(
""),
270 name = cms.string(
"SubJet"),
271 doc = cms.string(
"slimmedJetsAK8, i.e. ak8 fat jets for boosted analysis"),
272 singleton = cms.bool(
False),
273 extension = cms.bool(
False),
274 variables = cms.PSet(P4Vars,
275 btagDeepB =
Var(
"bDiscriminator('pfDeepCSVJetTags:probb')+bDiscriminator('pfDeepCSVJetTags:probbb')",float,doc=
"DeepCSV b+bb tag discriminator",precision=10),
276 btagCSVV2 =
Var(
"bDiscriminator('pfCombinedInclusiveSecondaryVertexV2BJetTags')",float,doc=
" pfCombinedInclusiveSecondaryVertexV2 b-tag discriminator (aka CSVV2)",precision=10),
277 rawFactor =
Var(
"1.-jecFactor('Uncorrected')",float,doc=
"1 - Factor to get back to raw pT",precision=6),
278 tau1 =
Var(
"userFloat('NjettinessAK8Subjets:tau1')",float, doc=
"Nsubjettiness (1 axis)",precision=10),
279 tau2 =
Var(
"userFloat('NjettinessAK8Subjets:tau2')",float, doc=
"Nsubjettiness (2 axis)",precision=10),
280 tau3 =
Var(
"userFloat('NjettinessAK8Subjets:tau3')",float, doc=
"Nsubjettiness (3 axis)",precision=10),
281 tau4 =
Var(
"userFloat('NjettinessAK8Subjets:tau4')",float, doc=
"Nsubjettiness (4 axis)",precision=10),
282 n2b1 =
Var(
"userFloat('nb1AK8PuppiSoftDropSubjets:ecfN2')", float, doc=
"N2 with beta=1", precision=10),
283 n3b1 =
Var(
"userFloat('nb1AK8PuppiSoftDropSubjets:ecfN3')", float, doc=
"N3 with beta=1", precision=10),
288 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1, run2_nanoAOD_106Xv1:
290 modifier.toModify(subJetTable.variables,
291 btagCMVA =
Var(
"bDiscriminator('pfCombinedMVAV2BJetTags')",float,doc=
"CMVA V2 btag discriminator",precision=10),
295 fatJetTable.variables.pt.precision=10
296 subJetTable.variables.pt.precision=10
298 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, tau1 =
None)
299 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, tau2 =
None)
300 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, tau3 =
None)
301 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, tau4 =
None)
302 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, n2b1 =
None)
303 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, n3b1 =
None)
304 run2_miniAOD_80XLegacy.toModify( subJetTable.variables, btagCMVA =
None, btagDeepB =
None)
306 jetAK8UserDataTask = cms.Task(tightJetIdAK8,tightJetIdLepVetoAK8)
307 _jetAK8UserDataTask2016 = jetAK8UserDataTask.copy()
308 _jetAK8UserDataTask2016.add(looseJetIdAK8)
309 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
310 modifier.toReplaceWith(jetAK8UserDataTask,_jetAK8UserDataTask2016)
312 jetAK8Task = cms.Task(jetCorrFactorsAK8,updatedJetsAK8,jetAK8UserDataTask,updatedJetsAK8WithUserData,finalJetsAK8)
315 jetAK8LepTask = cms.Task(lepInAK8JetVars)
317 jetAK8TablesTask = cms.Task(fatJetTable,subJetTable)
def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
static std::string join(char **cmd)