CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ZMuSkim_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 ### HLT filter
3 import copy
5 from PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi import patGenericParticles
7 
8 ZMuHLTFilter = copy.deepcopy(hltHighLevel)
9 ZMuHLTFilter.throw = cms.bool(False)
10 ZMuHLTFilter.HLTPaths = ["HLT_Mu*","HLT_IsoMu*"]
11 
12 ### Z -> MuMu candidates
13 # Get muons of needed quality for Zs
14 
15 ###create a track collection with generic kinematic cuts
16 looseMuonsForZMuSkim = cms.EDFilter("TrackSelector",
17  src = cms.InputTag("generalTracks"),
18  cut = cms.string('pt > 10 && abs(eta)<2.4 && (charge!=0)'),
19  filter = cms.bool(True)
20  )
21 
22 
23 
24 ###cloning the previous collection into a collection of candidates
25 ConcretelooseMuonsForZMuSkim = cms.EDProducer("ConcreteChargedCandidateProducer",
26  src = cms.InputTag("looseMuonsForZMuSkim"),
27  particleType = cms.string("mu+")
28  )
29 
30 
31 
32 ###create iso deposits
33 tkIsoDepositTk = cms.EDProducer("CandIsoDepositProducer",
34  src = cms.InputTag("ConcretelooseMuonsForZMuSkim"),
35  MultipleDepositsFlag = cms.bool(False),
36  trackType = cms.string('track'),
37  ExtractorPSet = cms.PSet(
38  #MIsoTrackExtractorBlock
39  Diff_z = cms.double(0.2),
40  inputTrackCollection = cms.InputTag("generalTracks"),
41  BeamSpotLabel = cms.InputTag("offlineBeamSpot"),
42  ComponentName = cms.string('TrackExtractor'),
43  DR_Max = cms.double(0.5),
44  Diff_r = cms.double(0.1),
45  Chi2Prob_Min = cms.double(-1.0),
46  DR_Veto = cms.double(0.01),
47  NHits_Min = cms.uint32(0),
48  Chi2Ndof_Max = cms.double(1e+64),
49  Pt_Min = cms.double(-1.0),
50  DepositLabel = cms.untracked.string('tracker'),
51  BeamlineOption = cms.string('BeamSpotFromEvent')
52  )
53  )
54 
55 ###adding isodeposits to candidate collection
56 allPatTracks = patGenericParticles.clone(
57  src = cms.InputTag("ConcretelooseMuonsForZMuSkim"),
58  # isolation configurables
59  userIsolation = cms.PSet(
60  tracker = cms.PSet(
61  veto = cms.double(0.015),
62  src = cms.InputTag("tkIsoDepositTk"),
63  deltaR = cms.double(0.3),
64  #threshold = cms.double(1.5)
65  ),
66  ),
67  isoDeposits = cms.PSet(
68  tracker = cms.InputTag("tkIsoDepositTk"),
69  ),
70  )
71 
72 
73 
74 
75 ###create the "probe collection" of isolated tracks
76 looseIsoMuonsForZMuSkim = cms.EDFilter("PATGenericParticleSelector",
77  src = cms.InputTag("allPatTracks"),
78  cut = cms.string("(userIsolation('pat::TrackIso')/pt)<0.4"),
79  filter = cms.bool(True)
80  )
81 
82 
83 
84 ###create the "tag collection" of muon candidate, embedding the relevant infos
85 tightMuonsCandidateForZMuSkim = patMuons.clone(
86  src = cms.InputTag("muons"),
87  embedHighLevelSelection = cms.bool(True),
88 )
89 
90 ##apply ~tight muon ID
91 tightMuonsForZMuSkim = cms.EDFilter("PATMuonSelector",
92  src = cms.InputTag("tightMuonsCandidateForZMuSkim"),
93  cut = cms.string('(pt > 28) && (abs(eta)<2.4) && (isPFMuon>0) && (isGlobalMuon = 1) && (globalTrack().normalizedChi2() < 10) && (globalTrack().hitPattern().numberOfValidMuonHits()>0)&& (numberOfMatchedStations() > 1)&& (innerTrack().hitPattern().numberOfValidPixelHits() > 0)&& (innerTrack().hitPattern().trackerLayersWithMeasurement() > 5) && (abs(dB)<0.2) && ((isolationR03().sumPt/pt)<0.1)'),
94  filter = cms.bool(True)
95  )
96 
97 
98 # build Z-> MuMu candidates
99 dimuonsZMuSkim = cms.EDProducer("CandViewShallowCloneCombiner",
100  checkCharge = cms.bool(False),
101  cut = cms.string('(mass > 60) && (charge=0) && (abs(daughter(0).vz - daughter(1).vz) < 0.1)'),
102  decay = cms.string("tightMuonsForZMuSkim looseIsoMuonsForZMuSkim")
103  )
104 
105 
106 # Z filter
107 dimuonsFilterZMuSkim = cms.EDFilter("CandViewCountFilter",
108  src = cms.InputTag("dimuonsZMuSkim"),
109  minNumber = cms.uint32(1)
110  )
111 
112 
113 
114 diMuonSelSeq = cms.Sequence(
115  ZMuHLTFilter *
116  looseMuonsForZMuSkim *
117  ConcretelooseMuonsForZMuSkim *
118  tkIsoDepositTk *
119  allPatTracks *
120  looseIsoMuonsForZMuSkim *
121  tightMuonsCandidateForZMuSkim *
122  tightMuonsForZMuSkim *
123  dimuonsZMuSkim *
124  dimuonsFilterZMuSkim
125 )
126 
127 
128 
129 
130 
131