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 process = cms.Process("MuonsWithTrigger")
0003 
0004 ### standard includes
0005 process.load("FWCore.MessageService.MessageLogger_cfi")
0006 process.load('Configuration.StandardSequences.GeometryExtended_cff')
0007 process.load("Configuration.StandardSequences.Reconstruction_cff")
0008 process.load("Configuration.StandardSequences.MagneticField_cff")
0009 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0010 process.MessageLogger.cerr.FwkReport.reportEvery = 1000 
0011 process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(True))
0012 
0013 ### global tag
0014 #process.GlobalTag.globaltag = 'START3X_V26A::All'
0015 process.GlobalTag.globaltag = 'START3X_V26::All'
0016 
0017 ### source
0018 process.source = cms.Source("PoolSource",
0019     fileNames = cms.untracked.vstring(
0020         #'root://pcmssd12.cern.ch//data/gpetrucc/7TeV/hlt/MuHLT_MinBiasMC357_185_1.root',
0021         'root://pcmssd12.cern.ch//data/gpetrucc/7TeV/jpsi/ppMuX_Spring10_REDIGI_START3X_V26_S09_GEN-SIM-RECO_C0AC7DEB-8144-DF11-A1E1-00304867D838.root'
0022     )
0023 )
0024 
0025 ### number of events
0026 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
0027 
0028 ### FILTERS for GoodCollision
0029 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
0030 from HLTrigger.HLTfilters.hltLevel1GTSeed_cfi import hltLevel1GTSeed
0031 hltLevel1GTSeed.L1TechTriggerSeeding = cms.bool(True)
0032 process.bscFilter = hltLevel1GTSeed.clone(L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)'))
0033 process.bit40     = hltLevel1GTSeed.clone(L1SeedsLogicalExpression = cms.string('(40 OR 41)'))
0034 process.haloVeto  = hltLevel1GTSeed.clone(L1SeedsLogicalExpression = cms.string('NOT (36 OR 37 OR 38 OR 39)'))
0035 process.oneGoodVertexFilter = cms.EDFilter("VertexSelector",
0036    src = cms.InputTag("offlinePrimaryVertices"),
0037    cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 15 && position.Rho <= 2"),
0038    filter = cms.bool(True),   # otherwise it won't filter the events, just produce an empty vertex collection.
0039 )
0040 process.noScraping = cms.EDFilter("FilterOutScraping",
0041     applyfilter = cms.untracked.bool(True),
0042     debugOn = cms.untracked.bool(False), ## Or 'True' to get some per-event info
0043     numtrack = cms.untracked.uint32(10),
0044     thresh = cms.untracked.double(0.25)
0045 )
0046 process.preFilter = cms.Sequence( process.oneGoodVertexFilter * process.noScraping )
0047 process.oneRecoMu = cms.EDFilter("CandViewCountFilter", src = cms.InputTag("muons"), minNumber = cms.uint32(1))
0048 process.Skim_GOODCOLL = cms.Path(process.preFilter + process.oneRecoMu)
0049 process.Flag_BSC      = cms.Path(process.noScraping * process.oneGoodVertexFilter + process.bscFilter)
0050 process.Flag_Bit40    = cms.Path(process.bit40)
0051 process.Flag_HaloVeto = cms.Path(process.haloVeto)
0052 
0053 ### Adding Trigger Info from TriggerResultsSummary to the PATMuon
0054 process.load("MuonAnalysis.MuonAssociators.patMuonsWithTrigger_8E29_cff")
0055 from MuonAnalysis.MuonAssociators.patMuonsWithTrigger_8E29_cff import changeTriggerProcessName;
0056 #changeTriggerProcessName(process, "HLT2")   # Custom re-run HLT
0057 #changeTriggerProcessName(process, "REDIGI") # Spring10 ReDigi
0058 #process.muonL1Info.useTrack = 'global'
0059 #process.muonL1Info.useState = 'outermost'
0060 #process.muonMatchHLTL1.useTrack = 'global'
0061 #process.muonMatchHLTL1.useState = 'outermost'
0062 
0063 ### Adding MCtruth Info to the PATMuon
0064 from MuonAnalysis.MuonAssociators.patMuonsWithTrigger_8E29_cff import addMCinfo
0065 addMCinfo(process)
0066 
0067 ### Add MC classification by hits
0068 # Requires:
0069 #   SimGeneral/TrackingAnalysis V04-01-00-02 (35X) or V04-01-03+ (37X+)
0070 #   SimTracker/TrackAssociation V01-08-17    (35X+)
0071 #   SimMuon/MCTruth             V02-05-00-01 (35X) or V02-06-00+ (37X+)
0072 process.load("MuonAnalysis.MuonAssociators.muonClassificationByHits_cfi")
0073 from MuonAnalysis.MuonAssociators.muonClassificationByHits_cfi import addUserData as addClassByHits
0074 addClassByHits(process.patMuonsWithoutTrigger, extraInfo=True)
0075 
0076 ### Adding Info about the Muon Station involved to the PATMuon
0077 # Requires MuonAnalysis/Examples V00-03-00+
0078 process.load("MuonAnalysis.Examples.muonStations_cfi")
0079 from MuonAnalysis.Examples.muonStations_cfi import addUserData as addStations
0080 addStations(process.patMuonsWithoutTrigger)
0081 
0082 
0083 process.p = cms.Path(
0084     process.preFilter  +
0085     process.oneRecoMu  +
0086     process.muonClassificationByHits +
0087     process.muonStations +
0088     process.patMuonsWithTriggerSequence 
0089 )
0090 
0091 process.out = cms.OutputModule("PoolOutputModule",
0092     fileName = cms.untracked.string('tupleMC.root'),
0093     outputCommands = cms.untracked.vstring('drop *',
0094         'keep patMuons_patMuonsWithTrigger__*',                    ## All PAT muons
0095         'keep edmTriggerResults_TriggerResults_*_*',               ## HLT info, per path (cheap)
0096         'keep l1extraL1MuonParticles_l1extraParticles_*_*',        ## L1 info (cheap)
0097         #--- Other things you might want ---
0098         'keep *_offlinePrimaryVertices__*',                  ## 
0099         'keep *_offlineBeamSpot__*',                         ##
0100         '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)
0101         'keep TrackingRecHitsOwned_standAloneMuons_*_*',     ## muon rechits, to compute things like number of stations
0102     ),
0103     SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('Skim_GOODCOLL') )
0104 )
0105 process.e = cms.EndPath(process.out)