Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 ## import skeleton process
0004 from PhysicsTools.PatAlgos.patTemplate_cfg import *
0005 
0006 from PhysicsTools.PatAlgos.tools.coreTools import *
0007 removeMCMatching(process, ['All'])
0008 
0009 removeSpecificPATObjects(process,
0010                          ['Photons'],  # 'Tau' has currently been taken out due to problems with tau discriminators
0011                          outputModules=[])
0012 
0013 removeCleaning(process,
0014                outputModules=[])
0015 
0016 process.patJetCorrFactors.payload = 'AK5Calo'
0017 # For data:
0018 #process.patJetCorrFactors.levels = ['L2Relative', 'L3Absolute', 'L2L3Residual', 'L5Flavor', 'L7Parton']
0019 # For MC:
0020 process.patJetCorrFactors.levels = ['L2Relative', 'L3Absolute']
0021 #process.patJetCorrFactors.flavorType = "T"
0022 
0023 process.patMuons.usePV = False
0024 
0025 #-------------------------------------------------
0026 # selection step 1: trigger
0027 #-------------------------------------------------
0028 
0029 from HLTrigger.HLTfilters.hltHighLevel_cfi import *
0030 process.step1 = hltHighLevel.clone(TriggerResultsTag = "TriggerResults::HLT", HLTPaths = ["HLT_Mu15_eta2p1_v5"])
0031 
0032 #-------------------------------------------------
0033 # selection step 2: vertex filter
0034 #-------------------------------------------------
0035 
0036 # vertex filter
0037 process.step2 = cms.EDFilter("VertexSelector",
0038                              src = cms.InputTag("offlinePrimaryVertices"),
0039                              cut = cms.string("!isFake && ndof > 4 && abs(z) < 15 && position.Rho < 2"),
0040                              filter = cms.bool(True),
0041                              )
0042 
0043 #-------------------------------------------------
0044 # selection steps 3 and 4: muon selection
0045 #-------------------------------------------------
0046 
0047 from PhysicsTools.PatAlgos.cleaningLayer1.muonCleaner_cfi import *
0048 process.isolatedMuons010 = cleanPatMuons.clone(preselection =
0049                                                'isGlobalMuon & isTrackerMuon &'
0050                                                'pt > 20. &'
0051                                                'abs(eta) < 2.1 &'
0052                                                '(trackIso+caloIso)/pt < 0.1 &'
0053                                                'innerTrack.numberOfValidHits > 10 &'
0054                                                'globalTrack.normalizedChi2 < 10.0 &'
0055                                                'globalTrack.hitPattern.numberOfValidMuonHits > 0 &'
0056                                                'abs(dB) < 0.02'
0057                                                )
0058 
0059 process.isolatedMuons010.checkOverlaps = cms.PSet(
0060         jets = cms.PSet(src       = cms.InputTag("goodJets"),
0061                         algorithm = cms.string("byDeltaR"),
0062                         preselection        = cms.string(""),
0063                         deltaR              = cms.double(0.3),
0064                         checkRecoComponents = cms.bool(False),
0065                         pairCut             = cms.string(""),
0066                         requireNoOverlaps   = cms.bool(True),
0067                         )
0068             )
0069 process.isolatedMuons005 = cleanPatMuons.clone(src = 'isolatedMuons010',
0070                                                preselection = '(trackIso+caloIso)/pt < 0.05'
0071                                                )
0072 
0073 process.vetoMuons = cleanPatMuons.clone(preselection =
0074                                         'isGlobalMuon &'
0075                                         'pt > 10. &'
0076                                         'abs(eta) < 2.5 &'
0077                                         '(trackIso+caloIso)/pt < 0.2'
0078                                         )
0079 
0080 from PhysicsTools.PatAlgos.selectionLayer1.muonCountFilter_cfi import *
0081 process.step3a = countPatMuons.clone(src = 'isolatedMuons005', minNumber = 1, maxNumber = 1)
0082 process.step3b = countPatMuons.clone(src = 'isolatedMuons010', minNumber = 1, maxNumber = 1)
0083 process.step4  = countPatMuons.clone(src = 'vetoMuons', maxNumber = 1)
0084 
0085 #-------------------------------------------------
0086 # selection step 5: electron selection
0087 #-------------------------------------------------
0088 
0089 from PhysicsTools.PatAlgos.selectionLayer1.electronSelector_cfi import *
0090 process.vetoElectrons = selectedPatElectrons.clone(src = 'selectedPatElectrons',
0091                                                    cut =
0092                                                    'et > 15. &'
0093                                                    'abs(eta) < 2.5 &'
0094                                                    '(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/et <  0.2'
0095                                                    )
0096 
0097 from PhysicsTools.PatAlgos.selectionLayer1.electronCountFilter_cfi import *
0098 process.step5  = countPatMuons.clone(src = 'vetoElectrons', maxNumber = 0)
0099 
0100 #-------------------------------------------------
0101 # selection steps 6 and 7: jet selection
0102 #-------------------------------------------------
0103 
0104 from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import *
0105 process.goodJets = selectedPatJets.clone(src = 'patJets',
0106                                          cut =
0107                                          'pt > 30. &'
0108                                          'abs(eta) < 2.4 &'
0109                                          'emEnergyFraction > 0.01 &'
0110                                          'jetID.n90Hits > 1 &'
0111                                          'jetID.fHPD < 0.98'
0112                                          )
0113 
0114 from PhysicsTools.PatAlgos.selectionLayer1.jetCountFilter_cfi import *
0115 process.step6a = countPatJets.clone(src = 'goodJets', minNumber = 1)
0116 process.step6b = countPatJets.clone(src = 'goodJets', minNumber = 2)
0117 process.step6c = countPatJets.clone(src = 'goodJets', minNumber = 3)
0118 process.step7  = countPatJets.clone(src = 'goodJets', minNumber = 4)
0119 
0120 #-------------------------------------------------
0121 # paths
0122 #-------------------------------------------------
0123 
0124 process.looseSequence = cms.Path(process.step1 *
0125                                  process.step2 *
0126                                  process.patDefaultSequence *
0127                                  process.goodJets *
0128                                  process.isolatedMuons010 *
0129                                  process.step3b *
0130                                  process.vetoMuons *
0131                                  process.step4 *
0132                                  process.vetoElectrons *
0133                                  process.step5 *
0134                                  process.step6a *
0135                                  process.step6b *
0136                                  process.step6c
0137                                  )
0138 
0139 process.tightSequence = cms.Path(process.step1 *
0140                                  process.step2 *
0141                                  process.patDefaultSequence *
0142                                  process.goodJets *
0143                                  process.isolatedMuons010 *
0144                                  process.isolatedMuons005 *
0145                                  process.step3a *
0146                                  process.vetoMuons *
0147                                  process.step4 *
0148                                  process.vetoElectrons *
0149                                  process.step5 *
0150                                  process.step6a *
0151                                  process.step6b *
0152                                  process.step6c *
0153                                  process.step7
0154                                 )
0155 
0156 
0157 process.out.SelectEvents.SelectEvents = ['tightSequence',
0158                                          'looseSequence' ]
0159 
0160 from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
0161 process.out.outputCommands = cms.untracked.vstring('drop *', *patEventContentNoCleaning )
0162 
0163 ## ------------------------------------------------------
0164 #  In addition you usually want to change the following
0165 #  parameters:
0166 ## ------------------------------------------------------
0167 #
0168 #   process.GlobalTag.globaltag =  ...    ##  (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions)
0169 #                                         ##
0170 from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM
0171 process.source.fileNames = filesRelValProdTTbarAODSIM
0172 #                                         ##
0173 process.maxEvents.input = 1000
0174 #                                         ##
0175 #   process.out.outputCommands = [ ... ]  ##  (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py)
0176 #                                         ##
0177 process.out.fileName = 'patTuple_topSelection.root'
0178 #                                         ##
0179 #   process.options.wantSummary = False   ##  (to suppress the long output at the end of the job)