1 from __future__
import print_function
2 import FWCore.ParameterSet.Config
as cms
26 nanoMetadata = cms.EDProducer(
"UniqueStringProducer",
28 tag = cms.string(
"untagged"),
32 linkedObjects = cms.EDProducer(
"PATObjectCrossLinker",
33 jets=cms.InputTag(
"finalJets"),
34 muons=cms.InputTag(
"finalMuons"),
35 electrons=cms.InputTag(
"finalElectrons"),
36 taus=cms.InputTag(
"finalTaus"),
37 photons=cms.InputTag(
"finalPhotons"),
40 simpleCleanerTable = cms.EDProducer(
"NanoAODSimpleCrossCleaner",
41 name=cms.string(
"cleanmask"),
42 doc=cms.string(
"simple cleaning mask with priority to leptons"),
43 jets=cms.InputTag(
"linkedObjects",
"jets"),
44 muons=cms.InputTag(
"linkedObjects",
"muons"),
45 electrons=cms.InputTag(
"linkedObjects",
"electrons"),
46 taus=cms.InputTag(
"linkedObjects",
"taus"),
47 photons=cms.InputTag(
"linkedObjects",
"photons"),
48 jetSel=cms.string(
"pt>15"),
49 muonSel=cms.string(
"track.isNonnull && isLooseMuon && isPFMuon && innerTrack.validFraction >= 0.49 && ( isGlobalMuon && globalTrack.normalizedChi2 < 3 && combinedQuality.chi2LocalPosition < 12 && combinedQuality.trkKink < 20 && segmentCompatibility >= 0.303 || segmentCompatibility >= 0.451 )"),
50 electronSel=cms.string(
""),
51 tauSel=cms.string(
""),
52 photonSel=cms.string(
""),
53 jetName=cms.string(
"Jet"),muonName=cms.string(
"Muon"),electronName=cms.string(
"Electron"),
54 tauName=cms.string(
"Tau"),photonName=cms.string(
"Photon")
57 btagSFdir=
"PhysicsTools/NanoAOD/data/btagSF/" 59 btagWeightTable = cms.EDProducer(
"BTagSFProducer",
60 src = cms.InputTag(
"linkedObjects",
"jets"),
61 cut = cms.string(
"pt > 25. && abs(eta) < 2.5"),
62 discNames = cms.vstring(
63 "pfCombinedInclusiveSecondaryVertexV2BJetTags",
64 "pfDeepCSVJetTags:probb+pfDeepCSVJetTags:probbb",
65 "pfCombinedMVAV2BJetTags" 67 discShortNames = cms.vstring(
72 weightFiles = cms.vstring(
73 btagSFdir+
"CSVv2_94XSF_V2_B_F.csv",
74 btagSFdir+
"DeepCSV_94XSF_V2_B_F.csv",
77 operatingPoints = cms.vstring(
"3",
"3",
"3"),
78 measurementTypesB = cms.vstring(
"iterativefit",
"iterativefit",
"iterativefit"),
79 measurementTypesC = cms.vstring(
"iterativefit",
"iterativefit",
"iterativefit"),
80 measurementTypesUDSG = cms.vstring(
"iterativefit",
"iterativefit",
"iterativefit"),
81 sysTypes = cms.vstring(
"central",
"central",
"central")
84 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
85 modifier.toModify(btagWeightTable,
86 cut = cms.string(
"pt > 25. && abs(eta) < 2.4"),
87 weightFiles = cms.vstring(
88 btagSFdir+
"CSVv2_Moriond17_B_H.csv",
90 btagSFdir+
"cMVAv2_Moriond17_B_H.csv" 95 lhcInfoTable = cms.EDProducer(
"LHCInfoProducer",
96 precision = cms.int32(10),
100 lheInfoTable = cms.EDProducer(
"LHETablesProducer",
101 lheInfo = cms.VInputTag(cms.InputTag(
"externalLHEProducer"), cms.InputTag(
"source")),
102 precision = cms.int32(14),
103 storeLHEParticles = cms.bool(
True)
106 l1bits=cms.EDProducer(
"L1TriggerResultsConverter", src=cms.InputTag(
"gtStage2Digis"), legacyL1=cms.bool(
False),
107 storeUnprefireableBit=cms.bool(
True), src_ext=cms.InputTag(
"gtStage2Digis"))
108 (run2_miniAOD_80XLegacy | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1).toModify(l1bits, storeUnprefireableBit=
False)
110 nanoSequenceCommon = cms.Sequence(
111 nanoMetadata + jetSequence + muonSequence + tauSequence + boostedTauSequence + electronSequence + lowPtElectronSequence + photonSequence+vertexSequence+
112 isoTrackSequence + jetLepSequence +
114 jetTables + muonTables + tauTables + boostedTauTables + electronTables + lowPtElectronTables + photonTables + globalTables +vertexTables+ metTables+simpleCleanerTable + isoTrackTables
117 (run2_miniAOD_80XLegacy | run2_nanoAOD_92X | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toReplaceWith(nanoSequenceCommon, nanoSequenceCommon.copyAndExclude([boostedTauSequence, boostedTauTables]))
119 nanoSequenceOnlyFullSim = cms.Sequence(triggerObjectTables + l1bits)
121 nanoSequenceOnlyData = cms.Sequence(protonTables + lhcInfoTable)
123 nanoSequence = cms.Sequence(nanoSequenceCommon + nanoSequenceOnlyData + nanoSequenceOnlyFullSim)
125 ( run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toReplaceWith(nanoSequence, nanoSequence.copyAndExclude([nanoSequenceOnlyData]))
127 nanoSequenceFS = cms.Sequence(genParticleSequence + genVertexTables + particleLevelSequence + nanoSequenceCommon + jetMC + muonMC + electronMC + lowPtElectronMC + photonMC + tauMC + boostedTauMC + metMC + ttbarCatMCProducers + globalTablesMC + btagWeightTable + genWeightsTable + genVertexTable + genParticleTables + particleLevelTables + lheInfoTable + ttbarCategoryTable )
129 (run2_nanoAOD_92X | run2_miniAOD_80XLegacy | run2_nanoAOD_94X2016 | run2_nanoAOD_94X2016 | \
130 run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | \
131 run2_nanoAOD_102Xv1 ).toReplaceWith(nanoSequenceFS, nanoSequenceFS.copyAndExclude([genVertexTable, genVertexT0Table]))
134 (run2_miniAOD_80XLegacy | run2_nanoAOD_92X | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toReplaceWith(nanoSequenceFS, nanoSequenceFS.copyAndExclude([boostedTauMC]))
137 nanoSequenceMC = nanoSequenceFS.copy()
138 nanoSequenceMC.insert(nanoSequenceFS.index(nanoSequenceCommon)+1,nanoSequenceOnlyFullSim)
141 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1:
142 modifier.toModify(extraFlagsTable, variables= cms.PSet())
143 modifier.toModify(extraFlagsTable, variables =
dict(Flag_ecalBadCalibFilterV2 =
ExtVar(cms.InputTag(
"ecalBadCalibFilterNanoTagger"), bool, doc =
"Bad ECAL calib flag (updated xtal list)")))
146 import RecoTauTag.RecoTau.tools.runTauIdMVA
as tauIdConfig
148 updatedTauName =
"slimmedTausUpdated" 149 tauIdEmbedder = tauIdConfig.TauIDEmbedder(process, cms, debug =
False, updatedTauName = updatedTauName,
150 toKeep = [
"deepTau2017v2p1" ])
151 tauIdEmbedder.runTauID()
152 process.patTauMVAIDsSeq.insert(process.patTauMVAIDsSeq.index(getattr(process, updatedTauName)),
153 process.rerunMvaIsolationSequence)
157 updatedBoostedTauName =
"slimmedTausBoostedNewID" 158 boostedTauIdEmbedder = tauIdConfig.TauIDEmbedder(process, cms, debug=
False,
159 originalTauName =
"slimmedTausBoosted",
160 updatedTauName = updatedBoostedTauName,
162 toKeep = [
"2017v2",
"dR0p32017v2",
"newDM2017v2",
"againstEle2018",])
163 boostedTauIdEmbedder.runTauID()
164 process.boostedTauSequence.insert(process.boostedTauSequence.index(process.finalBoostedTaus),
165 process.rerunMvaIsolationSequenceBoosted)
167 process.boostedTauSequence.insert(process.boostedTauSequence.index(process.finalBoostedTaus),
168 getattr(process, updatedBoostedTauName))
175 _btagDiscriminators=[]
177 print(
"Updating process to run DeepCSV btag")
178 _btagDiscriminators += [
'pfDeepCSVJetTags:probb',
'pfDeepCSVJetTags:probbb',
'pfDeepCSVJetTags:probc']
180 print(
"Updating process to run DeepFlavour btag")
181 _btagDiscriminators += [
'pfDeepFlavourJetTags:probb',
'pfDeepFlavourJetTags:probbb',
'pfDeepFlavourJetTags:problepb',
'pfDeepFlavourJetTags:probc']
182 if len(_btagDiscriminators)==0:
return process
183 print(
"Will recalculate the following discriminators: "+
", ".
join(_btagDiscriminators))
186 jetSource = cms.InputTag(
'slimmedJets'),
187 jetCorrections = (
'AK4PFchs', cms.vstring([
'L1FastJet',
'L2Relative',
'L3Absolute',
'L2L3Residual']),
'None'),
188 btagDiscriminators = _btagDiscriminators,
189 postfix =
'WithDeepInfo',
191 process.load(
"Configuration.StandardSequences.MagneticField_cff")
192 process.jetCorrFactorsNano.src=
"selectedUpdatedPatJetsWithDeepInfo" 193 process.updatedJets.jetSource=
"selectedUpdatedPatJetsWithDeepInfo" 197 if addDeepMETProducer:
199 print(
"add DeepMET Producers")
200 process.load(
'RecoMET.METPUSubtraction.deepMETProducer_cfi')
201 process.deepMETsResolutionTune = process.deepMETProducer.clone()
202 process.deepMETsResponseTune = process.deepMETProducer.clone()
204 process.deepMETsResponseTune.graph_path = ResponseTune_Graph.value()
205 process.metTables += process.deepMetTables
208 from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties
import runMetCorAndUncFromMiniAOD
209 from PhysicsTools.PatAlgos.slimming.puppiForMET_cff
import makePuppiesFromMiniAOD
212 nanoAOD_DeepMET_switch = cms.PSet(
213 nanoAOD_addDeepMET_switch = cms.untracked.bool(
True),
214 nanoAOD_produceDeepMET_switch = cms.untracked.bool(
False),
215 ResponseTune_Graph = cms.untracked.string(
'RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2018.pb')
218 (~(run2_nanoAOD_106Xv2 | run2_miniAOD_devel)).toModify(nanoAOD_DeepMET_switch, nanoAOD_produceDeepMET_switch = cms.untracked.bool(
True))
219 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016:
220 modifier.toModify(nanoAOD_DeepMET_switch, ResponseTune_Graph=cms.untracked.string(
"RecoMET/METPUSubtraction/data/deepmet/deepmet_resp_v1_2016.pb"))
221 if nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch:
223 addDeepMETProducer=nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch,
224 ResponseTune_Graph=nanoAOD_DeepMET_switch.ResponseTune_Graph)
227 extractDeepMETs = nanoAOD_DeepMET_switch.nanoAOD_addDeepMET_switch
and not nanoAOD_DeepMET_switch.nanoAOD_produceDeepMET_switch
230 process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.fullPatMetSequence))
231 process.basicJetsForMetForT1METNano = process.basicJetsForMet.clone(
232 src = process.updatedJetsWithUserData.src,
234 type1JetPtThreshold = 0.0,
235 calcMuonSubtrRawPtAsValueMap = cms.bool(
True),
237 process.jetSequence.insert(process.jetSequence.index(process.updatedJetsWithUserData),cms.Sequence(process.basicJetsForMetForT1METNano))
238 process.updatedJetsWithUserData.userFloats.muonSubtrRawPt = cms.InputTag(
"basicJetsForMetForT1METNano:MuonSubtrRawPt")
239 process.corrT1METJetTable.src = process.finalJets.src
240 process.corrT1METJetTable.cut =
"pt<15 && abs(eta)<9.9" 241 for table
in process.jetTable, process.corrT1METJetTable:
242 table.variables.muonSubtrFactor =
Var(
"1-userFloat('muonSubtrRawPt')/(pt()*jecFactor('Uncorrected'))",float,doc=
"1-(muon-subtracted raw pt)/(raw pt)",precision=6)
243 process.metTables += process.corrT1METJetTable
245 nanoAOD_PuppiV15_switch = cms.PSet(
246 recoMetFromPFCs = cms.untracked.bool(
False),
247 reclusterJets = cms.untracked.bool(
False),
249 run2_nanoAOD_106Xv1.toModify(nanoAOD_PuppiV15_switch,recoMetFromPFCs=
True,reclusterJets=
True)
250 if nanoAOD_PuppiV15_switch.reclusterJets:
254 addToProcessAndTask(
'ak4PuppiJets', ak4PFJets.clone (src =
'puppi', doAreaFastjet =
True, jetPtMin = 10.), process, task)
256 addJetCollection(process,
258 jetSource = cms.InputTag(
'ak4PuppiJets'),
259 algo =
'AK', rParam=0.4,
260 genJetCollection=cms.InputTag(
'slimmedGenJets'),
261 jetCorrections = (
'AK4PFPuppi', [
'L1FastJet',
'L2Relative',
'L3Absolute',
'L2L3Residual'],
'None'),
262 pfCandidates = cms.InputTag(
'packedPFCandidates'),
263 pvSource = cms.InputTag(
'offlineSlimmedPrimaryVertices'),
264 svSource = cms.InputTag(
'slimmedSecondaryVertices'),
265 muSource =cms.InputTag(
'slimmedMuons'),
266 elSource = cms.InputTag(
'slimmedElectrons'),
267 genParticles= cms.InputTag(
'prunedGenParticles'),
268 getJetMCFlavour=
False 270 process.patJetsPuppi.addGenPartonMatch = cms.bool(
False)
271 process.patJetsPuppi.addGenJetMatch = cms.bool(
False)
273 runMetCorAndUncFromMiniAOD(process,isData=isData,metType=
"Puppi",postfix=
"Puppi",jetFlavor=
"AK4PFPuppi", recoMetFromPFCs=
bool(nanoAOD_PuppiV15_switch.recoMetFromPFCs), reclusterJets=
bool(nanoAOD_PuppiV15_switch.reclusterJets))
274 process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(process.jetSequence),cms.Sequence(process.puppiMETSequence+process.fullPatMetSequencePuppi))
280 for modname
in electron_id_modules_WorkingPoints_nanoAOD.modules:
282 process.electronSequence.insert(process.electronSequence.index(process.bitmapVIDForEle),process.egmGsfElectronIDSequence)
283 for modifier
in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016,run2_nanoAOD_102Xv1,run2_nanoAOD_106Xv1:
284 modifier.toModify(process.electronMVAValueMapProducer, srcMiniAOD =
"slimmedElectronsUpdated")
285 modifier.toModify(process.egmGsfElectronIDs, physicsObjectSrc =
"slimmedElectronsUpdated")
287 run2_nanoAOD_106Xv2.toModify(process.electronMVAValueMapProducer, src =
"slimmedElectrons")
288 run2_nanoAOD_106Xv2.toModify(process.egmGsfElectronIDs, physicsObjectSrc =
"slimmedElectrons")
290 for modname
in photon_id_modules_WorkingPoints_nanoAOD.modules:
292 process.photonSequence.insert(process.photonSequence.index(bitmapVIDForPho),process.egmPhotonIDSequence)
293 for modifier
in run2_miniAOD_80XLegacy,run2_nanoAOD_94XMiniAODv1,run2_nanoAOD_94XMiniAODv2,run2_nanoAOD_94X2016 ,run2_nanoAOD_102Xv1:
294 modifier.toModify(process.photonMVAValueMapProducer, srcMiniAOD =
"slimmedPhotonsTo106X")
295 modifier.toModify(process.egmPhotonIDs, physicsObjectSrc =
"slimmedPhotonsTo106X")
298 def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload):
299 _btagDiscriminators=[]
301 print(
"Updating process to run DeepCSV btag to AK8 jets")
302 _btagDiscriminators += [
'pfDeepCSVJetTags:probb',
'pfDeepCSVJetTags:probbb']
303 if addDeepBoostedJet:
304 print(
"Updating process to run DeepBoostedJet on datasets before 103X")
306 _btagDiscriminators += pfDeepBoostedJetTagsAll
308 print(
"Updating process to run ParticleNet before it's included in MiniAOD")
310 _btagDiscriminators += pfParticleNetJetTagsAll
311 if addParticleNetMass:
313 _btagDiscriminators += _pfParticleNetMassRegressionOutputs
315 print(
"Updating process to run DeepDoubleX on datasets before 104X")
316 _btagDiscriminators += [
'pfDeepDoubleBvLJetTags:probHbb', \
317 'pfDeepDoubleCvLJetTags:probHcc', \
318 'pfDeepDoubleCvBJetTags:probHcc', \
319 'pfMassIndependentDeepDoubleBvLJetTags:probHbb',
'pfMassIndependentDeepDoubleCvLJetTags:probHcc',
'pfMassIndependentDeepDoubleCvBJetTags:probHcc']
321 print(
"Updating process to run DeepDoubleXv2 on datasets before 11X")
322 _btagDiscriminators += [
323 'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb',
324 'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc',
325 'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc' 327 if len(_btagDiscriminators)==0:
return process
328 print(
"Will recalculate the following discriminators on AK8 jets: "+
", ".
join(_btagDiscriminators))
331 jetSource = cms.InputTag(
'slimmedJetsAK8'),
332 pvSource = cms.InputTag(
'offlineSlimmedPrimaryVertices'),
333 svSource = cms.InputTag(
'slimmedSecondaryVertices'),
335 jetCorrections = (jecPayload.value(), cms.vstring([
'L1FastJet',
'L2Relative',
'L3Absolute',
'L2L3Residual']),
'None'),
336 btagDiscriminators = _btagDiscriminators,
337 postfix=
'AK8WithDeepInfo',
340 process.jetCorrFactorsAK8.src=
"selectedUpdatedPatJetsAK8WithDeepInfo" 341 process.updatedJetsAK8.jetSource=
"selectedUpdatedPatJetsAK8WithDeepInfo" 344 from PhysicsTools.PatUtils.tools.runMETCorrectionsAndUncertainties
import runMetCorAndUncFromMiniAOD
348 fixEE2017Params = {
'userawPt':
True,
'ptThreshold':50.0,
'minEtaThreshold':2.65,
'maxEtaThreshold': 3.139},
349 postfix =
"FixEE2017")
350 process.nanoSequenceCommon.insert(process.nanoSequenceCommon.index(jetSequence),process.fullPatMetSequenceFixEE2017)
354 process.puppiNoLep.useExistingWeights =
True 355 process.puppi.useExistingWeights =
True 356 run2_nanoAOD_106Xv1.toModify(process.puppiNoLep, useExistingWeights =
False)
357 run2_nanoAOD_106Xv1.toModify(process.puppi, useExistingWeights =
False)
359 nanoAOD_addDeepInfo_switch = cms.PSet(
360 nanoAOD_addDeepBTag_switch = cms.untracked.bool(
False),
361 nanoAOD_addDeepFlavourTag_switch = cms.untracked.bool(
False),
363 run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfo_switch, nanoAOD_addDeepBTag_switch = cms.untracked.bool(
True))
364 for modifier
in run2_miniAOD_80XLegacy, run2_nanoAOD_94X2016, run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
365 modifier.toModify(nanoAOD_addDeepInfo_switch, nanoAOD_addDeepFlavourTag_switch = cms.untracked.bool(
True))
367 addDeepBTag=nanoAOD_addDeepInfo_switch.nanoAOD_addDeepBTag_switch,
368 addDeepFlavour=nanoAOD_addDeepInfo_switch.nanoAOD_addDeepFlavourTag_switch)
369 nanoAOD_addDeepInfoAK8_switch = cms.PSet(
370 nanoAOD_addDeepBTag_switch = cms.untracked.bool(
False),
371 nanoAOD_addDeepBoostedJet_switch = cms.untracked.bool(
True),
372 nanoAOD_addDeepDoubleX_switch = cms.untracked.bool(
True),
373 nanoAOD_addDeepDoubleXV2_switch = cms.untracked.bool(
True),
374 nanoAOD_addParticleNet_switch = cms.untracked.bool(
True),
375 nanoAOD_addParticleNetMass_switch = cms.untracked.bool(
True),
376 jecPayload = cms.untracked.string(
'AK8PFPuppi')
380 run2_miniAOD_80XLegacy.toModify(nanoAOD_addDeepInfoAK8_switch,
381 nanoAOD_addDeepBTag_switch =
True,
382 nanoAOD_addDeepBoostedJet_switch =
False,
383 nanoAOD_addDeepDoubleX_switch =
False,
384 nanoAOD_addDeepDoubleXV2_switch =
False,
385 nanoAOD_addParticleNet_switch =
False,
386 nanoAOD_addParticleNetMass_switch =
False,
387 jecPayload =
'AK8PFchs')
389 (run2_miniAOD_devel).toModify(
390 nanoAOD_addDeepInfoAK8_switch,
391 nanoAOD_addParticleNetMass_switch =
False,
393 (run2_nanoAOD_106Xv2 | run2_miniAOD_devel).toModify(
394 nanoAOD_addDeepInfoAK8_switch,
395 nanoAOD_addDeepBoostedJet_switch =
False,
396 nanoAOD_addDeepDoubleX_switch =
False,
397 nanoAOD_addDeepDoubleXV2_switch =
False,
398 nanoAOD_addParticleNet_switch =
False,
400 run2_nanoAOD_106Xv1.toModify(
401 nanoAOD_addDeepInfoAK8_switch,
402 nanoAOD_addDeepBoostedJet_switch =
False,
403 nanoAOD_addDeepDoubleX_switch =
False,
406 (run2_nanoAOD_106Xv1 & ~run2_nanoAOD_devel).toModify(
407 nanoAOD_addDeepInfoAK8_switch,
408 nanoAOD_addParticleNetMass_switch =
False,
411 addDeepBTag=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBTag_switch,
412 addDeepBoostedJet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepBoostedJet_switch,
413 addDeepDoubleX=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleX_switch,
414 addDeepDoubleXV2=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addDeepDoubleXV2_switch,
415 addParticleNet=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNet_switch,
416 addParticleNetMass=nanoAOD_addDeepInfoAK8_switch.nanoAOD_addParticleNetMass_switch,
417 jecPayload=nanoAOD_addDeepInfoAK8_switch.jecPayload)
418 addTauIds_switch = cms.PSet(
419 nanoAOD_addTauIds_switch = cms.untracked.bool(
True),
420 nanoAOD_addBoostedTauIds_switch = cms.untracked.bool(
True)
422 ((run2_nanoAOD_106Xv2 | run2_miniAOD_devel | run2_tau_ul_2016 | run2_tau_ul_2018) & \
423 (~(run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1))).toModify(addTauIds_switch, nanoAOD_addTauIds_switch =
False)
424 (run2_miniAOD_80XLegacy | run2_nanoAOD_92X | run2_nanoAOD_94X2016 | run2_nanoAOD_94XMiniAODv1 | run2_nanoAOD_94XMiniAODv2 | run2_nanoAOD_102Xv1 | run2_nanoAOD_106Xv1).toModify(addTauIds_switch, nanoAOD_addBoostedTauIds_switch =
False)
425 if addTauIds_switch.nanoAOD_addTauIds_switch:
427 if addTauIds_switch.nanoAOD_addBoostedTauIds_switch:
434 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
441 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2:
446 pdgSelection=
"?(abs(pdgId) == 11|| abs(pdgId)==13 || abs(pdgId)==15 ||abs(pdgId)== 12 || abs(pdgId)== 14 || abs(pdgId)== 16|| abs(pdgId)==24|| pdgId== 23)" 448 ptPrecision=
"{}?{}:{}".
format(pdgSelection, CandVars.pt.precision.value(),genParticleTable.variables.pt.precision.value())
449 process.genParticleTable.variables.pt.precision=cms.string(ptPrecision)
450 phiPrecision=
"{} ? {} : {}".
format(pdgSelection, CandVars.phi.precision.value(), genParticleTable.variables.phi.precision.value())
451 process.genParticleTable.variables.phi.precision=cms.string(phiPrecision)
452 etaPrecision=
"{} ? {} : {}".
format(pdgSelection, CandVars.eta.precision.value(), genParticleTable.variables.eta.precision.value())
453 process.genParticleTable.variables.eta.precision=cms.string(etaPrecision)
457 _80x_sequence = nanoSequenceCommon.copy()
459 _80x_sequence.remove(isoTrackTables)
460 _80x_sequence.remove(isoTrackSequence)
462 _80x_sequence.insert(_80x_sequence.index(jetSequence), extraFlagsProducers)
463 _80x_sequence.insert(_80x_sequence.index(simpleCleanerTable)+1, extraFlagsTable)
465 run2_miniAOD_80XLegacy.toReplaceWith( nanoSequenceCommon, _80x_sequence)
467 _102x_sequence = nanoSequenceCommon.copy()
469 _102x_sequence.insert(_102x_sequence.index(jetSequence),extraFlagsProducers102x)
470 _102x_sequence.insert(_102x_sequence.index(simpleCleanerTable)+1,extraFlagsTable)
472 for modifier
in run2_nanoAOD_94XMiniAODv1, run2_nanoAOD_94XMiniAODv2, run2_nanoAOD_102Xv1:
473 modifier.toReplaceWith(nanoSequenceCommon, _102x_sequence)
def nanoAOD_addDeepInfo(process, addDeepBTag, addDeepFlavour)
def addToProcessAndTask(label, module, process, task)
def ExtVar(tag, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
S & print(S &os, JobReport::InputFile const &f)
def nanoAOD_customizeMC(process)
def nanoAOD_activateVID(process)
def Var(expr, valtype, compression=None, doc=None, mcOnly=False, precision=-1)
def nanoWmassGenCustomize(process)
def nanoAOD_customizeCommon(process)
def nanoAOD_recalibrateMETs(process, isData)
def nanoAOD_addDeepInfoAK8(process, addDeepBTag, addDeepBoostedJet, addDeepDoubleX, addDeepDoubleXV2, addParticleNet, addParticleNetMass, jecPayload)
def nanoAOD_runMETfixEE2017(process, isData)
static std::string join(char **cmd)
def nanoAOD_addTauIds(process)
def nanoAOD_addDeepMET(process, addDeepMETProducer, ResponseTune_Graph)
def getPatAlgosToolsTask(process)
def nanoAOD_addBoostedTauIds(process)
def runMetCorAndUncFromMiniAOD(process, metType="PF", jetCollUnskimmed="slimmedJets", photonColl="slimmedPhotons", electronColl="slimmedElectrons", muonColl="slimmedMuons", tauColl="slimmedTaus", pfCandColl="packedPFCandidates", jetFlavor="AK4PFchs", jetCleaning="LepClean", isData=False, manualJetConfig=False, reclusterJets=None, jetSelection="pt>15 && abs(eta)<9.9", recoMetFromPFCs=None, jetCorLabelL3="ak4PFCHSL1FastL2L3Corrector", jetCorLabelRes="ak4PFCHSL1FastL2L3ResidualCorrector", CHS=False, reapplyJEC=True, jecUncFile="", computeMETSignificance=True, fixEE2017=False, fixEE2017Params=None, extractDeepMETs=False, postfix="")
def nanoAOD_customizeData(process)