CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ZmmgSkim_cff.py
Go to the documentation of this file.
1 '''
2 Defines the selection sequence ZmmgSkimSeq for the Zmmg skim for the
3 RAW-RECO event content. It also defines several other modules and sequences
4 used:
5  ZmmgHLTFilter
6  ZmmgTrailingMuons
7  ZmmgLeadingMuons
8  ZmmgDimuons
9  ZmmgDimuonFilter
10  ZmmgDimuonSequence
11  ZmmgMergedSuperClusters
12  ZmmgPhotonCandidates
13  ZmmgPhotons
14  ZmmgPhotonSequence
15  ZmmgCandidates
16  ZmmgFilter
17  ZmmgSequence
18 
19 Jan Veverka, Caltech, 5 May 2012
20 '''
21 
22 import copy
23 import FWCore.ParameterSet.Config as cms
24 
25 
26 ###____________________________________________________________________________
27 ###
28 ### HLT Filter
29 ###____________________________________________________________________________
30 
31 import copy
33 ZmmgHLTFilter = copy.deepcopy(hltHighLevel)
34 ZmmgHLTFilter.throw = cms.bool(False)
35 ZmmgHLTFilter.HLTPaths = ['HLT_Mu*','HLT_IsoMu*','HLT_DoubleMu*']
36 
37 
38 ###____________________________________________________________________________
39 ###
40 ### Build the Dimuon Sequence
41 ###____________________________________________________________________________
42 
43 ### Get muons of needed quality for Z -> mumugamma
44 ZmmgTrailingMuons = cms.EDFilter('MuonSelector',
45  src = cms.InputTag('muons'),
46  cut = cms.string('''pt > 10 &&
47  abs(eta) < 2.4 &&
48  isGlobalMuon = 1 &&
49  isTrackerMuon = 1 &&
50  abs(innerTrack().dxy)<2.0'''),
51  filter = cms.bool(True)
52  )
53 
54 ### Require a harder pt cut on the leading leg
55 ZmmgLeadingMuons = cms.EDFilter('MuonSelector',
56  src = cms.InputTag('ZmmgTrailingMuons'),
57  cut = cms.string('pt > 20'),
58  filter = cms.bool(True)
59  )
60 
61 ### Build dimuon candidates
62 ZmmgDimuons = cms.EDProducer('CandViewShallowCloneCombiner',
63  decay = cms.string('ZmmgLeadingMuons@+ ZmmgTrailingMuons@-'),
64  checkCharge = cms.bool(True),
65  cut = cms.string('mass > 30'),
66  )
67 
68 ### Require at least one dimuon candidate
69 ZmmgDimuonFilter = cms.EDFilter('CandViewCountFilter',
70  src = cms.InputTag('ZmmgDimuons'),
71  minNumber = cms.uint32(1)
72  )
73 
74 ### Put together the dimuon sequence
75 ZmmgDimuonSequence = cms.Sequence(
76  ZmmgTrailingMuons *
77  ZmmgLeadingMuons *
78  ZmmgDimuons *
79  ZmmgDimuonFilter
80  )
81 
82 
83 ###____________________________________________________________________________
84 ###
85 ### Build the Supercluster/Photon Sequence
86 ###____________________________________________________________________________
87 
88 ### Merge the barrel and endcap superclusters
89 ZmmgMergedSuperClusters = cms.EDProducer('EgammaSuperClusterMerger',
90  src = cms.VInputTag(
91  cms.InputTag('correctedHybridSuperClusters'),
92  cms.InputTag('correctedMulti5x5SuperClustersWithPreshower')
93  )
94  )
95 
96 ### Build candidates from all the merged superclusters
97 ZmmgPhotonCandidates = cms.EDProducer('ConcreteEcalCandidateProducer',
98  src = cms.InputTag('ZmmgMergedSuperClusters'),
99  particleType = cms.string('gamma')
100  )
101 
102 ### Select photon candidates with Et > 5 GeV
103 ZmmgPhotons = cms.EDFilter('CandViewSelector',
104  src = cms.InputTag('ZmmgPhotonCandidates'),
105  cut = cms.string('et > 5'),
106  filter = cms.bool(True)
107  )
108 
109 ### Put together the photon sequence
110 ZmmgPhotonSequence = cms.Sequence(
111  ZmmgMergedSuperClusters *
112  ZmmgPhotonCandidates *
113  ZmmgPhotons
114  )
115 
116 
117 ###____________________________________________________________________________
118 ###
119 ### Build the mu-mu-gamma filter sequence
120 ###____________________________________________________________________________
121 
122 ### Combine dimuons and photons to mumugamma candidates requiring
123 ### 1. trailing muon pt + photon et > 20 GeV
124 ### 2. distance between photon and near muon deltaR < 1.5
125 ### 3. sum of invariant masses of the mmg and mm systems < 200 GeV
126 ### 4. invariant mass of the mmg system > 40 GeV
127 ### dimuon = daughter(0)
128 ### leading muon = daughter(0).daughter(0)
129 ### trailing muon = daughter(0).daughter(1)
130 ### photon = daughter(1)
131 ZmmgCandidates = cms.EDProducer('CandViewShallowCloneCombiner',
132  decay = cms.string('ZmmgDimuons ZmmgPhotons'),
133  checkCharge = cms.bool(False),
134  cut = cms.string('''
135  daughter(0).daughter(1).pt + daughter(1).pt > 20 &
136  min(deltaR(daughter(0).daughter(0).eta,
137  daughter(0).daughter(0).phi,
138  daughter(1).eta,
139  daughter(1).phi),
140  deltaR(daughter(0).daughter(1).eta,
141  daughter(0).daughter(1).phi,
142  daughter(1).eta,
143  daughter(1).phi)) < 1.5 &
144  mass + daughter(0).mass < 200 &
145  mass > 40
146  '''),
147  )
148 
149 ### Require at least one mu-mu-gamma candidate passing the cuts
150 ZmmgFilter = cms.EDFilter('CandViewCountFilter',
151  src = cms.InputTag('ZmmgCandidates'),
152  minNumber = cms.uint32(1)
153  )
154 
155 ZmmgSequence = cms.Sequence(
156  ZmmgCandidates *
157  ZmmgFilter
158  )
159 
160 
161 ###____________________________________________________________________________
162 ###
163 ### Build the full selection sequence for the ZMuMuGammaSkim
164 ###____________________________________________________________________________
165 
166 ZmmgSkimSeq = cms.Sequence(
167  ZmmgHLTFilter *
168  ZmmgDimuonSequence *
169  ZmmgPhotonSequence *
170  ZmmgSequence
171  )
172