CMS 3D CMS Logo

WZElectronSkims53X_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 HLTPath = "HLT_Ele*"
4 HLTProcessName = "HLT"
5 
6 ## ____ __ _____ _ _
7 ## / ___|___ / _| ____| | ___ ___| |_ _ __ ___ _ __
8 ## | | _/ __| |_| _| | |/ _ \/ __| __| '__/ _ \| '_ \
9 ## | |_| \__ \ _| |___| | __/ (__| |_| | | (_) | | | |
10 ## \____|___/_| |_____|_|\___|\___|\__|_| \___/|_| |_|
11 ##
12 # GsfElectron ################
13 
14 GsfMatchedPhotonCands = cms.EDProducer("ElectronMatchedCandidateProducer",
15  src = cms.InputTag("goodPhotons"),
16  ReferenceElectronCollection = cms.untracked.InputTag("goodElectrons"),
17  deltaR = cms.untracked.double(0.3)
18 )
19 
20 ## _____ _ _ ___ _
21 ## | ____| | ___ ___| |_ _ __ ___ _ __ |_ _|__| |
22 ## | _| | |/ _ \/ __| __| '__/ _ \| '_ \ | |/ _` |
23 ## | |___| | __/ (__| |_| | | (_) | | | | | | (_| |
24 ## |_____|_|\___|\___|\__|_| \___/|_| |_| |___\__,_|
25 ##
26 # Electron ID ######
27 
28 
29 
30 ## _____ _ __ __ _ _ _
31 ## |_ _| __(_) __ _ __ _ ___ _ __ | \/ | __ _| |_ ___| |__ (_)_ __ __ _
32 ## | || '__| |/ _` |/ _` |/ _ \ '__| | |\/| |/ _` | __/ __| '_ \| | '_ \ / _` |
33 ## | || | | | (_| | (_| | __/ | | | | | (_| | || (__| | | | | | | | (_| |
34 ## |_||_| |_|\__, |\__, |\___|_| |_| |_|\__,_|\__\___|_| |_|_|_| |_|\__, |
35 ## |___/ |___/ |___/
36 ##
37 # Trigger ##################
38 PassingHLT = cms.EDProducer("trgMatchGsfElectronProducer",
39  InputProducer = cms.InputTag( 'gedGsfElectrons' ),
40  hltTags = cms.untracked.string( HLTPath ),
41  triggerEventTag = cms.untracked.InputTag("hltTriggerSummaryAOD","",HLTProcessName),
42  triggerResultsTag = cms.untracked.InputTag("TriggerResults","",HLTProcessName)
43 )
44 
45 # WElecTagHLT = PassingHLT.clone(
46 # InputProducer = cms.InputTag( "PassingWP80" )
47 # )
48 
49 # ele_sequence = cms.Sequence(
50 # goodElectrons +
51 # PassingWP80 +
52 # WElecTagHLT
53 # )
54 
55 
57 ZSCHltFilter = HLTrigger.HLTfilters.hltHighLevel_cfi.hltHighLevel.clone(
58  throw = cms.bool(False),
59  HLTPaths = ['HLT_Ele27_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele15_CaloIdT_CaloIsoVL_trackless_v*']
60  )
61 
62 # elecMetSeq = cms.Sequence( WEnuHltFilter * ele_sequence * elecMetFilter )
63 
64 
65 selectedElectrons = cms.EDFilter("GsfElectronRefSelector",
66  src = cms.InputTag( 'gedGsfElectrons' ),
67  cut = cms.string(
68 # "(abs(superCluster.eta)<2.5) && (energy*sin(superClusterPosition.theta)> 15)")
69  "(abs(superCluster.eta)<3) && (energy*sin(superClusterPosition.theta)> 15)")
70  )
71 
72 selectedMuons = cms.EDFilter("MuonRefSelector",
73  src = cms.InputTag( 'muons' ),
74  cut = cms.string("")
75  )
76 
77 selectedPhotons = cms.EDFilter("PhotonRefSelector",
78  src = cms.InputTag( 'gedPhotons' ),
79  cut = cms.string(
80  "(abs(superCluster.eta)<3) && (pt> 10)")
81  )
82 
83 # This are the cuts at trigger level except ecalIso
84 PassingVeryLooseId = selectedElectrons.clone(
85  cut = cms.string(
86  selectedElectrons.cut.value() +
87  " && (gsfTrack.trackerExpectedHitsInner.numberOfHits<=1)" #wrt std WP90 allowing 1 numberOfMissingExpectedHits
88  " && ((isEB"
89  " && ( dr03TkSumPt/p4.Pt <0.2 "#&& dr03EcalRecHitSumEt/p4.Pt < 0.3
90  " && dr03HcalTowerSumEt/p4.Pt < 0.2 )"
91  " && (sigmaIetaIeta<0.01)"
92  " && ( -0.15<deltaPhiSuperClusterTrackAtVtx<0.15 )"
93  " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
94  " && (hadronicOverEm<0.12)"
95  ")"
96  " || (isEE"
97  " && ( dr03TkSumPt/p4.Pt <0.2"
98  #&& dr03EcalRecHitSumEt/p4.Pt < 0.3
99  " && dr03HcalTowerSumEt/p4.Pt < 0.2 )"
100  " && (sigmaIetaIeta<0.03)"
101  " && ( -0.10<deltaPhiSuperClusterTrackAtVtx<0.10 )"
102  " && ( -0.009<deltaEtaSuperClusterTrackAtVtx<0.009 )"
103  " && (hadronicOverEm<0.10) "
104  "))"
105  )
106  )
107 PassingMediumId = selectedElectrons.clone(
108  cut = cms.string(
109  selectedElectrons.cut.value() +
110  " && (gsfTrack.trackerExpectedHitsInner.numberOfHits<=1)" #wrt std WP90 allowing 1 numberOfMissingExpectedHits
111  " && ((isEB"
112  " && ( dr03TkSumPt/p4.Pt <0.2 "#&& dr03EcalRecHitSumEt/p4.Pt < 0.3
113  " && dr03HcalTowerSumEt/p4.Pt < 0.2 )"
114  " && (sigmaIetaIeta<0.01)"
115  " && ( -0.06<deltaPhiSuperClusterTrackAtVtx<0.06 )"
116  " && ( -0.004<deltaEtaSuperClusterTrackAtVtx<0.004 )"
117  " && (hadronicOverEm<0.12)"
118  ")"
119  " || (isEE"
120  " && ( dr03TkSumPt/p4.Pt <0.2"
121  #&& dr03EcalRecHitSumEt/p4.Pt < 0.3
122  " && dr03HcalTowerSumEt/p4.Pt < 0.2 )"
123  " && (sigmaIetaIeta<0.03)"
124  " && ( -0.03<deltaPhiSuperClusterTrackAtVtx<0.03 )"
125  " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
126  " && (hadronicOverEm<0.10) "
127  "))"
128  )
129  )
130 
131 PassingTightId = selectedElectrons.clone(
132  cut = cms.string(
133  selectedElectrons.cut.value() +
134  " && (gsfTrack.trackerExpectedHitsInner.numberOfHits<=0)" #wrt std WP90 allowing 1 numberOfMissingExpectedHits
135  " && ((isEB"
136  " && ( dr03TkSumPt/p4.Pt <0.2 "#&& dr03EcalRecHitSumEt/p4.Pt < 0.3
137  " && dr03HcalTowerSumEt/p4.Pt < 0.2 )"
138  " && (sigmaIetaIeta<0.01)"
139  " && ( -0.03<deltaPhiSuperClusterTrackAtVtx<0.03 )"
140  " && ( -0.004<deltaEtaSuperClusterTrackAtVtx<0.004 )"
141  " && (hadronicOverEm<0.12)"
142  ")"
143  " || (isEE"
144  " && ( dr03TkSumPt/p4.Pt <0.2"
145  #&& dr03EcalRecHitSumEt/p4.Pt < 0.3
146  " && dr03HcalTowerSumEt/p4.Pt < 0.2 )"
147  " && (sigmaIetaIeta<0.03)"
148  " && ( -0.02<deltaPhiSuperClusterTrackAtVtx<0.02 )"
149  " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
150  " && (hadronicOverEm<0.10) "
151  "))"
152  )
153  )
154 
155 PassingMuonVeryLooseId = selectedMuons.clone(
156  cut = cms.string(
157  selectedMuons.cut.value() +
158  "(isPFMuon) && (isGlobalMuon || isTrackerMuon)"
159  )
160  )
161 
162 PassingPhotonVeryLooseId = selectedPhotons.clone(
163  cut = cms.string(
164  selectedPhotons.cut.value() +
165  "&& ( (eta<1.479 && sigmaIetaIeta<0.02 && hadronicOverEm<0.06 )"
166  "||"
167  "( eta>=1.479 && sigmaIetaIeta<0.04 && hadronicOverEm<0.06 ) )"
168  )
169  )
170 
171 MuFilter = cms.EDFilter("CandViewCountFilter",
172  src = cms.InputTag("PassingMuonVeryLooseId"),
173  minNumber = cms.uint32(2)
174  )
175 PhoFilter = cms.EDFilter("CandViewCountFilter",
176  src = cms.InputTag("PassingPhotonVeryLooseId"),
177  minNumber = cms.uint32(1)
178  )
179 
180 #------------------------------ electronID producer
182 # process.EleSelectionProducers
183 
184 SCselector = cms.EDFilter("SuperClusterSelector",
185  src = cms.InputTag('correctedMulti5x5SuperClustersWithPreshower'),
186  cut = cms.string('(eta>2.4 || eta<-2.4) && (energy*sin(position.theta)> 15)')
187  )
188 
189 ### Build candidates from all the merged superclusters
190 eleSC = cms.EDProducer('ConcreteEcalCandidateProducer',
191  src = cms.InputTag('SCselector'),
192  particleType = cms.string('gamma')
193  )
194 
195 selectedCands = cms.EDFilter("AssociatedVariableMaxCutCandRefSelector",
196  src = cms.InputTag("eleSelectionProducers:loose"),
197  max = cms.double(0.5)
198  )
199 
200 eleSelSeq = cms.Sequence( selectedElectrons + PassingVeryLooseId + PassingTightId +
201  (SCselector*eleSC)
202  )
203 
204 muSelSeq = cms.Sequence( selectedMuons + PassingMuonVeryLooseId + PassingPhotonVeryLooseId + MuFilter + PhoFilter +
205  (SCselector*eleSC)
206  )
207 
208 ############################################################
209 # Selectors
210 ##############################
211 ZeeSelector = cms.EDProducer("CandViewShallowCloneCombiner",
212  decay = cms.string("PassingVeryLooseId PassingVeryLooseId"),
213  checkCharge = cms.bool(False),
214  cut = cms.string("mass > 40 && mass < 140")
215  )
216 
217 
218 #met, mt cuts for W selection
219 MT="sqrt(2*daughter(0).pt*daughter(1).pt*(1 - cos(daughter(0).phi - daughter(1).phi)))"
220 MET_CUT_MIN = 25.
221 W_ELECTRON_ET_CUT_MIN = 30.0
222 MT_CUT_MIN = 50.
223 
224 WenuSelector = cms.EDProducer("CandViewShallowCloneCombiner",
225  decay = cms.string("pfMet PassingTightId"), # charge coniugate states are implied
226  checkCharge = cms.bool(False),
227  cut = cms.string(("daughter(0).pt > %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN))
228 )
229 
230 
231 EleSCSelector = cms.EDProducer("CandViewShallowCloneCombiner",
232  decay = cms.string("PassingVeryLooseId eleSC"),
233 # decay = cms.string("selectedElectrons eleSC"),
234 # decay = cms.string("PassingVeryLooseId photons"),
235  checkCharge = cms.bool(False),
236 # cut = cms.string("40 <mass < 140 && daughter(0).pt>27")
237  cut = cms.string("40 < mass < 140 ")
238  )
239 WZSelector = cms.EDProducer("CandViewMerger",
240  src = cms.VInputTag("WenuSelector", "ZeeSelector", "EleSCSelector")
241  )
242 
243 
244 
245 ############################################################
246 # Filters
247 ##############################
248 WenuFilter = cms.EDFilter("CandViewCountFilter",
249  src = cms.InputTag("WenuSelector"),
250  minNumber = cms.uint32(1)
251  )
252 # filter events with at least one Zee candidate as identified by the ZeeSelector
253 ZeeFilter = cms.EDFilter("CandViewCountFilter",
254  src = cms.InputTag("ZeeSelector"),
255  minNumber = cms.uint32(1)
256  )
257 
258 MinZSCNumberFilter = cms.EDFilter("CandViewCountFilter",
259  #src = cms.InputTag('SCselector'),
260  src = cms.InputTag('eleSC'),
261  minNumber = cms.uint32(1)
262  )
263 ZSCFilter = cms.EDFilter("CandViewCountFilter",
264  src = cms.InputTag("EleSCSelector"),
265  minNumber = cms.uint32(1)
266  )
267 
268 WZFilter = cms.EDFilter("CandViewCountFilter",
269  src = cms.InputTag("WZSelector"),
270  minNumber = cms.uint32(1)
271  )
272 
273 FilterSeq = cms.Sequence(eleSelSeq * (ZeeSelector + WenuSelector + EleSCSelector) * WZSelector)
274 ZSCSingleEleFilterSeq = cms.Sequence(~ZSCHltFilter * eleSelSeq * EleSCSelector * ZSCFilter)
275 FilterMuSeq = cms.Sequence(muSelSeq * (ZeeSelector + WenuSelector + EleSCSelector) * WZSelector)