コード例 #1
0
def filter_jet( jet_pt = ' > 30 ', jet_eta = '< 2.4', do_hists=False ) :

    filt = Filter( 'FilterJet' )

    filt.cut_pt = jet_pt
    #filt.cut_abseta = ' < 4.5 '
    filt.cut_eta = jet_eta
    filt.cut_loose = ' == True '

    filt.cut_muon_dr    = ' > 0.4 '
    filt.cut_electron_dr    = ' > 0.4 '
    filt.cut_photon_dr    = ' > 0.4 '

    filt.cut_jet_nhf_central_loose = ' < 0.99 '
    filt.cut_jet_nemf_central_loose = ' < 0.99 '
    filt.cut_jet_nconst_central_loose = ' > 1'
    filt.cut_jet_nhf_central_tight = ' < 0.90 '
    filt.cut_jet_nemf_central_tight = ' < 0.90 '
    filt.cut_jet_nconst_central_tight = ' > 1'
    filt.cut_jet_nhf_central_tightlep = ' < 0.9 '
    filt.cut_jet_nemf_central_tightlep = ' < 0.9 '
    filt.cut_jet_nconst_central_tightlep = '> 1 '
    filt.cut_jet_muf_central_tightlep = '< 0.8 '
    filt.cut_jet_chf_central_loose = ' > 0'
    filt.cut_jet_cmult_central_loose = ' > 0 '
    filt.cut_jet_cemf_central_loose = ' < 0.99 '
    filt.cut_jet_chf_central_tight = ' > 0 '
    filt.cut_jet_cmult_central_tight = ' > 0'
    filt.cut_jet_cemf_central_tight = ' < 0.99 '
    filt.cut_jet_chf_central_tightlep = ' > 0'
    filt.cut_jet_cmult_central_tightlep = ' > 0'
    filt.cut_jet_cemf_central_tightlep = ' < 0.90'
    filt.cut_jet_nhf_transition_loose = ' > 0.01 '
    filt.cut_jet_nemf_transition_loose = ' < 0.98 '
    filt.cut_jet_nmult_transition_loose = ' > 2 '
    filt.cut_jet_nhf_transition_tight = ' > 0.01 '
    filt.cut_jet_nemf_transition_tight = ' < 0.98 '
    filt.cut_jet_nmult_transition_tight = ' > 2 '
    filt.cut_jet_nemf_forward_loose = ' < 0.90 '
    filt.cut_jet_nmult_forward_loose = '> 10 '
    filt.cut_jet_nemf_forward_tight = ' < 0.90 '
    filt.cut_jet_nmult_forward_tight = ' > 10 '

    #filt.cut_jet_el_dr = ' > 0.4 '
    #filt.cut_jet_ph_dr = ' > 0.4 '

    filt.cut_jet_CSV_Loose = ' > 0.5426 '
    filt.cut_jet_CSV_Medium = ' > 0.8484 '
    filt.cut_jet_CSV_Tight = ' > 0.9535 '
    filt.cut_jet_DeepJet_Loose = ' > 0.0614 '
    filt.cut_jet_DeepJet_Medium = ' > 0.3093 '
    filt.cut_jet_DeepJet_Tight = ' > 0.7221 '
    filt.add_var('evalBTagID', "medium" )

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )

    return filt
コード例 #2
0
ファイル: ConfWgamgamReco.py プロジェクト: cranelli/usercode
def build_jet( do_cutflow=False, do_hists=False ) :

    filt = Filter('BuildJet')
    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 30 '
    filt.cut_abseta = ' < 4.5 '

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )

    return filt
コード例 #3
0
ファイル: ConfWgamgamReco.py プロジェクト: sachikot/usercode
def build_jet(do_cutflow=False, do_hists=False):

    filt = Filter('BuildJet')
    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 30 '
    filt.cut_abseta = ' < 4.5 '

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)

    return filt
コード例 #4
0
ファイル: ConfFilter.py プロジェクト: ngzube/usercode
def config_analysis( alg_list ) :
    """ Configure analysis modules. Order is preserved """

    
    filter_event = Filter('FilterEvent')
    filter_event.cut_n_gen_photons = ' < 2 ' #for Wg
    #filter_event.cut_n_gen_photons = ' < 1 ' #for DYJets, WJets, top
    #filter_event.cut_n_gen_photons = ' > 1 ' # to make Zgg
    #filter_event.cut_n_gen_photons = ' > 0 ' # to make Wg backgrounds

    filter_event.add_hist( 'cut_n_gen_photons', 10, 0, 10 )

    filter_event.do_cutflow=True
    alg_list.append( filter_event )
コード例 #5
0
ファイル: ConfPhotonReco.py プロジェクト: jkunkle/usercode
def build_jet( do_cutflow=False, do_hists=False ) :

    filt = Filter('BuildJet')
    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 30 '
    filt.cut_abseta = ' < 4.5 '
    #filt.cut_idloose = ' == True '

    filt.cut_jet_nhf_central_loose = ' < 0.99 '
    filt.cut_jet_nemf_central_loose = ' < 0.99 '
    filt.cut_jet_nconst_central_loose = ' > 1'
    filt.cut_jet_nhf_central_tight = ' < 0.90 '
    filt.cut_jet_nemf_central_tight = ' < 0.90 '
    filt.cut_jet_nconst_central_tight = ' > 1'
    filt.cut_jet_nhf_central_tightlep = ' < 0.9 '
    filt.cut_jet_nemf_central_tightlep = ' < 0.9 '
    filt.cut_jet_nconst_central_tightlep = '> 1 '
    filt.cut_jet_muf_central_tightlep = '< 0.8 '
    filt.cut_jet_chf_central_loose = ' > 0'
    filt.cut_jet_cmult_central_loose = ' > 0 '
    filt.cut_jet_cemf_central_loose = ' < 0.99 '
    filt.cut_jet_chf_central_tight = ' > 0 '
    filt.cut_jet_cmult_central_tight = ' > 0'
    filt.cut_jet_cemf_central_tight = ' < 0.99 '
    filt.cut_jet_chf_central_tightlep = ' > 0'
    filt.cut_jet_cmult_central_tightlep = ' > 0'
    filt.cut_jet_cemf_central_tightlep = ' < 0.90'
    filt.cut_jet_nhf_transition_loose = ' > 0.01 '
    filt.cut_jet_nemf_transition_loose = ' < 0.98 '
    filt.cut_jet_nmult_transition_loose = ' > 2 '
    filt.cut_jet_nhf_transition_tight = ' > 0.01 '
    filt.cut_jet_nemf_transition_tight = ' < 0.98 '
    filt.cut_jet_nmult_transition_tight = ' > 2 '
    filt.cut_jet_nemf_forward_loose = ' < 0.90 '
    filt.cut_jet_nmult_forward_loose = '> 10 '
    filt.cut_jet_nemf_forward_tight = ' < 0.90 '
    filt.cut_jet_nmult_forward_tight = ' > 10 '

    #filt.cut_jet_el_dr = ' > 0.4 '
    #filt.cut_jet_ph_dr = ' > 0.4 '

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )

    return filt
コード例 #6
0
def get_jet_filter(do_hists=False):

    filt = Filter('FilterJet')

    # redo overlap rm with photons and muons
    filt.cut_jet_ele_dr = ' > 0.4 '
    #filt.cut_jet_ph_dr = ' > 0.4 '
    filt.cut_jet_mu_dr = ' > 0.4 '

    filt.do_cutflow = False

    if do_hists:
        filt.add_hist('cut_jet_ele_dr', 50, 0, 5)
        filt.add_hist('cut_jet_ph_dr', 50, 0, 5)
        filt.add_hist('cut_jet_mu_dr', 50, 0, 5)

    return filt
コード例 #7
0
ファイル: ConfObjFilter.py プロジェクト: ngzube/usercode
def get_jet_filter( do_hists = False ) :

    filt = Filter ( 'FilterJet' ) 

    # redo overlap rm with photons and muons
    filt.cut_jet_ele_dr = ' > 0.4 '
    filt.cut_jet_ph_dr = ' > 0.4 '
    filt.cut_jet_mu_dr = ' > 0.4 '

    filt.do_cutflow = False

    if do_hists :
        filt.add_hist('cut_jet_ele_dr', 50, 0, 5)
        filt.add_hist('cut_jet_ph_dr', 50, 0, 5)
        filt.add_hist('cut_jet_mu_dr', 50, 0, 5)

    return filt
コード例 #8
0
ファイル: ConfObjFilterZgg.py プロジェクト: jkunkle/usercode
def get_jet_filter(do_hists=False):

    filt = Filter("FilterJet")

    filt.cut_jet_nhf = " < 0.99 "
    filt.cut_jet_nef = " < 0.99 "
    filt.cut_jet_chf = " > 0 "
    filt.cut_jet_cef = " < 0.99 "
    filt.cut_jet_n_constituents = " > 1 "
    filt.cut_jet_nch = " > 0 "

    # redo overlap rm with photons and muons
    filt.cut_jet_ele_dr = " > 0.4 "
    filt.cut_jet_ph_dr = " > 0.4 "
    filt.cut_jet_mu_dr = " > 0.4 "

    filt.do_cutflow = False

    if do_hists:
        filt.add_hist("cut_jet_ele_dr", 50, 0, 5)
        filt.add_hist("cut_jet_ph_dr", 50, 0, 5)
        filt.add_hist("cut_jet_mu_dr", 50, 0, 5)

    return filt
コード例 #9
0
ファイル: ConfObjFilter.py プロジェクト: sachikot/usercode
def get_jet_filter(do_hists=False):

    filt = Filter('FilterJet')

    filt.cut_jet_nhf = ' < 0.99 '
    filt.cut_jet_nef = ' < 0.99 '
    filt.cut_jet_chf = ' > 0 '
    filt.cut_jet_cef = ' < 0.99 '
    filt.cut_jet_n_constituents = ' > 1 '
    filt.cut_jet_nch = ' > 0 '

    # redo overlap rm with photons and muons
    filt.cut_jet_ele_dr = ' > 0.4 '
    filt.cut_jet_ph_dr = ' > 0.4 '
    filt.cut_jet_mu_dr = ' > 0.4 '

    filt.do_cutflow = False

    if do_hists:
        filt.add_hist('cut_jet_ele_dr', 50, 0, 5)
        filt.add_hist('cut_jet_ph_dr', 50, 0, 5)
        filt.add_hist('cut_jet_mu_dr', 50, 0, 5)

    return filt
コード例 #10
0
def get_jet_filter( do_hists = False ) :

    filt = Filter ( 'FilterJet' ) 

    filt.cut_jet_nhf = ' < 0.99 '
    filt.cut_jet_nef = ' < 0.99 '
    filt.cut_jet_chf = ' > 0 '
    filt.cut_jet_cef = ' < 0.99 '
    filt.cut_jet_n_constituents = ' > 1 '
    filt.cut_jet_nch = ' > 0 '

    # redo overlap rm with photons and muons
    filt.cut_jet_ele_dr = ' > 0.4 '
    filt.cut_jet_ph_dr = ' > 0.4 '
    filt.cut_jet_mu_dr = ' > 0.4 '

    filt.do_cutflow = False

    if do_hists :
        filt.add_hist('cut_jet_ele_dr', 50, 0, 5)
        filt.add_hist('cut_jet_ph_dr', 50, 0, 5)
        filt.add_hist('cut_jet_mu_dr', 50, 0, 5)

    return filt
コード例 #11
0
ファイル: ConfTemplate.py プロジェクト: jkunkle/usercode
def build_photon( do_cutflow=False, do_hists=False ) :

    # Define the filter object
    # The name must mathch that checked in the ApplyModule
    # function in src/RunAnalysis.cxx
    filt = Filter('BuildPhoton')

    # filter objects have a do_cutflow option
    # enabling this flag keeps a count, for each cut, of
    # the number of times a PassInt, PassFloat, or PassBool
    # is called and how many times it passes
    filt.do_cutflow = do_cutflow

    # define cuts
    # a few examples are given below
    # complicated cuts, such as
    # vetoing the crack region in eta
    # require some special handling
    filt.cut_pt           = ' > 15 '
    filt.cut_abseta       = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.479 & < 1.566 '
    filt.invert('cut_abseta_crack')

    filt.cut_sigmaIEIE = ' < 0.011 '

    if do_hists :
        # The Filter object also retains a list of 
        # histograms.  Each time a PassInt, PassFloat, or PassBool
        # is called for a given cut the histogram is filled
        # with the value input.
        # The histogram name
        # (the first argument to add_hist) must
        # match the cut name for it to work.
        # by default two histograms are made for
        # each cut -- a before and after.
        # The before histogram is filled on each call
        # while the after histogram is filled only
        # if the cut passes
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE', 50, 0, 0.05 )

    return filt
コード例 #12
0
def build_photon(do_cutflow=False, do_hists=False):

    # Define the filter object
    # The name must mathch that checked in the ApplyModule
    # function in src/RunAnalysis.cxx
    filt = Filter('BuildPhoton')

    # filter objects have a do_cutflow option
    # enabling this flag keeps a count, for each cut, of
    # the number of times a PassInt, PassFloat, or PassBool
    # is called and how many times it passes
    filt.do_cutflow = do_cutflow

    # define cuts
    # a few examples are given below
    # complicated cuts, such as
    # vetoing the crack region in eta
    # require some special handling
    filt.cut_pt = ' > 15 '
    filt.cut_abseta = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.479 & < 1.566 '
    filt.invert('cut_abseta_crack')

    filt.cut_sigmaIEIE = ' < 0.011 '

    if do_hists:
        # The Filter object also retains a list of
        # histograms.  Each time a PassInt, PassFloat, or PassBool
        # is called for a given cut the histogram is filled
        # with the value input.
        # The histogram name
        # (the first argument to add_hist) must
        # match the cut name for it to work.
        # by default two histograms are made for
        # each cut -- a before and after.
        # The before histogram is filled on each call
        # while the after histogram is filled only
        # if the cut passes
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_sigmaIEIE', 50, 0, 0.05)

    return filt
コード例 #13
0
def build_photon(do_cutflow=False, do_hists=False, filtPID=None):

    filt = Filter("BuildPhoton")

    filt.do_cutflow = do_cutflow

    filt.cut_pt = " > 15 "
    filt.cut_abseta = " < 2.5"
    filt.cut_abseta_crack = " > 1.479 & < 1.566 "
    filt.invert("cut_abseta_crack")

    filt.cut_emfrac = " < 0.05"
    filt.cut_eveto = " == True"

    filt.cut_sigmaIEIE_barrel_loose = " < 0.012 "
    filt.cut_chIsoCorr_barrel_loose = " < 2.6 "
    filt.cut_neuIsoCorr_barrel_loose = " < 3.5 "
    filt.cut_phoIsoCorr_barrel_loose = " < 1.3 "

    filt.cut_sigmaIEIE_endcap_loose = " < 0.034 "
    filt.cut_chIsoCorr_endcap_loose = " < 2.3 "
    filt.cut_neuIsoCorr_endcap_loose = " < 2.9 "
    # no cut for loose
    # filt.cut_phoIsoCorr_endcap_loose = ' < 1.0 '

    filt.cut_sigmaIEIE_barrel_medium = " < 0.011 "
    filt.cut_chIsoCorr_barrel_medium = " < 1.5 "
    filt.cut_neuIsoCorr_barrel_medium = " < 1.0 "
    filt.cut_phoIsoCorr_barrel_medium = " < 0.7 "

    filt.cut_sigmaIEIE_endcap_medium = " < 0.033 "
    filt.cut_chIsoCorr_endcap_medium = " < 1.2 "
    filt.cut_neuIsoCorr_endcap_medium = " < 1.5 "
    filt.cut_phoIsoCorr_endcap_medium = " < 1.0 "

    filt.cut_sigmaIEIE_barrel_tight = " < 0.011 "
    filt.cut_chIsoCorr_barrel_tight = " < 0.7 "
    filt.cut_neuIsoCorr_barrel_tight = " < 0.4 "
    filt.cut_phoIsoCorr_barrel_tight = " < 0.5 "

    filt.cut_sigmaIEIE_endcap_tight = " < 0.031 "
    filt.cut_chIsoCorr_endcap_tight = " < 0.5 "
    filt.cut_neuIsoCorr_endcap_tight = " < 1.5 "
    filt.cut_phoIsoCorr_endcap_tight = " < 1.0 "

    if filtPID is not None:
        setattr(filt, "cut_pid_%s" % filtPID, "== True")

    if do_hists:
        filt.add_hist("cut_pt", 100, 0, 500)
        filt.add_hist("cut_abseta", 50, 0, 5)
        filt.add_hist("cut_abseta_crack", 50, 0, 5)
        filt.add_hist("cut_emfrac", 50, 0, 0.1)
        filt.add_hist("cut_eveto", 2, 0, 2)
        filt.add_hist("cut_sigmaIEIE_barrel", 50, 0, 0.05)
        filt.add_hist("cut_chIsoCorr_barrel", 50, 0, 5)
        filt.add_hist("cut_neuIsoCorr_barrel", 50, 0, 5)
        filt.add_hist("cut_phoIsoCorr_barrel", 50, 0, 5)

    return filt
