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 removeMCMatching(process, ['All'])
0008 
0009 ## global tag for data
0010 process.GlobalTag.globaltag = 'GR_R_42_V14::All'
0011 
0012 
0013 # Triggers for the /Jet PD in the used example run 165121 are from:
0014 # /cdaq/physics/Run2011/1e33/v1.3/HLT/V2
0015 # The list is here, let's take all of them :
0016 ## Jet = cms.vstring( 'HLT_DiJetAve110_v3',
0017 ##   'HLT_DiJetAve150_v3',
0018 ##   'HLT_DiJetAve190_v3',
0019 ##   'HLT_DiJetAve240_v3',
0020 ##   'HLT_DiJetAve300_v3',
0021 ##   'HLT_DiJetAve30_v3',
0022 ##   'HLT_DiJetAve370_v3',
0023 ##   'HLT_DiJetAve60_v3',
0024 ##   'HLT_DiJetAve80_v3',
0025 ##   'HLT_Jet110_v3',
0026 ##   'HLT_Jet150_v3',
0027 ##   'HLT_Jet190_v3',
0028 ##   'HLT_Jet240_v3',
0029 ##   'HLT_Jet300_v2',
0030 ##   'HLT_Jet30_v3',
0031 ##   'HLT_Jet370_NoJetID_v3',
0032 ##   'HLT_Jet370_v3',
0033 ##   'HLT_Jet60_v3',
0034 ##   'HLT_Jet80_v3' ),
0035 mytrigs = ['*']
0036 
0037 # Jet energy corrections to use:
0038 #inputJetCorrLabel = ('AK5PF', ['L1Offset', 'L2Relative', 'L3Absolute', 'L2L3Residual'])
0039 inputJetCorrLabel = ('AK5PF', ['L1Offset', 'L2Relative', 'L3Absolute'])
0040 process.patJetCorrFactors.useRho=False
0041 
0042 # add pf met
0043 from PhysicsTools.PatAlgos.tools.metTools import *
0044 addPfMET(process, 'PF')
0045 
0046 # Add PF jets
0047 from PhysicsTools.PatAlgos.tools.jetTools import *
0048 switchJetCollection(process,cms.InputTag('ak5PFJets'),
0049                  doJTA        = True,
0050                  doBTagging   = True,
0051                  jetCorrLabel = inputJetCorrLabel,
0052                  doType1MET   = True,
0053                  genJetCollection=cms.InputTag("ak5GenJets"),
0054                  doJetID      = True
0055                  )
0056 process.patJets.addTagInfos = True
0057 process.patJets.tagInfoSources  = cms.VInputTag(
0058     cms.InputTag("secondaryVertexTagInfosAOD"),
0059     )
0060 
0061 # Apply loose PF jet ID
0062 from PhysicsTools.SelectorUtils.pfJetIDSelector_cfi import pfJetIDSelector
0063 process.goodPatJets = cms.EDFilter("PFJetIDSelectionFunctorFilter",
0064                                    filterParams = pfJetIDSelector.clone(),
0065                                    src = cms.InputTag("selectedPatJets"),
0066                                    filter = cms.bool(True)
0067                                    )
0068 
0069 
0070 # Taus are currently broken in 4.1.x
0071 removeSpecificPATObjects( process, ['Taus'] )
0072 process.patDefaultSequence.remove( process.patTaus )
0073 
0074 # require physics declared
0075 process.load('HLTrigger.special.hltPhysicsDeclared_cfi')
0076 process.hltPhysicsDeclared.L1GtReadoutRecordTag = 'gtDigis'
0077 
0078 # require scraping filter
0079 process.scrapingVeto = cms.EDFilter("FilterOutScraping",
0080                                     applyfilter = cms.untracked.bool(True),
0081                                     debugOn = cms.untracked.bool(False),
0082                                     numtrack = cms.untracked.uint32(10),
0083                                     thresh = cms.untracked.double(0.2)
0084                                     )
0085 # HB + HE noise filtering
0086 process.load('CommonTools.RecoAlgos.HBHENoiseFilter_cfi')
0087 process.HBHENoiseFilter.minIsolatedNoiseSumE        = 999999.
0088 process.HBHENoiseFilter.minNumIsolatedNoiseChannels = 999999
0089 process.HBHENoiseFilter.minIsolatedNoiseSumEt       = 999999.
0090 
0091 
0092 from HLTrigger.HLTfilters.hltHighLevel_cfi import *
0093 if mytrigs is not None :
0094     process.hltSelection = hltHighLevel.clone(TriggerResultsTag = 'TriggerResults::HLT', HLTPaths = mytrigs)
0095     process.hltSelection.throw = False
0096 
0097 from PhysicsTools.SelectorUtils.pvSelector_cfi import pvSelector
0098 goodVertexSelection = pvSelector.clone( maxZ = 24. )
0099 process.primaryVertexFilter = cms.EDFilter("PrimaryVertexFilter",
0100                                            goodVertexSelection
0101                                            )
0102 
0103 
0104 # Select jets
0105 process.selectedPatJets.cut = cms.string('pt > 25')
0106 
0107 # Add the files
0108 readFiles = cms.untracked.vstring()
0109 secFiles = cms.untracked.vstring()
0110 
0111 
0112 readFiles.extend( [
0113         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/E4D2CB53-9881-E011-8D99-003048F024DC.root',
0114         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/DC453887-7481-E011-89B9-001617E30D0A.root',
0115         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/DABFB9E8-9B81-E011-9FF7-0030487CD812.root',
0116         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/D4E6F338-9B81-E011-A8DE-003048F110BE.root',
0117         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/CEC22BF3-9681-E011-AA91-003048CFB40C.root',
0118         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/BC737791-9581-E011-90E2-0030487CD6DA.root',
0119         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/B6E2792E-8881-E011-9C34-000423D9A212.root',
0120         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/A47B3EF5-9D81-E011-AC11-003048F024FA.root',
0121         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/84253FEF-9B81-E011-9DB7-001617DBD230.root',
0122         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/80749EFD-AB81-E011-A6E3-0030487CD76A.root',
0123         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/749CCE90-9581-E011-862A-000423D9A212.root',
0124         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/6CDB388A-9681-E011-B324-0030487CD178.root',
0125         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/464C7F95-9581-E011-BAEC-0030487CAEAC.root',
0126         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/42B01B46-9D81-E011-AF75-003048F1C58C.root',
0127         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/36C0F1A9-1382-E011-A5B5-003048F11942.root',
0128         '/store/data/Run2011A/Jet/AOD/PromptReco-v4/000/165/121/10691D45-9D81-E011-9A9A-003048F118C2.root',
0129  ] )
0130 
0131 process.source.fileNames = readFiles
0132 
0133 process.source.inputCommands = cms.untracked.vstring("keep *", "drop *_MEtoEDMConverter_*_*")
0134 
0135 # let it run
0136 
0137 process.p = cms.Path(
0138     process.hltSelection*
0139     process.scrapingVeto*
0140     process.primaryVertexFilter*
0141     process.HBHENoiseFilter*
0142     process.patDefaultSequence*
0143     process.goodPatJets
0144     )
0145 
0146 # rename output file
0147 process.out.fileName = cms.untracked.string('jet2011A_aod.root')
0148 
0149 # reduce verbosity
0150 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(1000)
0151 
0152 # process all the events
0153 process.maxEvents.input = 1000
0154 process.options.wantSummary = True
0155 
0156 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
0157 from PhysicsTools.PatAlgos.patEventContent_cff import patExtraAodEventContent
0158 process.out.outputCommands = patEventContentNoCleaning
0159 process.out.outputCommands += patExtraAodEventContent
0160 process.out.outputCommands += [
0161     'drop patJets_selectedPatJets_*_*',
0162     'keep patJets_goodPatJets_*_*',
0163     'keep recoPFCandidates_selectedPatJets*_*_*'
0164     ]
0165 
0166 # switch on PAT trigger
0167 from PhysicsTools.PatAlgos.tools.trigTools import switchOnTrigger
0168 switchOnTrigger( process )
0169 process.patTrigger.addL1Algos = cms.bool( True )
0170 switchOnTrigger( process ) # to fix event content