def isFOMuonEwkino(chain, index): if getattr( chain, 'is_loose_lepton', None ) is not None and chain.is_loose_lepton[ index] is not None and chain.is_loose_lepton[index][1] == 'ewkino': if not chain.is_loose_lepton[index][0]: return False else: if not isLooseMuonEwkino(chain, index): return False if chain._lPt[index] <= 10: return False if not chain._lPOGMedium[index]: return False if chain._leptonMvaTTH[index] <= 0.4: if chain._ptRatio[index] < 0.35: return False looseWP = getBTagWP(chain.year, 'loose', 'Deep') mediumWP = getBTagWP(chain.year, 'medium', 'Deep') if chain.year == 2016: if (chain._closestJetDeepFlavor_b[index] + chain._closestJetDeepFlavor_bb[index] + chain._closestJetDeepFlavor_lepb[index]) >= slidingCutMuon( chain, index, 10., looseWP / 1.5, 50., looseWP / 5.): return False else: if (chain._closestJetDeepFlavor_b[index] + chain._closestJetDeepFlavor_bb[index] + chain._closestJetDeepFlavor_lepb[index]) >= slidingCutMuon( chain, index, 10., mediumWP / 2., 50., looseWP / 5.): return False return True
def isTightElectronEwkino(chain, index): if getattr( chain, 'is_FO_lepton', None ) is not None and chain.is_loose_lepton[ index] is not None and chain.is_loose_lepton[index][1] == 'ewkino': if not chain.is_loose_lepton[index][0]: return False else: if not isLooseElectronEwkino(chain, index): return False if chain._lPt[index] <= 10: return False if chain._lElectronMissingHits[index] != 0: return False if abs(chain._lEta[index] ) < 1.479 and chain._lElectronSigmaIetaIeta[index] > 0.011: return False if 1.479 < abs(chain._lEta[index] ) and chain._lElectronSigmaIetaIeta[index] > 0.033: return False if chain._lElectronEInvMinusPInv[index] < -0.04: return False if chain._lElectronHOverE[index] > 0.1: return False if (chain._closestJetDeepFlavor_b[index] + chain._closestJetDeepFlavor_bb[index] + chain._closestJetDeepFlavor_lepb[index]) >= getBTagWP( chain.year, 'tight', 'Deep'): return False if not chain._lElectronPassConvVeto[index]: return False if chain._leptonMvaTTH[index] <= 0.4: return False return True
def isTightBJetLuka(chain, index): if not isGoodJet(chain, index, cleaned='loose', selection='Luka'): return False if readBTagValue(chain, index, 'Deep') < getBTagWP(chain.year, 'tight', 'Deep'): return False return True
def isLooseBJetTTT(chain, index): if not isGoodJet(chain, index, cleaned='loose', selection='TTT'): return False if readBTagValue(chain, index, 'Deep') < getBTagWP(chain.year, 'loose', 'Deep'): return False return True
def isTightBJetAN2017014(chain, index): if not isGoodJet(chain, index, cleaned=None, selection='AN2017014'): return False if readBTagValue(chain, index, 'AN2017014') < getBTagWP( chain.year, 'tight', 'AN2017014'): return False return True
def isTightBJetHNLLowPt(chain, index): if not isGoodJet(chain, index, cleaned='FO', selection='HNLowPt'): return False if readBTagValue(chain, index, 'Deep') < getBTagWP(chain.year, 'tight', 'Deep'): return False return True