Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:19

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 #this is our version of the patMuonsWithTrigger from MuonAnalysis, we have rename all methods to avoid any clash, and remove
0004 #all dependencies othen than to PatAlgos.
0005 
0006 ### ==== Make PAT Muons ====
0007 
0008 import PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi
0009 oniaPATMuonsWithoutTrigger = PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi.patMuons.clone(
0010     muonSource = 'muons',
0011     # embed the tracks, so we don't have to carry them around
0012     embedTrack          = True,
0013     embedCombinedMuon   = True,
0014     embedStandAloneMuon = True,
0015     embedPFCandidate    = False,
0016     embedCaloMETMuonCorrs = cms.bool(False),
0017     embedTcMETMuonCorrs   = cms.bool(False),
0018     embedPfEcalEnergy     = cms.bool(False),
0019     # then switch off some features we don't need
0020     embedPickyMuon = False,
0021     embedTpfmsMuon = False, 
0022     userIsolation = cms.PSet(),   # no extra isolation beyond what's in reco::Muon itself
0023     isoDeposits = cms.PSet(), # no heavy isodeposits
0024     addGenMatch = False,       # no mc: T&P doesn't take it from here anyway.
0025 )
0026 # Reset all these; the default in muonProducer_cfi is not empty, but wrong
0027 oniaPATMuonsWithoutTrigger.userData.userInts.src    = []
0028 oniaPATMuonsWithoutTrigger.userData.userFloats.src  = []
0029 oniaPATMuonsWithoutTrigger.userData.userCands.src   = []
0030 oniaPATMuonsWithoutTrigger.userData.userClasses.src = []
0031 
0032 ### ==== Unpack trigger, and match ====
0033 from PhysicsTools.PatAlgos.triggerLayer1.triggerProducer_cfi import patTrigger as oniaPATTriggerTMP
0034 oniaPATTriggerTMP.onlyStandAlone = True
0035 oniaPATTrigger = cms.EDProducer("TriggerObjectFilterByCollection",
0036     src = cms.InputTag("oniaPATTriggerTMP"),
0037     collections = cms.vstring("hltL2MuonCandidates", "hltL3MuonCandidates", "hltHighPtTkMuonCands", "hltGlbTrkMuonCands")
0038 )
0039 
0040 ### ==== Then perform a match for all HLT triggers of interest
0041 PATmuonTriggerMatchHLT = cms.EDProducer( "PATTriggerMatcherDRDPtLessByR",
0042     src     = cms.InputTag( "oniaPATMuonsWithoutTrigger" ),
0043     matched = cms.InputTag( "oniaPATTrigger" ),
0044     matchedCuts = cms.string(""),
0045     maxDPtRel = cms.double( 0.5 ),
0046     maxDeltaR = cms.double( 0.5 ),
0047     resolveAmbiguities    = cms.bool( True ),
0048     resolveByMatchQuality = cms.bool( True ) #change with respect to previous tag
0049 )
0050 
0051 PATmuonMatchHLTL2   = PATmuonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltL2MuonCandidates")'), 
0052                                                    maxDeltaR = 0.3, maxDPtRel = 10.0)       #maxDeltaR Changed accordingly to Zoltan tuning. It was: 1.2
0053 PATmuonMatchHLTL3   = PATmuonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltL3MuonCandidates")'), 
0054                                                    maxDeltaR = 0.1, maxDPtRel = 10.0)       #maxDeltaR Changed accordingly to Zoltan tuning. It was: 0.5
0055 PATmuonMatchHLTL3T  = PATmuonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltGlbTrkMuonCands")'),  
0056                                                    maxDeltaR = 0.1, maxDPtRel = 10.0)       #maxDeltaR Changed accordingly to Zoltan tuning. It was: 0.5
0057 PATmuonMatchHLTTkMu = PATmuonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltHighPtTkMuonCands")'),  
0058                                                    maxDeltaR = 0.1, maxDPtRel = 10.0)       #maxDeltaR Changed accordingly to Zoltan tuning. It was: 0.5
0059 
0060 oniaPATTriggerMatchers1Mu = cms.Sequence(
0061       PATmuonMatchHLTL2 +
0062       PATmuonMatchHLTL3 +
0063       PATmuonMatchHLTL3T +
0064       PATmuonMatchHLTTkMu
0065 )
0066 
0067 oniaPATTriggerMatchers1MuInputTags = [
0068     cms.InputTag('PATmuonMatchHLTL2'),
0069     cms.InputTag('PATmuonMatchHLTL3'),
0070     cms.InputTag('PATmuonMatchHLTL3T'),
0071     cms.InputTag('PATmuonMatchHLTTkMu'),
0072 ]
0073 
0074 ## ==== Embed ====
0075 oniaPATMuonsWithTrigger = cms.EDProducer( "PATTriggerMatchMuonEmbedder",
0076     src     = cms.InputTag(  "oniaPATMuonsWithoutTrigger" ),
0077     matches = cms.VInputTag()
0078 )
0079 oniaPATMuonsWithTrigger.matches += oniaPATTriggerMatchers1MuInputTags
0080 
0081 ## ==== Trigger Sequence ====
0082 oniaPATTriggerMatching = cms.Sequence(
0083     oniaPATTriggerTMP * oniaPATTrigger * 
0084     oniaPATTriggerMatchers1Mu *
0085     oniaPATMuonsWithTrigger
0086 )
0087 
0088 oniaPATMuonsWithTriggerSequence = cms.Sequence(
0089     oniaPATMuonsWithoutTrigger *
0090     oniaPATTriggerMatching
0091 )