コード例 #14
0
def build_electron(do_cutflow=False,
                   do_hists=False,
                   filtPID=None,
                   evalPID=None,
                   applyCorrections=False):

    filt = Filter('BuildElectron')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 10'
    filt.cut_abssceta = ' <2.5 '
    # no crack for now
    #filt.cut_abssceta_crack = ' > 1.44 & < 1.57 '
    #filt.invert('cut_abssceta_crack')

    filt.cut_absdEtaIn_barrel_tight = ' < 0.004 '
    filt.cut_absdPhiIn_barrel_tight = ' < 0.03 '
    filt.cut_sigmaIEIE_barrel_tight = ' < 0.01 '
    filt.cut_hovere_barrel_tight = ' < 0.12 '
    filt.cut_d0_barrel_tight = ' < 0.02 '
    filt.cut_z0_barrel_tight = ' < 0.1 '
    filt.cut_eoverp_barrel_tight = ' < 0.05 '
    filt.cut_pfIso30_barrel_tight = ' < 0.1 '
    filt.cut_convfit_barrel_tight = ' == 0 '
    filt.cut_misshits_barrel_tight = ' == 0 '

    filt.cut_absdEtaIn_barrel_medium = ' < 0.004 '
    filt.cut_absdPhiIn_barrel_medium = ' < 0.06 '
    filt.cut_sigmaIEIE_barrel_medium = ' < 0.01 '
    filt.cut_hovere_barrel_medium = ' < 0.12 '
    filt.cut_d0_barrel_medium = ' < 0.02 '
    filt.cut_z0_barrel_medium = ' < 0.1 '
    filt.cut_eoverp_barrel_medium = ' < 0.05 '
    filt.cut_pfIso30_barrel_medium = ' < 0.15 '
    filt.cut_convfit_barrel_medium = ' == 0 '
    filt.cut_misshits_barrel_medium = ' <= 1 '

    filt.cut_absdEtaIn_barrel_loose = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_loose = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_loose = ' < 0.01 '
    filt.cut_hovere_barrel_loose = ' < 0.12 '
    filt.cut_d0_barrel_loose = ' < 0.02 '
    filt.cut_z0_barrel_loose = ' < 0.2 '
    filt.cut_eoverp_barrel_loose = ' < 0.05 '
    filt.cut_pfIso30_barrel_loose = ' < 0.15 '
    filt.cut_convfit_barrel_loose = ' == 0 '
    filt.cut_misshits_barrel_loose = ' <= 1 '

    filt.cut_absdEtaIn_barrel_veryloose = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_veryloose = ' < 0.8 '
    filt.cut_sigmaIEIE_barrel_veryloose = ' < 0.01 '
    filt.cut_hovere_barrel_veryloose = ' < 0.15 '
    filt.cut_d0_barrel_veryloose = ' < 0.04 '
    filt.cut_z0_barrel_veryloose = ' < 0.2 '
    #filt.cut_eoverp_barrel_veryloose     = ' < 0.05 ' #no cut
    filt.cut_pfIso30_barrel_veryloose = ' < 0.1 '
    #filt.cut_convfit_barrel_veryloose    = ' == 0 ' #no cut
    #filt.cut_misshits_barrel_veryloose   = ' == 0 ' #no cut

    filt.cut_absdEtaIn_barrel_tightTrig = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_tightTrig = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_tightTrig = ' < 0.01 '
    filt.cut_hovere_barrel_tightTrig = ' < 0.12 '
    filt.cut_ecalIso30_barrel_tightTrig = ' < 0.2 '
    filt.cut_hcalIso30_barrel_tightTrig = ' < 0.2 '
    filt.cut_trkIso30_barrel_tightTrig = ' < 0.2 '

    filt.cut_absdEtaIn_endcap_tight = ' < 0.005 '
    filt.cut_absdPhiIn_endcap_tight = ' < 0.02 '
    filt.cut_sigmaIEIE_endcap_tight = ' < 0.03 '
    filt.cut_hovere_endcap_tight = ' < 0.1 '
    filt.cut_d0_endcap_tight = ' < 0.02 '
    filt.cut_z0_endcap_tight = ' < 0.1 '
    filt.cut_eoverp_endcap_tight = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_tight = ' < 0.1 '
    filt.cut_pfIso30_endcap_highPt_tight = ' < 0.15 '
    filt.cut_convfit_endcap_tight = ' == 0 '
    filt.cut_misshits_endcap_tight = ' == 0 '

    filt.cut_absdEtaIn_endcap_medium = ' < 0.007 '
    filt.cut_absdPhiIn_endcap_medium = ' < 0.03 '
    filt.cut_sigmaIEIE_endcap_medium = ' < 0.03 '
    filt.cut_hovere_endcap_medium = ' < 0.1 '
    filt.cut_d0_endcap_medium = ' < 0.02 '
    filt.cut_z0_endcap_medium = ' < 0.1 '
    filt.cut_eoverp_endcap_medium = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_medium = ' < 0.1 '
    filt.cut_pfIso30_endcap_highPt_medium = ' < 0.15 '
    filt.cut_convfit_endcap_medium = ' == 0 '
    filt.cut_misshits_endcap_medium = ' <= 1 '

    filt.cut_absdEtaIn_endcap_loose = ' < 0.009 '
    filt.cut_absdPhiIn_endcap_loose = ' < 0.1 '
    filt.cut_sigmaIEIE_endcap_loose = ' < 0.03 '
    filt.cut_hovere_endcap_loose = ' < 0.1 '
    filt.cut_d0_endcap_loose = ' < 0.02 '
    filt.cut_z0_endcap_loose = ' < 0.2 '
    filt.cut_eoverp_endcap_loose = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_loose = ' < 0.10 '
    filt.cut_pfIso30_endcap_highPt_loose = ' < 0.15 '
    filt.cut_convfit_endcap_loose = ' == 0 '
    filt.cut_misshits_endcap_loose = ' <= 1 '

    filt.cut_absdEtaIn_endcap_veryloose = ' < 0.01 '
    filt.cut_absdPhiIn_endcap_veryloose = ' < 0.7 '
    filt.cut_sigmaIEIE_endcap_veryloose = ' < 0.03 '
    #filt.cut_hovere_endcap_veryloose      = ' < 0.15 ' #no cut
    filt.cut_d0_endcap_veryloose = ' < 0.04 '
    filt.cut_z0_endcap_veryloose = ' < 0.2 '
    #filt.cut_eoverp_endcap_veryloose     = ' < 0.05 ' #no cut
    filt.cut_pfIso30_endcap_veryloose = ' < 0.15 '
    #filt.cut_convfit_endcap_veryloose    = ' == 0 ' #no cut
    #filt.cut_misshits_endcap_veryloose   = ' == 0 ' #no cut

    filt.cut_absdEtaIn_endcap_tightTrig = ' < 0.009 '
    filt.cut_absdPhiIn_endcap_tightTrig = ' < 0.10 '
    filt.cut_sigmaIEIE_endcap_tightTrig = ' < 0.03 '
    filt.cut_hovere_endcap_tightTrig = ' < 0.1 '
    filt.cut_ecalIso30_endcap_tightTrig = ' < 0.2 '
    filt.cut_hcalIso30_endcap_tightTrig = ' < 0.2 '
    filt.cut_trkIso30_endcap_tightTrig = ' < 0.2 '

    filt.cut_mva_central_lowpt_mvatrig = ' > 0.0 '
    filt.cut_mva_crack_lowpt_mvatrig = ' > 0.1 '
    filt.cut_mva_endcap_lowpt_mvatrig = ' > 0.62 '
    filt.cut_mva_central_highpt_mvatrig = ' > 0.94 '
    filt.cut_mva_crack_highpt_mvatrig = ' > 0.85 '
    filt.cut_mva_endcap_highpt_mvatrig = ' > 0.92 '

    filt.cut_relpfiso_mvatrig = ' < 0.15 '
    filt.cut_misshits_mvatrig = ' == 0 '
    filt.cut_convfit_mvatrig = ' == 0 '

    filt.cut_mva_central_lowpt_mvanontrig = ' > 0.47 '
    filt.cut_mva_crack_lowpt_mvanontrig = ' > 0.004 '
    filt.cut_mva_endcap_lowpt_mvanontrig = ' > 0.295 '
    filt.cut_mva_central_highpt_mvanontrig = ' > -0.34 '
    filt.cut_mva_crack_highpt_mvanontrig = ' > -0.65 '
    filt.cut_mva_endcap_highpt_mvanontrig = ' > 0.6 '

    filt.cut_relpfiso_mvanontrig = ' < 0.4 '
    filt.cut_misshits_mvanontrig = ' < 2 '
    filt.cut_sip_mvanontrig = ' < 4'

    if filtPID is not None:
        setattr(filt, 'cut_pid_%s' % filtPID, ' == True')

    if evalPID is not None:
        filt.add_var('evalPID', evalPID)

    if applyCorrections:
        workarea = os.getenv('WorkArea')
        filt.add_var('applyCorrections', 'true')
        filt.add_var(
            'correctionFile',
            '%s/TreeFilter/RecoWgg/data/scalesNewReg-May2013.csv' % workarea)
        filt.add_var(
            'linCorrectionFile',
            '%s/TreeFilter/RecoWgg/data/linearityNewReg-May2013.csv' %
            workarea)

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_absdEtaIn_barrel_tight', 100, -0.1, 0.1)
        filt.add_hist('cut_absdPhiIn_barrel_tight', 100, -0.1, 0.1)
        filt.add_hist('cut_sigmaIEIE_barrel_tight', 100, 0, 0.05)
        filt.add_hist('cut_hovere_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_d0_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_z0_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_eoverp_barrel_tight', 100, 0, 1)
        filt.add_hist('cut_pfIso30_barrel_tight', 100, 0, 10)
        filt.add_hist('cut_convfit_barrel_tight', 2, 0, 2)
        filt.add_hist('cut_misshits_barrel_tight', 10, 0, 10)

        filt.add_hist('cut_mva_central_lowpt_mvatrig', 50, -1, 1)
        filt.add_hist('cut_mva_crack_lowpt_mvatrig', 50, -1, 1)
        filt.add_hist('cut_mva_endcap_lowpt_mvatrig', 50, -1, 1)
        filt.add_hist('cut_mva_central_highpt_mvatrig', 50, -1, 1)
        filt.add_hist('cut_mva_crack_highpt_mvatrig', 50, -1, 1)
        filt.add_hist('cut_mva_endcap_highpt_mvatrig', 50, -1, 1)

        filt.add_hist('cut_relpfiso_mvatrig', 50, 0, 5)
        filt.add_hist('cut_misshits_mvatrig', 10, 0, 10)
        filt.add_hist('cut_convfit_mvatrig', 2, 0, 1)

        filt.add_hist('cut_mva_central_lowpt_mvanontrig', 50, -1, 1)
        filt.add_hist('cut_mva_crack_lowpt_mvanontrig', 50, -1, 1)
        filt.add_hist('cut_mva_endcap_lowpt_mvanontrig', 50, -1, 1)
        filt.add_hist('cut_mva_central_highpt_mvanontrig', 50, -1, 1)
        filt.add_hist('cut_mva_crack_highpt_mvanontrig', 50, -1, 1)
        filt.add_hist('cut_mva_endcap_highpt_mvanontrig', 50, -1, 1)

        filt.add_hist('cut_relpfiso_mvanontrig', 50, 0, 5)
        filt.add_hist('cut_misshits_mvanontrig', 10, 0, 10)
        filt.add_hist('cut_sip_mvanontrig', 50, 0, 10)

    return filt
コード例 #15
0
def build_muon(do_cutflow=False, do_hists=False, applyCorrections=False):

    filt = Filter('BuildMuon')

    filt.do_cutflow = do_cutflow

    filt.cut_isGlobal = ' == True '
    filt.cut_isPF = ' == True '
    filt.cut_pt = ' > 10 '
    filt.cut_abseta = ' < 2.5'
    filt.cut_chi2 = ' < 10'
    filt.cut_nTrkLayers = ' > 8 '
    filt.cut_nStations = ' > 1'
    filt.cut_nPixelHits = ' > 0'
    filt.cut_d0 = ' < 0.2'
    filt.cut_z0 = ' < 0.5'
    #filt.cut_trkiso     = ' < 0.1 '
    filt.cut_corriso = ' < 0.2'

    if applyCorrections:
        filt.add_var('applyCorrections', 'true')

        workarea = os.getenv('WorkArea')
        filt.add_var(
            'path',
            '%s/TreeFilter/RecoWgg/data/MuScleFitCorrector_v4_3/MuScleFit_2012_MC_53X_smearReReco.txt'
            % workarea)

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_chi2', 50, 0, 50)
        filt.add_hist('cut_nTrkLayers', 20, 0, 20)
        filt.add_hist('cut_nStations', 5, 0, 5)
        filt.add_hist('cut_nPixelHits', 20, 0, 20)
        filt.add_hist('cut_d0', 100, -0.05, 0.05)
        filt.add_hist('cut_z0', 100, -0.05, 0.05)
        filt.add_hist('cut_trkiso', 50, 0, 0.5)
        filt.add_hist('cut_corriso', 50, 0, 0.5)

    return filt
