CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LeptonAnalyzer.py
Go to the documentation of this file.
1 from PhysicsTools.Heppy.analyzers.core.Analyzer import Analyzer
2 from PhysicsTools.Heppy.analyzers.core.AutoHandle import AutoHandle
3 from PhysicsTools.Heppy.physicsobjects.Electron import Electron
4 from PhysicsTools.Heppy.physicsobjects.Muon import Muon
5 #from CMGTools.TTHAnalysis.tools.EfficiencyCorrector import EfficiencyCorrector
6 
7 from PhysicsTools.HeppyCore.utils.deltar import bestMatch
8 from PhysicsTools.Heppy.physicsutils.RochesterCorrections import rochcor
9 from PhysicsTools.Heppy.physicsutils.MuScleFitCorrector import MuScleFitCorr
10 from PhysicsTools.Heppy.physicsutils.ElectronCalibrator import EmbeddedElectronCalibrator
11 #from CMGTools.TTHAnalysis.electronCalibrator import ElectronCalibrator
15 
16 
17 from ROOT import heppy
18 cmgMuonCleanerBySegments = heppy.CMGMuonCleanerBySegmentsAlgo()
19 
20 class LeptonAnalyzer( Analyzer ):
21 
22 
23  def __init__(self, cfg_ana, cfg_comp, looperName ):
24  super(LeptonAnalyzer,self).__init__(cfg_ana,cfg_comp,looperName)
25  if self.cfg_ana.doMuScleFitCorrections and self.cfg_ana.doMuScleFitCorrections != "none":
26  if self.cfg_ana.doMuScleFitCorrections not in [ "none", "prompt", "prompt-sync", "rereco", "rereco-sync" ]:
27  raise RuntimeError, 'doMuScleFitCorrections must be one of "none", "prompt", "prompt-sync", "rereco", "rereco-sync"'
28  rereco = ("prompt" not in self.cfg_ana.doMuScleFitCorrections)
29  sync = ("sync" in self.cfg_ana.doMuScleFitCorrections)
30  self.muscleCorr = MuScleFitCorr(cfg_comp.isMC, rereco, sync)
31  if hasattr(self.cfg_ana, "doRochesterCorrections") and self.cfg_ana.doRochesterCorrections:
32  raise RuntimeError, "You can't run both Rochester and MuScleFit corrections!"
33  else:
34  self.cfg_ana.doMuScleFitCorrections = False
35  #FIXME: only Embedded works
36  self.electronEnergyCalibrator = EmbeddedElectronCalibrator()
37 # if hasattr(cfg_comp,'efficiency'):
38 # self.efficiency= EfficiencyCorrector(cfg_comp.efficiency)
39  self.eleEffectiveArea = getattr(cfg_ana, 'ele_effectiveAreas', "Phys14_25ns_v1")
40  self.muEffectiveArea = getattr(cfg_ana, 'mu_effectiveAreas', "Phys14_25ns_v1")
41  #----------------------------------------
42  # DECLARATION OF HANDLES OF LEPTONS STUFF
43  #----------------------------------------
44 
45 
46  def declareHandles(self):
47  super(LeptonAnalyzer, self).declareHandles()
48 
49  #leptons
50  self.handles['muons'] = AutoHandle(self.cfg_ana.muons,"std::vector<pat::Muon>")
51  self.handles['electrons'] = AutoHandle(self.cfg_ana.electrons,"std::vector<pat::Electron>")
52 
53  #rho for muons
54  self.handles['rhoMu'] = AutoHandle( self.cfg_ana.rhoMuon, 'double')
55  #rho for electrons
56  self.handles['rhoEle'] = AutoHandle( self.cfg_ana.rhoElectron, 'double')
57 
58  def beginLoop(self, setup):
59  super(LeptonAnalyzer,self).beginLoop(setup)
60  self.counters.addCounter('events')
61  count = self.counters.counter('events')
62  count.register('all events')
63 
64  #------------------
65  # MAKE LEPTON LISTS
66  #------------------
67 
68 
69  def makeLeptons(self, event):
70  ### inclusive leptons = all leptons that could be considered somewhere in the analysis, with minimal requirements (used e.g. to match to MC)
71  event.inclusiveLeptons = []
72  ### selected leptons = subset of inclusive leptons passing some basic id definition and pt requirement
73  ### other leptons = subset of inclusive leptons failing some basic id definition and pt requirement
74  event.selectedLeptons = []
75  event.selectedMuons = []
76  event.selectedElectrons = []
77  event.otherLeptons = []
78 
79  #muons
80  allmuons = self.makeAllMuons(event)
81 
82  for mu in allmuons:
83  # inclusive, very loose, selection
84  if (mu.track().isNonnull() and mu.muonID(self.cfg_ana.inclusive_muon_id) and
85  mu.pt()>self.cfg_ana.inclusive_muon_pt and abs(mu.eta())<self.cfg_ana.inclusive_muon_eta and
86  abs(mu.dxy())<self.cfg_ana.inclusive_muon_dxy and abs(mu.dz())<self.cfg_ana.inclusive_muon_dz):
87  event.inclusiveLeptons.append(mu)
88  # basic selection
89  if (mu.muonID(self.cfg_ana.loose_muon_id) and
90  mu.pt() > self.cfg_ana.loose_muon_pt and abs(mu.eta()) < self.cfg_ana.loose_muon_eta and
91  abs(mu.dxy()) < self.cfg_ana.loose_muon_dxy and abs(mu.dz()) < self.cfg_ana.loose_muon_dz and
92  mu.relIso03 < self.cfg_ana.loose_muon_relIso and
93  mu.absIso03 < (self.cfg_ana.loose_muon_absIso if hasattr(self.cfg_ana,'loose_muon_absIso') else 9e99)):
94  mu.looseIdSusy = True
95  event.selectedLeptons.append(mu)
96  event.selectedMuons.append(mu)
97  else:
98  mu.looseIdSusy = False
99  event.otherLeptons.append(mu)
100 
101  #electrons
102  allelectrons = self.makeAllElectrons(event)
103 
104  looseMuons = event.selectedLeptons[:]
105  for ele in allelectrons:
106  ## remove muons if muForEleCrossCleaning is not empty
107  ## apply selection
108  if ( ele.electronID(self.cfg_ana.inclusive_electron_id) and
109  ele.pt()>self.cfg_ana.inclusive_electron_pt and abs(ele.eta())<self.cfg_ana.inclusive_electron_eta and
110  abs(ele.dxy())<self.cfg_ana.inclusive_electron_dxy and abs(ele.dz())<self.cfg_ana.inclusive_electron_dz and
111  ele.lostInner()<=self.cfg_ana.inclusive_electron_lostHits ):
112  event.inclusiveLeptons.append(ele)
113  # basic selection
114  if (ele.electronID(self.cfg_ana.loose_electron_id) and
115  ele.pt()>self.cfg_ana.loose_electron_pt and abs(ele.eta())<self.cfg_ana.loose_electron_eta and
116  abs(ele.dxy()) < self.cfg_ana.loose_electron_dxy and abs(ele.dz())<self.cfg_ana.loose_electron_dz and
117  ele.relIso03 <= self.cfg_ana.loose_electron_relIso and
118  ele.absIso03 < (self.cfg_ana.loose_electron_absIso if hasattr(self.cfg_ana,'loose_electron_absIso') else 9e99) and
119  ele.lostInner() <= self.cfg_ana.loose_electron_lostHits and
120  ( True if (hasattr(self.cfg_ana,'notCleaningElectrons') and self.cfg_ana.notCleaningElectrons) else (bestMatch(ele, looseMuons)[1] > (self.cfg_ana.min_dr_electron_muon**2)) )):
121  event.selectedLeptons.append(ele)
122  event.selectedElectrons.append(ele)
123  ele.looseIdSusy = True
124  else:
125  event.otherLeptons.append(ele)
126  ele.looseIdSusy = False
127 
128  event.otherLeptons.sort(key = lambda l : l.pt(), reverse = True)
129  event.selectedLeptons.sort(key = lambda l : l.pt(), reverse = True)
130  event.selectedMuons.sort(key = lambda l : l.pt(), reverse = True)
131  event.selectedElectrons.sort(key = lambda l : l.pt(), reverse = True)
132  event.inclusiveLeptons.sort(key = lambda l : l.pt(), reverse = True)
133 
134  for lepton in event.selectedLeptons:
135  if hasattr(self,'efficiency'):
136  self.efficiency.attachToObject(lepton)
137 
138  def makeAllMuons(self, event):
139  """
140  make a list of all muons, and apply basic corrections to them
141  """
142  # Start from all muons
143  allmuons = map( Muon, self.handles['muons'].product() )
144 
145  # Muon scale and resolution corrections (if enabled)
146  if self.cfg_ana.doMuScleFitCorrections:
147  for mu in allmuons:
148  self.muscleCorr.correct(mu, event.run)
149  elif self.cfg_ana.doRochesterCorrections:
150  for mu in allmuons:
151  corp4 = rochcor.corrected_p4(mu, event.run)
152  mu.setP4( corp4 )
153 
154  # Clean up dulicate muons (note: has no effect unless the muon id is removed)
155  if self.cfg_ana.doSegmentBasedMuonCleaning:
156  isgood = cmgMuonCleanerBySegments.clean( self.handles['muons'].product() )
157  newmu = []
158  for i,mu in enumerate(allmuons):
159  if isgood[i]: newmu.append(mu)
160  allmuons = newmu
161 
162  # Attach EAs for isolation:
163  for mu in allmuons:
164  mu.rho = float(self.handles['rhoMu'].product()[0])
165  if self.muEffectiveArea == "Data2012":
166  if aeta < 1.0 : mu.EffectiveArea03 = 0.382;
167  elif aeta < 1.47 : mu.EffectiveArea03 = 0.317;
168  elif aeta < 2.0 : mu.EffectiveArea03 = 0.242;
169  elif aeta < 2.2 : mu.EffectiveArea03 = 0.326;
170  elif aeta < 2.3 : mu.EffectiveArea03 = 0.462;
171  else : mu.EffectiveArea03 = 0.372;
172  if aeta < 1.0 : mu.EffectiveArea04 = 0.674;
173  elif aeta < 1.47 : mu.EffectiveArea04 = 0.565;
174  elif aeta < 2.0 : mu.EffectiveArea04 = 0.442;
175  elif aeta < 2.2 : mu.EffectiveArea04 = 0.515;
176  elif aeta < 2.3 : mu.EffectiveArea04 = 0.821;
177  else : mu.EffectiveArea04 = 0.660;
178  elif self.muEffectiveArea == "Phys14_25ns_v1":
179  aeta = abs(mu.eta())
180  if aeta < 0.800: mu.EffectiveArea03 = 0.0913
181  elif aeta < 1.300: mu.EffectiveArea03 = 0.0765
182  elif aeta < 2.000: mu.EffectiveArea03 = 0.0546
183  elif aeta < 2.200: mu.EffectiveArea03 = 0.0728
184  else: mu.EffectiveArea03 = 0.1177
185  if aeta < 0.800: mu.EffectiveArea04 = 0.1564
186  elif aeta < 1.300: mu.EffectiveArea04 = 0.1325
187  elif aeta < 2.000: mu.EffectiveArea04 = 0.0913
188  elif aeta < 2.200: mu.EffectiveArea04 = 0.1212
189  else: mu.EffectiveArea04 = 0.2085
190  else: raise RuntimeError, "Unsupported value for mu_effectiveAreas: can only use Data2012 (rho: ?) and Phys14_v1 (rho: fixedGridRhoFastjetAll)"
191  # Attach the vertex to them, for dxy/dz calculation
192  for mu in allmuons:
193  mu.associatedVertex = event.goodVertices[0]
194 
195  # Compute relIso in 0.3 and 0.4 cones
196  for mu in allmuons:
197  if self.cfg_ana.mu_isoCorr=="rhoArea" :
198  mu.absIso03 = (mu.pfIsolationR03().sumChargedHadronPt + max( mu.pfIsolationR03().sumNeutralHadronEt + mu.pfIsolationR03().sumPhotonEt - mu.rho * mu.EffectiveArea03,0.0))
199  mu.absIso04 = (mu.pfIsolationR04().sumChargedHadronPt + max( mu.pfIsolationR04().sumNeutralHadronEt + mu.pfIsolationR04().sumPhotonEt - mu.rho * mu.EffectiveArea04,0.0))
200  elif self.cfg_ana.mu_isoCorr=="deltaBeta" :
201  mu.absIso03 = (mu.pfIsolationR03().sumChargedHadronPt + max( mu.pfIsolationR03().sumNeutralHadronEt + mu.pfIsolationR03().sumPhotonEt - mu.pfIsolationR03().sumPUPt/2,0.0))
202  mu.absIso04 = (mu.pfIsolationR04().sumChargedHadronPt + max( mu.pfIsolationR04().sumNeutralHadronEt + mu.pfIsolationR04().sumPhotonEt - mu.pfIsolationR04().sumPUPt/2,0.0))
203  else :
204  raise RuntimeError, "Unsupported mu_isoCorr name '" + str(self.cfg_ana.mu_isoCorr) + "'! For now only 'rhoArea' and 'deltaBeta' are supported."
205  mu.relIso03 = mu.absIso03/mu.pt()
206  mu.relIso04 = mu.absIso04/mu.pt()
207 
208  return allmuons
209 
210  def makeAllElectrons(self, event):
211  """
212  make a list of all electrons, and apply basic corrections to them
213  """
214  allelectrons = map( Electron, self.handles['electrons'].product() )
215 
216  ## Duplicate removal for fast sim (to be checked if still necessary in latest greatest 5.3.X releases)
217  allelenodup = []
218  for e in allelectrons:
219  dup = False
220  for e2 in allelenodup:
221  if abs(e.pt()-e2.pt()) < 1e-6 and abs(e.eta()-e2.eta()) < 1e-6 and abs(e.phi()-e2.phi()) < 1e-6 and e.charge() == e2.charge():
222  dup = True
223  break
224  if not dup: allelenodup.append(e)
225  allelectrons = allelenodup
226 
227  # fill EA for rho-corrected isolation
228  for ele in allelectrons:
229  ele.rho = float(self.handles['rhoEle'].product()[0])
230  if self.eleEffectiveArea == "Data2012":
231  # https://twiki.cern.ch/twiki/bin/viewauth/CMS/EgammaEARhoCorrection?rev=14
232  SCEta = abs(ele.superCluster().eta())
233  if SCEta < 1.0 : ele.EffectiveArea03 = 0.13 # 0.130;
234  elif SCEta < 1.479: ele.EffectiveArea03 = 0.14 # 0.137;
235  elif SCEta < 2.0 : ele.EffectiveArea03 = 0.07 # 0.067;
236  elif SCEta < 2.2 : ele.EffectiveArea03 = 0.09 # 0.089;
237  elif SCEta < 2.3 : ele.EffectiveArea03 = 0.11 # 0.107;
238  elif SCEta < 2.4 : ele.EffectiveArea03 = 0.11 # 0.110;
239  else : ele.EffectiveArea03 = 0.14 # 0.138;
240  if SCEta < 1.0 : ele.EffectiveArea04 = 0.208;
241  elif SCEta < 1.479: ele.EffectiveArea04 = 0.209;
242  elif SCEta < 2.0 : ele.EffectiveArea04 = 0.115;
243  elif SCEta < 2.2 : ele.EffectiveArea04 = 0.143;
244  elif SCEta < 2.3 : ele.EffectiveArea04 = 0.183;
245  elif SCEta < 2.4 : ele.EffectiveArea04 = 0.194;
246  else : ele.EffectiveArea04 = 0.261;
247  elif self.eleEffectiveArea == "Phys14_25ns_v1":
248  aeta = abs(ele.eta())
249  if aeta < 0.800: ele.EffectiveArea03 = 0.1013
250  elif aeta < 1.300: ele.EffectiveArea03 = 0.0988
251  elif aeta < 2.000: ele.EffectiveArea03 = 0.0572
252  elif aeta < 2.200: ele.EffectiveArea03 = 0.0842
253  else: ele.EffectiveArea03 = 0.1530
254  if aeta < 0.800: ele.EffectiveArea04 = 0.1830
255  elif aeta < 1.300: ele.EffectiveArea04 = 0.1734
256  elif aeta < 2.000: ele.EffectiveArea04 = 0.1077
257  elif aeta < 2.200: ele.EffectiveArea04 = 0.1565
258  else: ele.EffectiveArea04 = 0.2680
259  else: raise RuntimeError, "Unsupported value for ele_effectiveAreas: can only use Data2012 (rho: ?) and Phys14_v1 (rho: fixedGridRhoFastjetAll)"
260 
261  # Electron scale calibrations
262  if self.cfg_ana.doElectronScaleCorrections:
263  for ele in allelectrons:
264  self.electronEnergyCalibrator.correct(ele, event.run)
265 
266  # Attach the vertex
267  for ele in allelectrons:
268  ele.associatedVertex = event.goodVertices[0]
269 
270  # Compute relIso with R=0.3 and R=0.4 cones
271  for ele in allelectrons:
272  if self.cfg_ana.ele_isoCorr=="rhoArea" :
273  ele.absIso03 = (ele.chargedHadronIsoR(0.3) + max(ele.neutralHadronIsoR(0.3)+ele.photonIsoR(0.3)-ele.rho*ele.EffectiveArea03,0))
274  ele.absIso04 = (ele.chargedHadronIsoR(0.4) + max(ele.neutralHadronIsoR(0.4)+ele.photonIsoR(0.4)-ele.rho*ele.EffectiveArea04,0))
275  elif self.cfg_ana.ele_isoCorr=="deltaBeta" :
276  ele.absIso03 = (ele.chargedHadronIsoR(0.3) + max( ele.neutralHadronIsoR(0.3)+ele.photonIsoR(0.3) - ele.puChargedHadronIsoR(0.3)/2, 0.0))
277  ele.absIso04 = (ele.chargedHadronIsoR(0.4) + max( ele.neutralHadronIsoR(0.4)+ele.photonIsoR(0.4) - ele.puChargedHadronIsoR(0.4)/2, 0.0))
278  else :
279  raise RuntimeError, "Unsupported ele_isoCorr name '" + str(self.cfg_ana.ele_isoCorr) + "'! For now only 'rhoArea' and 'deltaBeta' are supported."
280  ele.relIso03 = ele.absIso03/ele.pt()
281  ele.relIso04 = ele.absIso04/ele.pt()
282 
283  # Set tight MVA id
284  for ele in allelectrons:
285  if self.cfg_ana.ele_tightId=="MVA" :
286  ele.tightIdResult = ele.electronID("POG_MVA_ID_Trig_full5x5")
287  elif self.cfg_ana.ele_tightId=="Cuts_2012" :
288  ele.tightIdResult = -1 + 1*ele.electronID("POG_Cuts_ID_2012_Veto_full5x5") + 1*ele.electronID("POG_Cuts_ID_2012_Loose_full5x5") + 1*ele.electronID("POG_Cuts_ID_2012_Medium_full5x5") + 1*ele.electronID("POG_Cuts_ID_2012_Tight_full5x5")
289  else :
290  raise RuntimeError, "Unsupported ele_tightId name '" + str(self.cfg_ana.ele_tightId) + "'! For now only 'MVA' and 'Cuts_2012' are supported."
291 
292 
293  return allelectrons
294 
295  def matchLeptons(self, event):
296  def plausible(rec,gen):
297  if abs(rec.pdgId()) == 11 and abs(gen.pdgId()) != 11: return False
298  if abs(rec.pdgId()) == 13 and abs(gen.pdgId()) != 13: return False
299  dr = deltaR(rec.eta(),rec.phi(),gen.eta(),gen.phi())
300  if dr < 0.3: return True
301  if rec.pt() < 10 and abs(rec.pdgId()) == 13 and gen.pdgId() != rec.pdgId(): return False
302  if dr < 0.7: return True
303  if min(rec.pt(),gen.pt())/max(rec.pt(),gen.pt()) < 0.3: return False
304  return True
305 
306  leps = event.inclusiveLeptons if self.cfg_ana.match_inclusiveLeptons else event.selectedLeptons
307  match = matchObjectCollection3(leps,
308  event.genleps + event.gentauleps,
309  deltaRMax = 1.2, filter = plausible)
310  for lep in leps:
311  gen = match[lep]
312  lep.mcMatchId = (gen.sourceId if gen != None else 0)
313  lep.mcMatchTau = (gen in event.gentauleps if gen else -99)
314 
315  def isFromB(self,particle,bid=5, done={}):
316  for i in xrange( particle.numberOfMothers() ):
317  mom = particle.mother(i)
318  momid = abs(mom.pdgId())
319  if momid / 1000 == bid or momid / 100 == bid or momid == bid:
320  return True
321  elif mom.status() == 2 and self.isFromB(mom, done=done):
322  return True
323  return False
324 
325  def matchAnyLeptons(self, event):
326  event.anyLeptons = [ x for x in event.genParticles if x.status() == 1 and abs(x.pdgId()) in [11,13] ]
327  leps = event.inclusiveLeptons if hasattr(event, 'inclusiveLeptons') else event.selectedLeptons
328  match = matchObjectCollection3(leps, event.anyLeptons, deltaRMax = 0.3, filter = lambda x,y : abs(x.pdgId()) == abs(y.pdgId()))
329  for lep in leps:
330  gen = match[lep]
331  lep.mcMatchAny_gp = gen
332  if gen:
333  if self.isFromB(gen): lep.mcMatchAny = 5 # B (inclusive of B->D)
334  elif self.isFromB(gen,bid=4): lep.mcMatchAny = 4 # Charm
335  else: lep.mcMatchAny = 1
336  else:
337  lep.mcMatchAny = 0
338  # fix case where the matching with the only prompt leptons failed, but we still ended up with a prompt match
339  if gen != None and hasattr(lep,'mcMatchId') and lep.mcMatchId == 0:
340  if isPromptLepton(gen, False): lep.mcMatchId = 100
341  elif not hasattr(lep,'mcMatchId'):
342  lep.mcMatchId = 0
343  if not hasattr(lep,'mcMatchTau'): lep.mcMatchTau = 0
344 
345  def process(self, event):
346  self.readCollections( event.input )
347  self.counters.counter('events').inc('all events')
348 
349  #call the leptons functions
350  self.makeLeptons(event)
351 
352  if self.cfg_comp.isMC and self.cfg_ana.do_mc_match:
353  self.matchLeptons(event)
354  self.matchAnyLeptons(event)
355 
356  return True
357 
358 #A default config
359 setattr(LeptonAnalyzer,"defaultConfig",cfg.Analyzer(
360  verbose=False,
361  class_object=LeptonAnalyzer,
362  # input collections
363  muons='slimmedMuons',
364  electrons='slimmedElectrons',
365  rhoMuon= 'fixedGridRhoFastjetAll',
366  rhoElectron = 'fixedGridRhoFastjetAll',
367 ## photons='slimmedPhotons',
368  # energy scale corrections and ghost muon suppression (off by default)
369  doMuScleFitCorrections=False, # "rereco"
370  doRochesterCorrections=False,
371  doElectronScaleCorrections=False, # "embedded" in 5.18 for regression
372  doSegmentBasedMuonCleaning=False,
373  # inclusive very loose muon selection
374  inclusive_muon_id = "POG_ID_Loose",
375  inclusive_muon_pt = 3,
376  inclusive_muon_eta = 2.4,
377  inclusive_muon_dxy = 0.5,
378  inclusive_muon_dz = 1.0,
379  # loose muon selection
380  loose_muon_id = "POG_ID_Loose",
381  loose_muon_pt = 5,
382  loose_muon_eta = 2.4,
383  loose_muon_dxy = 0.05,
384  loose_muon_dz = 0.2,
385  loose_muon_relIso = 0.4,
386  # inclusive very loose electron selection
387  inclusive_electron_id = "",
388  inclusive_electron_pt = 5,
389  inclusive_electron_eta = 2.5,
390  inclusive_electron_dxy = 0.5,
391  inclusive_electron_dz = 1.0,
392  inclusive_electron_lostHits = 1.0,
393  # loose electron selection
394  loose_electron_id = "", #POG_MVA_ID_NonTrig_full5x5",
395  loose_electron_pt = 7,
396  loose_electron_eta = 2.4,
397  loose_electron_dxy = 0.05,
398  loose_electron_dz = 0.2,
399  loose_electron_relIso = 0.4,
400  loose_electron_lostHits = 1.0,
401  # muon isolation correction method (can be "rhoArea" or "deltaBeta")
402  mu_isoCorr = "rhoArea" ,
403  mu_effectiveAreas = "Phys14_25ns_v1", #(can be 'Data2012' or 'Phys14_25ns_v1')
404  # electron isolation correction method (can be "rhoArea" or "deltaBeta")
405  ele_isoCorr = "rhoArea" ,
406  el_effectiveAreas = "Phys14_25ns_v1" , #(can be 'Data2012' or 'Phys14_25ns_v1')
407  ele_tightId = "Cuts_2012" ,
408  # minimum deltaR between a loose electron and a loose muon (on overlaps, discard the electron)
409  min_dr_electron_muon = 0.02,
410  # do MC matching
411  do_mc_match = True, # note: it will in any case try it only on MC, not on data
412  match_inclusiveLeptons = False, # match to all inclusive leptons
413  )
414 )
def bestMatch
Definition: deltar.py:133
T eta() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
eleEffectiveArea
Duplicate removal for fast sim (to be checked if still necessary in latest greatest 5...
def isPromptLepton
Definition: genutils.py:49
def matchObjectCollection3
Definition: deltar.py:38