Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 # This is an example PAT configuration showing the usage of PAT on minbias data
0002 
0003 # Starting with a skeleton process which gets imported with the following line
0004 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0005 
0006 from PhysicsTools.PatAlgos.tools.coreTools import *
0007 
0008 ## global tag for data
0009 process.GlobalTag.globaltag = 'GR_R_38X_V14::All'
0010 
0011 # add pf met
0012 from PhysicsTools.PatAlgos.tools.metTools import *
0013 removeMCMatching(process, ['All'])
0014 addPfMET(process, 'PF')
0015 
0016 # Add PF jets
0017 from PhysicsTools.PatAlgos.tools.jetTools import *
0018 addJetCollection(process,cms.InputTag('ak5PFJets'),
0019                  'AK5', 'PF',
0020                  doJTA        = False,
0021                  doBTagging   = False,
0022                  jetCorrLabel = ('AK5PF', cms.vstring(['L2Relative', 'L3Absolute', 'L2L3Residual'])),
0023                  doType1MET   = False,
0024                  doL1Cleaning = False,
0025                  doL1Counters = False,
0026                  genJetCollection=cms.InputTag("ak5GenJets"),
0027                  doJetID      = False
0028                  )
0029 
0030 # require physics declared
0031 process.load('HLTrigger.special.hltPhysicsDeclared_cfi')
0032 process.hltPhysicsDeclared.L1GtReadoutRecordTag = 'gtDigis'
0033 
0034 # require scraping filter
0035 process.scrapingVeto = cms.EDFilter("FilterOutScraping",
0036                                     applyfilter = cms.untracked.bool(True),
0037                                     debugOn = cms.untracked.bool(False),
0038                                     numtrack = cms.untracked.uint32(10),
0039                                     thresh = cms.untracked.double(0.2)
0040                                     )
0041 
0042 
0043 # configure HLT
0044 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
0045 process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
0046 process.hltLevel1GTSeed.L1TechTriggerSeeding = cms.bool(True)
0047 process.hltLevel1GTSeed.L1SeedsLogicalExpression = cms.string('0 AND (40 OR 41) AND NOT (36 OR 37 OR 38 OR 39) AND NOT ((42 AND NOT 43) OR (43 AND NOT 42))')
0048 
0049 process.primaryVertexFilter = cms.EDFilter("GoodVertexFilter",
0050                                            vertexCollection = cms.InputTag('offlinePrimaryVertices'),
0051                                            minimumNDOF = cms.uint32(4) ,
0052                                            maxAbsZ = cms.double(15),
0053                                            maxd0 = cms.double(2)
0054                                            )
0055 
0056 # Select jets
0057 process.selectedPatJets.cut = cms.string('pt > 10')
0058 process.selectedPatJetsAK5PF.cut = cms.string('pt > 10')
0059 
0060 # Add the files
0061 readFiles = cms.untracked.vstring()
0062 secFiles = cms.untracked.vstring()
0063 
0064 readFiles.extend( [
0065 '/store/data/Run2010A/MinimumBias/RECO/v4/000/144/114/EA7E0799-10B4-DF11-BA75-0030487CAF0E.root',
0066 '/store/data/Run2010A/MinimumBias/RECO/v4/000/144/114/A6A0ABC9-0DB4-DF11-A5E6-003048F024C2.root',
0067 '/store/data/Run2010A/MinimumBias/RECO/v4/000/144/114/9E7E774E-32B4-DF11-AE21-003048F0258C.root'
0068         ] );
0069 process.source.fileNames = readFiles
0070 
0071 process.source.inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*")
0072 
0073 # let it run
0074 
0075 #print
0076 #print "============== Warning =============="
0077 #print "technical trigger filter:    DISABLED"
0078 #print "physics declare bit filter:  DISABLED"
0079 #print "primary vertex filter:       DISABLED"
0080 
0081 process.p = cms.Path(
0082     process.hltLevel1GTSeed*
0083     process.scrapingVeto*
0084     process.hltPhysicsDeclared*
0085     process.primaryVertexFilter*
0086     process.patDefaultSequence
0087     )
0088 
0089 # rename output file
0090 process.out.fileName = cms.untracked.string('reco_7TeV_firstdata_pat.root',)
0091 
0092 # reduce verbosity
0093 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(1000)
0094 
0095 # process all the events
0096 process.maxEvents.input = 1000
0097 process.options.wantSummary = True
0098 
0099 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
0100 from PhysicsTools.PatAlgos.patEventContent_cff import patExtraAodEventContent
0101 process.out.outputCommands = patEventContentNoCleaning
0102 process.out.outputCommands += patExtraAodEventContent
0103 process.out.outputCommands += [
0104         'keep recoPFCandidates_particleFlow_*_*'
0105         ]
0106 
0107 # switch on PAT trigger
0108 from PhysicsTools.PatAlgos.tools.trigTools import switchOnTrigger
0109 switchOnTrigger( process )
0110 
0111 process.patTrigger.addL1Algos = cms.bool( True )
0112