CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
patCandidatesForZMuMuSubskim_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
4 #####################################################
5 # PAT muons and tracks for ZMuMu subskim: no MC match
6 #####################################################
7 
8 # PAT TRACKS
9 
10 # before pat: conversion to track candidates for pat; isolation
12 patAODTrackCands.cut = 'pt > 15.'
13 
14 # pat tracks
15 from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import patGenericParticles
16 
17 allPatTracks = patGenericParticles.clone(
18  src = cms.InputTag("patAODTrackCands"),
19  embedTrack = cms.bool(True),
20  # isolation configurables
21  userIsolation = cms.PSet(
22  tracker = cms.PSet(
23  veto = cms.double(0.015),
24  src = cms.InputTag("patAODTrackIsoDepositCtfTk"),
25  deltaR = cms.double(0.3),
26  threshold = cms.double(1.5)
27  ),
28  ecal = cms.PSet(
29  src = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","ecal"),
30  deltaR = cms.double(0.3)
31  ),
32  hcal = cms.PSet(
33  src = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","hcal"),
34  deltaR = cms.double(0.3)
35  ),
36  ),
37  isoDeposits = cms.PSet(
38  tracker = cms.InputTag("patAODTrackIsoDepositCtfTk"),
39  ecal = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","ecal"),
40  hcal = cms.InputTag("patAODTrackIsoDepositCalByAssociatorTowers","hcal")
41  ),
42  addGenMatch = cms.bool(False)
43 )
44 
46 selectedPatTracks.cut = 'pt > 15. & track.dxy()<1.0'
47 
48 # PAT MUONS
49 
50 # before pat: Merge CaloMuons into the collection of reco::Muons
51 # Starting from 3_4_X a special recipe is needed for CaloMuons merging
52 # Uncomment the following lines and follow the recipe in:
53 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideMuonIsolation#To_remake_IsoDeposits_in_CMSSW_3
54 
55 #from RecoMuon.MuonIdentification.calomuons_cfi import calomuons;
56 #muons = cms.EDProducer("CaloMuonMerger",
57 # muons = cms.InputTag("muons"), # half-dirty thing. it works aslong as we're the first module using muons in the path
58 # caloMuons = cms.InputTag("calomuons"),
59 # minCaloCompatibility = calomuons.minCaloCompatibility)
60 
61 ## And re-make isolation, as we can't use the one in AOD because our collection is different
62 #import RecoMuon.MuonIsolationProducers.muIsolation_cff
63 
64 # pat muons
65 # needed starting from 3_6_1
67 #
69 patMuons.isoDeposits = cms.PSet(
70  tracker = cms.InputTag("muIsoDepositTk"),
71  ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
72  hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
73 )
74 patMuons.userIsolation = cms.PSet(
75  hcal = cms.PSet(
76  src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
77  deltaR = cms.double(0.3)
78  ),
79  tracker = cms.PSet(
80  veto = cms.double(0.015),
81  src = cms.InputTag("muIsoDepositTk"),
82  deltaR = cms.double(0.3),
83  threshold = cms.double(1.5)
84  ),
85  ecal = cms.PSet(
86  src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
87  deltaR = cms.double(0.3)
88  )
89  )
90 
91 patMuons.addGenMatch = cms.bool(False)
92 patMuons.embedTrack = cms.bool(True)
93 patMuons.embedCombinedMuon = cms.bool(True)
94 patMuons.embedStandAloneMuon = cms.bool(True)
95 patMuons.embedPickyMuon = cms.bool(False)
96 patMuons.embedTpfmsMuon = cms.bool(False)
97 patMuons.embedPFCandidate = cms.bool(False)
98 
100 selectedPatMuons.cut = 'pt > 15. & abs(eta) < 100.0 & ( (isGlobalMuon==1 & innerTrack.dxy()<1.0) | ((isTrackerMuon==1 & innerTrack.dxy()<1.0) | (isStandAloneMuon==1 & outerTrack.dxy()<1.0) ))'
101 
102 # trigger info
104 # to access 8E29 menus
105 #patTrigger.triggerResults = cms.InputTag( "TriggerResults::HLT8E29" )
106 #patTrigger.triggerEvent = cms.InputTag( "hltTriggerSummaryAOD::HLT8E29" )
107 # to access 1E31 menus
108 patTrigger.triggerResults = cms.InputTag( "TriggerResults::HLT" )
109 patTrigger.triggerEvent = cms.InputTag( "hltTriggerSummaryAOD::HLT" )
110 
111 muonTriggerMatchHLTMuons = cms.EDProducer( "PATTriggerMatcherDRDPtLessByR",
112  src = cms.InputTag( "selectedPatMuons" ),
113  matched = cms.InputTag( "patTrigger" ),
114  andOr = cms.bool( False ),
115  filterIdsEnum = cms.vstring( 'TriggerMuon' ), # 'TriggerMuon' is the enum from trigger::TriggerObjectType for HLT muons
116  filterIds = cms.vint32( 0 ),
117  filterLabels = cms.vstring( '*' ),
118  pathNames = cms.vstring( 'HLT_Mu9' ),
119  collectionTags = cms.vstring( '*' ),
120  maxDPtRel = cms.double( 1.0 ),
121  maxDeltaR = cms.double( 0.2 ),
122  resolveAmbiguities = cms.bool( True ),
123  resolveByMatchQuality = cms.bool( False )
124 )
125 
127 patTriggerEvent.patTriggerMatches = cms.VInputTag( "muonTriggerMatchHLTMuons" )
128 
129 patTriggerSequence = cms.Sequence(
130  patTrigger *
131  muonTriggerMatchHLTMuons *
132  patTriggerEvent
133 )
134 
135 selectedPatMuonsTriggerMatch = cms.EDProducer( "PATTriggerMatchMuonEmbedder",
136  src = cms.InputTag( "selectedPatMuons" ),
137  matches = cms.VInputTag( "muonTriggerMatchHLTMuons" )
138 )
139 
140 muonTriggerMatchEmbedder = cms.Sequence(
141  selectedPatMuonsTriggerMatch
142 )
143 
144 # uncomment in case of CaloMuons merging
145 #beforePatMuons = cms.Sequence(
146 # muons *
147 # muIsolation
148 #)
149 
150 beforePatTracks = cms.Sequence(
151  patAODTrackCandSequence
152 )
153 
154 beforePat = cms.Sequence(
155 # uncomment in case of CaloMuons merging
156 # beforePatMuons *
157  beforePatTracks
158 )
159 
160 patCandsSequence = cms.Sequence(
161  patMuons *
162  selectedPatMuons *
163  allPatTracks *
164  selectedPatTracks
165 )
166 
167 goodMuonRecoForDimuon = cms.Sequence(
168  beforePat *
169  patCandsSequence *
170  patTriggerSequence *
171  muonTriggerMatchEmbedder
172 )
173