Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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 
0017 ### source
0018 process.source = cms.Source("PoolSource",
0019     fileNames = cms.untracked.vstring(
0020         #'rfio:/castor/cern.ch/user/g/gpetrucc/7TeV/DATA/Muons_With_HLTDEBUG.root' 
0021         #'file:/afs/cern.ch/user/g/gpetrucc/scratch0/mu10/clean/CMSSW_3_5_6/src/hlt.root'
0022         #'rfio:/castor/cern.ch/user/g/gpetrucc/7TeV/DATA/Muons_With_HLTDEBUG_v9_Run134542_Ls44to52.root'
0023         #'file:/data/gpetrucc/Feb9Skims/Data_CollisionEvents_MuonSkim.root'
0024         'root://castorcms.cern.ch//castor/cern.ch/cms/store/data/Commissioning10/MinimumBias/RECO/v9/000/135/149/D6383A41-F85A-DF11-A2A7-0030487C8CBE.root'
0025     )
0026 )
0027 
0028 ### number of events
0029 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
0030 
0031 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff")
0032 from HLTrigger.HLTfilters.hltLevel1GTSeed_cfi import hltLevel1GTSeed
0033 hltLevel1GTSeed.L1TechTriggerSeeding = cms.bool(True)
0034 process.bptxAnd   = hltLevel1GTSeed.clone(L1SeedsLogicalExpression = cms.string('0'))
0035 process.bscFilter = hltLevel1GTSeed.clone(L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)'))
0036 process.oneGoodVertexFilter = cms.EDFilter("VertexSelector",
0037    src = cms.InputTag("offlinePrimaryVertices"),
0038    cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 15 && position.Rho <= 2"),
0039    filter = cms.bool(True),   # otherwise it won't filter the events, just produce an empty vertex collection.
0040 )
0041 process.noScraping = cms.EDFilter("FilterOutScraping",
0042     applyfilter = cms.untracked.bool(True),
0043     debugOn = cms.untracked.bool(False), ## Or 'True' to get some per-event info
0044     numtrack = cms.untracked.uint32(10),
0045     thresh = cms.untracked.double(0.25)
0046 )
0047 
0048 process.globalMuFilter = cms.EDFilter("TrackCountFilter", src = cms.InputTag("globalMuons"), minNumber = cms.uint32(1))
0049 
0050 process.preFilter = cms.Sequence(process.noScraping * process.oneGoodVertexFilter + process.globalMuFilter)
0051 process.Flag_BBPTX = cms.Path(process.noScraping * process.oneGoodVertexFilter + process.bptxAnd)
0052 process.Flag_BSC   = cms.Path(process.noScraping * process.oneGoodVertexFilter + process.bscFilter)
0053 
0054 process.load("MuonAnalysis.MuonAssociators.patMuonsWithTrigger_8E29_cff")
0055 #process.muonL1Info.useTrack = 'global'
0056 #process.muonL1Info.useState = 'outermost'
0057 #process.muonMatchHLTL1MuOpen.useTrack = 'global'
0058 #process.muonMatchHLTL1MuOpen.useState = 'outermost'
0059 
0060 process.load("MuonAnalysis.Examples.muonStations_cfi");
0061 from MuonAnalysis.Examples.muonStations_cfi import addUserData as addStations
0062 addStations(process.patMuonsWithoutTrigger)
0063 
0064 ## Skimming: change to fit your requirement
0065 #process.muonFilter = cms.EDFilter("PATMuonRefSelector", 
0066 #    src = cms.InputTag("patMuonsWithTrigger"), 
0067 #    cut = cms.string("isGlobalMuon"), 
0068 #    filter = cms.bool(True) 
0069 #)
0070 
0071 process.p = cms.Path(
0072     process.preFilter  +
0073     process.muonStations +
0074     process.patMuonsWithTriggerSequence 
0075 )
0076 
0077 process.out = cms.OutputModule("PoolOutputModule",
0078     fileName = cms.untracked.string('tupleData.root'),
0079     outputCommands = cms.untracked.vstring('drop *',
0080         'keep patMuons_patMuonsWithTrigger__*',                    ## All PAT muons
0081         'keep edmTriggerResults_TriggerResults_*_*',               ## HLT info, per path (cheap)
0082         'keep l1extraL1MuonParticles_l1extraParticles_*_*',        ## L1 info (cheap)
0083         #--- Other things you might want ---
0084         'keep *_offlinePrimaryVertices__*',                  ## 
0085         'keep *_offlineBeamSpot__*',                         ##
0086         '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)
0087         #'keep TrackingRecHitsOwned_standAloneMuons_*_*',     ## muon rechits, to compute things like number of stations
0088     ),
0089     SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('p') )
0090 )
0091 process.e = cms.EndPath(process.out)