def passedFilter(self, cutter, region):
        if not self.initEvent(cutter): return False
        if self.flavors_of_interest == ['tau'] and region == 'TauFakesDY':

            if not cutter.cut(self.new_chain.l_flavor.count(2) == 1, '1 tau'):
                return False

            if not cutter.cut(
                    self.new_chain.l_flavor[0] == self.new_chain.l_flavor[1],
                    'SF'):
                return False
            if not cutter.cut(
                    self.new_chain.l_charge[0] != self.new_chain.l_charge[1],
                    'OS'):
                return False

            l1Vec = getFourVec(self.new_chain.l_pt[0], self.new_chain.l_eta[0],
                               self.new_chain.l_phi[0], self.new_chain.l_e[0])
            l2Vec = getFourVec(self.new_chain.l_pt[1], self.new_chain.l_eta[1],
                               self.new_chain.l_phi[1], self.new_chain.l_e[1])

            if not cutter.cut(
                    abs(91.19 - (l1Vec + l2Vec).M()) < 15, 'Z window'):
                return False
            if not cutter.cut(self.chain._met < 50, 'MET > 50'): return False
            if not cutter.cut(not bVeto(self.chain), 'b-veto'): return False

            self.loose_leptons_of_interest = [2]
            return True
        elif self.flavors_of_interest == ['tau'] and region == 'Mix':
            return passedFilterTauMixCT(self.chain, self.new_chain,
                                        self.is_reco_level, cutter)

        else:
            return False
    def passedFilter(self, cutter):
        if not self.initEvent(cutter): return False
        if not cutter.cut(not bVeto(self.chain), 'b-veto'): return False

        #Relaxed
        if not cutter.cut(massDiff(self.chain.Mll_Z1, MZ) < 15, 'First Z ok'):
            return False
        if not cutter.cut(self.new_chain.minMos > 12, 'min Mos > 12'):
            return False

        return True
 def passedFilter(self, cutter):
     if not self.initEvent(cutter): return False
     if not cutter.cut(containsOSSF(self.chain), 'OSSF present'):
         return False
     if not cutter.cut(abs(self.new_chain.M3l - MZ) < 15, 'M3l_onZ'):
         return False
     if not cutter.cut(self.chain.MZossf < 75, 'Mll < 75'): return False
     if self.chain.selection == 'AN2017014' and not cutter.cut(
             passesPtCutsAN2017014(self.chain), 'pt_cuts'):
         return False
     if not cutter.cut(not bVeto(self.chain), 'b-veto'): return False
     self.chain.category = max(cat.CATEGORIES)
     return True
def passedFilterTauMixCT(chain, new_chain, is_reco_level, cutter):
    if not cutter.cut(not fourthFOVeto(chain, no_tau=chain.obj_sel['notau']),
                      'Fourth FO veto'):
        return False
    if not cutter.cut(not threeSameSignVeto(chain), 'No three same sign'):
        return False
    if not cutter.cut(not bVeto(chain), 'b-veto'): return False
    if not cutter.cut(new_chain.l_pt[l1] < 55, 'l1pt<55'): return False
    # if not cutter.cut(new_chain.M3l < 80, 'm3l<80'):            return False
    if is_reco_level:
        if not cutter.cut(chain._met > 75, 'MET > 75'): return False
    else:
        if not cutter.cut(chain._gen_met > 75, 'MET > 75'): return False
    if not cutter.cut(not containsOSSF(chain), 'no OSSF'): return False
    return True
Exemple #5
0
    def passCuts(chain, indices):
        if len(indices) != 3: return False
        if chain._lCharge[indices[0]] == chain._lCharge[
                indices[1]] and chain._lCharge[indices[2]] == chain._lCharge[
                    indices[1]]:
            return False
        if bVeto(chain): return False
        vectors = []
        for lepton_index in indices:
            vectors.append(
                getFourVec(chain._lPt[lepton_index], chain._lEta[lepton_index],
                           chain._lPhi[lepton_index], chain._lE[lepton_index]))
        mass_lll = (vectors[0] + vectors[1] + vectors[2]).M()
        if abs(mass_lll - 91.19) < 15: return False

        return True
    def passedFilter(self, cutter, region):
        if not self.initEvent(cutter): return False
        applyConeCorrection(self.chain, self.new_chain)
        if 'tau' in self.flavors_of_interest:
            if region != 'Mix':
                if not cutter.cut(self.chain._met < 50, 'MET>50'): return False
                if not cutter.cut(containsOSSF(self.chain), 'OSSF present'):
                    return False
                if not cutter.cut(not bVeto(self.chain), 'b-veto'):
                    return False
            else:
                if not passedFilterTauMixCT(self.chain, self.new_chain,
                                            self.is_reco_level, cutter):
                    return False

        if not cutter.cut(self.hasCorrectNumberOfFakes(),
                          'correct number of fakes'):
            return False
        # if not cutter.cut(self.chain._passMETFilters, 'pass met filters'): return False

        return True