File indexing completed on 2024-04-06 12:24:29
0001
0002 import FWCore.ParameterSet.Config as cms
0003 from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask
0004
0005 from FWCore.ParameterSet.VarParsing import VarParsing
0006 options = VarParsing('analysis')
0007 options.inputFiles = '/store/mc/RunIIFall17MiniAOD/ZprimeToWWToWlepWhad_narrow_M-3000_TuneCP5_13TeV-madgraph/MINIAODSIM/94X_mc2017_realistic_v10-v1/20000/3E25D208-8205-E811-8858-3417EBE64426.root'
0008 options.maxEvents = -1
0009 options.parseArguments()
0010
0011 process = cms.Process("PATtest")
0012
0013
0014 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0015 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0016
0017
0018
0019 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0020
0021
0022 process.source = cms.Source("PoolSource",
0023 fileNames=cms.untracked.vstring(options.inputFiles)
0024 )
0025
0026 process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(options.maxEvents))
0027
0028
0029 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0030 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0031 from Configuration.AlCa.GlobalTag import GlobalTag
0032 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')
0033 process.load("Configuration.StandardSequences.MagneticField_cff")
0034
0035
0036 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
0037 process.out = cms.OutputModule("PoolOutputModule",
0038 fileName = cms.untracked.string('patTuple.root'),
0039
0040
0041
0042
0043 outputCommands = cms.untracked.vstring('drop *', *patEventContentNoCleaning )
0044 )
0045
0046 patAlgosToolsTask = getPatAlgosToolsTask(process)
0047 process.outpath = cms.EndPath(process.out, patAlgosToolsTask)
0048
0049
0050 from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection
0051 from RecoBTag.ONNXRuntime.pfDeepBoostedJet_cff import _pfDeepBoostedJetTagsAll as pfDeepBoostedJetTagsAll
0052
0053 updateJetCollection(
0054 process,
0055 jetSource = cms.InputTag('slimmedJetsAK8'),
0056 pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
0057 svSource = cms.InputTag('slimmedSecondaryVertices'),
0058 rParam = 0.8,
0059 jetCorrections = ('AK8PFPuppi', cms.vstring(['L2Relative', 'L3Absolute']), 'None'),
0060 btagDiscriminators = pfDeepBoostedJetTagsAll
0061 )
0062
0063 from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent
0064 process.out.outputCommands.append('keep *_slimmedJetsAK8*_*_*')
0065 process.out.outputCommands.append('keep *_offlineSlimmedPrimaryVertices*_*_*')
0066 process.out.outputCommands.append('keep *_slimmedSecondaryVertices*_*_*')
0067 process.out.outputCommands.append('keep *_selectedPatJets*_*_*')
0068 process.out.outputCommands.append('keep *_selectedUpdatedPatJets*_*_*')
0069 process.out.outputCommands.append('keep *_updatedPatJets*_*_*')
0070
0071 process.out.fileName = 'test_deep_boosted_jet_MINIAODSIM.root'
0072
0073
0074
0075