52 def template_method(hmo, hms, hno, hns, hto, hts, do_scale, lb_minus_one_reco_eff, corr = None, MC = False):
55 tbin1 = hmo.GetXaxis().
FindBin(75000)
56 tbin2 = hmo.GetXaxis().
FindBin(104000)
57 tbin3 = hmo.GetXaxis().
FindBin(120000)
58 tbin4 = hmo.GetXaxis().
FindBin(250000)
65 matchos_peak, matchos_peakerr =
extract(hmo, tbin1, tbin2)
66 matchos_tail, matchos_tailerr =
extract(hmo, tbin3, tbin4)
67 matchss_peak, matchss_peakerr =
extract(hms, tbin1, tbin2)
68 matchss_tail, matchss_tailerr =
extract(hms, tbin3, tbin4)
70 nomatchos_peak, nomatchos_peakerr =
extract(hno, tbin1, tbin2)
71 nomatchos_tail, nomatchos_tailerr =
extract(hno, tbin3, tbin4)
72 nomatchss_peak, nomatchss_peakerr =
extract(hns, tbin1, tbin2)
73 nomatchss_tail, nomatchss_tailerr =
extract(hns, tbin3, tbin4)
75 templateos_peak, templateos_peakerr =
extract(hto, tbin1, tbin2)
76 templateos_tail, templateos_tailerr =
extract(hto, tbin3, tbin4)
77 templatess_peak, templatess_peakerr =
extract(hts, tbin1, tbin2)
78 templatess_tail, templatess_tailerr =
extract(hts, tbin3, tbin4)
80 totalos_peak = matchos_peak + nomatchos_peak
81 totalos_tail = matchos_tail + nomatchos_tail
93 sum_w_m, sum_w2_m =
extract(hmo, tbin1, tbin2)
94 sum_w_n, sum_w2_n =
extract(hno, tbin1, tbin2)
96 sum_w = sum_w_m + sum_w_n
97 sum_w2 = (sum_w2_m**2) + (sum_w2_n**2)
101 err = (eff*(1-eff)*sum_w2/sum_w**2)**0.5
104 if templatess_tail == 0:
105 eff = lb_minus_one_reco_eff[0]
106 err = lb_minus_one_reco_eff[1]
107 elif templateos_tail == 0:
108 eff = lb_minus_one_reco_eff[0]
109 err = lb_minus_one_reco_eff[1]
111 if templatess_tail != 0
and templateos_tail != 0:
113 n2 = templateos_peak*(matchss_tail/templatess_tail)
116 d2 = templateos_peak*(nomatchos_tail/templateos_tail)
118 d2 = templateos_peak*( (totalos_tail - matchos_tail/corr) /templateos_tail )
121 eff = (n1 - n2)/(d1 - d2)
123 except ZeroDivisionError:
124 eff = lb_minus_one_reco_eff[0]
125 err = lb_minus_one_reco_eff[1]