コード例 #16
0
def build_photon(do_cutflow=False,
                 do_hists=False,
                 filtPID=None,
                 evalPID=None,
                 doEVeto=True):

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 15 '
    filt.cut_abseta = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.479 & < 1.566 '
    filt.invert('cut_abseta_crack')

    #filt.cut_hovere       = ' < 0.05'
    if doEVeto:
        filt.cut_eveto = ' == False'

    filt.cut_sigmaIEIE_barrel_loose = ' < 0.012 '
    filt.cut_chIsoCorr_barrel_loose = ' < 2.6 '
    filt.cut_neuIsoCorr_barrel_loose = ' < 3.5 '
    filt.cut_phoIsoCorr_barrel_loose = ' < 1.3 '
    filt.cut_hovere_barrel_loose = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_loose = ' < 0.034 '
    filt.cut_chIsoCorr_endcap_loose = ' < 2.3 '
    filt.cut_neuIsoCorr_endcap_loose = ' < 2.9 '
    # no cut for loose
    #filt.cut_phoIsoCorr_endcap_loose = ' < 1.0 '
    filt.cut_hovere_endcap_loose = ' < 0.05 '

    filt.cut_sigmaIEIE_barrel_medium = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_medium = ' < 1.5 '
    filt.cut_neuIsoCorr_barrel_medium = ' < 1.0 '
    filt.cut_phoIsoCorr_barrel_medium = ' < 0.7 '
    filt.cut_hovere_barrel_medium = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_medium = ' < 0.033 '
    filt.cut_chIsoCorr_endcap_medium = ' < 1.2 '
    filt.cut_neuIsoCorr_endcap_medium = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_medium = ' < 1.0 '
    filt.cut_hovere_endcap_medium = ' < 0.05 '

    filt.cut_sigmaIEIE_barrel_tight = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_tight = ' < 0.7 '
    filt.cut_neuIsoCorr_barrel_tight = ' < 0.4 '
    filt.cut_phoIsoCorr_barrel_tight = ' < 0.5 '
    filt.cut_hovere_barrel_tight = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_tight = ' < 0.031 '
    filt.cut_chIsoCorr_endcap_tight = ' < 0.5 '
    filt.cut_neuIsoCorr_endcap_tight = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_tight = ' < 1.0 '
    filt.cut_hovere_endcap_tight = ' < 0.05 '

    filt.cut_hovere12_barrel_mva_presel_smallr9 = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_smallr9 = ' < 4 '
    filt.cut_hovere12_barrel_mva_presel_larger9 = ' < 0.082 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_larger9 = ' < 50 '
    filt.cut_sigmaIEIE_barrel_mva_presel = ' < 0.014 '
    filt.cut_chgpfIso_barrel_mva_presel = ' < 4 '

    filt.cut_hovere12_endcap_mva_presel_smallr9 = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_smallr9 = ' < 4 '
    filt.cut_hovere12_endcap_mva_presel_larger9 = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_larger9 = ' < 50 '
    filt.cut_sigmaIEIE_endcap_mva_presel = ' < 0.034 '
    filt.cut_chgpfIso_endcap_mva_presel = ' < 4 '

    if filtPID is not None:
        setattr(filt, 'cut_pid_%s' % filtPID, ' == True')

    if evalPID is not None:
        filt.add_var('evalPID', evalPID)

    filt.add_var(
        'TMVAWeightsFileEB',
        '/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EB_BDT.weights.xml')
    filt.add_var(
        'TMVAWeightsFileEE',
        '/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EE_BDT.weights.xml')

    #filt.cut_ph_el_dr = ' > 0.2 '

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_hovere', 50, 0, 0.1)
        filt.add_hist('cut_eveto', 2, 0, 2)
        filt.add_hist('cut_sigmaIEIE_barrel_medium', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_phoIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_sigmaIEIE_endcap_medium', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_endcap_medium', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_endcap_medium', 50, 0, 5)
        filt.add_hist('cut_phoIsoCorr_endcap_medium', 50, 0, 5)

        filt.add_hist('cut_sigmaIEIE_barrel_loose', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_barrel_loose', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_barrel_loose', 100, -5, 5)
        filt.add_hist('cut_phoIsoCorr_barrel_loose', 50, 0, 5)
        filt.add_hist('cut_sigmaIEIE_endcap_loose', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_endcap_loose', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_endcap_loose', 100, -5, 5)
        filt.add_hist('cut_phoIsoCorr_endcap_loose', 50, 0, 5)

    return filt
コード例 #17
0
def build_medium_photon(do_cutflow=False, do_hists=False):

    filt = Filter("BuildPIDPhoton")

    filt.do_cutflow = do_cutflow

    filt.cut_pt = " > 15 "
    # filt.cut_abseta       = ' < 1.479'
    # filt.cut_abseta       = ' > 1.566'
    filt.cut_abseta = " < 2.5"
    filt.cut_abseta_crack = " > 1.479 & < 1.566 "
    filt.invert("cut_abseta_crack")

    filt.cut_emfrac = " < 0.05"
    filt.cut_eveto = " == False"

    filt.cut_sigmaIEIE_barrel = " < 0.011 "
    filt.cut_chIsoCorr_barrel = " < 1.5 "
    filt.cut_neuIsoCorr_barrel = " < 1.0 "
    filt.cut_phoIsoCorr_barrel = " < 0.7 "

    filt.cut_sigmaIEIE_endcap = " < 0.033 "
    filt.cut_chIsoCorr_endcap = " < 1.2 "
    filt.cut_neuIsoCorr_endcap = " < 1.5 "
    filt.cut_phoIsoCorr_endcap = " < 1.0 "

    if do_hists:
        filt.add_hist("cut_pt", 100, 0, 500)
        filt.add_hist("cut_abseta", 50, 0, 5)
        filt.add_hist("cut_abseta_crack", 50, 0, 5)
        filt.add_hist("cut_emfrac", 50, 0, 0.1)
        filt.add_hist("cut_eveto", 2, 0, 2)
        filt.add_hist("cut_sigmaIEIE_barrel", 50, 0, 0.05)
        filt.add_hist("cut_chIsoCorr_barrel", 50, 0, 5)
        filt.add_hist("cut_neuIsoCorr_barrel", 50, 0, 5)
        filt.add_hist("cut_phoIsoCorr_barrel", 50, 0, 5)

    return filt
コード例 #18
0
def build_photon( do_cutflow=False, do_hists=False ) :

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt           = ' > 25 '
    filt.cut_abseta       = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.479 & < 1.566 '
    filt.invert('cut_abseta_crack')
    filt.cut_emfrac       = ' < 0.05'
    filt.cut_eveto        = ' == True'
    filt.cut_sigmaIEIE_barrel = ' < 0.011 '
    filt.cut_chIsoCorr_barrel = ' < 1.5 '
    filt.cut_neuIsoCorr_barrel = ' < 1.0 '
    filt.cut_phoIsoCorr_barrel = ' < 0.7 '
    filt.cut_sigmaIEIE_endcap = ' < 0.033 '
    filt.cut_chIsoCorr_endcap = ' < 1.2 '
    filt.cut_neuIsoCorr_endcap = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap = ' < 1.0 '

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_emfrac', 50, 0, 0.1 )
        filt.add_hist( 'cut_eveto', 2, 0, 2 )
        filt.add_hist( 'cut_sigmaIEIE_barrel', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel', 50, 0, 5 )

    return filt
コード例 #19
0
ファイル: ConfWgamgamReco.py プロジェクト: lgray/usercode
def build_electron( do_cutflow=False, do_hists=False, filtPID=None, evalPID=None ) :

    filt = Filter('BuildElectron')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 25'
    filt.cut_abssceta       = ' <2.5 '
    # no crack for now
    #filt.cut_abssceta_crack = ' > 1.44 & < 1.57 '
    #filt.invert('cut_abssceta_crack')

    filt.cut_absdEtaIn_barrel_tight       = ' < 0.004 '
    filt.cut_absdPhiIn_barrel_tight       = ' < 0.03 '
    filt.cut_sigmaIEIE_barrel_tight       = ' < 0.01 '
    filt.cut_hovere_barrel_tight          = ' < 0.12 '
    filt.cut_d0_barrel_tight              = ' < 0.02 '
    filt.cut_z0_barrel_tight              = ' < 0.1 '
    filt.cut_eoverp_barrel_tight          = ' < 0.05 '
    filt.cut_pfIso30_barrel_tight         = ' < 0.1 '
    filt.cut_convfit_barrel_tight         = ' < 0.000001 '
    filt.cut_misshits_barrel_tight        = ' == 0 '

    filt.cut_absdEtaIn_barrel_medium      = ' < 0.004 '
    filt.cut_absdPhiIn_barrel_medium      = ' < 0.06 '
    filt.cut_sigmaIEIE_barrel_medium      = ' < 0.01 '
    filt.cut_hovere_barrel_medium         = ' < 0.12 '
    filt.cut_d0_barrel_medium             = ' < 0.02 '
    filt.cut_z0_barrel_medium             = ' < 0.1 '
    filt.cut_eoverp_barrel_medium         = ' < 0.05 '
    filt.cut_pfIso30_barrel_medium        = ' < 0.15 '
    filt.cut_convfit_barrel_medium        = ' < 0.000001 '
    filt.cut_misshits_barrel_medium       = ' <= 1 '

    filt.cut_absdEtaIn_barrel_loose       = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_loose       = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_loose       = ' < 0.01 '
    filt.cut_hovere_barrel_loose          = ' < 0.12 '
    filt.cut_d0_barrel_loose              = ' < 0.02 '
    filt.cut_z0_barrel_loose              = ' < 0.2 '
    filt.cut_eoverp_barrel_loose          = ' < 0.05 '
    filt.cut_pfIso30_barrel_loose         = ' < 0.15 '
    filt.cut_convfit_barrel_loose         = ' < 0.000001 '
    filt.cut_misshits_barrel_loose        = ' <= 1 '

    filt.cut_absdEtaIn_barrel_veryloose   = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_veryloose   = ' < 0.8 '
    filt.cut_sigmaIEIE_barrel_veryloose   = ' < 0.01 '
    filt.cut_hovere_barrel_veryloose      = ' < 0.15 '
    filt.cut_d0_barrel_veryloose          = ' < 0.04 '
    filt.cut_z0_barrel_veryloose          = ' < 0.2 '
    #filt.cut_eoverp_barrel_veryloose     = ' < 0.05 ' #no cut
    filt.cut_pfIso30_barrel_veryloose     = ' < 0.1 '
    #filt.cut_convfit_barrel_veryloose    = ' < 0.000001 ' #no cut
    #filt.cut_misshits_barrel_veryloose   = ' == 0 ' #no cut

    filt.cut_absdEtaIn_barrel_tightTrig   = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_tightTrig   = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_tightTrig   = ' < 0.01 '
    filt.cut_hovere_barrel_tightTrig      = ' < 0.12 '
    filt.cut_ecalIso30_barrel_tightTrig   = ' < 0.2 '
    filt.cut_hcalIso30_barrel_tightTrig   = ' < 0.2 '
    filt.cut_trkIso30_barrel_tightTrig    = ' < 0.2 '

    filt.cut_absdEtaIn_endcap_tight       = ' < 0.005 '
    filt.cut_absdPhiIn_endcap_tight       = ' < 0.02 '
    filt.cut_sigmaIEIE_endcap_tight       = ' < 0.03 '
    filt.cut_hovere_endcap_tight          = ' < 0.1 '
    filt.cut_d0_endcap_tight              = ' < 0.02 '
    filt.cut_z0_endcap_tight              = ' < 0.1 '
    filt.cut_eoverp_endcap_tight          = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_tight   = ' < 0.1 '
    filt.cut_pfIso30_endcap_highPt_tight  = ' < 0.15 '
    filt.cut_convfit_endcap_tight         = ' < 0.000001 '
    filt.cut_misshits_endcap_tight        = ' == 0 '

    filt.cut_absdEtaIn_endcap_medium      = ' < 0.007 '
    filt.cut_absdPhiIn_endcap_medium      = ' < 0.03 '
    filt.cut_sigmaIEIE_endcap_medium      = ' < 0.03 '
    filt.cut_hovere_endcap_medium         = ' < 0.1 '
    filt.cut_d0_endcap_medium             = ' < 0.02 '
    filt.cut_z0_endcap_medium             = ' < 0.1 '
    filt.cut_eoverp_endcap_medium         = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_medium  = ' < 0.1 '
    filt.cut_pfIso30_endcap_highPt_medium = ' < 0.15 '
    filt.cut_convfit_endcap_medium        = ' < 0.000001 '
    filt.cut_misshits_endcap_medium       = ' <= 1 '

    filt.cut_absdEtaIn_endcap_loose       = ' < 0.009 '
    filt.cut_absdPhiIn_endcap_loose       = ' < 0.1 '
    filt.cut_sigmaIEIE_endcap_loose       = ' < 0.03 '
    filt.cut_hovere_endcap_loose          = ' < 0.1 '
    filt.cut_d0_endcap_loose              = ' < 0.02 '
    filt.cut_z0_endcap_loose              = ' < 0.2 '
    filt.cut_eoverp_endcap_loose          = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_loose   = ' < 0.10 '
    filt.cut_pfIso30_endcap_highPt_loose  = ' < 0.15 '
    filt.cut_convfit_endcap_loose         = ' < 0.000001 '
    filt.cut_misshits_endcap_loose        = ' <= 1 '

    filt.cut_absdEtaIn_endcap_veryloose   = ' < 0.01 '
    filt.cut_absdPhiIn_endcap_veryloose   = ' < 0.7 '
    filt.cut_sigmaIEIE_endcap_veryloose   = ' < 0.03 '
    #filt.cut_hovere_endcap_veryloose      = ' < 0.15 ' #no cut
    filt.cut_d0_endcap_veryloose          = ' < 0.04 '
    filt.cut_z0_endcap_veryloose          = ' < 0.2 '
    #filt.cut_eoverp_endcap_veryloose     = ' < 0.05 ' #no cut
    filt.cut_pfIso30_endcap_veryloose     = ' < 0.15 '
    #filt.cut_convfit_endcap_veryloose    = ' < 0.000001 ' #no cut
    #filt.cut_misshits_endcap_veryloose   = ' == 0 ' #no cut

    filt.cut_absdEtaIn_endcap_tightTrig   = ' < 0.009 '
    filt.cut_absdPhiIn_endcap_tightTrig   = ' < 0.10 '
    filt.cut_sigmaIEIE_endcap_tightTrig   = ' < 0.03 '
    filt.cut_hovere_endcap_tightTrig      = ' < 0.1 '
    filt.cut_ecalIso30_endcap_tightTrig   = ' < 0.2 '
    filt.cut_hcalIso30_endcap_tightTrig   = ' < 0.2 '
    filt.cut_trkIso30_endcap_tightTrig    = ' < 0.2 '

    if filtPID is not None :
        setattr(filt, 'cut_pid_%s' %filtPID, ' == True' )

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_absdEtaIn_barrel_tight', 100, -0.1, 0.1 )
        filt.add_hist( 'cut_absdPhiIn_barrel_tight', 100, -0.1, 0.1 )
        filt.add_hist( 'cut_sigmaIEIE_barrel_tight', 100, 0, 0.05 )
        filt.add_hist( 'cut_hovere_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_d0_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_z0_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_eoverp_barrel_tight', 100, 0, 1 )
        filt.add_hist( 'cut_pfIso30_barrel_tight', 100, 0, 10 )
        filt.add_hist( 'cut_convfit_barrel_tight', 2, 0, 2 )
        filt.add_hist( 'cut_misshits_barrel_tight', 10, 0, 10 )

    return filt
コード例 #20
0
def build_electron(do_cutflow=False, do_hists=False, filtPID=None):

    filt = Filter('BuildElectron')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 25'
    filt.cut_abssceta = ' <2.5 '
    # no crack for now
    #filt.cut_abssceta_crack = ' > 1.44 & < 1.57 '
    #filt.invert('cut_abssceta_crack')

    filt.cut_dEtaIn_barrel_tight = ' < 0.004 '
    filt.cut_dPhiIn_barrel_tight = ' < 0.03 '
    filt.cut_sigmaIEIE_barrel_tight = ' < 0.01 '
    filt.cut_hovere_barrel_tight = ' < 0.12 '
    #filt.cut_d0_barrel_tight        = ' < 0.02 '
    #filt.cut_z0_barrel_tight        = ' < 0.1 '
    filt.cut_eoverp_barrel_tight = ' < 0.05 '
    filt.cut_pfIso30_barrel_tight = ' < 0.1 '
    #filt.cut_convfit_barrel_tight   = ' < 0.000001 '
    filt.cut_misshits_barrel_tight = ' == 0 '

    filt.cut_dEtaIn_barrel_medium = ' < 0.004 '
    filt.cut_dPhiIn_barrel_medium = ' < 0.06 '
    filt.cut_sigmaIEIE_barrel_medium = ' < 0.01 '
    filt.cut_hovere_barrel_medium = ' < 0.12 '
    #filt.cut_d0_barrel_medium        = ' < 0.02 '
    #filt.cut_z0_barrel_medium        = ' < 0.1 '
    filt.cut_eoverp_barrel_medium = ' < 0.05 '
    filt.cut_pfIso30_barrel_medium = ' < 0.15 '
    #filt.cut_convfit_barrel_medium   = ' < 0.000001 '
    #filt.cut_misshits_barrel_medium  = ' <= 1 '

    filt.cut_dEtaIn_barrel_loose = ' < 0.007 '
    filt.cut_dPhiIn_barrel_loose = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_loose = ' < 0.01 '
    filt.cut_hovere_barrel_loose = ' < 0.12 '
    filt.cut_d0_barrel_loose = ' < 0.02 '
    filt.cut_z0_barrel_loose = ' < 0.2 '
    filt.cut_eoverp_barrel_loose = ' < 0.05 '
    filt.cut_pfIso30_barrel_loose = ' < 0.15 '
    filt.cut_convfit_barrel_loose = ' < 0.000001 '
    filt.cut_misshits_barrel_loose = ' <= 1 '

    filt.cut_dEtaIn_barrel_veryloose = ' < 0.007 '
    filt.cut_dPhiIn_barrel_veryloose = ' < 0.8 '
    filt.cut_sigmaIEIE_barrel_veryloose = ' < 0.01 '
    filt.cut_hovere_barrel_veryloose = ' < 0.15 '
    filt.cut_d0_barrel_veryloose = ' < 0.04 '
    filt.cut_z0_barrel_veryloose = ' < 0.2 '
    #filt.cut_eoverp_barrel_veryloose    = ' < 0.05 ' #no cut
    filt.cut_pfIso30_barrel_veryloose = ' < 0.1 '
    #filt.cut_convfit_barrel_veryloose   = ' < 0.000001 ' #no cut
    #filt.cut_misshits_barrel_veryloose  = ' == 0 ' #no cut

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_dEtaIn_barrel_tight', 100, -0.1, 0.1)
        filt.add_hist('cut_dPhiIn_barrel_tight', 100, -0.1, 0.1)
        filt.add_hist('cut_sigmaIEIE_barrel_tight', 100, 0, 0.05)
        filt.add_hist('cut_hovere_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_d0_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_z0_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_eoverp_barrel_tight', 100, 0, 1)
        filt.add_hist('cut_pfIso30_barrel_tight', 100, 0, 10)
        filt.add_hist('cut_convfit_barrel_tight', 2, 0, 2)
        filt.add_hist('cut_misshits_barrel_tight', 10, 0, 10)

    return filt
コード例 #21
0
def build_photon(do_cutflow=False, do_hists=False, filtPID=None):

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 15 '
    filt.cut_abseta = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.479 & < 1.566 '
    filt.invert('cut_abseta_crack')

    filt.cut_emfrac = ' < 0.05'
    filt.cut_eveto = ' == True'

    filt.cut_sigmaIEIE_barrel_loose = ' < 0.012 '
    filt.cut_chIsoCorr_barrel_loose = ' < 2.6 '
    filt.cut_neuIsoCorr_barrel_loose = ' < 3.5 '
    filt.cut_phoIsoCorr_barrel_loose = ' < 1.3 '

    filt.cut_sigmaIEIE_endcap_loose = ' < 0.034 '
    filt.cut_chIsoCorr_endcap_loose = ' < 2.3 '
    filt.cut_neuIsoCorr_endcap_loose = ' < 2.9 '
    # no cut for loose
    #filt.cut_phoIsoCorr_endcap_loose = ' < 1.0 '

    filt.cut_sigmaIEIE_barrel_medium = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_medium = ' < 1.5 '
    filt.cut_neuIsoCorr_barrel_medium = ' < 1.0 '
    filt.cut_phoIsoCorr_barrel_medium = ' < 0.7 '

    filt.cut_sigmaIEIE_endcap_medium = ' < 0.033 '
    filt.cut_chIsoCorr_endcap_medium = ' < 1.2 '
    filt.cut_neuIsoCorr_endcap_medium = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_medium = ' < 1.0 '

    filt.cut_sigmaIEIE_barrel_tight = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_tight = ' < 0.7 '
    filt.cut_neuIsoCorr_barrel_tight = ' < 0.4 '
    filt.cut_phoIsoCorr_barrel_tight = ' < 0.5 '

    filt.cut_sigmaIEIE_endcap_tight = ' < 0.031 '
    filt.cut_chIsoCorr_endcap_tight = ' < 0.5 '
    filt.cut_neuIsoCorr_endcap_tight = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_tight = ' < 1.0 '

    if filtPID is not None:
        setattr(filt, 'cut_pid_%s' % filtPID, '== True')

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_emfrac', 50, 0, 0.1)
        filt.add_hist('cut_eveto', 2, 0, 2)
        filt.add_hist('cut_sigmaIEIE_barrel', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_barrel', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_barrel', 50, 0, 5)
        filt.add_hist('cut_phoIsoCorr_barrel', 50, 0, 5)

    return filt
コード例 #22
0
def build_muon(do_cutflow=False, do_hists=False):

    filt = Filter("BuildMuon")

    filt.do_cutflow = do_cutflow

    filt.cut_isGlobal = " == True "
    filt.cut_isPF = " == True "
    filt.cut_pt = " > 25 "
    filt.cut_abseta = " < 2.5"
    filt.cut_chi2 = " < 10"
    filt.cut_nTrkLayers = " > 8 "
    filt.cut_nStations = " > 1"
    filt.cut_nPixelHits = " > 0"
    filt.cut_d0 = " < 0.2"
    filt.cut_z0 = " < 0.5"
    # filt.cut_trkiso     = ' < 0.1 '
    filt.cut_corriso = " < 0.2"

    if do_hists:
        filt.add_hist("cut_pt", 100, 0, 500)
        filt.add_hist("cut_abseta", 50, 0, 5)
        filt.add_hist("cut_chi2", 50, 0, 50)
        filt.add_hist("cut_nTrkLayers", 20, 0, 20)
        filt.add_hist("cut_nStations", 5, 0, 5)
        filt.add_hist("cut_nPixelHits", 20, 0, 20)
        filt.add_hist("cut_d0", 100, -0.05, 0.05)
        filt.add_hist("cut_z0", 100, -0.05, 0.05)
        filt.add_hist("cut_trkiso", 50, 0, 0.5)
        filt.add_hist("cut_corriso", 50, 0, 0.5)

    return filt
コード例 #23
0
ファイル: ConfPhotonReco.py プロジェクト: jkunkle/usercode
def build_photon( do_cutflow=False, do_hists=False, filtPID=None, evalPID=None, doEVeto=True, applyCorrections=False ) :

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt           = ' > 10 '
    filt.cut_abseta       = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.44 & < 1.57 '
    filt.invert('cut_abseta_crack')

    # taken from https://twiki.cern.ch/twiki/bin/view/CMS/CutBasedPhotonIdentificationRun2#Recommended_Working_points_for_2
    # Updated Dec 2016
    filt.cut_sigmaIEIE_barrel_loose  = ' < 0.01031 '
    filt.cut_chIsoCorr_barrel_loose  = ' < 1.295 '
    filt.cut_neuIsoCorr_barrel_loose = ' < 10.910 '
    filt.cut_phoIsoCorr_barrel_loose = ' < 3.630 '
    filt.cut_hovere_barrel_loose = ' < 0.0597 '

    filt.cut_sigmaIEIE_endcap_loose  = ' < 0.03013 '
    filt.cut_chIsoCorr_endcap_loose  = ' < 1.011 '
    filt.cut_neuIsoCorr_endcap_loose = ' < 5.931 '
    filt.cut_phoIsoCorr_endcap_loose = ' < 6.641 '
    filt.cut_hovere_endcap_loose = ' < 0.0481 '

    filt.cut_sigmaIEIE_barrel_medium  = ' < 0.01022 '
    filt.cut_chIsoCorr_barrel_medium  = ' < 0.441 '
    filt.cut_neuIsoCorr_barrel_medium = ' < 2.725 '
    filt.cut_phoIsoCorr_barrel_medium = ' < 2.571 '
    filt.cut_hovere_barrel_medium = ' < 0.0396 '

    filt.cut_sigmaIEIE_endcap_medium  = ' < 0.03001 '
    filt.cut_chIsoCorr_endcap_medium  = ' < 0.442 '
    filt.cut_neuIsoCorr_endcap_medium = ' < 1.715 '
    filt.cut_phoIsoCorr_endcap_medium = ' < 3.863 '
    filt.cut_hovere_endcap_medium = ' < 0.0219 '

    filt.cut_sigmaIEIE_barrel_tight  = ' < 0.00994 '
    filt.cut_chIsoCorr_barrel_tight  = ' < 0.202 '
    filt.cut_neuIsoCorr_barrel_tight = ' < 0.264 '
    filt.cut_phoIsoCorr_barrel_tight = ' < 2.362 '
    filt.cut_hovere_barrel_tight = ' < 0.0269 '

    filt.cut_sigmaIEIE_endcap_tight  = ' < 0.0300 '
    filt.cut_chIsoCorr_endcap_tight  = ' < 0.034 '
    filt.cut_neuIsoCorr_endcap_tight = ' < 0.586 '
    filt.cut_phoIsoCorr_endcap_tight = ' < 2.617 '
    filt.cut_hovere_endcap_tight = ' < 0.0213 '

    if filtPID is not None :
        setattr(filt, 'cut_pid_%s' %filtPID, ' == True' )

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_hovere', 50, 0, 0.1 )
        filt.add_hist( 'cut_eveto', 2, 0, 2 )
        filt.add_hist( 'cut_sigmaIEIE_barrel_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_medium', 50, 0, 5 )

        filt.add_hist( 'cut_sigmaIEIE_barrel_loose', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_loose', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_loose', 100, -5, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_loose', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_loose', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_loose', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_loose', 100, -5, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_loose', 50, 0, 5 )

    return filt
コード例 #24
0
def build_photon( do_cutflow=False, do_hists=False, filtPID=None, evalPID=None, doEVeto=True ) :

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt           = ' > 15 '
    filt.cut_abseta       = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.479 & < 1.566 '
    filt.invert('cut_abseta_crack')

    #filt.cut_hovere       = ' < 0.05'
    if doEVeto :
        filt.cut_eveto        = ' == False'

    filt.cut_sigmaIEIE_barrel_loose  = ' < 0.012 '
    filt.cut_chIsoCorr_barrel_loose  = ' < 2.6 '
    filt.cut_neuIsoCorr_barrel_loose = ' < 3.5 '
    filt.cut_phoIsoCorr_barrel_loose = ' < 1.3 '
    filt.cut_hovere_barrel_loose = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_loose  = ' < 0.034 '
    filt.cut_chIsoCorr_endcap_loose  = ' < 2.3 '
    filt.cut_neuIsoCorr_endcap_loose = ' < 2.9 '
    # no cut for loose
    #filt.cut_phoIsoCorr_endcap_loose = ' < 1.0 '
    filt.cut_hovere_endcap_loose = ' < 0.05 '

    filt.cut_sigmaIEIE_barrel_medium  = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_medium  = ' < 1.5 '
    filt.cut_neuIsoCorr_barrel_medium = ' < 1.0 '
    filt.cut_phoIsoCorr_barrel_medium = ' < 0.7 '
    filt.cut_hovere_barrel_medium = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_medium  = ' < 0.033 '
    filt.cut_chIsoCorr_endcap_medium  = ' < 1.2 '
    filt.cut_neuIsoCorr_endcap_medium = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_medium = ' < 1.0 '
    filt.cut_hovere_endcap_medium = ' < 0.05 '

    filt.cut_sigmaIEIE_barrel_tight  = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_tight  = ' < 0.7 '
    filt.cut_neuIsoCorr_barrel_tight = ' < 0.4 '
    filt.cut_phoIsoCorr_barrel_tight = ' < 0.5 '
    filt.cut_hovere_barrel_tight = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_tight  = ' < 0.031 '
    filt.cut_chIsoCorr_endcap_tight  = ' < 0.5 '
    filt.cut_neuIsoCorr_endcap_tight = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_tight = ' < 1.0 '
    filt.cut_hovere_endcap_tight = ' < 0.05 '

    filt.cut_hovere12_barrel_mva_presel_smallr9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_smallr9  = ' < 4 '
    filt.cut_hovere12_barrel_mva_presel_larger9      = ' < 0.082 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_larger9  = ' < 50 '
    filt.cut_sigmaIEIE_barrel_mva_presel             = ' < 0.014 '
    filt.cut_chgpfIso_barrel_mva_presel              = ' < 4 '

    filt.cut_hovere12_endcap_mva_presel_smallr9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_smallr9  = ' < 4 '
    filt.cut_hovere12_endcap_mva_presel_larger9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_larger9  = ' < 50 '
    filt.cut_sigmaIEIE_endcap_mva_presel             = ' < 0.034 '
    filt.cut_chgpfIso_endcap_mva_presel              = ' < 4 '

    if filtPID is not None :
        setattr(filt, 'cut_pid_%s' %filtPID, ' == True' )

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    filt.add_var( 'TMVAWeightsFileEB', '/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EB_BDT.weights.xml' )
    filt.add_var( 'TMVAWeightsFileEE', '/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EE_BDT.weights.xml' )

    #filt.cut_ph_el_dr = ' > 0.2 '

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_hovere', 50, 0, 0.1 )
        filt.add_hist( 'cut_eveto', 2, 0, 2 )
        filt.add_hist( 'cut_sigmaIEIE_barrel_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_medium', 50, 0, 5 )

        filt.add_hist( 'cut_sigmaIEIE_barrel_loose', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_loose', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_loose', 100, -5, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_loose', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_loose', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_loose', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_loose', 100, -5, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_loose', 50, 0, 5 )

    return filt
コード例 #25
0
def build_medium_electron( do_cutflow=False, do_hists=False ) :

    filt = Filter('BuildMediumElectron')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 25'
    #filt.cut_abssceta       = ' > 1.57 '
    #filt.cut_abssceta       = ' < 1.479 '
    filt.cut_abssceta       = ' < 2.5 '
    filt.cut_abssceta_crack = ' > 1.479 & < 1.57 '
    filt.invert('cut_abssceta_crack')

    filt.cut_dEtaIn_barrel    = ' < 0.004 '
    filt.cut_dPhiIn_barrel    = ' < 0.06 '
    filt.cut_sigmaIEIE_barrel = ' < 0.01 '
    filt.cut_hovere_barrel    = ' < 0.12 '
    filt.cut_d0_barrel        = ' < 0.02 '
    filt.cut_z0_barrel        = ' < 0.1 '
    filt.cut_eoverp_barrel    = ' < 0.05 '
    filt.cut_pfIso30_barrel   = ' < 0.15 '
    filt.cut_convfit_barrel   = ' < 0.000001 '
    filt.cut_misshits_barrel  = ' <= 1 '

    filt.cut_dEtaIn_endcap    = ' < 0.007 '
    filt.cut_dPhiIn_endcap    = ' < 0.03 '
    filt.cut_sigmaIEIE_endcap = ' < 0.03 '
    filt.cut_hovere_endcap    = ' < 0.10 '
    filt.cut_d0_endcap        = ' < 0.02 '
    filt.cut_z0_endcap        = ' < 0.1 '
    filt.cut_eoverp_endcap    = ' < 0.05 '
    filt.cut_pfIso30_endcap   = ' < 0.15 '
    filt.cut_convfit_endcap   = ' < 0.000001 '
    filt.cut_misshits_endcap  = ' <= 1 '

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_abssceta', 50, 0, 5 )
        filt.add_hist( 'cut_dEtaIn_barrel', 100, -0.1, 0.1 )
        filt.add_hist( 'cut_dPhiIn_barrel', 100, -0.1, 0.1 )
        filt.add_hist( 'cut_sigmaIEIE_barrel', 100, 0, 0.05 )
        filt.add_hist( 'cut_hovere_barrel', 100, -1, 1 )
        filt.add_hist( 'cut_d0_barrel', 100, -1, 1 )
        filt.add_hist( 'cut_z0_barrel', 100, -1, 1 )
        filt.add_hist( 'cut_eoverp_barrel', 100, 0, 1 )
        filt.add_hist( 'cut_pfIso30_barrel', 100, 0, 10 )
        filt.add_hist( 'cut_convfit_barrel', 2, 0, 2 )
        filt.add_hist( 'cut_misshits_barrel', 10, 0, 10 )

    return filt
コード例 #26
0
ファイル: ConfWgamgamReco.py プロジェクト: lgray/usercode
def build_photon( do_cutflow=False, do_hists=False, filtPID=None, evalPID=None ) :

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt           = ' > 15 '
    filt.cut_abseta       = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.479 & < 1.566 '
    filt.invert('cut_abseta_crack')

    filt.cut_emfrac       = ' < 0.05'
    filt.cut_eveto        = ' == False'

    filt.cut_sigmaIEIE_barrel_loose  = ' < 0.012 '
    filt.cut_chIsoCorr_barrel_loose  = ' < 2.6 '
    filt.cut_neuIsoCorr_barrel_loose = ' < 3.5 '
    filt.cut_phoIsoCorr_barrel_loose = ' < 1.3 '

    filt.cut_sigmaIEIE_endcap_loose  = ' < 0.034 '
    filt.cut_chIsoCorr_endcap_loose  = ' < 2.3 '
    filt.cut_neuIsoCorr_endcap_loose = ' < 2.9 '
    # no cut for loose
    #filt.cut_phoIsoCorr_endcap_loose = ' < 1.0 '

    filt.cut_sigmaIEIE_barrel_medium  = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_medium  = ' < 1.5 '
    filt.cut_neuIsoCorr_barrel_medium = ' < 1.0 '
    filt.cut_phoIsoCorr_barrel_medium = ' < 0.7 '

    filt.cut_sigmaIEIE_endcap_medium  = ' < 0.033 '
    filt.cut_chIsoCorr_endcap_medium  = ' < 1.2 '
    filt.cut_neuIsoCorr_endcap_medium = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_medium = ' < 1.0 '

    filt.cut_sigmaIEIE_barrel_tight  = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_tight  = ' < 0.7 '
    filt.cut_neuIsoCorr_barrel_tight = ' < 0.4 '
    filt.cut_phoIsoCorr_barrel_tight = ' < 0.5 '

    filt.cut_sigmaIEIE_endcap_tight  = ' < 0.031 '
    filt.cut_chIsoCorr_endcap_tight  = ' < 0.5 '
    filt.cut_neuIsoCorr_endcap_tight = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_tight = ' < 1.0 '

    if filtPID is not None :
        setattr(filt, 'cut_pid_%s' %filtPID, ' == True' )

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    filt.cut_ph_el_dr = ' > 0.2 '

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_emfrac', 50, 0, 0.1 )
        filt.add_hist( 'cut_eveto', 2, 0, 2 )
        filt.add_hist( 'cut_sigmaIEIE_barrel_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_medium', 50, 0, 5 )

    return filt
コード例 #27
0
ファイル: ConfWgamgamReco.py プロジェクト: cranelli/usercode
def build_photon( do_cutflow=False, do_hists=False, filtPID=None, evalPID=None, doEVeto=True, applyCorrections=False ) :

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt           = ' > 10 '
    filt.cut_abseta       = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.44 & < 1.57 '
    filt.invert('cut_abseta_crack')

    #filt.cut_hovere       = ' < 0.05'
    if doEVeto :
        filt.cut_eveto        = ' == False'

    filt.cut_sigmaIEIE_barrel_loose  = ' < 0.012 '
    filt.cut_chIsoCorr_barrel_loose  = ' < 2.6 '
    filt.cut_neuIsoCorr_barrel_loose = ' < 3.5 '
    filt.cut_phoIsoCorr_barrel_loose = ' < 1.3 '
    filt.cut_hovere_barrel_loose = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_loose  = ' < 0.034 '
    filt.cut_chIsoCorr_endcap_loose  = ' < 2.3 '
    filt.cut_neuIsoCorr_endcap_loose = ' < 2.9 '
    # no cut for loose
    #filt.cut_phoIsoCorr_endcap_loose = ' < 1.0 '
    filt.cut_hovere_endcap_loose = ' < 0.05 '

    filt.cut_sigmaIEIE_barrel_medium  = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_medium  = ' < 1.5 '
    filt.cut_neuIsoCorr_barrel_medium = ' < 1.0 '
    filt.cut_phoIsoCorr_barrel_medium = ' < 0.7 '
    filt.cut_hovere_barrel_medium = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_medium  = ' < 0.033 '
    filt.cut_chIsoCorr_endcap_medium  = ' < 1.2 '
    filt.cut_neuIsoCorr_endcap_medium = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_medium = ' < 1.0 '
    filt.cut_hovere_endcap_medium = ' < 0.05 '

    filt.cut_sigmaIEIE_barrel_tight  = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_tight  = ' < 0.7 '
    filt.cut_neuIsoCorr_barrel_tight = ' < 0.4 '
    filt.cut_phoIsoCorr_barrel_tight = ' < 0.5 '
    filt.cut_hovere_barrel_tight = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_tight  = ' < 0.031 '
    filt.cut_chIsoCorr_endcap_tight  = ' < 0.5 '
    filt.cut_neuIsoCorr_endcap_tight = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_tight = ' < 1.0 '
    filt.cut_hovere_endcap_tight = ' < 0.05 '

    filt.cut_hovere12_barrel_mva_presel_smallr9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_smallr9  = ' < 4 '
    filt.cut_hovere12_barrel_mva_presel_larger9      = ' < 0.082 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_larger9  = ' < 50 '
    filt.cut_sigmaIEIE_barrel_mva_presel             = ' < 0.014 '
    filt.cut_chgpfIso_barrel_mva_presel              = ' < 4 '

    filt.cut_hovere12_endcap_mva_presel_smallr9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_smallr9  = ' < 4 '
    filt.cut_hovere12_endcap_mva_presel_larger9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_larger9  = ' < 50 '
    filt.cut_sigmaIEIE_endcap_mva_presel             = ' < 0.034 '
    filt.cut_chgpfIso_endcap_mva_presel              = ' < 4 '

    if filtPID is not None :
        setattr(filt, 'cut_pid_%s' %filtPID, ' == True' )

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    if applyCorrections :
        workarea = os.getenv('WorkArea')
        filt.add_var('applyCorrections', 'true' )
        filt.add_var('correctionFile', '%s/TreeFilter/RecoWgg/data/step2-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9.dat' %workarea )
        filt.add_var('smearingFile', '%s/TreeFilter/RecoWgg/data/outFile-step4-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9-smearEle.dat' %workarea )

    filt.add_var( 'TMVAWeightsFileEB', '/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EB_BDT.weights.xml' )
    filt.add_var( 'TMVAWeightsFileEE', '/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EE_BDT.weights.xml' )

    #filt.cut_ph_el_dr = ' > 0.2 '

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_hovere', 50, 0, 0.1 )
        filt.add_hist( 'cut_eveto', 2, 0, 2 )
        filt.add_hist( 'cut_sigmaIEIE_barrel_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_medium', 50, 0, 5 )

        filt.add_hist( 'cut_sigmaIEIE_barrel_loose', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_loose', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_loose', 100, -5, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_loose', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_loose', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_loose', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_loose', 100, -5, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_loose', 50, 0, 5 )

    return filt
コード例 #28
0
ファイル: ConfWgamgamReco.py プロジェクト: lgray/usercode
def build_muon( do_cutflow=False, do_hists=False ) :

    filt = Filter('BuildMuon')

    filt.do_cutflow = do_cutflow

    filt.cut_isGlobal   = ' == True '
    filt.cut_isPF       = ' == True '
    filt.cut_pt         = ' > 25 '
    filt.cut_abseta     = ' < 2.5'
    filt.cut_chi2       = ' < 10'
    filt.cut_nTrkLayers = ' > 8 ' 
    filt.cut_nStations  = ' > 1'
    filt.cut_nPixelHits = ' > 0'
    filt.cut_d0         = ' < 0.2'
    filt.cut_z0         = ' < 0.5'
    #filt.cut_trkiso     = ' < 0.1 '
    filt.cut_corriso    = ' < 0.2'

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_chi2', 50, 0, 50 )
        filt.add_hist( 'cut_nTrkLayers', 20, 0, 20 )
        filt.add_hist( 'cut_nStations', 5, 0, 5 )
        filt.add_hist( 'cut_nPixelHits', 20, 0, 20 )
        filt.add_hist( 'cut_d0', 100, -0.05, 0.05 )
        filt.add_hist( 'cut_z0', 100, -0.05, 0.05 )
        filt.add_hist( 'cut_trkiso', 50, 0, 0.5 )
        filt.add_hist( 'cut_corriso', 50, 0, 0.5 )

    return filt
コード例 #29
0
ファイル: ConfWgamgamReco.py プロジェクト: cranelli/usercode
def build_electron( do_cutflow=False, do_hists=False, filtPID=None, evalPID=None, applyCorrections=False ) :

    filt = Filter('BuildElectron')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 5'
    filt.cut_abssceta       = ' <2.5 '
    # no crack for now
    #filt.cut_abssceta_crack = ' > 1.44 & < 1.57 '
    #filt.invert('cut_abssceta_crack')

    filt.cut_absdEtaIn_barrel_tight       = ' < 0.004 '
    filt.cut_absdPhiIn_barrel_tight       = ' < 0.03 '
    filt.cut_sigmaIEIE_barrel_tight       = ' < 0.01 '
    filt.cut_hovere_barrel_tight          = ' < 0.12 '
    filt.cut_d0_barrel_tight              = ' < 0.02 '
    filt.cut_z0_barrel_tight              = ' < 0.1 '
    filt.cut_eoverp_barrel_tight          = ' < 0.05 '
    filt.cut_pfIso30_barrel_tight         = ' < 0.1 '
    filt.cut_convfit_barrel_tight         = ' == 0 '
    filt.cut_misshits_barrel_tight        = ' == 0 '

    filt.cut_absdEtaIn_barrel_medium      = ' < 0.004 '
    filt.cut_absdPhiIn_barrel_medium      = ' < 0.06 '
    filt.cut_sigmaIEIE_barrel_medium      = ' < 0.01 '
    filt.cut_hovere_barrel_medium         = ' < 0.12 '
    filt.cut_d0_barrel_medium             = ' < 0.02 '
    filt.cut_z0_barrel_medium             = ' < 0.1 '
    filt.cut_eoverp_barrel_medium         = ' < 0.05 '
    filt.cut_pfIso30_barrel_medium        = ' < 0.15 '
    filt.cut_convfit_barrel_medium        = ' == 0 '
    filt.cut_misshits_barrel_medium       = ' <= 1 '

    filt.cut_absdEtaIn_barrel_loose       = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_loose       = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_loose       = ' < 0.01 '
    filt.cut_hovere_barrel_loose          = ' < 0.12 '
    filt.cut_d0_barrel_loose              = ' < 0.02 '
    filt.cut_z0_barrel_loose              = ' < 0.2 '
    filt.cut_eoverp_barrel_loose          = ' < 0.05 '
    filt.cut_pfIso30_barrel_loose         = ' < 0.15 '
    filt.cut_convfit_barrel_loose         = ' == 0 '
    filt.cut_misshits_barrel_loose        = ' <= 1 '

    filt.cut_absdEtaIn_barrel_veryloose   = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_veryloose   = ' < 0.8 '
    filt.cut_sigmaIEIE_barrel_veryloose   = ' < 0.01 '
    filt.cut_hovere_barrel_veryloose      = ' < 0.15 '
    filt.cut_d0_barrel_veryloose          = ' < 0.04 '
    filt.cut_z0_barrel_veryloose          = ' < 0.2 '
    #filt.cut_eoverp_barrel_veryloose     = ' < 0.05 ' #no cut
    filt.cut_pfIso30_barrel_veryloose     = ' < 0.1 '
    #filt.cut_convfit_barrel_veryloose    = ' == 0 ' #no cut
    #filt.cut_misshits_barrel_veryloose   = ' == 0 ' #no cut

    filt.cut_absdEtaIn_barrel_tightTrig   = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_tightTrig   = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_tightTrig   = ' < 0.01 '
    filt.cut_hovere_barrel_tightTrig      = ' < 0.12 '
    filt.cut_ecalIso30_barrel_tightTrig   = ' < 0.2 '
    filt.cut_hcalIso30_barrel_tightTrig   = ' < 0.2 '
    filt.cut_trkIso30_barrel_tightTrig    = ' < 0.2 '

    filt.cut_absdEtaIn_endcap_tight       = ' < 0.005 '
    filt.cut_absdPhiIn_endcap_tight       = ' < 0.02 '
    filt.cut_sigmaIEIE_endcap_tight       = ' < 0.03 '
    filt.cut_hovere_endcap_tight          = ' < 0.1 '
    filt.cut_d0_endcap_tight              = ' < 0.02 '
    filt.cut_z0_endcap_tight              = ' < 0.1 '
    filt.cut_eoverp_endcap_tight          = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_tight   = ' < 0.1 '
    filt.cut_pfIso30_endcap_highPt_tight  = ' < 0.15 '
    filt.cut_convfit_endcap_tight         = ' == 0 '
    filt.cut_misshits_endcap_tight        = ' == 0 '

    filt.cut_absdEtaIn_endcap_medium      = ' < 0.007 '
    filt.cut_absdPhiIn_endcap_medium      = ' < 0.03 '
    filt.cut_sigmaIEIE_endcap_medium      = ' < 0.03 '
    filt.cut_hovere_endcap_medium         = ' < 0.1 '
    filt.cut_d0_endcap_medium             = ' < 0.02 '
    filt.cut_z0_endcap_medium             = ' < 0.1 '
    filt.cut_eoverp_endcap_medium         = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_medium  = ' < 0.1 '
    filt.cut_pfIso30_endcap_highPt_medium = ' < 0.15 '
    filt.cut_convfit_endcap_medium        = ' == 0 '
    filt.cut_misshits_endcap_medium       = ' <= 1 '

    filt.cut_absdEtaIn_endcap_loose       = ' < 0.009 '
    filt.cut_absdPhiIn_endcap_loose       = ' < 0.1 '
    filt.cut_sigmaIEIE_endcap_loose       = ' < 0.03 '
    filt.cut_hovere_endcap_loose          = ' < 0.1 '
    filt.cut_d0_endcap_loose              = ' < 0.02 '
    filt.cut_z0_endcap_loose              = ' < 0.2 '
    filt.cut_eoverp_endcap_loose          = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_loose   = ' < 0.10 '
    filt.cut_pfIso30_endcap_highPt_loose  = ' < 0.15 '
    filt.cut_convfit_endcap_loose         = ' == 0 '
    filt.cut_misshits_endcap_loose        = ' <= 1 '

    filt.cut_absdEtaIn_endcap_veryloose   = ' < 0.01 '
    filt.cut_absdPhiIn_endcap_veryloose   = ' < 0.7 '
    filt.cut_sigmaIEIE_endcap_veryloose   = ' < 0.03 '
    #filt.cut_hovere_endcap_veryloose      = ' < 0.15 ' #no cut
    filt.cut_d0_endcap_veryloose          = ' < 0.04 '
    filt.cut_z0_endcap_veryloose          = ' < 0.2 '
    #filt.cut_eoverp_endcap_veryloose     = ' < 0.05 ' #no cut
    filt.cut_pfIso30_endcap_veryloose     = ' < 0.15 '
    #filt.cut_convfit_endcap_veryloose    = ' == 0 ' #no cut
    #filt.cut_misshits_endcap_veryloose   = ' == 0 ' #no cut

    filt.cut_absdEtaIn_endcap_tightTrig    = ' < 0.009 '
    filt.cut_absdPhiIn_endcap_tightTrig    = ' < 0.10 '
    filt.cut_sigmaIEIE_endcap_tightTrig    = ' < 0.03 '
    filt.cut_hovere_endcap_tightTrig       = ' < 0.1 '
    filt.cut_ecalIso30_endcap_tightTrig    = ' < 0.2 '
    filt.cut_hcalIso30_endcap_tightTrig    = ' < 0.2 '
    filt.cut_trkIso30_endcap_tightTrig     = ' < 0.2 '

    filt.cut_mva_central_lowpt_mvatrig     = ' > 0.0 '
    filt.cut_mva_crack_lowpt_mvatrig       = ' > 0.1 '
    filt.cut_mva_endcap_lowpt_mvatrig      = ' > 0.62 '
    filt.cut_mva_central_highpt_mvatrig    = ' > 0.94 '
    filt.cut_mva_crack_highpt_mvatrig      = ' > 0.85 '
    filt.cut_mva_endcap_highpt_mvatrig     = ' > 0.92 '
    
    filt.cut_relpfiso_mvatrig              = ' < 0.15 '
    filt.cut_misshits_mvatrig              = ' == 0 '
    filt.cut_convfit_mvatrig               = ' == 0 ' 

    filt.cut_mva_central_lowpt_mvanontrig  = ' > 0.47 '
    filt.cut_mva_crack_lowpt_mvanontrig    = ' > 0.004 '
    filt.cut_mva_endcap_lowpt_mvanontrig   = ' > 0.295 '
    filt.cut_mva_central_highpt_mvanontrig = ' > -0.34 '
    filt.cut_mva_crack_highpt_mvanontrig   = ' > -0.65 '
    filt.cut_mva_endcap_highpt_mvanontrig  = ' > 0.6 '
    
    filt.cut_relpfiso_mvanontrig           = ' < 0.4 '
    filt.cut_misshits_mvanontrig           = ' < 2 '
    filt.cut_sip_mvanontrig                = ' < 4' 

    if filtPID is not None :
        setattr(filt, 'cut_pid_%s' %filtPID, ' == True' )

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    if applyCorrections :
        workarea = os.getenv('WorkArea')
        filt.add_var('applyCorrections', 'true' )
        filt.add_var('correctionFile', '%s/TreeFilter/RecoWgg/data/step2-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9.dat' %workarea )
        filt.add_var('smearingFile', '%s/TreeFilter/RecoWgg/data/outFile-step4-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9-smearEle.dat' %workarea )


    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_absdEtaIn_barrel_tight', 100, -0.1, 0.1 )
        filt.add_hist( 'cut_absdPhiIn_barrel_tight', 100, -0.1, 0.1 )
        filt.add_hist( 'cut_sigmaIEIE_barrel_tight', 100, 0, 0.05 )
        filt.add_hist( 'cut_hovere_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_d0_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_z0_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_eoverp_barrel_tight', 100, 0, 1 )
        filt.add_hist( 'cut_pfIso30_barrel_tight', 100, 0, 10 )
        filt.add_hist( 'cut_convfit_barrel_tight', 2, 0, 2 )
        filt.add_hist( 'cut_misshits_barrel_tight', 10, 0, 10 )

        filt.add_hist( 'cut_mva_central_lowpt_mvatrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_crack_lowpt_mvatrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_endcap_lowpt_mvatrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_central_highpt_mvatrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_crack_highpt_mvatrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_endcap_highpt_mvatrig', 50, -1, 1 )
        
        filt.add_hist( 'cut_relpfiso_mvatrig', 50, 0, 5 )
        filt.add_hist( 'cut_misshits_mvatrig', 10, 0, 10 )
        filt.add_hist( 'cut_convfit_mvatrig', 2, 0, 1 )

        filt.add_hist( 'cut_mva_central_lowpt_mvanontrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_crack_lowpt_mvanontrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_endcap_lowpt_mvanontrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_central_highpt_mvanontrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_crack_highpt_mvanontrig', 50, -1, 1 )
        filt.add_hist( 'cut_mva_endcap_highpt_mvanontrig', 50, -1, 1 )
        
        filt.add_hist( 'cut_relpfiso_mvanontrig', 50, 0, 5 )
        filt.add_hist( 'cut_misshits_mvanontrig', 10, 0, 10 )
        filt.add_hist( 'cut_sip_mvanontrig', 50, 0, 10 )

    return filt
コード例 #30
0
def build_medium_photon(do_cutflow=False, do_hists=False):

    filt = Filter('BuildPIDPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 15 '
    #filt.cut_abseta       = ' < 1.479'
    #filt.cut_abseta       = ' > 1.566'
    filt.cut_abseta = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.479 & < 1.566 '
    filt.invert('cut_abseta_crack')

    filt.cut_emfrac = ' < 0.05'
    filt.cut_eveto = ' == False'

    filt.cut_sigmaIEIE_barrel = ' < 0.011 '
    filt.cut_chIsoCorr_barrel = ' < 1.5 '
    filt.cut_neuIsoCorr_barrel = ' < 1.0 '
    filt.cut_phoIsoCorr_barrel = ' < 0.7 '

    filt.cut_sigmaIEIE_endcap = ' < 0.033 '
    filt.cut_chIsoCorr_endcap = ' < 1.2 '
    filt.cut_neuIsoCorr_endcap = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap = ' < 1.0 '

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_emfrac', 50, 0, 0.1)
        filt.add_hist('cut_eveto', 2, 0, 2)
        filt.add_hist('cut_sigmaIEIE_barrel', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_barrel', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_barrel', 50, 0, 5)
        filt.add_hist('cut_phoIsoCorr_barrel', 50, 0, 5)

    return filt
コード例 #31
0
def build_electron(do_cutflow=False, do_hists=False, filtPID=None):

    filt = Filter("BuildElectron")

    filt.do_cutflow = do_cutflow

    filt.cut_pt = " > 25"
    filt.cut_abssceta = " <2.5 "
    # no crack for now
    # filt.cut_abssceta_crack = ' > 1.44 & < 1.57 '
    # filt.invert('cut_abssceta_crack')

    filt.cut_dEtaIn_barrel_tight = " < 0.004 "
    filt.cut_dPhiIn_barrel_tight = " < 0.03 "
    filt.cut_sigmaIEIE_barrel_tight = " < 0.01 "
    filt.cut_hovere_barrel_tight = " < 0.12 "
    # filt.cut_d0_barrel_tight        = ' < 0.02 '
    # filt.cut_z0_barrel_tight        = ' < 0.1 '
    filt.cut_eoverp_barrel_tight = " < 0.05 "
    filt.cut_pfIso30_barrel_tight = " < 0.1 "
    # filt.cut_convfit_barrel_tight   = ' < 0.000001 '
    filt.cut_misshits_barrel_tight = " == 0 "

    filt.cut_dEtaIn_barrel_medium = " < 0.004 "
    filt.cut_dPhiIn_barrel_medium = " < 0.06 "
    filt.cut_sigmaIEIE_barrel_medium = " < 0.01 "
    filt.cut_hovere_barrel_medium = " < 0.12 "
    # filt.cut_d0_barrel_medium        = ' < 0.02 '
    # filt.cut_z0_barrel_medium        = ' < 0.1 '
    filt.cut_eoverp_barrel_medium = " < 0.05 "
    filt.cut_pfIso30_barrel_medium = " < 0.15 "
    # filt.cut_convfit_barrel_medium   = ' < 0.000001 '
    # filt.cut_misshits_barrel_medium  = ' <= 1 '

    filt.cut_dEtaIn_barrel_loose = " < 0.007 "
    filt.cut_dPhiIn_barrel_loose = " < 0.15 "
    filt.cut_sigmaIEIE_barrel_loose = " < 0.01 "
    filt.cut_hovere_barrel_loose = " < 0.12 "
    filt.cut_d0_barrel_loose = " < 0.02 "
    filt.cut_z0_barrel_loose = " < 0.2 "
    filt.cut_eoverp_barrel_loose = " < 0.05 "
    filt.cut_pfIso30_barrel_loose = " < 0.15 "
    filt.cut_convfit_barrel_loose = " < 0.000001 "
    filt.cut_misshits_barrel_loose = " <= 1 "

    filt.cut_dEtaIn_barrel_veryloose = " < 0.007 "
    filt.cut_dPhiIn_barrel_veryloose = " < 0.8 "
    filt.cut_sigmaIEIE_barrel_veryloose = " < 0.01 "
    filt.cut_hovere_barrel_veryloose = " < 0.15 "
    filt.cut_d0_barrel_veryloose = " < 0.04 "
    filt.cut_z0_barrel_veryloose = " < 0.2 "
    # filt.cut_eoverp_barrel_veryloose    = ' < 0.05 ' #no cut
    filt.cut_pfIso30_barrel_veryloose = " < 0.1 "
    # filt.cut_convfit_barrel_veryloose   = ' < 0.000001 ' #no cut
    # filt.cut_misshits_barrel_veryloose  = ' == 0 ' #no cut

    if do_hists:
        filt.add_hist("cut_pt", 100, 0, 500)
        filt.add_hist("cut_abseta", 50, 0, 5)
        filt.add_hist("cut_abseta_crack", 50, 0, 5)
        filt.add_hist("cut_dEtaIn_barrel_tight", 100, -0.1, 0.1)
        filt.add_hist("cut_dPhiIn_barrel_tight", 100, -0.1, 0.1)
        filt.add_hist("cut_sigmaIEIE_barrel_tight", 100, 0, 0.05)
        filt.add_hist("cut_hovere_barrel_tight", 100, -1, 1)
        filt.add_hist("cut_d0_barrel_tight", 100, -1, 1)
        filt.add_hist("cut_z0_barrel_tight", 100, -1, 1)
        filt.add_hist("cut_eoverp_barrel_tight", 100, 0, 1)
        filt.add_hist("cut_pfIso30_barrel_tight", 100, 0, 10)
        filt.add_hist("cut_convfit_barrel_tight", 2, 0, 2)
        filt.add_hist("cut_misshits_barrel_tight", 10, 0, 10)

    return filt
コード例 #32
0
def build_muon(do_cutflow=False, do_hists=False):

    filt = Filter('BuildMuon')

    filt.do_cutflow = do_cutflow

    filt.cut_isGlobal = ' == True '
    filt.cut_isPF = ' == True '
    filt.cut_pt = ' > 25 '
    filt.cut_abseta = ' < 2.5'
    filt.cut_chi2 = ' < 10'
    filt.cut_nTrkLayers = ' > 8 '
    filt.cut_nStations = ' > 1'
    filt.cut_nPixelHits = ' > 0'
    filt.cut_d0 = ' < 0.2'
    filt.cut_z0 = ' < 0.5'
    #filt.cut_trkiso     = ' < 0.1 '
    filt.cut_corriso = ' < 0.2'

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_chi2', 50, 0, 50)
        filt.add_hist('cut_nTrkLayers', 20, 0, 20)
        filt.add_hist('cut_nStations', 5, 0, 5)
        filt.add_hist('cut_nPixelHits', 20, 0, 20)
        filt.add_hist('cut_d0', 100, -0.05, 0.05)
        filt.add_hist('cut_z0', 100, -0.05, 0.05)
        filt.add_hist('cut_trkiso', 50, 0, 0.5)
        filt.add_hist('cut_corriso', 50, 0, 0.5)

    return filt
コード例 #33
0
def filter_muon(mu_pt=' > 25 ',
                do_cutflow=False,
                apply_corrections=False,
                do_hists=False,
                evalPID='tight',
                invertIso=False):
    """
       Muon ID cuts
       https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideMuonIdRun2
    """

    workarea = os.getenv('WorkArea')
    base_path = '%s/TreeFilter/RecoResonance/data' % workarea

    filt = Filter('FilterMuon')

    if do_cutflow:
        filt.do_cutflow = True
        #filt.add_var('evalPID', evalPID )

    filt.cut_pt = mu_pt
    filt.cut_eta = ' < 2.4'
    #filt.cut_tight        = ' == True '
    filt.cut_id_Tight = '==True'
    filt.cut_pfiso_tight = ' < 0.15 '
    filt.cut_trkiso_tight = ' < 0.05 '

    filt.add_var('triggerMatchBits', '23,31')
    filt.add_var('FilePathRochester',
                 '%s/roccor.Run2.v3/RoccoR2016.txt' % base_path)

    filt.cut_isPf_loose = ' == True '
    filt.cut_isGlobalOrTk_loose = ' == True '

    filt.cut_isGlobal_tight = ' == True '
    filt.cut_isPF_tight = ' == True '
    filt.cut_abseta_tight = ' < 2.4'
    filt.cut_chi2_tight = ' < 10'
    filt.cut_nMuonHits_tight = ' > 0 '
    filt.cut_nStations_tight = ' > 1'
    filt.cut_nTrkLayers_tight = ' > 5 '
    filt.cut_nPixelHits_tight = ' > 0'
    filt.cut_d0_tight = ' < 0.2'
    filt.cut_z0_tight = ' < 0.5'
    filt.cut_corriso_tight = ' < 0.25'
    filt.cut_trkiso_tight = ' < 0.05 '

    if invertIso:
        for key, var in vars(filt).items():
            if 'iso' in key:
                print('Inverting iso', key, var)
                filt.invert(key)

    if apply_corrections:
        filt.add_var('apply_corrections', 'true')

        workarea = os.getenv('WorkArea')
        filt.add_var(
            'path',
            '%s/TreeFilter/RecoWgg/data/MuScleFitCorrector_v4_3/MuScleFit_2012_MC_53X_smearReReco.txt'
            % workarea)

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 200)
        filt.add_hist('cut_eta', 60, -1, 5)
        filt.add_hist('cut_chi2_tight', 50, 0, 50)
        filt.add_hist('cut_nTrkLayers_tight', 20, 0, 20)
        filt.add_hist('cut_nStations_tight', 5, 0, 5)
        filt.add_hist('cut_nPixelHits_tight', 20, 0, 20)
        filt.add_hist('cut_d0_tight', 100, -0.05, 0.05)
        filt.add_hist('cut_z0_tight', 100, -0.05, 0.05)
        filt.add_hist('cut_trkiso_tight', 50, 0, 0.5)
        filt.add_hist('cut_corriso_tight', 50, 0, 0.5)

    return filt
コード例 #34
0
def build_photon(do_cutflow=False, do_hists=False, filtPID=None, evalPID=None):

    filt = Filter("BuildPhoton")

    filt.do_cutflow = do_cutflow

    filt.cut_pt = " > 15 "
    filt.cut_abseta = " < 2.5"
    filt.cut_abseta_crack = " > 1.479 & < 1.566 "
    filt.invert("cut_abseta_crack")

    filt.cut_hovere = " < 0.05"
    filt.cut_eveto = " == False"

    filt.cut_sigmaIEIE_barrel_loose = " < 0.012 "
    filt.cut_chIsoCorr_barrel_loose = " < 2.6 "
    filt.cut_neuIsoCorr_barrel_loose = " < 3.5 "
    filt.cut_phoIsoCorr_barrel_loose = " < 1.3 "

    filt.cut_sigmaIEIE_endcap_loose = " < 0.034 "
    filt.cut_chIsoCorr_endcap_loose = " < 2.3 "
    filt.cut_neuIsoCorr_endcap_loose = " < 2.9 "
    # no cut for loose
    # filt.cut_phoIsoCorr_endcap_loose = ' < 1.0 '

    filt.cut_sigmaIEIE_barrel_medium = " < 0.011 "
    filt.cut_chIsoCorr_barrel_medium = " < 1.5 "
    filt.cut_neuIsoCorr_barrel_medium = " < 1.0 "
    filt.cut_phoIsoCorr_barrel_medium = " < 0.7 "

    filt.cut_sigmaIEIE_endcap_medium = " < 0.033 "
    filt.cut_chIsoCorr_endcap_medium = " < 1.2 "
    filt.cut_neuIsoCorr_endcap_medium = " < 1.5 "
    filt.cut_phoIsoCorr_endcap_medium = " < 1.0 "

    filt.cut_sigmaIEIE_barrel_tight = " < 0.011 "
    filt.cut_chIsoCorr_barrel_tight = " < 0.7 "
    filt.cut_neuIsoCorr_barrel_tight = " < 0.4 "
    filt.cut_phoIsoCorr_barrel_tight = " < 0.5 "

    filt.cut_sigmaIEIE_endcap_tight = " < 0.031 "
    filt.cut_chIsoCorr_endcap_tight = " < 0.5 "
    filt.cut_neuIsoCorr_endcap_tight = " < 1.5 "
    filt.cut_phoIsoCorr_endcap_tight = " < 1.0 "

    filt.cut_hovere12_barrel_mva_presel_smallr9 = " < 0.075 "
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_smallr9 = " < 4 "
    filt.cut_trkIsoEtCorr_barrel_mva_presel_smallr9 = " < 4 "
    filt.cut_hovere12_barrel_mva_presel_larger9 = " < 0.082 "
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_larger9 = " < 50 "
    filt.cut_trkIsoEtCorr_barrel_mva_presel_larger9 = " < 50 "
    filt.cut_sigmaIEIE_barrel_mva_presel = " < 0.014 "
    filt.cut_chgpfIso_barrel_mva_presel = " < 4 "

    filt.cut_hovere12_endcap_mva_presel_smallr9 = " < 0.075 "
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_smallr9 = " < 4 "
    filt.cut_trkIsoEtCorr_endcap_mva_presel_smallr9 = " < 4 "
    filt.cut_hovere12_endcap_mva_presel_larger9 = " < 0.075 "
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_larger9 = " < 50 "
    filt.cut_trkIsoEtCorr_endcap_mva_presel_larger9 = " < 50 "
    filt.cut_sigmaIEIE_endcap_mva_presel = " < 0.034 "
    filt.cut_chgpfIso_endcap_mva_presel = " < 4 "

    if filtPID is not None:
        setattr(filt, "cut_pid_%s" % filtPID, " == True")

    if evalPID is not None:
        filt.add_var("evalPID", evalPID)

    filt.add_var("TMVAWeightsFileEB", "/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EB_BDT.weights.xml")
    filt.add_var("TMVAWeightsFileEE", "/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EE_BDT.weights.xml")

    # filt.cut_ph_el_dr = ' > 0.2 '

    if do_hists:
        filt.add_hist("cut_pt", 100, 0, 500)
        filt.add_hist("cut_abseta", 50, 0, 5)
        filt.add_hist("cut_abseta_crack", 50, 0, 5)
        filt.add_hist("cut_hovere", 50, 0, 0.1)
        filt.add_hist("cut_eveto", 2, 0, 2)
        filt.add_hist("cut_sigmaIEIE_barrel_medium", 50, 0, 0.05)
        filt.add_hist("cut_chIsoCorr_barrel_medium", 50, 0, 5)
        filt.add_hist("cut_neuIsoCorr_barrel_medium", 50, 0, 5)
        filt.add_hist("cut_phoIsoCorr_barrel_medium", 50, 0, 5)
        filt.add_hist("cut_sigmaIEIE_endcap_medium", 50, 0, 0.05)
        filt.add_hist("cut_chIsoCorr_endcap_medium", 50, 0, 5)
        filt.add_hist("cut_neuIsoCorr_endcap_medium", 50, 0, 5)
        filt.add_hist("cut_phoIsoCorr_endcap_medium", 50, 0, 5)

        filt.add_hist("cut_sigmaIEIE_barrel_loose", 50, 0, 0.05)
        filt.add_hist("cut_chIsoCorr_barrel_loose", 50, 0, 5)
        filt.add_hist("cut_neuIsoCorr_barrel_loose", 100, -5, 5)
        filt.add_hist("cut_phoIsoCorr_barrel_loose", 50, 0, 5)
        filt.add_hist("cut_sigmaIEIE_endcap_loose", 50, 0, 0.05)
        filt.add_hist("cut_chIsoCorr_endcap_loose", 50, 0, 5)
        filt.add_hist("cut_neuIsoCorr_endcap_loose", 100, -5, 5)
        filt.add_hist("cut_phoIsoCorr_endcap_loose", 50, 0, 5)

    return filt
コード例 #35
0
def filter_photon(ph_pt=' > 10 ',
                  id_cut='medium',
                  ieta_cut=None,
                  ele_veto='None',
                  ele_olap='True',
                  do_cutflow=False,
                  do_hists=False,
                  evalPID='medium'):

    filt = Filter('FilterPhoton')

    filt.cut_pt = ph_pt
    filt.cut_eta = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.4442 & < 1.566 '
    filt.invert('cut_abseta_crack')

    filt.cut_muon_dr = ' > 0.4 '
    if ele_olap == 'True':
        filt.cut_electron_dr = ' > 0.4 '

    if ieta_cut is not None:
        if ieta_cut == 'EB':
            filt.cut_eb = ' == True '
        if ieta_cut == 'EE':
            filt.cut_ee = ' == True '

    if ele_veto is not 'None':
        if ele_veto == 'True':
            filt.cut_CSEV = ' == True '
        elif ele_veto == 'False':
            filt.cut_CSEV = ' == False '

    dosieiecut = True
    if id_cut == "almosttight":
        filt.cut_tight = " == True "
        dosieiecut = False
        id_cut = "tight"
    elif id_cut == "almostmedium":
        filt.cut_medium = " == True "
        dosieiecut = False
        id_cut = "medium"
    elif (id_cut is not 'None'):
        setattr(filt, 'cut_%s' % id_cut, ' == True ')

    #else:
    #    filt.cut_medium     = ' == True '


#    filt.cut_vid_medium     = ' == True '

#    filt.cut_sigmaIEIE_barrel_loose  = ' < 0.01031 '
#    filt.cut_chIsoCorr_barrel_loose  = ' < 1.295 '
#    filt.cut_neuIsoCorr_barrel_loose = ' < 10.910 '
#    filt.cut_phoIsoCorr_barrel_loose = ' < 3.630 '
#    filt.cut_hovere_barrel_loose = ' < 0.0597 '
#
#    filt.cut_sigmaIEIE_endcap_loose  = ' < 0.03013 '
#    filt.cut_chIsoCorr_endcap_loose  = ' < 1.011 '
#    filt.cut_neuIsoCorr_endcap_loose = ' < 5.931 '
#    filt.cut_phoIsoCorr_endcap_loose = ' < 6.641 '
#    filt.cut_hovere_endcap_loose = ' < 0.0481 '
#
#    filt.cut_sigmaIEIE_barrel_medium  = ' < 0.01022 '
#    filt.cut_chIsoCorr_barrel_medium  = ' < 0.441 '
#    filt.cut_neuIsoCorr_barrel_medium = ' < 2.725 '
#    filt.cut_phoIsoCorr_barrel_medium = ' < 2.571 '
#    filt.cut_hovere_barrel_medium = ' < 0.0396 '
#
#    filt.cut_sigmaIEIE_endcap_medium  = ' < 0.03001 '
#    filt.cut_chIsoCorr_endcap_medium  = ' < 0.442 '
#    filt.cut_neuIsoCorr_endcap_medium = ' < 1.715 '
#    filt.cut_phoIsoCorr_endcap_medium = ' < 3.863 '
#    filt.cut_hovere_endcap_medium = ' < 0.0219 '
#
#    filt.cut_sigmaIEIE_barrel_tight  = ' < 0.00994 '
#    filt.cut_chIsoCorr_barrel_tight  = ' < 0.202 '
#    filt.cut_neuIsoCorr_barrel_tight = ' < 0.264 '
#    filt.cut_phoIsoCorr_barrel_tight = ' < 2.362 '
#    filt.cut_hovere_barrel_tight = ' < 0.0269 '
#
#    filt.cut_sigmaIEIE_endcap_tight  = ' < 0.0300 '
#    filt.cut_chIsoCorr_endcap_tight  = ' < 0.034 '
#    filt.cut_neuIsoCorr_endcap_tight = ' < 0.586 '
#    filt.cut_phoIsoCorr_endcap_tight = ' < 2.617 '
#    filt.cut_hovere_endcap_tight = ' < 0.0213 '

### 94X V2 PID ###
    if dosieiecut: filt.cut_sigmaIEIE_barrel_loose = ' < 0.0106'
    filt.cut_chIsoCorr_barrel_loose = ' < 1.694'
    filt.cut_neuIsoCorr_barrel_loose = ' < 24.032 '
    filt.cut_phoIsoCorr_barrel_loose = ' < 2.876'
    filt.cut_hovere_barrel_loose = ' < 0.04596 '

    if dosieiecut: filt.cut_sigmaIEIE_endcap_loose = ' < 0.0272 '
    filt.cut_chIsoCorr_endcap_loose = ' < 2.089 '
    filt.cut_neuIsoCorr_endcap_loose = ' < 19.722 '
    filt.cut_phoIsoCorr_endcap_loose = ' < 4.162 '
    filt.cut_hovere_endcap_loose = ' < 0.0590 '

    if dosieiecut: filt.cut_sigmaIEIE_barrel_medium = ' < 0.01015 '
    filt.cut_chIsoCorr_barrel_medium = ' < 1.141 '
    filt.cut_neuIsoCorr_barrel_medium = ' < 1.189 '
    filt.cut_phoIsoCorr_barrel_medium = ' < 2.08 '
    filt.cut_hovere_barrel_medium = ' < 0.02197 '

    if dosieiecut: filt.cut_sigmaIEIE_endcap_medium = ' < 0.0272 '
    filt.cut_chIsoCorr_endcap_medium = ' < 1.051 '
    filt.cut_neuIsoCorr_endcap_medium = ' < 2.718 '
    filt.cut_phoIsoCorr_endcap_medium = ' < 3.867 '
    filt.cut_hovere_endcap_medium = ' < 0.0326 '

    if dosieiecut: filt.cut_sigmaIEIE_barrel_tight = ' < 0.00996 '
    filt.cut_chIsoCorr_barrel_tight = ' < 0.65 '
    filt.cut_neuIsoCorr_barrel_tight = ' < 0.317 '
    filt.cut_phoIsoCorr_barrel_tight = ' < 2.044 '
    filt.cut_hovere_barrel_tight = ' < 0.02148 '

    if dosieiecut: filt.cut_sigmaIEIE_endcap_tight = ' < 0.0271 '
    filt.cut_chIsoCorr_endcap_tight = ' < 0.517 '
    filt.cut_neuIsoCorr_endcap_tight = ' < 2.716 '
    filt.cut_phoIsoCorr_endcap_tight = ' < 3.032 '
    filt.cut_hovere_endcap_tight = ' < 0.0321 '

    if do_cutflow and id_cut and id_cut != "None":
        filt.do_cutflow = True
        #filt.add_var( 'evalPID', evalPID )
        #filt.add_var( 'evalPID', id_cut) ## this could mess with other non-VID working points

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 200)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_eveto', 2, 0, 2)
        filt.add_hist('cut_muon_dr', 400, 0, 6)
        filt.add_hist('cut_electron_dr', 400, 0, 6)
        filt.add_hist('cut_hovere_barrel_medium', 50, 0, 0.1)
        filt.add_hist('cut_sigmaIEIE_barrel_medium', 100, 0, 0.04)
        filt.add_hist('cut_chIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_phoIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_sigmaIEIE_endcap_medium', 100, 0, 0.04)
        filt.add_hist('cut_chIsoCorr_endcap_medium', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_endcap_medium', 50, 0, 5)
        filt.add_hist('cut_phoIsoCorr_endcap_medium', 50, 0, 5)

    #    filt.add_hist( 'cut_sigmaIEIE_barrel_loose', 50, 0, 0.05 )
    #    filt.add_hist( 'cut_chIsoCorr_barrel_loose', 50, 0, 5 )
    #    filt.add_hist( 'cut_neuIsoCorr_barrel_loose', 100, -5, 5 )
    #    filt.add_hist( 'cut_phoIsoCorr_barrel_loose', 50, 0, 5 )
    #    filt.add_hist( 'cut_sigmaIEIE_endcap_loose', 50, 0, 0.05 )
    #    filt.add_hist( 'cut_chIsoCorr_endcap_loose', 50, 0, 5 )
    #    filt.add_hist( 'cut_neuIsoCorr_endcap_loose', 100, -5, 5 )
    #    filt.add_hist( 'cut_phoIsoCorr_endcap_loose', 50, 0, 5 )

    return filt
コード例 #36
0
ファイル: ConfWgamgamReco.py プロジェクト: cranelli/usercode
def build_muon( do_cutflow=False, do_hists=False, evalPID=None, applyCorrections=False ) :

    filt = Filter('BuildMuon')

    filt.do_cutflow = do_cutflow

    filt.cut_isGlobal   = ' == True '
    filt.cut_isPF       = ' == True '
    filt.cut_pt         = ' > 5 '
    filt.cut_abseta     = ' < 2.4'
    filt.cut_chi2       = ' < 10'
    filt.cut_nTrkLayers = ' > 8 ' 
    filt.cut_nStations  = ' > 1'
    filt.cut_nPixelHits = ' > 0'
    filt.cut_d0         = ' < 0.2'
    filt.cut_z0         = ' < 0.5'
    filt.cut_corriso    = ' < 0.2'

    ##filt.cut_trkiso     = ' < 0.1 '

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    if applyCorrections :
        filt.add_var( 'applyCorrections', 'true' )

        workarea = os.getenv('WorkArea')
        filt.add_var( 'path', '%s/TreeFilter/RecoWgg/data/MuScleFitCorrector_v4_3/MuScleFit_2012_MC_53X_smearReReco.txt' %workarea )

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_chi2', 50, 0, 50 )
        filt.add_hist( 'cut_nTrkLayers', 20, 0, 20 )
        filt.add_hist( 'cut_nStations', 5, 0, 5 )
        filt.add_hist( 'cut_nPixelHits', 20, 0, 20 )
        filt.add_hist( 'cut_d0', 100, -0.05, 0.05 )
        filt.add_hist( 'cut_z0', 100, -0.05, 0.05 )
        filt.add_hist( 'cut_trkiso', 50, 0, 0.5 )
        filt.add_hist( 'cut_corriso', 50, 0, 0.5 )

    return filt
コード例 #37
0
ファイル: ConfPhotonReco.py プロジェクト: jkunkle/usercode
def build_electron( do_cutflow=False, do_hists=False, filtPID=None, evalPID=None, applyCorrections=False ) :

    filt = Filter('BuildElectron')

    filt.do_cutflow = do_cutflow

    # using values here
    #https://twiki.cern.ch/twiki/bin/view/CMS/CutBasedElectronIdentificationRun2
    # d0 and z0 cuts not recommeded
    # as of Dec 2016

    filt.cut_pt = ' > 10'
    filt.cut_abssceta       = ' <2.5 '
    #filt.cut_abssceta       = ' <1.479 '
    #filt.cut_abssceta       = ' >= 1.479 & < 2.5'
    # no crack for now
    #filt.cut_abssceta_crack = ' > 1.4442 & < 1.566 '
    #filt.invert('cut_abssceta_crack')
    #filt.invert('cut_abssceta')

    filt.cut_sigmaIEIE_barrel_tight        = ' < 0.00998 '
    filt.cut_absdEtaIn_barrel_tight        = ' < 0.00308 '
    filt.cut_absdPhiIn_barrel_tight        = ' < 0.0816 '
    filt.cut_hovere_barrel_tight           = ' < 0.0414 '
    filt.cut_isoRho_barrel_tight           = ' < 0.0588 '
    filt.cut_ooEmooP_barrel_tight          = ' < 0.0129 '
    #filt.cut_d0_barrel_tight               = ' < 0.0111 '
    #filt.cut_z0_barrel_tight               = ' < 0.0466 '
    filt.cut_misshits_barrel_tight         = ' < 1 '
    filt.cut_passConvVeto_barrel_tight     = ' == 1 '

    filt.cut_sigmaIEIE_barrel_medium       = ' < 0.00998 '
    filt.cut_absdEtaIn_barrel_medium       = ' < 0.00311 '
    filt.cut_absdPhiIn_barrel_medium       = ' < 0.103 '
    filt.cut_hovere_barrel_medium          = ' < 0.253 '
    filt.cut_isoRho_barrel_medium          = ' < 0.0695 '
    filt.cut_ooEmooP_barrel_medium         = ' < 0.134 '
    #filt.cut_d0_barrel_medium              = ' < 0.0118 '
    #filt.cut_z0_barrel_medium              = ' < 0.373 '
    filt.cut_misshits_barrel_medium        = ' < 1 '
    filt.cut_passConvVeto_barrel_medium    = ' == 1 '

    filt.cut_sigmaIEIE_barrel_loose        = ' < 0.011 '
    filt.cut_absdEtaIn_barrel_loose        = ' < 0.00477 '
    filt.cut_absdPhiIn_barrel_loose        = ' < 0.222 '
    filt.cut_hovere_barrel_loose           = ' < 0.298 '
    filt.cut_isoRho_barrel_loose           = ' < 0.0994 '
    filt.cut_ooEmooP_barrel_loose          = ' < 0.241 '
    #filt.cut_d0_barrel_loose               = ' < 0.0261 '
    #filt.cut_z0_barrel_loose               = ' < 0.41 '
    filt.cut_misshits_barrel_loose         = ' < 1 '
    filt.cut_passConvVeto_barrel_loose     = ' == 1 '

    filt.cut_sigmaIEIE_barrel_veryloose    = ' < 0.0115 '
    filt.cut_absdEtaIn_barrel_veryloose    = ' < 0.00749 '
    filt.cut_absdPhiIn_barrel_veryloose    = ' < 0.228 '
    filt.cut_hovere_barrel_veryloose       = ' < 0.356 '
    filt.cut_isoRho_barrel_veryloose       = ' < 0.175 '
    filt.cut_ooEmooP_barrel_veryloose      = ' < 0.299 '
    #filt.cut_d0_barrel_veryloose           = ' < 0.0564 '
    #filt.cut_z0_barrel_veryloose           = ' < 0.472 '
    filt.cut_misshits_barrel_veryloose     = ' < 2 '
    filt.cut_passConvVeto_barrel_veryloose = ' == 1 '

    filt.cut_sigmaIEIE_endcap_tight        = ' < 0.0292 '
    filt.cut_absdEtaIn_endcap_tight        = ' < 0.00605 '
    filt.cut_absdPhiIn_endcap_tight        = ' < 0.0394 '
    filt.cut_hovere_endcap_tight           = ' < 0.0641 '
    filt.cut_isoRho_endcap_tight           = ' < 0.0571 '
    filt.cut_ooEmooP_endcap_tight          = ' < 0.0129 '
    #filt.cut_d0_endcap_tight               = ' < 0.0351 '
    #filt.cut_z0_endcap_tight               = ' < 0.417 '
    filt.cut_misshits_endcap_tight         = ' < 1 '
    filt.cut_passConvVeto_endcap_tight     = ' == 1 '

    filt.cut_sigmaIEIE_endcap_medium       = ' < 0.0298 '
    filt.cut_absdEtaIn_endcap_medium       = ' < 0.00609 '
    filt.cut_absdPhiIn_endcap_medium       = ' < 0.045 '
    filt.cut_hovere_endcap_medium          = ' < 0.0878 '
    filt.cut_isoRho_endcap_medium          = ' < 0.0821 '
    filt.cut_ooEmooP_endcap_medium         = ' < 0.13 '
    #filt.cut_d0_endcap_medium              = ' < 0.0739 '
    #filt.cut_z0_endcap_medium              = ' < 0.602 '
    filt.cut_misshits_endcap_medium        = ' <  1 '
    filt.cut_passConvVeto_endcap_medium    = ' == 1 '

    filt.cut_sigmaIEIE_endcap_loose        = ' < 0.0314 '
    filt.cut_absdEtaIn_endcap_loose        = ' < 0.00868 '
    filt.cut_absdPhiIn_endcap_loose        = ' < 0.213 '
    filt.cut_hovere_endcap_loose           = ' < 0.101 '
    filt.cut_isoRho_endcap_loose           = ' < 0.107 '
    filt.cut_ooEmooP_endcap_loose          = ' < 0.14 '
    #filt.cut_d0_endcap_loose               = ' < 0.118 '
    #filt.cut_z0_endcap_loose               = ' < 0.822 '
    filt.cut_misshits_endcap_loose         = ' <  1 '
    filt.cut_passConvVeto_endcap_loose     = ' == 1 '

    filt.cut_sigmaIEIE_endcap_veryloose    = ' < 0.037 '
    filt.cut_absdEtaIn_endcap_veryloose    = ' < 0.00895 '
    filt.cut_absdPhiIn_endcap_veryloose    = ' < 0.213 '
    filt.cut_hovere_endcap_veryloose       = ' < 0.211 '
    filt.cut_isoRho_endcap_veryloose       = ' < 0.159 '
    filt.cut_ooEmooP_endcap_veryloose      = ' < 0.15 '
    #filt.cut_d0_endcap_veryloose           = ' < 0.222 '
    #filt.cut_z0_endcap_veryloose           = ' < 0.921 '
    filt.cut_misshits_endcap_veryloose     = ' < 3 '
    filt.cut_passConvVeto_endcap_veryloose = ' == 1 '


    if filtPID is not None :
        setattr(filt, 'cut_pid_%s' %filtPID, ' == True' )

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    if applyCorrections :
        workarea = os.getenv('WorkArea')
        filt.add_var('applyCorrections', 'true' )
        filt.add_var('correctionFile', '%s/TreeFilter/RecoWgg/data/step2-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9.dat' %workarea )
        filt.add_var('smearingFile', '%s/TreeFilter/RecoWgg/data/outFile-step4-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9-smearEle.dat' %workarea )


    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_absdEtaIn_barrel_tight', 100, -0.1, 0.1 )
        filt.add_hist( 'cut_absdPhiIn_barrel_tight', 100, -0.1, 0.1 )
        filt.add_hist( 'cut_sigmaIEIE_barrel_tight', 100, 0, 0.05 )
        filt.add_hist( 'cut_hovere_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_d0_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_z0_barrel_tight', 100, -1, 1 )
        filt.add_hist( 'cut_ooEmooP_barrel_tight', 100, 0, 1 )
        filt.add_hist( 'cut_pfIso30_barrel_tight', 100, 0, 10 )
        filt.add_hist( 'cut_passConvVeto_barrel_tight', 2, 0, 2 )
        filt.add_hist( 'cut_misshits_barrel_tight', 10, 0, 10 )

    return filt
コード例 #38
0
ファイル: ConfWgamgamReco.py プロジェクト: sachikot/usercode
def build_electron(do_cutflow=False,
                   do_hists=False,
                   filtPID=None,
                   evalPID=None):

    filt = Filter('BuildElectron')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 25'
    filt.cut_abssceta = ' <2.5 '
    # no crack for now
    #filt.cut_abssceta_crack = ' > 1.44 & < 1.57 '
    #filt.invert('cut_abssceta_crack')

    filt.cut_absdEtaIn_barrel_tight = ' < 0.004 '
    filt.cut_absdPhiIn_barrel_tight = ' < 0.03 '
    filt.cut_sigmaIEIE_barrel_tight = ' < 0.01 '
    filt.cut_hovere_barrel_tight = ' < 0.12 '
    filt.cut_d0_barrel_tight = ' < 0.02 '
    filt.cut_z0_barrel_tight = ' < 0.1 '
    filt.cut_eoverp_barrel_tight = ' < 0.05 '
    filt.cut_pfIso30_barrel_tight = ' < 0.1 '
    filt.cut_convfit_barrel_tight = ' < 0.000001 '
    filt.cut_misshits_barrel_tight = ' == 0 '

    filt.cut_absdEtaIn_barrel_medium = ' < 0.004 '
    filt.cut_absdPhiIn_barrel_medium = ' < 0.06 '
    filt.cut_sigmaIEIE_barrel_medium = ' < 0.01 '
    filt.cut_hovere_barrel_medium = ' < 0.12 '
    filt.cut_d0_barrel_medium = ' < 0.02 '
    filt.cut_z0_barrel_medium = ' < 0.1 '
    filt.cut_eoverp_barrel_medium = ' < 0.05 '
    filt.cut_pfIso30_barrel_medium = ' < 0.15 '
    filt.cut_convfit_barrel_medium = ' < 0.000001 '
    filt.cut_misshits_barrel_medium = ' <= 1 '

    filt.cut_absdEtaIn_barrel_loose = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_loose = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_loose = ' < 0.01 '
    filt.cut_hovere_barrel_loose = ' < 0.12 '
    filt.cut_d0_barrel_loose = ' < 0.02 '
    filt.cut_z0_barrel_loose = ' < 0.2 '
    filt.cut_eoverp_barrel_loose = ' < 0.05 '
    filt.cut_pfIso30_barrel_loose = ' < 0.15 '
    filt.cut_convfit_barrel_loose = ' < 0.000001 '
    filt.cut_misshits_barrel_loose = ' <= 1 '

    filt.cut_absdEtaIn_barrel_veryloose = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_veryloose = ' < 0.8 '
    filt.cut_sigmaIEIE_barrel_veryloose = ' < 0.01 '
    filt.cut_hovere_barrel_veryloose = ' < 0.15 '
    filt.cut_d0_barrel_veryloose = ' < 0.04 '
    filt.cut_z0_barrel_veryloose = ' < 0.2 '
    #filt.cut_eoverp_barrel_veryloose     = ' < 0.05 ' #no cut
    filt.cut_pfIso30_barrel_veryloose = ' < 0.1 '
    #filt.cut_convfit_barrel_veryloose    = ' < 0.000001 ' #no cut
    #filt.cut_misshits_barrel_veryloose   = ' == 0 ' #no cut

    filt.cut_absdEtaIn_barrel_tightTrig = ' < 0.007 '
    filt.cut_absdPhiIn_barrel_tightTrig = ' < 0.15 '
    filt.cut_sigmaIEIE_barrel_tightTrig = ' < 0.01 '
    filt.cut_hovere_barrel_tightTrig = ' < 0.12 '
    filt.cut_ecalIso30_barrel_tightTrig = ' < 0.2 '
    filt.cut_hcalIso30_barrel_tightTrig = ' < 0.2 '
    filt.cut_trkIso30_barrel_tightTrig = ' < 0.2 '

    filt.cut_absdEtaIn_endcap_tight = ' < 0.005 '
    filt.cut_absdPhiIn_endcap_tight = ' < 0.02 '
    filt.cut_sigmaIEIE_endcap_tight = ' < 0.03 '
    filt.cut_hovere_endcap_tight = ' < 0.1 '
    filt.cut_d0_endcap_tight = ' < 0.02 '
    filt.cut_z0_endcap_tight = ' < 0.1 '
    filt.cut_eoverp_endcap_tight = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_tight = ' < 0.1 '
    filt.cut_pfIso30_endcap_highPt_tight = ' < 0.15 '
    filt.cut_convfit_endcap_tight = ' < 0.000001 '
    filt.cut_misshits_endcap_tight = ' == 0 '

    filt.cut_absdEtaIn_endcap_medium = ' < 0.007 '
    filt.cut_absdPhiIn_endcap_medium = ' < 0.03 '
    filt.cut_sigmaIEIE_endcap_medium = ' < 0.03 '
    filt.cut_hovere_endcap_medium = ' < 0.1 '
    filt.cut_d0_endcap_medium = ' < 0.02 '
    filt.cut_z0_endcap_medium = ' < 0.1 '
    filt.cut_eoverp_endcap_medium = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_medium = ' < 0.1 '
    filt.cut_pfIso30_endcap_highPt_medium = ' < 0.15 '
    filt.cut_convfit_endcap_medium = ' < 0.000001 '
    filt.cut_misshits_endcap_medium = ' <= 1 '

    filt.cut_absdEtaIn_endcap_loose = ' < 0.009 '
    filt.cut_absdPhiIn_endcap_loose = ' < 0.1 '
    filt.cut_sigmaIEIE_endcap_loose = ' < 0.03 '
    filt.cut_hovere_endcap_loose = ' < 0.1 '
    filt.cut_d0_endcap_loose = ' < 0.02 '
    filt.cut_z0_endcap_loose = ' < 0.2 '
    filt.cut_eoverp_endcap_loose = ' < 0.05 '
    filt.cut_pfIso30_endcap_lowPt_loose = ' < 0.10 '
    filt.cut_pfIso30_endcap_highPt_loose = ' < 0.15 '
    filt.cut_convfit_endcap_loose = ' < 0.000001 '
    filt.cut_misshits_endcap_loose = ' <= 1 '

    filt.cut_absdEtaIn_endcap_veryloose = ' < 0.01 '
    filt.cut_absdPhiIn_endcap_veryloose = ' < 0.7 '
    filt.cut_sigmaIEIE_endcap_veryloose = ' < 0.03 '
    #filt.cut_hovere_endcap_veryloose      = ' < 0.15 ' #no cut
    filt.cut_d0_endcap_veryloose = ' < 0.04 '
    filt.cut_z0_endcap_veryloose = ' < 0.2 '
    #filt.cut_eoverp_endcap_veryloose     = ' < 0.05 ' #no cut
    filt.cut_pfIso30_endcap_veryloose = ' < 0.15 '
    #filt.cut_convfit_endcap_veryloose    = ' < 0.000001 ' #no cut
    #filt.cut_misshits_endcap_veryloose   = ' == 0 ' #no cut

    filt.cut_absdEtaIn_endcap_tightTrig = ' < 0.009 '
    filt.cut_absdPhiIn_endcap_tightTrig = ' < 0.10 '
    filt.cut_sigmaIEIE_endcap_tightTrig = ' < 0.03 '
    filt.cut_hovere_endcap_tightTrig = ' < 0.1 '
    filt.cut_ecalIso30_endcap_tightTrig = ' < 0.2 '
    filt.cut_hcalIso30_endcap_tightTrig = ' < 0.2 '
    filt.cut_trkIso30_endcap_tightTrig = ' < 0.2 '

    if filtPID is not None:
        setattr(filt, 'cut_pid_%s' % filtPID, ' == True')

    if evalPID is not None:
        filt.add_var('evalPID', evalPID)

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_absdEtaIn_barrel_tight', 100, -0.1, 0.1)
        filt.add_hist('cut_absdPhiIn_barrel_tight', 100, -0.1, 0.1)
        filt.add_hist('cut_sigmaIEIE_barrel_tight', 100, 0, 0.05)
        filt.add_hist('cut_hovere_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_d0_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_z0_barrel_tight', 100, -1, 1)
        filt.add_hist('cut_eoverp_barrel_tight', 100, 0, 1)
        filt.add_hist('cut_pfIso30_barrel_tight', 100, 0, 10)
        filt.add_hist('cut_convfit_barrel_tight', 2, 0, 2)
        filt.add_hist('cut_misshits_barrel_tight', 10, 0, 10)

    return filt
コード例 #39
0
ファイル: ConfWgamgamReco.py プロジェクト: sachikot/usercode
def build_photon(do_cutflow=False,
                 do_hists=False,
                 filtPID=None,
                 evalPID=None,
                 doEVeto=True,
                 applyCorrections=False):

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 10 '
    filt.cut_abseta = ' < 2.5'
    filt.cut_abseta_crack = ' > 1.44 & < 1.57 '
    filt.invert('cut_abseta_crack')

    #filt.cut_hovere       = ' < 0.05'
    if doEVeto:
        filt.cut_eveto = ' == False'

    filt.cut_sigmaIEIE_barrel_loose = ' < 0.012 '
    filt.cut_chIsoCorr_barrel_loose = ' < 2.6 '
    filt.cut_neuIsoCorr_barrel_loose = ' < 3.5 '
    filt.cut_phoIsoCorr_barrel_loose = ' < 1.3 '
    filt.cut_hovere_barrel_loose = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_loose = ' < 0.034 '
    filt.cut_chIsoCorr_endcap_loose = ' < 2.3 '
    filt.cut_neuIsoCorr_endcap_loose = ' < 2.9 '
    # no cut for loose
    #filt.cut_phoIsoCorr_endcap_loose = ' < 1.0 '
    filt.cut_hovere_endcap_loose = ' < 0.05 '

    filt.cut_sigmaIEIE_barrel_medium = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_medium = ' < 1.5 '
    filt.cut_neuIsoCorr_barrel_medium = ' < 1.0 '
    filt.cut_phoIsoCorr_barrel_medium = ' < 0.7 '
    filt.cut_hovere_barrel_medium = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_medium = ' < 0.033 '
    filt.cut_chIsoCorr_endcap_medium = ' < 1.2 '
    filt.cut_neuIsoCorr_endcap_medium = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_medium = ' < 1.0 '
    filt.cut_hovere_endcap_medium = ' < 0.05 '

    filt.cut_sigmaIEIE_barrel_tight = ' < 0.011 '
    filt.cut_chIsoCorr_barrel_tight = ' < 0.7 '
    filt.cut_neuIsoCorr_barrel_tight = ' < 0.4 '
    filt.cut_phoIsoCorr_barrel_tight = ' < 0.5 '
    filt.cut_hovere_barrel_tight = ' < 0.05 '

    filt.cut_sigmaIEIE_endcap_tight = ' < 0.031 '
    filt.cut_chIsoCorr_endcap_tight = ' < 0.5 '
    filt.cut_neuIsoCorr_endcap_tight = ' < 1.5 '
    filt.cut_phoIsoCorr_endcap_tight = ' < 1.0 '
    filt.cut_hovere_endcap_tight = ' < 0.05 '

    filt.cut_hovere12_barrel_mva_presel_smallr9 = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_smallr9 = ' < 4 '
    filt.cut_hovere12_barrel_mva_presel_larger9 = ' < 0.082 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_larger9 = ' < 50 '
    filt.cut_sigmaIEIE_barrel_mva_presel = ' < 0.014 '
    filt.cut_chgpfIso_barrel_mva_presel = ' < 4 '

    filt.cut_hovere12_endcap_mva_presel_smallr9 = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_smallr9 = ' < 4 '
    filt.cut_hovere12_endcap_mva_presel_larger9 = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_larger9 = ' < 50 '
    filt.cut_sigmaIEIE_endcap_mva_presel = ' < 0.034 '
    filt.cut_chgpfIso_endcap_mva_presel = ' < 4 '

    if filtPID is not None:
        setattr(filt, 'cut_pid_%s' % filtPID, ' == True')

    if evalPID is not None:
        filt.add_var('evalPID', evalPID)

    if applyCorrections:
        workarea = os.getenv('WorkArea')
        filt.add_var('applyCorrections', 'true')
        filt.add_var(
            'correctionFile',
            '%s/TreeFilter/RecoWgg/data/step2-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9.dat'
            % workarea)
        filt.add_var(
            'smearingFile',
            '%s/TreeFilter/RecoWgg/data/outFile-step4-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9-smearEle.dat'
            % workarea)

    filt.add_var(
        'TMVAWeightsFileEB',
        '/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EB_BDT.weights.xml')
    filt.add_var(
        'TMVAWeightsFileEE',
        '/afs/cern.ch/user/r/rslu/public/photonIDMVA_2014/EE_BDT.weights.xml')

    #filt.cut_ph_el_dr = ' > 0.2 '

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_hovere', 50, 0, 0.1)
        filt.add_hist('cut_eveto', 2, 0, 2)
        filt.add_hist('cut_sigmaIEIE_barrel_medium', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_phoIsoCorr_barrel_medium', 50, 0, 5)
        filt.add_hist('cut_sigmaIEIE_endcap_medium', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_endcap_medium', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_endcap_medium', 50, 0, 5)
        filt.add_hist('cut_phoIsoCorr_endcap_medium', 50, 0, 5)

        filt.add_hist('cut_sigmaIEIE_barrel_loose', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_barrel_loose', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_barrel_loose', 100, -5, 5)
        filt.add_hist('cut_phoIsoCorr_barrel_loose', 50, 0, 5)
        filt.add_hist('cut_sigmaIEIE_endcap_loose', 50, 0, 0.05)
        filt.add_hist('cut_chIsoCorr_endcap_loose', 50, 0, 5)
        filt.add_hist('cut_neuIsoCorr_endcap_loose', 100, -5, 5)
        filt.add_hist('cut_phoIsoCorr_endcap_loose', 50, 0, 5)

    return filt
コード例 #40
0
def filter_electron(el_pt=' > 25 ',
                    do_cutflow=False,
                    do_hists=False,
                    apply_corrections=False,
                    evalPID='medium',
                    invertIso=False):

    filt = Filter('FilterElectron')

    filt.cut_pt = el_pt
    filt.cut_eta = ' < 2.5'
    filt.cut_abssceta = ' <2.5 '

    #filt.cut_tight     = ' == True '
    #filt.cut_medium     = ' == True '
    #filt.cut_vid_tight     = ' == True '
    filt.cut_vid_medium = ' == True '
    filt.cut_muon_dr = ' > 0.4 '
    filt.add_var('triggerMatchBits', '58,109')
    filt.cut_d0_barrel = ' < 0.05 '
    filt.cut_d0_endcap = ' < 0.10 '
    filt.cut_dz_barrel = ' < 0.10 '
    filt.cut_dz_endcap = ' < 0.20 '
    filt.cut_hovere_94x = ' == True'
    filt.cut_isorho_94x = ' == True'

    ### 94X V2 PID cuts ###
    filt.cut_sigmaIEIE_barrel_tight = ' < 0.0104 '
    filt.cut_absdEtaIn_barrel_tight = ' < 0.00255 '
    filt.cut_absdPhiIn_barrel_tight = ' < 0.022 '
    filt.cut_hovere_barrel_tight = ' < 0.026'
    filt.cut_isoRho_barrel_tight = ' < 0.0287 '
    filt.cut_ooEmooP_barrel_tight = ' < 0.0159 '
    filt.cut_misshits_barrel_tight = ' < 2 '
    filt.cut_passConvVeto_barrel_tight = ' == 1 '

    filt.cut_sigmaIEIE_barrel_medium = ' < 0.0106 '
    filt.cut_absdEtaIn_barrel_medium = ' < 0.0032 '
    filt.cut_absdPhiIn_barrel_medium = ' < 0.0547 '
    filt.cut_hovere_barrel_medium = ' < 0.046 '
    filt.cut_isoRho_barrel_medium = ' < 0.0478 '
    filt.cut_ooEmooP_barrel_medium = ' < 0.184 '
    filt.cut_misshits_barrel_medium = ' < 2 '
    filt.cut_passConvVeto_barrel_medium = ' == 1 '

    filt.cut_sigmaIEIE_barrel_loose = ' < 0.0112 '
    filt.cut_absdEtaIn_barrel_loose = ' < 0.00377 '
    filt.cut_absdPhiIn_barrel_loose = ' < 0.0884 '
    filt.cut_hovere_barrel_loose = ' < 0.05 '
    filt.cut_isoRho_barrel_loose = ' < 0.112 '
    filt.cut_ooEmooP_barrel_loose = ' < 0.193 '
    filt.cut_misshits_barrel_loose = ' < 2 '
    filt.cut_passConvVeto_barrel_loose = ' == 1 '

    filt.cut_sigmaIEIE_barrel_veryloose = ' < 0.0126 '
    filt.cut_absdEtaIn_barrel_veryloose = ' < 0.00463 '
    filt.cut_absdPhiIn_barrel_veryloose = ' < 0.148 '
    filt.cut_hovere_barrel_veryloose = ' < 0.05 '
    filt.cut_isoRho_barrel_veryloose = ' < 0.198 '
    filt.cut_ooEmooP_barrel_veryloose = ' < 0.209 '
    filt.cut_misshits_barrel_veryloose = ' < 3 '
    filt.cut_passConvVeto_barrel_veryloose = ' == 1 '

    filt.cut_sigmaIEIE_endcap_tight = ' < 0.0353 '
    filt.cut_absdEtaIn_endcap_tight = ' < 0.00501 '
    filt.cut_absdPhiIn_endcap_tight = ' < 0.0236 '
    filt.cut_hovere_endcap_tight = ' < 0.0188'
    filt.cut_isoRho_endcap_tight = ' < 0.0445 '
    filt.cut_ooEmooP_endcap_tight = ' < 0.0197 '
    filt.cut_misshits_endcap_tight = ' < 2 '
    filt.cut_passConvVeto_endcap_tight = ' == 1 '

    filt.cut_sigmaIEIE_endcap_medium = ' < 0.0387 '
    filt.cut_absdEtaIn_endcap_medium = ' < 0.00632 '
    filt.cut_absdPhiIn_endcap_medium = ' < 0.0394 '
    filt.cut_hovere_endcap_medium = ' < 0.0275 '
    filt.cut_isoRho_endcap_medium = ' < 0.0658 '
    filt.cut_ooEmooP_endcap_medium = ' < 0.0721 '
    filt.cut_misshits_endcap_medium = ' <  2 '
    filt.cut_passConvVeto_endcap_medium = ' == 1 '

    filt.cut_sigmaIEIE_endcap_loose = ' < 0.0425 '
    filt.cut_absdEtaIn_endcap_loose = ' < 0.00674 '
    filt.cut_absdPhiIn_endcap_loose = ' < 0.169 '
    filt.cut_hovere_endcap_loose = ' < 0.0441 '
    filt.cut_isoRho_endcap_loose = ' < 0.108 '
    filt.cut_ooEmooP_endcap_loose = ' < 0.111 '
    filt.cut_misshits_endcap_loose = ' <  2 '
    filt.cut_passConvVeto_endcap_loose = ' == 1 '

    filt.cut_sigmaIEIE_endcap_veryloose = ' < 0.0457 '
    filt.cut_absdEtaIn_endcap_veryloose = ' < 0.00814 '
    filt.cut_absdPhiIn_endcap_veryloose = ' < 0.19 '
    filt.cut_hovere_endcap_veryloose = ' < 0.05 '
    filt.cut_isoRho_endcap_veryloose = ' < 0.203 '
    filt.cut_ooEmooP_endcap_veryloose = ' < 0.132 '
    filt.cut_misshits_endcap_veryloose = ' < 4 '
    filt.cut_passConvVeto_endcap_veryloose = ' == 1 '

    if invertIso:
        for key, var in vars(filt).items():
            if 'iso' in key:
                print('Inverting iso', key, var)
                filt.invert(key)


#    ### 80X VID cuts ###
#    filt.cut_sigmaIEIE_barrel_tight        = ' < 0.00998 '
#    filt.cut_absdEtaIn_barrel_tight        = ' < 0.00308 '
#    filt.cut_absdPhiIn_barrel_tight        = ' < 0.0816 '
#    filt.cut_hovere_barrel_tight           = ' < 0.0414 '
#    filt.cut_isoRho_barrel_tight           = ' < 0.0588 '
#    filt.cut_ooEmooP_barrel_tight          = ' < 0.0129 '
#    #filt.cut_d0_barrel_tight               = ' < 0.0111 '
#    #filt.cut_z0_barrel_tight               = ' < 0.0466 '
#    filt.cut_misshits_barrel_tight         = ' < 2 '
#    filt.cut_passConvVeto_barrel_tight     = ' == 1 '
#
#    filt.cut_sigmaIEIE_barrel_medium       = ' < 0.00998 '
#    filt.cut_absdEtaIn_barrel_medium       = ' < 0.00311 '
#    filt.cut_absdPhiIn_barrel_medium       = ' < 0.103 '
#    filt.cut_hovere_barrel_medium          = ' < 0.253 '
#    filt.cut_isoRho_barrel_medium          = ' < 0.0695 '
#    filt.cut_ooEmooP_barrel_medium         = ' < 0.134 '
#    #filt.cut_d0_barrel_medium              = ' < 0.0118 '
#    #filt.cut_z0_barrel_medium              = ' < 0.373 '
#    filt.cut_misshits_barrel_medium        = ' < 2 '
#    filt.cut_passConvVeto_barrel_medium    = ' == 1 '
#
#    filt.cut_sigmaIEIE_barrel_loose        = ' < 0.011 '
#    filt.cut_absdEtaIn_barrel_loose        = ' < 0.00477 '
#    filt.cut_absdPhiIn_barrel_loose        = ' < 0.222 '
#    filt.cut_hovere_barrel_loose           = ' < 0.298 '
#    filt.cut_isoRho_barrel_loose           = ' < 0.0994 '
#    filt.cut_ooEmooP_barrel_loose          = ' < 0.241 '
#    #filt.cut_d0_barrel_loose               = ' < 0.0261 '
#    #filt.cut_z0_barrel_loose               = ' < 0.41 '
#    filt.cut_misshits_barrel_loose         = ' < 2 '
#    filt.cut_passConvVeto_barrel_loose     = ' == 1 '
#
#    filt.cut_sigmaIEIE_barrel_veryloose    = ' < 0.0115 '
#    filt.cut_absdEtaIn_barrel_veryloose    = ' < 0.00749 '
#    filt.cut_absdPhiIn_barrel_veryloose    = ' < 0.228 '
#    filt.cut_hovere_barrel_veryloose       = ' < 0.356 '
#    filt.cut_isoRho_barrel_veryloose       = ' < 0.175 '
#    filt.cut_ooEmooP_barrel_veryloose      = ' < 0.299 '
#    #filt.cut_d0_barrel_veryloose           = ' < 0.0564 '
#    #filt.cut_z0_barrel_veryloose           = ' < 0.472 '
#    filt.cut_misshits_barrel_veryloose     = ' < 3 '
#    filt.cut_passConvVeto_barrel_veryloose = ' == 1 '
#
#    filt.cut_sigmaIEIE_endcap_tight        = ' < 0.0292 '
#    filt.cut_absdEtaIn_endcap_tight        = ' < 0.00605 '
#    filt.cut_absdPhiIn_endcap_tight        = ' < 0.0394 '
#    filt.cut_hovere_endcap_tight           = ' < 0.0641 '
#    filt.cut_isoRho_endcap_tight           = ' < 0.0571 '
#    filt.cut_ooEmooP_endcap_tight          = ' < 0.0129 '
#    #filt.cut_d0_endcap_tight               = ' < 0.0351 '
#    #filt.cut_z0_endcap_tight               = ' < 0.417 '
#    filt.cut_misshits_endcap_tight         = ' < 2 '
#    filt.cut_passConvVeto_endcap_tight     = ' == 1 '
#
#    filt.cut_sigmaIEIE_endcap_medium       = ' < 0.0298 '
#    filt.cut_absdEtaIn_endcap_medium       = ' < 0.00609 '
#    filt.cut_absdPhiIn_endcap_medium       = ' < 0.045 '
#    filt.cut_hovere_endcap_medium          = ' < 0.0878 '
#    filt.cut_isoRho_endcap_medium          = ' < 0.0821 '
#    filt.cut_ooEmooP_endcap_medium         = ' < 0.13 '
#    #filt.cut_d0_endcap_medium              = ' < 0.0739 '
#    #filt.cut_z0_endcap_medium              = ' < 0.602 '
#    filt.cut_misshits_endcap_medium        = ' <  2 '
#    filt.cut_passConvVeto_endcap_medium    = ' == 1 '
#
#    filt.cut_sigmaIEIE_endcap_loose        = ' < 0.0314 '
#    filt.cut_absdEtaIn_endcap_loose        = ' < 0.00868 '
#    filt.cut_absdPhiIn_endcap_loose        = ' < 0.213 '
#    filt.cut_hovere_endcap_loose           = ' < 0.101 '
#    filt.cut_isoRho_endcap_loose           = ' < 0.107 '
#    filt.cut_ooEmooP_endcap_loose          = ' < 0.14 '
#    #filt.cut_d0_endcap_loose               = ' < 0.118 '
#    #filt.cut_z0_endcap_loose               = ' < 0.822 '
#    filt.cut_misshits_endcap_loose         = ' <  2 '
#    filt.cut_passConvVeto_endcap_loose     = ' == 1 '
#
#    filt.cut_sigmaIEIE_endcap_veryloose    = ' < 0.037 '
#    filt.cut_absdEtaIn_endcap_veryloose    = ' < 0.00895 '
#    filt.cut_absdPhiIn_endcap_veryloose    = ' < 0.213 '
#    filt.cut_hovere_endcap_veryloose       = ' < 0.211 '
#    filt.cut_isoRho_endcap_veryloose       = ' < 0.159 '
#    filt.cut_ooEmooP_endcap_veryloose      = ' < 0.15 '
#    #filt.cut_d0_endcap_veryloose           = ' < 0.222 '
#    #filt.cut_z0_endcap_veryloose           = ' < 0.921 '
#    filt.cut_misshits_endcap_veryloose     = ' < 4 '
#    filt.cut_passConvVeto_endcap_veryloose = ' == 1 '

    if do_cutflow:
        filt.do_cutflow = True
        filt.add_var('evalPID', evalPID)

    if apply_corrections:
        workarea = os.getenv('WorkArea')
        filt.add_var('applyCorrections', 'true')
        filt.add_var(
            'correctionFile',
            '%s/TreeFilter/RecoWgg/data/step2-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9.dat'
            % workarea)
        filt.add_var(
            'smearingFile',
            '%s/TreeFilter/RecoWgg/data/outFile-step4-invMass_SC-loose-Et_20-trigger-noPF-HggRunEtaR9-smearEle.dat'
            % workarea)

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 200)
        filt.add_hist('cut_eta', 50, 0, 5)
        filt.add_hist('cut_abssceta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_absdEtaIn_barrel_medium', 100, -0.1, 0.1)
        filt.add_hist('cut_absdPhiIn_barrel_medium', 100, -0.1, 0.1)
        filt.add_hist('cut_sigmaIEIE_barrel_medium', 100, 0, 0.05)
        filt.add_hist('cut_hovere_barrel_medium', 100, -1, 1)
        filt.add_hist('cut_d0_barrel_medium', 100, -1, 1)
        filt.add_hist('cut_z0_barrel_medium', 100, -1, 1)
        filt.add_hist('cut_ooEmooP_barrel_medium', 100, 0, 1)
        filt.add_hist('cut_pfIso30_barrel_medium', 100, 0, 10)
        filt.add_hist('cut_passConvVeto_barrel_medium', 2, 0, 2)
        filt.add_hist('cut_misshits_barrel_medium', 10, 0, 10)

    return filt
コード例 #41
0
def build_medium_electron(do_cutflow=False, do_hists=False):

    filt = Filter('BuildMediumElectron')

    filt.do_cutflow = do_cutflow

    filt.cut_pt = ' > 25'
    #filt.cut_abssceta       = ' > 1.57 '
    #filt.cut_abssceta       = ' < 1.479 '
    filt.cut_abssceta = ' < 2.5 '
    filt.cut_abssceta_crack = ' > 1.479 & < 1.57 '
    filt.invert('cut_abssceta_crack')

    filt.cut_dEtaIn_barrel = ' < 0.004 '
    filt.cut_dPhiIn_barrel = ' < 0.06 '
    filt.cut_sigmaIEIE_barrel = ' < 0.01 '
    filt.cut_hovere_barrel = ' < 0.12 '
    filt.cut_d0_barrel = ' < 0.02 '
    filt.cut_z0_barrel = ' < 0.1 '
    filt.cut_eoverp_barrel = ' < 0.05 '
    filt.cut_pfIso30_barrel = ' < 0.15 '
    filt.cut_convfit_barrel = ' < 0.000001 '
    filt.cut_misshits_barrel = ' <= 1 '

    filt.cut_dEtaIn_endcap = ' < 0.007 '
    filt.cut_dPhiIn_endcap = ' < 0.03 '
    filt.cut_sigmaIEIE_endcap = ' < 0.03 '
    filt.cut_hovere_endcap = ' < 0.10 '
    filt.cut_d0_endcap = ' < 0.02 '
    filt.cut_z0_endcap = ' < 0.1 '
    filt.cut_eoverp_endcap = ' < 0.05 '
    filt.cut_pfIso30_endcap = ' < 0.15 '
    filt.cut_convfit_endcap = ' < 0.000001 '
    filt.cut_misshits_endcap = ' <= 1 '

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)
        filt.add_hist('cut_abseta_crack', 50, 0, 5)
        filt.add_hist('cut_abssceta', 50, 0, 5)
        filt.add_hist('cut_dEtaIn_barrel', 100, -0.1, 0.1)
        filt.add_hist('cut_dPhiIn_barrel', 100, -0.1, 0.1)
        filt.add_hist('cut_sigmaIEIE_barrel', 100, 0, 0.05)
        filt.add_hist('cut_hovere_barrel', 100, -1, 1)
        filt.add_hist('cut_d0_barrel', 100, -1, 1)
        filt.add_hist('cut_z0_barrel', 100, -1, 1)
        filt.add_hist('cut_eoverp_barrel', 100, 0, 1)
        filt.add_hist('cut_pfIso30_barrel', 100, 0, 10)
        filt.add_hist('cut_convfit_barrel', 2, 0, 2)
        filt.add_hist('cut_misshits_barrel', 10, 0, 10)

    return filt
コード例 #42
0
def filter_jet(jet_pt=' > 30 ', jet_eta='< 2.4', do_hists=False):

    filt = Filter('FilterJet')

    filt.cut_pt = jet_pt
    #filt.cut_abseta = ' < 4.5 '
    filt.cut_eta = jet_eta
    #filt.cut_loose = ' == True '
    filt.cut_tight = ' == True '

    filt.cut_muon_dr = ' > 0.4 '
    filt.cut_electron_dr = ' > 0.4 '
    filt.cut_photon_dr = ' > 0.4 '

    # From https://twiki.cern.ch/twiki/bin/view/CMS/JetID13TeVRun2016
    # For -2.7 <= eta <= 2.7
    # loose
    filt.cut_jet_nhf_central_loose = ' < 0.99 '
    filt.cut_jet_nemf_central_loose = ' < 0.99 '
    filt.cut_jet_nconst_central_loose = ' > 1'
    # tight
    filt.cut_jet_nhf_central_tight = ' < 0.90 '
    filt.cut_jet_nemf_central_tight = ' < 0.90 '
    filt.cut_jet_nconst_central_tight = ' > 1'
    # tightlep
    filt.cut_jet_nhf_central_tightlep = ' < 0.9 '
    filt.cut_jet_nemf_central_tightlep = ' < 0.9 '
    filt.cut_jet_nconst_central_tightlep = '> 1 '
    filt.cut_jet_muf_central_tightlep = '< 0.8 '
    # For -2.4 <= eta <= 2.4 in addition apply
    filt.cut_jet_chf_central_loose = ' > 0'
    filt.cut_jet_cmult_central_loose = ' > 0 '
    filt.cut_jet_cemf_central_loose = ' < 0.99 '
    filt.cut_jet_chf_central_tight = ' > 0 '
    filt.cut_jet_cmult_central_tight = ' > 0'
    filt.cut_jet_cemf_central_tight = ' < 0.99 '
    filt.cut_jet_chf_central_tightlep = ' > 0'
    filt.cut_jet_cmult_central_tightlep = ' > 0'
    filt.cut_jet_cemf_central_tightlep = ' < 0.90'

    # For 2.7 < abs(eta) <= 3.0
    filt.cut_jet_nhf_transition_loose = ' > 0.01 '
    filt.cut_jet_nemf_transition_loose = ' < 0.98 '
    filt.cut_jet_nmult_transition_loose = ' > 2 '
    filt.cut_jet_nhf_transition_tight = ' > 0.01 '
    filt.cut_jet_nemf_transition_tight = ' < 0.98 '
    filt.cut_jet_nmult_transition_tight = ' > 2 '
    # For abs(eta) > 3.0
    filt.cut_jet_nemf_forward_loose = ' < 0.90 '
    filt.cut_jet_nmult_forward_loose = '> 10 '
    filt.cut_jet_nemf_forward_tight = ' < 0.90 '
    filt.cut_jet_nmult_forward_tight = ' > 10 '

    #filt.cut_jet_el_dr = ' > 0.4 '
    #filt.cut_jet_ph_dr = ' > 0.4 '

    filt.cut_jet_CSV_Loose = ' > 0.5426 '
    filt.cut_jet_CSV_Medium = ' > 0.8484 '
    filt.cut_jet_CSV_Tight = ' > 0.9535 '
    filt.cut_jet_DeepJet_Loose = ' > 0.0614 '
    filt.cut_jet_DeepJet_Medium = ' > 0.3093 '
    filt.cut_jet_DeepJet_Tight = ' > 0.7221 '
    filt.add_var('evalBTagID', "medium")

    if do_hists:
        filt.add_hist('cut_pt', 100, 0, 500)
        filt.add_hist('cut_abseta', 50, 0, 5)

    return filt
コード例 #43
0
ファイル: ConfWgamgamReco.py プロジェクト: sachikot/usercode
def build_photon( do_cutflow=False, do_hists=False, filtPID=None, evalPID=None ) :

    filt = Filter('BuildPhoton')

    filt.do_cutflow = do_cutflow

    filt.cut_hovere12_barrel_mva_presel_smallr9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_smallr9  = ' < 4 '
    filt.cut_hovere12_barrel_mva_presel_larger9      = ' < 0.082 '
    filt.cut_hcalIsoEtCorr_barrel_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_barrel_mva_presel_larger9  = ' < 50 '
    filt.cut_sigmaIEIE_barrel_mva_presel             = ' < 0.014 '
    filt.cut_chgpfIso_barrel_mva_presel              = ' < 4 '

    filt.cut_hovere12_endcap_mva_presel_smallr9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_smallr9 = ' < 4 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_smallr9  = ' < 4 '
    filt.cut_hovere12_endcap_mva_presel_larger9      = ' < 0.075 '
    filt.cut_hcalIsoEtCorr_endcap_mva_presel_larger9 = ' < 50 '
    filt.cut_trkIsoEtCorr_endcap_mva_presel_larger9  = ' < 50 '
    filt.cut_sigmaIEIE_endcap_mva_presel             = ' < 0.034 '
    filt.cut_chgpfIso_endcap_mva_presel              = ' < 4 '

    if filtPID is not None :
        setattr(filt, 'cut_pid_%s' %filtPID, ' == True' )

    if evalPID is not None :
        filt.add_var( 'evalPID', evalPID )

    filt.add_var( 'TMVAWeightsFileEB', '/afs/cern.ch/user/j/jkunkle/usercode/Analysis/TreeFilter/TrainPhotonMVA/weights/photonMVAEB_BDT.weights.xml' )
    filt.add_var( 'TMVAWeightsFileEE', '/afs/cern.ch/user/j/jkunkle/usercode/Analysis/TreeFilter/TrainPhotonMVA/weights/photonMVAEE_BDT.weights.xml' )

    #filt.cut_ph_el_dr = ' > 0.2 '

    if do_hists :
        filt.add_hist( 'cut_pt', 100, 0, 500 )
        filt.add_hist( 'cut_abseta', 50, 0, 5 )
        filt.add_hist( 'cut_abseta_crack', 50, 0, 5 )
        filt.add_hist( 'cut_hovere', 50, 0, 0.1 )
        filt.add_hist( 'cut_eveto', 2, 0, 2 )
        filt.add_hist( 'cut_sigmaIEIE_barrel_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_medium', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_medium', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_medium', 50, 0, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_medium', 50, 0, 5 )

        filt.add_hist( 'cut_sigmaIEIE_barrel_loose', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_barrel_loose', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_barrel_loose', 100, -5, 5 )
        filt.add_hist( 'cut_phoIsoCorr_barrel_loose', 50, 0, 5 )
        filt.add_hist( 'cut_sigmaIEIE_endcap_loose', 50, 0, 0.05 )
        filt.add_hist( 'cut_chIsoCorr_endcap_loose', 50, 0, 5 )
        filt.add_hist( 'cut_neuIsoCorr_endcap_loose', 100, -5, 5 )
        filt.add_hist( 'cut_phoIsoCorr_endcap_loose', 50, 0, 5 )

    return filt