Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:44

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("MuonsWithTrigger")
0004 
0005 ### standard includes
0006 process.load("FWCore.MessageService.MessageLogger_cfi")
0007 process.load('Configuration.StandardSequences.GeometryExtended_cff')
0008 process.load("Configuration.StandardSequences.Reconstruction_cff")
0009 process.load("Configuration.StandardSequences.MagneticField_cff")
0010 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0011 process.MessageLogger.cerr.FwkReport.reportEvery = 1000 
0012 process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(True))
0013 
0014 ### global tag
0015 #process.GlobalTag.globaltag = 'GR_R_35X_V7::All'
0016 process.GlobalTag.globaltag = 'GR10_E_V4::All'
0017 
0018 ### source
0019 process.source = cms.Source("PoolSource",
0020     fileNames = cms.untracked.vstring(
0021         #'rfio:/castor/cern.ch/user/g/gpetrucc/7TeV/DATA/Muons_With_HLTDEBUG.root' 
0022         #'file:/afs/cern.ch/user/g/gpetrucc/scratch0/mu10/clean/CMSSW_3_5_6/src/hlt.root'
0023         'rfio:/castor/cern.ch/user/g/gpetrucc/7TeV/DATA/Muons_With_HLTDEBUG_v9_Run134542_Ls44to52.root'
0024     )
0025 )
0026 
0027 ### number of events
0028 process.maxEvents = cms.untracked.PSet( output = cms.untracked.int32(100) )
0029 
0030 from HLTrigger.HLTfilters.hltLevel1GTSeed_cfi import hltLevel1GTSeed
0031 hltLevel1GTSeed.L1TechTriggerSeeding = cms.bool(True)
0032 process.bptxAnd   = hltLevel1GTSeed.clone(L1SeedsLogicalExpression = cms.string('0'))
0033 process.bscFilter = hltLevel1GTSeed.clone(L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)'))
0034 process.oneGoodVertexFilter = cms.EDFilter("VertexSelector",
0035    src = cms.InputTag("offlinePrimaryVertices"),
0036    cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 15 && position.Rho <= 2"),
0037    filter = cms.bool(True),   # otherwise it won't filter the events, just produce an empty vertex collection.
0038 )
0039 process.noScraping = cms.EDFilter("FilterOutScraping",
0040     applyfilter = cms.untracked.bool(True),
0041     debugOn = cms.untracked.bool(False), ## Or 'True' to get some per-event info
0042     numtrack = cms.untracked.uint32(10),
0043     thresh = cms.untracked.double(0.25)
0044 )
0045 #process.preFilter = cms.Sequence(process.bptxAnd * process.bscFilter * process.oneGoodVertexFilter * process.noScraping)
0046 process.preFilter = cms.Sequence(process.noScraping * process.oneGoodVertexFilter)
0047 process.test     = cms.Path(process.preFilter)
0048 process.testBPTX = cms.Path(process.preFilter + process.bptxAnd)
0049 process.testBSC  = cms.Path(process.preFilter + process.bscFilter)
0050 
0051 process.load("MuonAnalysis.MuonAssociators.patMuonsWithTrigger_8E29_cff")
0052 from MuonAnalysis.MuonAssociators.patMuonsWithTrigger_8E29_cff import changeTriggerProcessName;
0053 changeTriggerProcessName(process, "HLTMUON")
0054 #process.muonL1Info.useTrack = 'global'
0055 #process.muonL1Info.useState = 'outermost'
0056 #process.muonMatchHLTL1MuOpen.useTrack = 'global'
0057 #process.muonMatchHLTL1MuOpen.useState = 'outermost'
0058 
0059 process.load("MuonAnalysis.MuonAssociators.triggerMatcherToHLTDebug_cfi")
0060 from MuonAnalysis.MuonAssociators.triggerMatcherToHLTDebug_cfi import addUserData
0061 process.matchDebug = process.triggerMatcherToHLTDebug.clone()
0062 addUserData(process.patMuonsWithoutTrigger, "matchDebug")
0063 #process.matchDebug.l1matcherConfig.useTrack = 'global'
0064 #process.matchDebug.l1matcherConfig.useState = 'outermost'
0065 
0066 process.muonStations = cms.EDProducer("MuonStationCounter",
0067     src = cms.InputTag("muons"),
0068     useGlobalTrack = cms.bool(False)
0069 )
0070 process.patMuonsWithoutTrigger.userData.userInts.src += [
0071     cms.InputTag("muonStations",""),
0072     cms.InputTag("muonStations","any"),
0073     cms.InputTag("muonStations","dt"),
0074     cms.InputTag("muonStations","dtAny"),
0075     cms.InputTag("muonStations","csc"),
0076     cms.InputTag("muonStations","cscAny"),
0077     cms.InputTag("muonStations","rpc"),
0078     cms.InputTag("muonStations","rpcAny"),
0079 ]
0080 
0081 ## Skimming: change to fit your requirement
0082 process.muonFilter = cms.EDFilter("PATMuonRefSelector", 
0083     src = cms.InputTag("patMuonsWithTrigger"), 
0084     cut = cms.string("isGlobalMuon"), 
0085     filter = cms.bool(True) 
0086 )
0087 
0088 process.p = cms.Path(
0089     process.preFilter  +
0090     process.matchDebug +
0091     process.patMuonsWithTriggerSequence +
0092     process.muonFilter          
0093 )
0094 
0095 process.out = cms.OutputModule("PoolOutputModule",
0096     fileName = cms.untracked.string('tupleData.root'),
0097     outputCommands = cms.untracked.vstring('drop *',
0098         'keep patMuons_patMuonsWithTrigger__*',                    ## All PAT muons
0099         'keep edmTriggerResults_TriggerResults_*_*',               ## HLT info, per path (cheap)
0100         'keep l1extraL1MuonParticles_l1extraParticles_*_*',        ## L1 info (cheap)
0101         #--- Other things you might want ---
0102         #'keep *_offlinePrimaryVertices__*',                  ## 
0103         #'keep *_offlineBeamSpot__*',                         ##
0104         #'keep recoTrackExtras_standAloneMuons_*_*',          ## track states at the muon system, to which patMuons sta tracks point (useful if you want variables of the innermost or outermost state)
0105         #'keep TrackingRecHitsOwned_standAloneMuons_*_*',     ## muon rechits, to compute things like number of stations
0106     ),
0107     SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') )
0108 )
0109 process.e = cms.EndPath(process.out)