ATLAS Offline Software
ThresholdDefLegacy.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 from ..Base.Thresholds import LegacyThreshold, ZeroBiasThreshold, ThresholdValue
4 from ..Base.Limits import CaloLimits as CL
5 
6 
8 
9  alreadyExecuted = False
10 
11  EMVarRun2 = {
12  1 : {
13  "eta_bin_boundaries": [0, 0.8, 1.1, 1.4, 1.5, 1.8, 2.5], # 6 bins
14  "shift": [ 1, -1, -2, -3, -1, 0]
15  },
16  2 : {
17  "eta_bin_boundaries": [0, 0.7, 0.9, 1.2, 1.4, 1.5, 1.7, 2.5], # 7 bins
18  "shift": [ 2, 1, 0, -1, -2, 0, 1]
19  },
20  3 : {
21  "eta_bin_boundaries": [0, 0.7, 0.8, 1.1, 1.3, 1.4, 1.5, 1.7, 2.5], # 8 bins
22  "shift" : [ 2, 1, 0, -1, -2, -3, -1, 1]
23  }
24  }
25 
26  @staticmethod
27  def addVaryingThrValuesRun2(thr, pt, shift_set):
28  eta_bin_boundaries = ThresholdDefLegacy.EMVarRun2[shift_set]["eta_bin_boundaries"]
29  shift = ThresholdDefLegacy.EMVarRun2[shift_set]["shift"]
30  thr.addThrValue(pt+shift[0], priority=1)
31  for idx,sh in reversed(list(enumerate(shift))[1:]):
32  eta_min = int(10 * eta_bin_boundaries[idx])
33  eta_max = int(10 * eta_bin_boundaries[idx+1])
34  thr.addThrValue( pt + sh, -eta_max, -eta_min, priority=2)
35  for idx,sh in list(enumerate(shift))[1:]:
36  eta_min = int(10 * eta_bin_boundaries[idx])
37  eta_max = int(10 * eta_bin_boundaries[idx+1])
38  thr.addThrValue( pt + sh, eta_min, eta_max, priority=2)
39  return thr
40 
41  @staticmethod
42  def registerThresholds(tc, menuName):
43  # dear Menu Experts, please note that it is only necessary to
44  # check the menu name if a certain threshold has different
45  # definitions in different menus
46 
47  if ThresholdDefLegacy.alreadyExecuted:
48  return
49  ThresholdDefLegacy.alreadyExecuted = True
50 
51  # EM
52  ThresholdValue.setDefaults('EM',{'isobits' : '00000', 'use_relIso' : True })
53 
54  for thrV in [3, 5, 7, 8, 10, 12, 14, 15, 16, 18, 20, 22]:
55  LegacyThreshold('EM%i' % thrV, 'EM').addThrValue(thrV)
56 
57  # for beam splashes:
58  LegacyThreshold('EM20A', 'EM').addThrValue(255, priority=1).addThrValue(20,16,20,priority=2)
59  LegacyThreshold('EM20C', 'EM').addThrValue(255, priority=1).addThrValue(20,-20,-16,priority=2)
60 
61  # variable thresholds (V)
62  # hadronic isolation (H) had_isolation=1GeV
63  # em isolation (I)
64 
65  # I section
66  ThresholdValue.setDefaults('EM', {'isobits' : '00010', 'use_relIso' : True })
67  for thrV in [8]:
68  LegacyThreshold('EM%iI' % thrV, 'EM').addThrValue(thrV)
69 
70  # VH section
71  ThresholdValue.setDefaults('EM', {'isobits' : '00001', 'use_relIso' : True })
72  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM8VH', 'EM'), 8, shift_set = 1 )
73  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM10VH', 'EM'), 10, shift_set = 1 )
74  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM13VH', 'EM'), 13, shift_set = 2 )
75  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM15VH', 'EM'), 15, shift_set = 2 )
76  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM18VH', 'EM'), 18, shift_set = 3 )
77  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM20VH', 'EM'), 20, shift_set = 3 )
78  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM22VH', 'EM'), 22, shift_set = 3 )
79 
80  # (V)HI section
81  ThresholdValue.setDefaults('EM', {'isobits' : '00100', 'use_relIso' : True })
82  for thrV in [15]:
83  LegacyThreshold('EM%iHI' % thrV, 'EM').addThrValue(thrV)
84 
85  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM15VHI', 'EM'), 15, shift_set = 2 )
86  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM18VHI', 'EM'), 18, shift_set = 3 )
87  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM20VHI', 'EM'), 20, shift_set = 3 )
88  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM22VHI', 'EM'), 22, shift_set = 3 )
89  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM24VHI', 'EM'), 24, shift_set = 3 )
90  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM26VHI', 'EM'), 26, shift_set = 3 )
91  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM30VHI', 'EM'), 30, shift_set = 3 )
92 
93  # VHIM section
94  ThresholdValue.setDefaults('EM', {'isobits' : '01000', 'use_relIso' : True })
95  ThresholdDefLegacy.addVaryingThrValuesRun2( LegacyThreshold( 'EM24VHIM', 'EM'), 24, shift_set = 3 )
96 
97  ThresholdValue.setDefaults('EM', {})
98 
99 
100  # TAU
101  ThresholdValue.setDefaults('TAU',{'isobits' : '00000', 'use_relIso' : True })
102  for thrV in [1, 2, 3, 5, 6, 8, 12, 15, 20, 25, 30, 35, 40, 50, 60, 90, 100]:
103  LegacyThreshold('HA%i' % thrV, 'TAU').addThrValue(thrV)
104 
105  # beam splashes
106  for thrV in [20]:
107  LegacyThreshold('HA%iA' % thrV, 'TAU').addThrValue(255, priority=1).addThrValue( thrV, etamin = 12, etamax = 16, priority=2)
108  LegacyThreshold('HA%iC' % thrV, 'TAU').addThrValue(255, priority=1).addThrValue( thrV, etamin = -16, etamax = -12, priority=2)
109 
110  ThresholdValue.setDefaults('TAU', {'isobits' : '00001', 'use_relIso' : True })
111  for thrV in [12,20]:
112  LegacyThreshold('HA%iIL' % thrV, 'TAU').addThrValue(thrV)
113 
114  ThresholdValue.setDefaults('TAU', {'isobits' : '00010', 'use_relIso' : True })
115  for thrV in [12,20,25]:
116  LegacyThreshold('HA%iIM' % thrV, 'TAU').addThrValue(thrV)
117 
118  ThresholdValue.setDefaults('TAU', {'isobits' : '00100', 'use_relIso' : True })
119  for thrV in [12,20,25]:
120  LegacyThreshold('HA%iIT' % thrV, 'TAU').addThrValue(thrV)
121 
122  ThresholdValue.setDefaults('TAU', {'isobits' : '01000', 'use_relIso' : True })
123  for thrV in [12,20]:
124  LegacyThreshold('HA%iI' % thrV, 'TAU').addThrValue(thrV)
125 
126  ThresholdValue.setDefaults('TAU', {})
127 
128 
129  # JET
130 
131  ThresholdValue.setDefaults('JET', {'window' : 8})
132 
133  # Standart jet (-31<=eta<=31)
134  for thrV in [5, 10, 12, 15, 20, 25, 30, 35, 40, 50, 60, 70, 75, 85, 100, 120, 150,175, 250, 400]:
135  LegacyThreshold('J%i' % thrV, 'JET').addThrValue(CL.JetOff).addThrValue(thrV, etamin=-31, etamax=31, priority=1) # jets are between -31 and 31 -ATR-11526
136 
137  ThresholdValue.setDefaults('JET', {})
138 
139 
140  # JB and JF
141 
142  ThresholdValue.setDefaults('JET', {'window' : 8})
143 
144  # Beam Splashes
145  for thrV in [75]:
146  LegacyThreshold('J%iA' % thrV, 'JET').addThrValue(CL.JetOff).addThrValue( thrV, etamin = 15, etamax = 23, priority=1)
147  LegacyThreshold('J%iC' % thrV, 'JET').addThrValue(CL.JetOff).addThrValue( thrV, etamin = -23, etamax = -15, priority=1)
148  # Central jet
149  for (thrV, etamax) in [(12,25), (12,28), (15,25), (17,22), (20,28), (25,23), (35,23), (20,49), (30,49), (40,25), (45,21)]:
150  LegacyThreshold('J%ip0ETA%i' % (thrV, etamax), 'JET').addThrValue(CL.JetOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1)
151 
152  # Standard forward jet
153  for thrV in [10, 15, 20, 25, 30, 35, 45, 50, 70, 75, 100]:
154  LegacyThreshold('J%ip31ETA49' % thrV, 'JET').addThrValue(CL.JetOff)\
155  .addThrValue( thrV, etamin=31, etamax=49, priority=1)\
156  .addThrValue( thrV, etamin=-49, etamax=-31, priority=1)
157 
158  # Custom Forward jet and VBF jets
159  for (thrV, etamin, etamax) in [ (15,23,49), (15,24,49), (20,28,31) ]:
160  LegacyThreshold('J%ip%iETA%i' % (thrV, etamin,etamax), 'JET').addThrValue(CL.JetOff)\
161  .addThrValue( thrV, etamin = etamin, etamax=etamax, priority=1)\
162  .addThrValue( thrV, etamin = -etamax, etamax = -etamin, priority=1)
163 
164 
165  ThresholdValue.setDefaults('JET', {'window' : 4})
166 
167  for thrV in [15]:
168  LegacyThreshold('JJ%ip23ETA49' % thrV, 'JET')\
169  .addThrValue(CL.JetOff)\
170  .addThrValue( thrV, etamin=23, etamax=49, priority=1)\
171  .addThrValue( thrV, etamin=-49, etamax=-23, priority=1)
172 
173  ThresholdValue.setDefaults('JET', {})
174 
175  # ZB
176  ZeroBiasThreshold('ZB_EM12').setSeedThreshold( seed='EM12', seed_multi=1, bcdelay=3564 )
177  ZeroBiasThreshold('ZB_EM15').setSeedThreshold( seed='EM15', seed_multi=1, bcdelay=3564 )
178  ZeroBiasThreshold('ZB_J10' ).setSeedThreshold( seed='J10', seed_multi=1, bcdelay=3564 )
179  ZeroBiasThreshold('ZB_J75' ).setSeedThreshold( seed='J75', seed_multi=1, bcdelay=3564 )
180 
181  # JE
182 
183  ThresholdValue.setDefaults('JE', {'etamin' : -49,'etamax' : 49, 'phimin' : 0,'phimax' : 64,
184  'window' : 8, 'priority': 0})
185 
186  for thrV in [100, 140, 200, 300, 350, 500]:
187  LegacyThreshold('JE%i' % thrV, 'JE').addThrValue(thrV)
188 
189  # TE
190  for thrV in [0, 2, 3, 4, 5, 10, 15, 20, 25, 30, 40, 45, 50, 55, 60, 65, 70, 90, 100, 120, 140, 160, 200, 280, 300, 360, 2000, 4000, 10000, 12000, 14000]:
191  LegacyThreshold('TE%i' % thrV, 'TE').addThrValue(thrV)
192 
193  # XE
194  for thrV in [10, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 150, 300]:
195  LegacyThreshold('XE%i' % thrV, 'XE').addThrValue(thrV)
196 
197  # XS
198  for thrV in [20, 25, 30, 35, 40, 45, 50, 55, 60, 65]:
199  LegacyThreshold('XS%i' % thrV, 'XS').addThrValue(thrV)
200 
201  # Restricted range TE |eta|<2.4
202  etamax = 24
203  for thrV in [0, 3, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 80, 110, 150, 180, 1000, 2000, 5000, 6500, 8000, 9000]:
204  LegacyThreshold('TE%ip0ETA%i' % (thrV, etamax), 'TE').addThrValue(CL.EtSumOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1)
205 
206  # Restricted range TE 2.4<|eta|<4.9
207  etamin = 24
208  etamax = 49
209  for thrV in [0, 3, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 80, 110, 150, 180, 1000, 2000, 5000, 6500, 8000, 9000]:
210  LegacyThreshold('TE%ip%iETA%i' % (thrV, etamin, etamax), 'TE')\
211  .addThrValue( CL.EtSumOff)\
212  .addThrValue( thrV, etamin = etamin, etamax=etamax, priority=1)\
213  .addThrValue( thrV, etamin = -etamax, etamax = -etamin, priority=1)
214 
215  # RXE (restriced range ET miss)
216  etamax = 24
217  for thrV in [30, 35, 40, 45, 50, 55, 60, 70, 80]:
218  LegacyThreshold('XE%ip0ETA%i' % (thrV, etamax), 'XE').addThrValue(CL.EtMissOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1)
219 
220  # Restricted range TE |eta|<4.9
221  etamax = 49
222  for thrV in [3, 7, 500, 600, 1500, 3000, 3500, 5000, 6500, 8000, 9000]:
223  LegacyThreshold('TE%ip0ETA%i' % (thrV, etamax), 'TE').addThrValue(CL.EtSumOff).addThrValue( thrV, etamin = -etamax, etamax = etamax, priority=1)
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.L1.Config.ThresholdDefLegacy.ThresholdDefLegacy.registerThresholds
def registerThresholds(tc, menuName)
Definition: ThresholdDefLegacy.py:42
python.L1.Base.Thresholds.LegacyThreshold
Definition: Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py:150
python.L1.Config.ThresholdDefLegacy.ThresholdDefLegacy.addVaryingThrValuesRun2
def addVaryingThrValuesRun2(thr, pt, shift_set)
Definition: ThresholdDefLegacy.py:27
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.L1.Config.ThresholdDefLegacy.ThresholdDefLegacy
Definition: ThresholdDefLegacy.py:7
python.L1.Base.Thresholds.ZeroBiasThreshold
Definition: Trigger/TriggerCommon/TriggerMenuMT/python/L1/Base/Thresholds.py:1087