Back to home page

Project CMSSW displayed by LXR

 
 

    


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 process = cms.Process("PATtest")
0006 
0007 ## MessageLogger
0008 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0009 
0010 ## Options and Output Report
0011 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0012 
0013 ## Source
0014 process.source = cms.Source("PoolSource",
0015     fileNames = cms.untracked.vstring()
0016 )
0017 ## Maximal Number of Events
0018 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
0019 
0020 ## Geometry and Detector Conditions (needed for a few patTuple production steps)
0021 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0022 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0023 from Configuration.AlCa.GlobalTag import GlobalTag
0024 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc')
0025 process.load("Configuration.StandardSequences.MagneticField_cff")
0026 
0027 ## Output Module Configuration (expects a path 'p')
0028 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
0029 process.out = cms.OutputModule("PoolOutputModule",
0030                                fileName = cms.untracked.string('patTuple.root'),
0031                                ## save only events passing the full path
0032                                #SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') ),
0033                                ## save PAT output; you need a '*' to unpack the list of commands
0034                                ## 'patEventContent'
0035                                outputCommands = cms.untracked.vstring('drop *', *patEventContentNoCleaning )
0036                                )
0037 
0038 patAlgosToolsTask = getPatAlgosToolsTask(process)
0039 process.outpath = cms.EndPath(process.out, patAlgosToolsTask)
0040 
0041 ## and add them to the event content
0042 from PhysicsTools.PatAlgos.tools.jetTools import updateJetCollection
0043 
0044 updateJetCollection(
0045    process,
0046    jetSource = cms.InputTag('slimmedJets'),
0047    pvSource = cms.InputTag('offlineSlimmedPrimaryVertices'),
0048    svSource = cms.InputTag('slimmedSecondaryVertices'),
0049    jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'),
0050    btagDiscriminators = [
0051       'pfCombinedSecondaryVertexV2BJetTags',
0052       'pfDeepCSVJetTags:probudsg', 
0053       'pfDeepCSVJetTags:probb', 
0054       'pfDeepCSVJetTags:probc', 
0055       'pfDeepCSVJetTags:probbb', 
0056       'pfDeepFlavourJetTags:probb',
0057       'pfDeepFlavourJetTags:probbb',
0058       'pfDeepFlavourJetTags:problepb',
0059       'pfDeepFlavourJetTags:probc',
0060       'pfDeepFlavourJetTags:probuds',
0061       'pfDeepFlavourJetTags:probg',
0062       'pfDeepVertexJetTags:probb',
0063       'pfDeepCombinedJetTags:probb',
0064 
0065       ]
0066    )
0067 
0068 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM
0069 
0070 process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM
0071 process.source.fileNames = cms.untracked.vstring('/store/mc/RunIIFall17MiniAODv2/TTToHadronic_TuneCP5_13TeV-powheg-pythia8/MINIAODSIM/PU2017_12Apr2018_new_pmx_94X_mc2017_realistic_v14-v2/60000/FCC2AFA9-4BBB-E811-B35F-0CC47AFB7D48.root')
0072 
0073 process.maxEvents.input = 10
0074 
0075 from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent
0076 process.out.outputCommands = MINIAODSIMEventContent.outputCommands
0077 process.out.outputCommands.append('keep *_selectedUpdatedPatJets*_*_*')
0078 process.out.outputCommands.append('keep *_pfDeepCSVTagInfos*_*_*')
0079 process.out.outputCommands.append('keep *_pfDeepFlavourTagInfos*_*_*')
0080 process.out.outputCommands.append('keep *_pfDeepFlavourJetTags*_*_*')
0081 process.out.outputCommands.append('keep *_updatedPatJets*_*_*')
0082 
0083 process.out.fileName = 'test_deep_vertexcomb_MINIAODSIM.root'
0084 
0085 #                                         ##
0086 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)
0087 # process.add_(cms.Service("InitRootHandlers", DebugLevel =cms.untracked.int32(3)))