Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:59

0001 ## import skeleton process
0002 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0003 
0004 #process.Tracer = cms.Service("Tracer")
0005 
0006 process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff")
0007 patAlgosToolsTask.add(process.patCandidatesTask)
0008 #Temporary customize to the unit tests that fail due to old input samples
0009 process.patTaus.skipMissingTauID = True
0010 
0011 process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff")
0012 patAlgosToolsTask.add(process.selectedPatCandidatesTask)
0013 
0014 from PhysicsTools.PatAlgos.tools.metTools import addMETCollection
0015 #addMETCollection(process, labelName='patMETCalo', metSource='met')
0016 addMETCollection(process, labelName='patMETPF', metSource='pfMetT1')
0017 #addMETCollection(process, labelName='patMETTC', metSource='tcMet') # FIXME: removed from RECO/AOD; needs functionality to add to processing
0018 
0019 ## uncomment the following line to add different jet collections
0020 ## to the event content
0021 from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
0022 from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
0023 
0024 ## uncomment the following lines to add ak4PFJetsCHS to your PAT output
0025 labelAK4PFCHS = 'AK4PFCHS'
0026 postfixAK4PFCHS = 'Copy'
0027 addJetCollection(
0028    process,
0029    postfix   = postfixAK4PFCHS,
0030    labelName = labelAK4PFCHS,
0031    jetSource = cms.InputTag('ak4PFJetsCHS'),
0032    jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'Type-2')
0033    )
0034 process.out.outputCommands.append( 'drop *_selectedPatJets%s%s_caloTowers_*'%( labelAK4PFCHS, postfixAK4PFCHS ) )
0035 
0036 # uncomment the following lines to add ak4PFJets to your PAT output
0037 switchJetCollection(
0038    process,
0039    jetSource = cms.InputTag('ak4PFJets'),
0040    jetCorrections = ('AK4PF', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'Type-1'),
0041    btagDiscriminators = [
0042        'pfJetBProbabilityBJetTags'
0043      , 'pfJetProbabilityBJetTags'
0044      , 'pfTrackCountingHighPurBJetTags'
0045      , 'pfTrackCountingHighEffBJetTags'
0046      , 'pfSimpleSecondaryVertexHighEffBJetTags'
0047      , 'pfSimpleSecondaryVertexHighPurBJetTags'
0048      , 'pfCombinedInclusiveSecondaryVertexV2BJetTags'
0049      ]
0050    )
0051 process.out.outputCommands.append( 'drop *_selectedPatJets_caloTowers_*' )
0052 
0053 # uncomment the following lines to add ak8PFJetsCHSSoftDrop to your PAT output
0054 labelAK8PFCHSSoftDrop = 'AK8PFCHSSoftDrop'
0055 addJetCollection(
0056    process,
0057    labelName = labelAK8PFCHSSoftDrop,
0058    jetSource = cms.InputTag('ak8PFJetsCHSSoftDrop',''),
0059    algo = 'AK',
0060    rParam = 0.8,
0061    genJetCollection = cms.InputTag('ak8GenJets'),
0062    jetCorrections = ('AK8PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'),
0063    btagDiscriminators = ['None'], # turn-off b tagging
0064    getJetMCFlavour = False # jet flavor needs to be disabled for groomed fat jets
0065    )
0066 process.out.outputCommands.append( 'keep *_selectedPatJets%s_pfCandidates_*'%( labelAK8PFCHSSoftDrop ) )
0067 process.out.outputCommands.append( 'drop *_selectedPatJets%s_caloTowers_*'%( labelAK8PFCHSSoftDrop ) )
0068 
0069 # uncomment the following lines to switch to ak4CaloJets in your PAT output
0070 labelAK4Calo = 'AK4Calo'
0071 addJetCollection(
0072    process,
0073    labelName = labelAK4Calo,
0074    jetSource = cms.InputTag('ak4CaloJets'),
0075    jetCorrections = ('AK7Calo', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'Type-1'), # FIXME: Use proper JECs, as soon as available
0076    btagDiscriminators = [
0077        'pfJetBProbabilityBJetTags'
0078      , 'pfJetProbabilityBJetTags'
0079      , 'pfTrackCountingHighPurBJetTags'
0080      , 'pfTrackCountingHighEffBJetTags'
0081      , 'pfSimpleSecondaryVertexHighEffBJetTags'
0082      , 'pfSimpleSecondaryVertexHighPurBJetTags'
0083      , 'pfCombinedInclusiveSecondaryVertexV2BJetTags'
0084      ]
0085    )
0086 process.out.outputCommands.append( 'drop *_selectedPatJets%s_pfCandidates_*'%( labelAK4Calo ) )
0087 ## JetID works only with RECO input for the CaloTowers (s. below for 'process.source.fileNames')
0088 #process.patJets.addJetID=True
0089 #process.load("RecoJets.JetProducers.ak4JetID_cfi")
0090 #process.patJets.jetIDMap="ak4JetID"
0091 process.patJetsAK4Calo.useLegacyJetMCFlavour=True # Need to use legacy flavour since the new flavour requires jet constituents which are dropped for CaloJets from AOD
0092 
0093 #print process.out.outputCommands
0094 
0095 ## ------------------------------------------------------
0096 #  In addition you usually want to change the following
0097 #  parameters:
0098 ## ------------------------------------------------------
0099 #
0100 #   process.GlobalTag.globaltag =  ...    ##  (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions)
0101 #                                         ##
0102 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM
0103 process.source.fileNames = filesRelValProdTTbarAODSIM
0104 #from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValTTbarGENSIMRECO
0105 #process.source.fileNames = filesRelValTTbarGENSIMRECO
0106 #                                         ##
0107 process.maxEvents.input = 10
0108 #                                         ##
0109 #   process.out.outputCommands = [ ... ]  ##  (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py)
0110 #                                         ##
0111 process.out.fileName = 'patTuple_addJets.root'
0112 #                                         ##
0113 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)