from higgstautau import tauid from higgstautau.tauid.p851 import selection, nvtx_to_category, CATEGORIES from higgstautau.tauid.common import LEVELS, PRONGS from higgstautau.tauid import EFFIC_UNCERT_2011 as EFFIC_UNCERT from samples import MC_TauID import numpy as np from matplotlib import pyplot as plt from tauid_uncertainty import efficiency, efficiency_uncertainty pt = 40000 for prong in tauid.PRONGS: loose = selection('loose', prong, 3).Eval(pt) medium = selection('medium', prong, 3).Eval(pt) tight = selection('tight', prong, 3).Eval(pt) scores = np.linspace(0.5, 1., 1000, endpoint=True) high = [] low = [] for score in scores: high_score, low_score = tauid.uncertainty(score, pt, prong, 3) high.append(high_score - score) low.append(low_score - score) fig = plt.figure() ax = fig.add_subplot(111) ax.fill_between(scores, low, high, facecolor='yellow', linewidth=0) ax.vlines([loose, medium, tight], [-.5, -.5, -.5], [.5, .5, .5], color='k', linestyles='--') ax.axhline(0., 0., 1.)
from higgstautau import tauid from higgstautau.tauid.p851 import selection, nvtx_to_category, CATEGORIES from higgstautau.tauid.common import LEVELS, PRONGS from higgstautau.tauid import EFFIC_UNCERT_2011 as EFFIC_UNCERT from samples import MC_TauID import numpy as np from matplotlib import pyplot as plt from tauid_uncertainty import efficiency, efficiency_uncertainty pt = 40000 for prong in tauid.PRONGS: loose = selection('loose', prong, 3).Eval(pt) medium = selection('medium', prong, 3).Eval(pt) tight = selection('tight', prong, 3).Eval(pt) scores = np.linspace(0.5, 1., 1000, endpoint=True) high = [] low = [] for score in scores: high_score, low_score = tauid.uncertainty(score, pt, prong, 3) high.append(high_score - score) low.append(low_score - score) fig = plt.figure() ax = fig.add_subplot(111) ax.fill_between(scores, low, high, facecolor='yellow', linewidth=0) ax.vlines([loose, medium, tight], [-.5, -.5, -.5], [.5, .5, .5], color='k', linestyles='--')
prong, category) print curr_effic if prev_effic is not None and abs(curr_effic - prev_effic) < min_change: break if curr_effic > target: a = mid else: b = mid prev_effic = curr_effic print efficiency(ztautau, selection + curr_shift, prong, category) print list(curr_shift.y()) print list((selection + curr_shift).y()) print "=" * 20 return curr_shift loose = selection('loose', prong, cat_str) medium = selection('medium', prong, cat_str) tight = selection('tight', prong, cat_str) shift_loose_low = medium - loose shift_loose_high = 0. - loose shift_medium_low = tight - medium shift_medium_high = loose - medium shift_tight_low = 1. - tight shift_tight_high = medium - tight uncert_loose = EFFIC_UNCERT['loose'][prong] uncert_medium = EFFIC_UNCERT['medium'][prong] uncert_tight = EFFIC_UNCERT['tight'][prong]