3 from ..Base.Thresholds
import MuonThreshold, eEMThreshold, eEMVarThreshold, jEMThreshold, eTauThreshold, jTauThreshold, cTauThreshold, jJetThreshold, jLJetThreshold, gJetThreshold, gLJetThreshold, XEThreshold, TEThreshold, LArSaturationThreshold, MBTSThreshold, MBTSSIThreshold, NimThreshold, NSWMonThreshold, ZeroBiasThresholdTopo
4 from .L1CaloThresholdMapping
import get_threshold_cut
9 thrVal_SPAREXE = 104857.5
13 alreadyExecuted =
False
17 "eta_bin_boundaries": [0, 0.7, 0.8, 1.1, 1.3, 1.4, 1.5, 1.8, 2.5],
18 "shift": [ 1, 1, -1, -2, -2, -3, -1, 0]
25 "eta_bin_boundaries": [0, 0.8, 1.6, 4.9],
30 "eta_bin_boundaries": [0, 0.8, 1.6, 4.9],
37 eta_bin_boundaries = ThresholdDef.eEMVar[shift_set][
"eta_bin_boundaries"]
38 shift = ThresholdDef.eEMVar[shift_set][
"shift"]
39 thr.addThrValue(pt+shift[0], priority=1)
40 for idx,sh
in reversed(
list(enumerate(shift))):
41 eta_min =
int(10 * eta_bin_boundaries[idx])
42 eta_max =
int(10 * eta_bin_boundaries[idx+1])
43 thr.addThrValue( pt + sh, -eta_max, -eta_min, priority=2)
44 for idx,sh
in enumerate(shift):
45 eta_min =
int(10 * eta_bin_boundaries[idx])
46 eta_max =
int(10 * eta_bin_boundaries[idx+1])
47 thr.addThrValue( pt + sh, eta_min, eta_max, priority=2)
51 eta_bin_boundaries = ThresholdDef.jJVar[shift_set][
"eta_bin_boundaries"]
52 shift = ThresholdDef.jJVar[shift_set][
"shift"]
53 for idx,sh
in reversed(
list(enumerate(shift))):
54 eta_min =
int(10 * eta_bin_boundaries[idx])
55 eta_max =
int(10 * eta_bin_boundaries[idx+1])
56 if -eta_min < -rangemax
or -eta_max > -rangemin:
58 if -eta_min > - rangemin:
60 if -eta_max < - rangemax:
62 thr.addThrValue( pt + sh, -eta_max, -eta_min, priority=1)
63 for idx,sh
in enumerate(shift):
64 eta_min =
int(10 * eta_bin_boundaries[idx])
65 eta_max =
int(10 * eta_bin_boundaries[idx+1])
66 if eta_min > rangemax
or eta_max < rangemin:
68 if eta_max > rangemax:
70 if eta_min < rangemin:
72 thr.addThrValue( pt + sh, eta_min, eta_max, priority=1)
79 if ThresholdDef.alreadyExecuted:
80 raise RuntimeError(
"Calling ThresholdDef.registerThresholds twice")
81 ThresholdDef.alreadyExecuted =
True
86 MuonThreshold(
"MU3VF" ).setThrValue( thr=3, ba=4 ).setTGCFlags(
"F")
87 MuonThreshold(
"MU3VC" ).setThrValue( thr=3, ba=4 ).setTGCFlags(
"C")
88 MuonThreshold(
"MU5VF" ).setThrValue( thr=5, ba=6 ).setTGCFlags(
"F")
90 MuonThreshold(
"MU8FC" ).setThrValue( thr=8 ).setTGCFlags(
"F & C")
91 MuonThreshold(
"MU9VF" ).setThrValue( thr=9,ba=8 ).setTGCFlags(
"F")
92 MuonThreshold(
"MU9VFC" ).setThrValue( thr=9,ba=8 ).setTGCFlags(
"F & C")
93 MuonThreshold(
"MU8VF" ).setThrValue( thr=8, ba=10 ).setTGCFlags(
"F")
94 MuonThreshold(
"MU8VFC" ).setThrValue( thr=8, ba=10 ).setTGCFlags(
"F & C")
95 MuonThreshold(
"MU14FCH" ).setThrValue( thr=14 ).setTGCFlags(
"F & C & H")
96 MuonThreshold(
"MU14FCHR" ).setThrValue( thr=14 ).setTGCFlags(
"F & C & H").setExclusionList(
"rpcFeet")
97 MuonThreshold(
"MU15VFCH" ).setThrValue( thr=15, ba=14 ).setTGCFlags(
"F & C & H")
98 MuonThreshold(
"MU15VFCHR").setThrValue( thr=15, ba=14 ).setTGCFlags(
"F & C & H").setExclusionList(
"rpcFeet")
99 MuonThreshold(
"MU18VFCH" ).setThrValue( thr=18, ba=14 ).setTGCFlags(
"F & C & H")
101 MuonThreshold(
"MU10BOM" ).setThrValue( thr=10 ).setRPCFlags(
"M").setRegion(
"BA")
102 MuonThreshold(
"MU12BOM" ).setThrValue( thr=12 ).setRPCFlags(
"M").setRegion(
"BA")
104 MuonThreshold(
"MU8FH" ).setThrValue( thr=8 ).setTGCFlags(
"F & H")
106 MuonThreshold(
"MU20VFC" ).setThrValue( thr=20, ba=14 ).setTGCFlags(
"F & C")
108 MuonThreshold(
"MU12FCH" ).setThrValue( thr=12 ).setTGCFlags(
"F & C & H")
109 MuonThreshold(
"MU4BOM" ).setThrValue( thr=4 ).setRPCFlags(
"M").setRegion(
"BA")
110 MuonThreshold(
"MU4BO" ).setThrValue( thr=4 ).setRegion(
"BA")
111 MuonThreshold(
"MU10BO" ).setThrValue( thr=10 ).setRegion(
"BA")
112 MuonThreshold(
"MU14EOF" ).setThrValue( thr=14 ).setTGCFlags(
"F").setRegion(
"EC,FW")
113 MuonThreshold(
"MU8EOF" ).setThrValue( thr=8 ).setTGCFlags(
"F").setRegion(
"EC,FW")
114 MuonThreshold(
"MU3EOF" ).setThrValue( thr=3, ba=4 ).setTGCFlags(
"F").setRegion(
"EC,FW")
119 eEM_cuts = [1, 2, 5, 7, 9, 12, 15, 18, 26]
121 ttconfig = tc.l1menu.thresholds.typeWideThresholdConfig(
'eEM')
122 ptMin = ttconfig[
"ptMinToTopo"]
123 for thrV
in eEM_cuts:
131 for thrV
in range(1,3):
132 eEMThreshold(
'eEMSPARE%i' % thrV,
'eEM').addThrValue(thrVal_SPARE)
135 eEM_cuts = [9, 10, 12, 18, 24, 26, 40]
136 for thrV
in eEM_cuts:
137 eEMThreshold(
'eEM%iL' % thrV,
'eEM').addThrValue(
get_threshold_cut(
'eEM',thrV)).setIsolation( reta =
"Loose", wstot =
"Loose", rhad =
"Loose" )
140 eEM_cuts = [10, 18, 22, 26, 28]
141 for thrV
in eEM_cuts:
142 eEMThreshold(
'eEM%iM' % thrV,
'eEM').addThrValue(
get_threshold_cut(
'eEM',thrV)).setIsolation( reta =
"Medium", wstot =
"Medium", rhad =
"Medium" )
146 for thrV
in eEM_cuts:
147 eEMThreshold(
'eEM%iT' % thrV,
'eEM').addThrValue(
get_threshold_cut(
'eEM',thrV)).setIsolation( reta =
"Tight", wstot =
"Tight", rhad =
"Tight" )
151 for thrV
in eEM_cuts:
152 ThresholdDef.addVaryingThrValues( pt=
get_threshold_cut(
'eEM',thrV), shift_set = 1,
153 thr=
eEMVarThreshold(
'eEM%iVM' % thrV,
'eEM').setIsolation( reta =
"Medium", wstot =
"Medium", rhad =
"Medium" ) )
157 for thrV
in jEM_cuts:
161 for thrV
in jEM_cuts:
162 jEMThreshold(
'jEM%iM' % thrV,
'jEM').addThrValue(
get_threshold_cut(
'jEM',thrV)).setIsolation( iso =
"Medium", frac =
"Medium", frac2 =
"Medium" )
165 for thrV
in range(1,2):
166 jEMThreshold(
'jEMSPARE%i' % thrV,
'jEM').addThrValue(thrVal_SPARE)
169 eTAU_cuts = [1, 12, 20, 30, 35, 60, 80, 140]
171 ttconfig = tc.l1menu.thresholds.typeWideThresholdConfig(
'eTAU')
172 ptMin = ttconfig[
"ptMinToTopo"]
173 for thrV
in eTAU_cuts:
177 for thrV
in eTAU_cuts:
179 eTAU_cuts = [20, 30, 35]
180 for thrV
in eTAU_cuts:
184 for thrV
in eTAU_cuts:
187 for thrV
in eTAU_cuts:
190 for thrV
in eTAU_cuts:
193 for thrV
in range(1,10):
194 eTauThreshold(
'eTAUSPARE%i' % thrV,
'eTAU').setEt(thrVal_SPARE)
197 cTAU_cuts = [12, 20, 30, 35]
198 for thrV
in cTAU_cuts:
202 for thrV
in range(1,4):
203 cTauThreshold(
'cTAUSPARE%i' % thrV,
'cTAU').setEt(thrVal_SPARE)
206 jTAU_cuts = [1, 20, 30]
208 ttconfig = tc.l1menu.thresholds.typeWideThresholdConfig(
'jTAU')
209 ptMin = ttconfig[
"ptMinToTopo1"]
210 for thrV
in jTAU_cuts:
213 for thrV
in jTAU_cuts:
220 ttconfig = tc.l1menu.thresholds.typeWideThresholdConfig(
'jJ')
221 ptMin = ttconfig[
"ptMinToTopo1"]
222 jJ_cuts = [5, 10, 20, 30, 40, 50, 55, 60, 80, 90, 125, 140, 160, 180, 500]
227 jJ_cuts = [(30,25), (40,25), (50,25), (55,23), (70,23), (80,25), (85,21)]
228 for thrV, etamax
in jJ_cuts:
229 ThresholdDef.addJetVaryingThrValues(
jJetThreshold(
'jJ%ip0ETA%i' % (thrV, etamax),
'jJ'), pt=
get_threshold_cut(
'CjJ', thrV), shift_set=0, rangemin=0, rangemax=etamax )
235 jJ_cuts = [15, 20, 40, 50, 60, 90, 125]
237 ThresholdDef.addJetVaryingThrValues(
jJetThreshold(
'jJ%ip30ETA49' % thrV,
'jJ'), pt=
get_threshold_cut(
'FjJ', thrV), shift_set=0, rangemin=30, rangemax=49 )
240 for thrV
in range(1,4):
241 jJetThreshold(
'jJSPARE%i' % thrV,
'jJ').addThrValue(thrVal_SPARE)
244 for thrV
in [60, 80, 100, 120, 140, 160, 180, 200]:
248 for thrV
in range(1,5):
249 jLJetThreshold(
'jLJSPARE%i' % thrV,
'jLJ').addThrValue(thrVal_SPARE)
252 for thrV
in [20, 50, 100, 400]:
253 ThresholdDef.addJetVaryingThrValues(
gJetThreshold(
'gJ%ip0ETA25' % thrV,
'gJ'), pt=
get_threshold_cut(
'gJ', thrV), shift_set=0, rangemin=0, rangemax=25)
257 ThresholdDef.addJetVaryingThrValues(
gJetThreshold(
'gJ%ip25ETA49' % thrV,
'gJ'), pt=
get_threshold_cut(
'gJ', thrV), shift_set=0, rangemin=25, rangemax=49)
260 for thrV
in range(1,2):
261 gJetThreshold(
'gJSPARE%i' % thrV,
'gJ').addThrValue(thrVal_SPARE)
265 for thrV
in [80, 100, 140, 160]:
266 ThresholdDef.addJetVaryingThrValues(
gLJetThreshold(
'gLJ%ip0ETA25' % thrV,
'gLJ'), pt=
get_threshold_cut(
'gLJ', thrV), shift_set=0, rangemin=0, rangemax=25)
269 for thrV
in range(1,5):
270 gLJetThreshold(
'gLJSPARE%i' % thrV,
'gLJ').addThrValue(thrVal_SPARE)
274 for thrV
in gXE_cuts:
281 gXE_cuts = [60, 70, 80, 100, 110, 120, 500]
282 for thrV
in gXE_cuts:
290 for thrV
in [3,5,10,200]:
294 jXE_cuts = [60, 70, 80, 90, 100, 110, 120, 500]
295 for thrV
in jXE_cuts:
300 for thrV
in range(1, 6):
301 XEThreshold(
'jXESPARE%i' % thrV,
'jXE').setXE(thrVal_SPAREXE)
304 for thrV
in jXE_cuts:
309 for thrV
in jXE_cuts:
314 for thrV
in [3,4,5,10,20,50,100,200,600,1500,4000,6500,8300,9000,10000,12000]:
323 for thrV
in [100,5,1]:
326 for thrV
in [100,5,1]:
346 thresholdA=[ 32.04, 26.98, 35.00, 33.54, 32.08, 36.46, 30.63, 32.08, 33.54, 30.63, 29.17, 33.54, 32.08, 32.08, 30.63, 26.25]
347 thresholdC=[ 55.42, 31.98, 32.81, 49.48, 98.44, 32.11, 32.62, 29.90, 24.06, 25.81, 25.52, 35.00, 27.71, 36.46, 26.25, 30.63]
350 thresholdA=[ 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
351 thresholdC=[ 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
353 for i, (vA, vC)
in enumerate(zip(thresholdA, thresholdC)):
360 if tc.thresholdExists(
'MBTS_A%i' % x):
361 thr_mbtsA.addSector( tc.getDefinedThreshold(
'MBTS_A%i' % x) )
362 if tc.thresholdExists(
'MBTS_C%i' % x):
363 thr_mbtsC.addSector( tc.getDefinedThreshold(
'MBTS_C%i' % x) )