def make_final_mumu( alg_list, args ) : invpixlead = args.get('invpixlead', False ) print 'invpixlead = ', invpixlead invpixsubl = args.get('invpixsubl', False ) print 'invpixsubl = ', invpixsubl looseobj = args.get('looseobj', False ) print 'looseobj = ', looseobj notrig = args.get('notrig', False ) print 'notrig = ', notrig filter_photon = Filter( 'FilterPhoton' ) filter_photon.cut_ph_medium = ' == True ' if not looseobj : filter_photon.cut_ph_pt = ' > 15 ' filter_photon.cut_ph_csev = ' == False ' alg_list.append(filter_photon) if not looseobj : filter_muon = Filter( 'FilterMuon' ) filter_muon.cut_mu_pt = ' > 10 ' alg_list.append(filter_muon) filter_ele = Filter( 'FilterElectron' ) filter_ele.cut_el_pt = ' > 10 ' alg_list.append(filter_ele) alg_list.append( Filter('CalcEventVars') ) filter_event = Filter('FilterEvent') if looseobj : filter_event.cut_nPh = ' > 1 ' filter_event.cut_nMu = ' > 1 ' else : filter_event.cut_nPh = ' == 2 ' filter_event.cut_nMu = ' == 2 ' if not looseobj : filter_event.cut_dr_lep_ph1 = ' > 0.4 ' filter_event.cut_dr_lep_ph2 = ' > 0.4 ' filter_event.cut_dr_subllep_ph1 = ' > 0.4 ' filter_event.cut_dr_subllep_ph2 = ' > 0.4 ' filter_event.cut_dr_ph1_ph2 = ' > 0.4 ' if not notrig : filter_event.cut_DiMuTrig = ' == True ' if not looseobj : filter_event.cut_m_mumu = ' > 40 ' filter_event.cut_isEEEE = ' == False ' alg_list.append( filter_event )
def make_final_mu( alg_list, args ) : looseobj = args.get('looseobj', False ) print 'looseobj = ', looseobj notrig = args.get('notrig', False ) print 'notrig = ', notrig mtvar = args.get('mtvar', 'mt_lep_met') print 'mtvar = ', mtvar mtcut = args.get('mtcut', ' > 40') print 'mtcut = ', mtcut phpt = args.get('phpt', ' > 25 ' ) print 'phpt = ', phpt filter_photon = Filter( 'FilterPhoton' ) filter_photon.cut_ph_medium = ' == True ' if not looseobj : filter_photon.cut_ph_pt = phpt alg_list.append(filter_photon) if not looseobj : filter_muon = Filter( 'FilterMuon' ) filter_muon.cut_mu_pt = ' > 10 ' alg_list.append(filter_muon) filter_ele = Filter( 'FilterElectron' ) filter_ele.cut_el_pt = ' > 10 ' alg_list.append(filter_ele) alg_list.append( Filter('CalcEventVars') ) filter_event = Filter('FilterEvent') if looseobj : filter_event.cut_nPh = ' > 1 ' filter_event.cut_nMu = ' > 0 ' else : filter_event.cut_nPh = ' == 2 ' filter_event.cut_nMu = ' == 1 ' filter_event.cut_nEl = ' == 0 ' if not notrig : filter_event.cut_nMuTrig = ' > 0 ' #filter_event.cut_dr_lep_ph1 = ' > 0.4 ' #filter_event.cut_dr_lep_ph2 = ' > 0.4 ' if not looseobj : filter_event.cut_dr_ph1_ph2 = ' > 0.4 ' filter_event.cut_leadPhot_trigMuDR = ' > 0.4 ' filter_event.cut_sublPhot_trigMuDR = ' > 0.4 ' if not looseobj : filter_event.cut_MuTrig = ' == True ' filter_event.cut_isEEEE = ' == False ' # remove diphoton mass cut #filter_event.cut_mgg = ' > 15 ' setattr( filter_event, 'cut_%s' %mtvar, mtcut ) alg_list.append( filter_event ) blind_pt = args.get('blind_pt', None ) if blind_pt == 'None' : blind_pt = None if blind_pt is not None : isData = args.pop('isData', 'False') filter_blind = Filter( 'FilterBlind' ) filter_blind.cut_ph_pt_lead = ' < %d ' %int(blind_pt) filter_blind.add_var( 'isData', isData ) alg_list.append(filter_blind)
def make_final_el( alg_list, args ) : looseobj = args.get('looseobj', False ) print 'looseobj = ', looseobj nozmass = args.get('nozmass', False ) print 'nozmass = ', nozmass zmasscr = args.get('zmasscr', False ) print 'zmasscr = ', zmasscr notrig = args.get('notrig', False ) print 'notrig = ', notrig csev = args.get('csev', False ) print 'csev = ', csev overlap_veto = args.get('overlap_veto', False ) print 'overlap_veto = ', overlap_veto invpixlead = args.get('invpixlead', False ) print 'invpixlead = ', invpixlead invpixsubl = args.get('invpixsubl', False ) print 'invpixsubl = ', invpixsubl mtvar = args.get('mtvar', 'mt_lep_met') print 'mtvar = ', mtvar mtcut = args.get('mtcut', ' > 40') print 'mtcut = ', mtcut mass_cut = args.get('mass_cut', 10) print 'mass_cut = ', mass_cut phpt = args.get('phpt', ' > 25 ' ) print 'phpt = ', phpt nelcut = args.get('nelcut', ' == 1 ' ) print 'nelcut= ', nelcut filter_photon = Filter( 'FilterPhoton' ) filter_photon.cut_ph_medium = ' == True ' if not looseobj : filter_photon.cut_ph_pt = phpt alg_list.append(filter_photon) if not looseobj : filter_muon = Filter( 'FilterMuon' ) filter_muon.cut_mu_pt = ' > 10 ' alg_list.append(filter_muon) filter_ele = Filter( 'FilterElectron' ) filter_ele.cut_el_pt = ' > 10 ' alg_list.append(filter_ele) alg_list.append( Filter('CalcEventVars') ) filter_event = Filter('FilterEvent') if looseobj : filter_event.cut_nPh = ' > 1 ' filter_event.cut_nEl = ' > 0 ' else : filter_event.cut_nPh = ' == 2 ' filter_event.cut_nMu = ' == 0 ' filter_event.cut_nEl = nelcut if not notrig : filter_event.cut_nElTrig = ' > 0 ' if csev : if invpixlead : filter_event.cut_csev_leadph12 = ' == True ' else : filter_event.cut_csev_leadph12 = ' == False ' if invpixsubl : filter_event.cut_csev_sublph12 = ' == True ' else : filter_event.cut_csev_sublph12 = ' == False ' elif overlap_veto : if invpixlead : filter_event.cut_overlapVeto_leadph12 = ' == True ' else : filter_event.cut_overlapVeto_leadph12 = ' == False ' if invpixsubl : filter_event.cut_overlapVeto_sublph12 = ' == True ' else : filter_event.cut_overlapVeto_sublph12 = ' == False ' else : if invpixlead : filter_event.cut_hasPixSeed_leadph12 = ' == True ' else : filter_event.cut_hasPixSeed_leadph12 = ' == False ' if invpixsubl : filter_event.cut_hasPixSeed_sublph12 = ' == True ' else : filter_event.cut_hasPixSeed_sublph12 = ' == False ' #filter_event.cut_dr_lep_ph1 = ' > 0.4 ' #filter_event.cut_dr_lep_ph2 = ' > 0.4 ' #filter_event.cut_dr_trigele_ph1 = ' > 0.4 ' #filter_event.cut_dr_trigele_ph2 = ' > 0.4 ' if not looseobj : filter_event.cut_dr_ph1_ph2 = ' > 0.4 ' #filter_event.cut_leadPhot_trigElDR = ' > 0.4 ' #filter_event.cut_sublPhot_trigElDR = ' > 0.4 ' if not looseobj : filter_event.cut_ElTrig = ' == True ' filter_event.cut_isEEEE = ' == False ' setattr( filter_event, 'cut_%s' %mtvar, mtcut ) # remove mgg Cut #filter_event.cut_mgg = ' > 15 ' mass_min = 91.2 - mass_cut mass_max = 91.2 + mass_cut if not nozmass : if zmasscr : #filter_event.cut_m_lepphph= ' > 86.2 & < 96.2 ' filter_event.cut_m_trigelphph= ' > %.1f & < %.1f ' %(mass_min, mass_max ) else : #filter_event.cut_m_lepphph= ' > 86.2 & < 96.2 ' #filter_event.cut_m_lepph1= ' > 86.2 & < 96.2 ' #filter_event.cut_m_lepph2= ' > 86.2 & < 96.2 ' #filter_event.invert( 'cut_m_lepphph' ) #filter_event.invert( 'cut_m_lepph1' ) #filter_event.invert( 'cut_m_lepph2' ) filter_event.cut_m_trigelphph = ' > %.1f & < %.1f ' %(mass_min, mass_max ) filter_event.cut_m_trigelph1 = ' > %.1f & < %.1f ' %(mass_min, mass_max ) filter_event.cut_m_trigelph2 = ' > %.1f & < %.1f ' %(mass_min, mass_max ) filter_event.invert( 'cut_m_trigelphph' ) filter_event.invert( 'cut_m_trigelph1' ) filter_event.invert( 'cut_m_trigelph2' ) alg_list.append( filter_event ) blind_pt = args.get('blind_pt', None ) if blind_pt == 'None' : blind_pt = None print 'BLIND PT = ', blind_pt if blind_pt is not None : isData = args.pop('isData', 'False') filter_blind = Filter( 'FilterBlind' ) filter_blind.cut_ph_pt_lead = ' < %d ' %int(blind_pt) filter_blind.add_var( 'isData', isData ) alg_list.append(filter_blind)