55 def thr2weights(thrs, factor=1.25):
73 while (jnext < n
and use[index[jnext]]==0):
76 w =
int( (thrs[index[j]]+thrs[index[jnext]]+1)/2.0) - sum
78 w =
int(thrs[index[j]]*factor - sum)
92 if (thr1.count(val)>1):
93 thr1[pos] = -thr1[pos]
96 l1_thrs = triggerPythonConfig.Lvl1Thresholds()
97 jet_thresholds = l1_thrs.allThresholdsOf(
'JET')
98 fjet_thresholds = l1_thrs.allThresholdsOf(
'JF')
99 log.debug(
'N jet thresholds: %d (8 expected)', len(jet_thresholds))
100 log.debug(
'N fjet thresholds: %d (4 expected)', len(fjet_thresholds))
103 jet_names, fjet_names = [
'---']*8, [
'---']*4
104 for j
in jet_thresholds:
105 log.debug(
'jet threshold %s: %d', j.name, j.thresholdInGeV())
107 jthr[j.mapping] = j.thresholdInGeV()
108 jet_names[j.mapping] = j.name
109 for j
in fjet_thresholds:
110 tvalues = j.thresholdValues
114 if tv.priority > priority:
115 threshold_value = tv.value
116 log.debug(
'fjet threshold %s: %d', j.name, threshold_value)
117 fjthr.append(threshold_value)
118 fjthr[j.mapping] = threshold_value
119 fjet_names[j.mapping] = j.name
124 log.debug(
'Jet thresholds: %s', s)
128 log.debug(
'Fjet thresholds: %s', s)
130 w = thr2weights(jthr)
137 w = thr2weights(fjthr)