Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-16 23:01:11

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       'pfNegativeDeepFlavourJetTags:probb',
0063       'pfNegativeDeepFlavourJetTags:probbb',
0064       'pfNegativeDeepFlavourJetTags:problepb',
0065       'pfNegativeDeepFlavourJetTags:probc',
0066       'pfNegativeDeepFlavourJetTags:probuds',
0067       'pfNegativeDeepFlavourJetTags:probg',
0068       ]
0069    )
0070 
0071 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarPileUpMINIAODSIM
0072 
0073 process.source.fileNames = filesRelValTTbarPileUpMINIAODSIM
0074 process.source.fileNames = cms.untracked.vstring('/store/mc/Run3Summer23BPixMiniAODv4/TTtoLNu2Q_TuneCP5_13p6TeV_powheg-pythia8/MINIAODSIM/130X_mcRun3_2023_realistic_postBPix_v2-v3/2520000/00488681-4f49-4bdc-89e6-198da9e42a17.root')
0075 
0076 process.maxEvents.input = 10
0077 
0078 from Configuration.EventContent.EventContent_cff import MINIAODSIMEventContent
0079 process.out.outputCommands = MINIAODSIMEventContent.outputCommands
0080 process.out.outputCommands.append('keep *_selectedUpdatedPatJets*_*_*')
0081 process.out.outputCommands.append('keep *_pfDeepCSVTagInfos*_*_*')
0082 process.out.outputCommands.append('keep *_pfDeepFlavourTagInfos*_*_*')
0083 process.out.outputCommands.append('keep *_pfDeepFlavourJetTags*_*_*')
0084 process.out.outputCommands.append('keep *_updatedPatJets*_*_*')
0085 
0086 process.out.fileName = 'test_deep_flavour_MINIAODSIM.root'
0087 
0088 #                                         ##
0089 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)
0090 # process.add_(cms.Service("InitRootHandlers", DebugLevel =cms.untracked.int32(3)))