Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:41

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.PatAlgos.tools.helpers import getPatAlgosToolsTask
0003 
0004 process = cms.Process("PATtest")
0005 
0006 ## MessageLogger
0007 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0008 process.MessageLogger.cerr.FwkReport.reportEvery = 1
0009 
0010 
0011 ## Options and Output Report
0012 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True),
0013 SkipEvent = cms.untracked.vstring('ProductNotFound'))
0014 
0015 ## Source
0016 process.source = cms.Source("PoolSource",
0017     fileNames = cms.untracked.vstring(),
0018     #skipEvents=cms.untracked.uint32(250)
0019 )
0020 
0021 #process.source.eventsToProcess = cms.untracked.VEventRange("1:3127296-1:3127297")
0022 
0023 ## Maximal Number of Events
0024 #process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0025 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) )
0026 
0027 ## Geometry and Detector Conditions (needed for a few patTuple production steps)
0028 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0029 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0030 from Configuration.AlCa.GlobalTag import GlobalTag
0031 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')
0032 process.load("Configuration.StandardSequences.MagneticField_cff")
0033 
0034 ## Output Module Configuration (expects a path 'p')
0035 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
0036 process.out = cms.OutputModule("PoolOutputModule",
0037                                fileName = cms.untracked.string('patTuple.root'),
0038                                ## save only events passing the full path
0039                                #SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ),
0040                                ## save PAT output; you need a '*' to unpack the list of commands
0041                                ## 'patEventContent'
0042                                outputCommands = cms.untracked.vstring('drop *', *patEventContentNoCleaning )
0043                                )
0044 
0045 patAlgosToolsTask = getPatAlgosToolsTask(process)
0046 process.outpath = cms.EndPath(process.out, patAlgosToolsTask)
0047 
0048 ## and add them to the event content
0049 from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection
0050 
0051 updateJetCollection(
0052    process,
0053    jetSource = cms.InputTag('slimmedJetsAK8'),
0054    pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
0055    svSource = cms.InputTag('slimmedSecondaryVertices'),
0056    rParam = 0.8,
0057    jetCorrections = ('AK8PFchs', cms.vstring(['L2Relative', 'L3Absolute']), 'None'),
0058    btagDiscriminators = [
0059       'pfBoostedDoubleSecondaryVertexAK8BJetTags',
0060       'pfMassIndependentDeepDoubleBvLJetTags:probQCD', 
0061       'pfMassIndependentDeepDoubleBvLJetTags:probHbb',
0062       'pfMassIndependentDeepDoubleCvLJetTags:probQCD',
0063       'pfMassIndependentDeepDoubleCvLJetTags:probHcc',
0064       'pfMassIndependentDeepDoubleCvBJetTags:probHbb',
0065       'pfMassIndependentDeepDoubleCvBJetTags:probHcc',
0066       'pfMassIndependentDeepDoubleBvLV2JetTags:probQCD', 
0067       'pfMassIndependentDeepDoubleBvLV2JetTags:probHbb',
0068       'pfMassIndependentDeepDoubleCvLV2JetTags:probQCD',
0069       'pfMassIndependentDeepDoubleCvLV2JetTags:probHcc',
0070       'pfMassIndependentDeepDoubleCvBV2JetTags:probHbb',
0071       'pfMassIndependentDeepDoubleCvBV2JetTags:probHcc',
0072       
0073       ]
0074    )
0075    
0076 
0077 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM
0078 
0079 process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM
0080 process.source.fileNames = cms.untracked.vstring(
0081 #'/store/relval/CMSSW_10_3_0_pre2/RelValTTbar_13/MINIAODSIM/PU25ns_103X_upgrade2018_realistic_v2-v1/20000/85820ACA-657B-BC44-AC74-AACD6D54B348.root'
0082 #'/store/mc/RunIIFall17MiniAOD/GluGluHToBB_M125_13TeV_powheg_pythia8/MINIAODSIM/94X_mc2017_realistic_v10-v1/20000/C8932584-5006-E811-9840-141877410512.root',
0083 #'/store/mc/RunIIFall17MiniAODv2/GluGluHToCC_M125_13TeV_powheg_pythia8/MINIAODSIM/PU2017_12Apr2018_94X_mc2017_realistic_v14-v2/30000/72164088-CB67-E811-9D0D-008CFA197AC4.root',
0084 'file:72164088-CB67-E811-9D0D-008CFA197AC4.root',
0085 #'/store/mc/RunIIFall17MiniAOD/QCD_HT700to1000_TuneCP5_13TeV-madgraph-pythia8/MINIAODSIM/94X_mc2017_realistic_v10-v1/20000/C0F304A4-23FA-E711-942E-E0071B6CAD20.root'
0086 )
0087 #process.maxEvents.input = 1000
0088 
0089 from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent
0090 process.out.outputCommands.append('keep *_slimmedJetsAK8*_*_*')
0091 process.out.outputCommands.append('keep *_offlineSlimmedPrimaryVertices*_*_*')
0092 process.out.outputCommands.append('keep *_slimmedSecondaryVertices*_*_*')
0093 process.out.outputCommands.append('keep *_selectedPatJets*_*_*')
0094 process.out.outputCommands.append('keep *_selectedUpdatedPatJets*_*_*')
0095 process.out.outputCommands.append('keep *_pfBoostedDoubleSVAK8TagInfos*_*_*')
0096 process.out.outputCommands.append('keep *_pfDeepDoubleXTagInfos*_*_*')
0097 process.out.outputCommands.append('keep *_updatedPatJets*_*_*')
0098 
0099 process.out.fileName = 'output_test_DDX.root'
0100 
0101 #                                         ##
0102 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)
0103 # process.add_(cms.Service("InitRootHandlers", DebugLevel =cms.untracked.int32(3)))