Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:02

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 ## Define the process
0004 process = cms.Process("Top")
0005 
0006 ## Define the input sample
0007 process.source = cms.Source("PoolSource",
0008   fileNames = cms.untracked.vstring(
0009     'file:patTuple.root'
0010   )
0011 )
0012 ## restrict the number of events for testing
0013 process.maxEvents = cms.untracked.PSet(
0014     input = cms.untracked.int32(1000)
0015 )
0016 
0017 from PhysicsTools.PatExamples.samplesCERN_cff import *
0018 ##process.source.fileNames = muonSKIM        ## ATTENTION these samples are NOT available on castor
0019 ##process.source.fileNames = simulationQCD   ## ATTENTION these samples are NOT available on castor
0020 ##process.source.fileNames = simulationWjets
0021 ##process.source.fileNames = simulationZjets
0022 ##process.source.fileNames = simulationTtbar
0023 
0024 ## Define the TFileService
0025 process.TFileService = cms.Service("TFileService",
0026 fileName = cms.string('analyzePatTopSelection.root')
0027 ##fileName = cms.string('analyzePatTopSelection_qcd.root')
0028 ##fileName = cms.string('analyzePatTopSelection_wjets.root')
0029 ##fileName = cms.string('analyzePatTopSelection_zjets.root')
0030 ##fileName = cms.string('analyzePatTopSelection_ttbar.root')
0031 )
0032 
0033 ## ----------------------------------------------------------------
0034 ## Apply object selection according to TopPAG reference selection
0035 ## for ICHEP 2010. This will result in 5 additional collections:
0036 ##
0037 ## * goodJets
0038 ## * vetoElecs
0039 ## * vetoMuons
0040 ## * looseMuons
0041 ## * tightMuons
0042 ##
0043 ## Have a look ont the cff file to learn more about the exact
0044 ## selection citeria.
0045 ## ----------------------------------------------------------------
0046 process.load("PhysicsTools.PatExamples.topObjectSelection_cff")
0047 process.topObjectProduction = cms.Path(
0048     process.topObjectSelection
0049 )
0050 
0051 ## ----------------------------------------------------------------
0052 ## Define the steps for the TopPAG reference selection for ICHEP
0053 ## 2010. Have a look at the WorkBookPATExampleTopQuarks. These
0054 ## are event selections. They make use of the object selections
0055 ## applied in the step above.
0056 ## ----------------------------------------------------------------
0057 
0058 ## Trigger bit (HLT_mu9)
0059 from HLTrigger.HLTfilters.hltHighLevel_cfi import *
0060 process.step1  = hltHighLevel.clone(TriggerResultsTag = "TriggerResults::HLT", HLTPaths = ["HLT_Mu9"])
0061 ## Vertex requirement
0062 process.step2  = cms.EDFilter("VertexSelector", src = cms.InputTag("offlinePrimaryVertices"), cut = cms.string("!isFake && ndof > 4 && abs(z) < 15 && position.Rho < 2"), filter = cms.bool(True))
0063 ## Exact one tight muon
0064 from PhysicsTools.PatAlgos.selectionLayer1.muonCountFilter_cfi import *
0065 process.step3a = countPatMuons.clone(src = 'tightMuons', minNumber = 1, maxNumber = 1)
0066 ## Exact one loose muon
0067 process.step3b = countPatMuons.clone(src = 'looseMuons', minNumber = 1, maxNumber = 1)
0068 ## Veto on additional muons
0069 process.step4  = countPatMuons.clone(src = 'vetoMuons' , maxNumber = 1)
0070 ## Veto on additional electrons
0071 from PhysicsTools.PatAlgos.selectionLayer1.electronCountFilter_cfi import *
0072 process.step5  = countPatMuons.clone(src = 'vetoElecs' , maxNumber = 0)
0073 ## Different jet multiplicity selections
0074 from PhysicsTools.PatAlgos.selectionLayer1.jetCountFilter_cfi import *
0075 process.step6a = countPatJets.clone(src = 'goodJets'   , minNumber = 1)
0076 process.step6b = countPatJets.clone(src = 'goodJets'   , minNumber = 2)
0077 process.step6c = countPatJets.clone(src = 'goodJets'   , minNumber = 3)
0078 process.step7  = countPatJets.clone(src = 'goodJets'   , minNumber = 4)
0079 
0080 
0081 ## ----------------------------------------------------------------
0082 ## Define monitoring modules for the event selection. You should
0083 ## few this only as an example for an analyses technique including
0084 ## full CMSSW features, not as a complete analysis.
0085 ## ----------------------------------------------------------------
0086 
0087 from PhysicsTools.PatExamples.PatTopSelectionAnalyzer_cfi import *
0088 process.monStart  = analyzePatTopSelection.clone(jets='goodJets')
0089 process.monStep1  = analyzePatTopSelection.clone(jets='goodJets')
0090 process.monStep2  = analyzePatTopSelection.clone(jets='goodJets')
0091 process.monStep3a = analyzePatTopSelection.clone(muons='tightMuons', jets='goodJets')
0092 process.monStep4  = analyzePatTopSelection.clone(muons='vetoMuons' , jets='goodJets')
0093 process.monStep5  = analyzePatTopSelection.clone(muons='vetoMuons', elecs='vetoElecs', jets='goodJets')
0094 process.monStep6a = analyzePatTopSelection.clone(muons='vetoMuons', elecs='vetoElecs', jets='goodJets')
0095 process.monStep6b = analyzePatTopSelection.clone(muons='vetoMuons', elecs='vetoElecs', jets='goodJets')
0096 process.monStep6c = analyzePatTopSelection.clone(muons='vetoMuons', elecs='vetoElecs', jets='goodJets')
0097 process.monStep7  = analyzePatTopSelection.clone(muons='vetoMuons', elecs='vetoElecs', jets='goodJets')
0098 
0099 
0100 ## ----------------------------------------------------------------
0101 ## Define the analysis paths: we define two selection paths to
0102 ## monitor the cutflow according to the TopPAG reference selection
0103 ## for ICHEP 2010. All necessary object collections have been pro-
0104 ## duced in the cms.Path topObjectProduction before hand. The out-
0105 ## put report is switched on to get a quick overview of the number
0106 ## number of events after each selection step.
0107 ## ----------------------------------------------------------------
0108 
0109 ## Switch output report on
0110 process.options   = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0111 
0112 ## Define loose event selection path
0113 process.looseEventSelection = cms.Path(
0114    #process.step1      *
0115     process.step2      *
0116     process.step3b     *
0117     process.step4      *
0118     process.step5      *
0119     process.step6a     *
0120     process.step6b     *
0121     process.step6c
0122     )
0123 
0124 ## Define tight event selection path
0125 process.tightEventSelection = cms.Path(
0126     process.monStart   *
0127    #process.step1      *
0128    #process.monStep1   *
0129     process.step2      *
0130     process.monStep2   *
0131     process.step3a     *
0132     process.monStep3a  *
0133     process.step4      *
0134     process.monStep4   *
0135     process.step5      *
0136     process.monStep5   *
0137     process.step6a     *
0138     process.monStep6a  *
0139     process.step6b     *
0140     process.monStep6b  *
0141     process.step6c     *
0142     process.monStep6c  *
0143     process.step7      *
0144     process.monStep7
0145     )