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
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
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
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
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
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
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
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
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
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