Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 ## import skeleton process
0002 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0003 
0004 # load the PAT config
0005 process.load("PhysicsTools.PatAlgos.patSequences_cff")
0006 
0007 # Configure PAT to use PF2PAT instead of AOD sources
0008 # this function will modify the PAT sequences. It is currently
0009 # not possible to run PF2PAT+PAT and standart PAT at the same time
0010 from PhysicsTools.PatAlgos.tools.pfTools import *
0011 
0012 # An empty postfix means that only PF2PAT is run,
0013 # otherwise both standard PAT and PF2PAT are run. In the latter case PF2PAT
0014 # collections have standard names + postfix (e.g. patElectronPFlow)
0015 postfix = "PFlow"
0016 usePF2PAT(process,runPF2PAT=True, jetAlgo='AK4', runOnMC=True, postfix=postfix)
0017 
0018 # turn to false when running on data
0019 getattr(process, "patElectrons"+postfix).embedGenMatch = True
0020 getattr(process, "patMuons"+postfix).embedGenMatch = True
0021 
0022 # add user data
0023 getattr(process, "patElectrons"+postfix).userData.userFunctions.append( 'trackIso * caloIso' )
0024 getattr(process, "patMuons"+postfix).userData.userFunctions.append( 'trackIso * caloIso' )
0025 process.patElectrons.userData.userFunctions.append( 'trackIso * caloIso' )
0026 process.patMuons.userData.userFunctions.append( 'trackIso * caloIso' )
0027 
0028 getattr(process, "patElectrons"+postfix).userData.userFunctionLabels.append( 'trackIso * caloIso' )
0029 getattr(process, "patMuons"+postfix).userData.userFunctionLabels.append( 'trackIso * caloIso' )
0030 process.patElectrons.userData.userFunctionLabels.append( 'trackIso * caloIso' )
0031 process.patMuons.userData.userFunctionLabels.append( 'trackIso * caloIso' )
0032 
0033 # Let it run
0034 process.p = cms.Path(
0035     getattr(process,"patPF2PATSequence"+postfix)
0036 )
0037 if not postfix=="":
0038     process.p += process.patDefaultSequence
0039 
0040 
0041 
0042 
0043 # Add PF2PAT output to the created file
0044 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
0045 #process.load("CommonTools.ParticleFlow.PF2PAT_EventContent_cff")
0046 #process.out.outputCommands =  cms.untracked.vstring('drop *')
0047 process.out.outputCommands = cms.untracked.vstring('drop *',
0048                                                    *patEventContentNoCleaning )
0049 
0050 ## ------------------------------------------------------
0051 #  In addition you usually want to change the following
0052 #  parameters:
0053 ## ------------------------------------------------------
0054 #
0055 #   process.GlobalTag.globaltag =  ...    ##  (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions)
0056 #                                         ##
0057 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM
0058 process.source.fileNames = filesRelValProdTTbarAODSIM
0059 #                                         ##
0060 process.maxEvents.input = 10
0061 #                                         ##
0062 #   process.out.outputCommands = [ ... ]  ##  (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py)
0063 #                                         ##
0064 process.out.fileName = 'patTuple_userData.root'
0065 #                                         ##
0066 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)