CMS 3D CMS Logo

oniaPATMuonsWithTrigger_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 #this is our version of the patMuonsWithTrigger from MuonAnalysis, we have rename all methods to avoid any clash, and remove
4 #all dependencies othen than to PatAlgos.
5 
6 ### ==== Make PAT Muons ====
7 
9 oniaPATMuonsWithoutTrigger = PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi.patMuons.clone(
10  muonSource = 'muons',
11  # embed the tracks, so we don't have to carry them around
12  embedTrack = True,
13  embedCombinedMuon = True,
14  embedStandAloneMuon = True,
15  embedPFCandidate = False,
16  embedCaloMETMuonCorrs = cms.bool(False),
17  embedTcMETMuonCorrs = cms.bool(False),
18  embedPfEcalEnergy = cms.bool(False),
19  # then switch off some features we don't need
20  embedPickyMuon = False,
21  embedTpfmsMuon = False,
22  userIsolation = cms.PSet(), # no extra isolation beyond what's in reco::Muon itself
23  isoDeposits = cms.PSet(), # no heavy isodeposits
24  addGenMatch = False, # no mc: T&P doesn't take it from here anyway.
25 )
26 # Reset all these; the default in muonProducer_cfi is not empty, but wrong
27 oniaPATMuonsWithoutTrigger.userData.userInts.src = []
28 oniaPATMuonsWithoutTrigger.userData.userFloats.src = []
29 oniaPATMuonsWithoutTrigger.userData.userCands.src = []
30 oniaPATMuonsWithoutTrigger.userData.userClasses.src = []
31 
32 ### ==== Unpack trigger, and match ====
33 from PhysicsTools.PatAlgos.triggerLayer1.triggerProducer_cfi import patTrigger as oniaPATTriggerTMP
34 oniaPATTriggerTMP.onlyStandAlone = True
35 oniaPATTrigger = cms.EDProducer("TriggerObjectFilterByCollection",
36  src = cms.InputTag("oniaPATTriggerTMP"),
37  collections = cms.vstring("hltL2MuonCandidates", "hltL3MuonCandidates", "hltHighPtTkMuonCands", "hltGlbTrkMuonCands")
38 )
39 
40 ### ==== Then perform a match for all HLT triggers of interest
41 PATmuonTriggerMatchHLT = cms.EDProducer( "PATTriggerMatcherDRDPtLessByR",
42  src = cms.InputTag( "oniaPATMuonsWithoutTrigger" ),
43  matched = cms.InputTag( "oniaPATTrigger" ),
44  matchedCuts = cms.string(""),
45  maxDPtRel = cms.double( 0.5 ),
46  maxDeltaR = cms.double( 0.5 ),
47  resolveAmbiguities = cms.bool( True ),
48  resolveByMatchQuality = cms.bool( True ) #change with respect to previous tag
49 )
50 
51 PATmuonMatchHLTL2 = PATmuonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltL2MuonCandidates")'),
52  maxDeltaR = 0.3, maxDPtRel = 10.0) #maxDeltaR Changed accordingly to Zoltan tuning. It was: 1.2
53 PATmuonMatchHLTL3 = PATmuonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltL3MuonCandidates")'),
54  maxDeltaR = 0.1, maxDPtRel = 10.0) #maxDeltaR Changed accordingly to Zoltan tuning. It was: 0.5
55 PATmuonMatchHLTL3T = PATmuonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltGlbTrkMuonCands")'),
56  maxDeltaR = 0.1, maxDPtRel = 10.0) #maxDeltaR Changed accordingly to Zoltan tuning. It was: 0.5
57 PATmuonMatchHLTTkMu = PATmuonTriggerMatchHLT.clone(matchedCuts = cms.string('coll("hltHighPtTkMuonCands")'),
58  maxDeltaR = 0.1, maxDPtRel = 10.0) #maxDeltaR Changed accordingly to Zoltan tuning. It was: 0.5
59 
60 oniaPATTriggerMatchers1Mu = cms.Sequence(
61  PATmuonMatchHLTL2 +
62  PATmuonMatchHLTL3 +
63  PATmuonMatchHLTL3T +
64  PATmuonMatchHLTTkMu
65 )
66 
67 oniaPATTriggerMatchers1MuInputTags = [
68  cms.InputTag('PATmuonMatchHLTL2'),
69  cms.InputTag('PATmuonMatchHLTL3'),
70  cms.InputTag('PATmuonMatchHLTL3T'),
71  cms.InputTag('PATmuonMatchHLTTkMu'),
72 ]
73 
74 ## ==== Embed ====
75 oniaPATMuonsWithTrigger = cms.EDProducer( "PATTriggerMatchMuonEmbedder",
76  src = cms.InputTag( "oniaPATMuonsWithoutTrigger" ),
77  matches = cms.VInputTag()
78 )
79 oniaPATMuonsWithTrigger.matches += oniaPATTriggerMatchers1MuInputTags
80 
81 ## ==== Trigger Sequence ====
82 oniaPATTriggerMatching = cms.Sequence(
83  oniaPATTriggerTMP * oniaPATTrigger *
84  oniaPATTriggerMatchers1Mu *
85  oniaPATMuonsWithTrigger
86 )
87 
88 oniaPATMuonsWithTriggerSequence = cms.Sequence(
89  oniaPATMuonsWithoutTrigger *
90  oniaPATTriggerMatching
91 )