ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMuonHypoConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
4# import Hypo Algs/Tools
5from AthenaConfiguration.ComponentFactory import CompFactory # tools are imported from the factory, (NewJO)
6
7# import monitoring
8from TrigMuonHypo.TrigMuonHypoMonitoring import (
9 TrigmuCombHypoMonitoring,
10 TrigMuonEFHypoMonitoring,
11 TrigMuonEFIdtpHypoMonitoring,
12 TrigL2MuonOverlapRemoverMonitoringMucomb,
13 TrigMuonEFInvMassHypoMonitoring,
14 TrigMuonEFIdtpInvMassHypoMonitoring,
15 TrigMuonEFTrackIsolationMonitoring
16)
17
18monitorAll = False #should only be true for local debugging to have histograms from all chains
19
20# other imports
21from AthenaCommon.SystemOfUnits import GeV
22
23from AthenaCommon.Logging import logging
24log = logging.getLogger('TrigMuonHypoConfig')
25
26muFastThresholds = {
27 # added for Run3 low-mu 2mu3
28 '3GeV_v22a' : [ [0,9.9], [ 0.1 ] ],
29 # 2011a tuning + 2015 tuning
30 '4GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.38, 1.25, 3.17, 3.41] ],
31 '4GeV_barrelOnly_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.38, 1000., 1000., 1000.] ],
32 '6GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 5.17, 3.25, 4.69, 5.14] ],
33 '8GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 6.63, 5.17, 6.39, 6.81] ],
34 '10GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 8.28, 6.35, 7.19, 8.58] ],
35 #not optimized: ATR-20049
36 '11GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 8.99, 6.62, 7.40, 9.32] ],
37 '13GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 10.42, 7.16, 7.81, 10.80] ],
38 '14GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 11.15, 7.58, 8.43, 11.61] ],
39 '15GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 11.31, 10.52, 12.00, 13.24] ],
40 '18GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 14.33, 9.45, 10.96, 14.35] ],
41 '20GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.10, 3.25, 2.69, 5.14] ], # new
42 '22GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.20, 3.25, 4.90, 5.00] ], # new
43 '23GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.20, 3.25, 4.90, 5.00] ], # new
44 '24GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 4.80, 3.25, 4.50, 5.10] ], # new
45 '26GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.50, 3.25, 4.45, 4.40] ], # new
46 '28GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.70, 3.25, 4.50, 5.40] ], # new
47 '30GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.00, 4.00, 4.30, 5.55] ], # new
48 '32GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.00, 6.50, 4.20, 6.00] ], # new
49 '34GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.40, 7.20, 4.60, 9.00] ], # new
50 '35GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.30, 5.40, 4.80, 5.00] ], # new
51 '36GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 4.20, 3.90, 4.30, 5.00] ], # new
52 '40GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.16, 6.20, 5.50, 10.00] ], # new
53 '45GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.20, 9.80, 5.30, 10.70] ], # new
54 '48GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 4.00, 7.30, 5.50, 9.50] ], # new
55 '50GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 1.30, 8.10, 4.50, 9.50] ], # new
56 '60GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 21.13, 21.20, 25.38, 29.54] ],
57 '80GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 21.13, 21.20, 25.38, 29.54] ],
58 '40GeV_uptoEC2_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 21.13, 21.20, 25.38, 1000.] ],
59 '40GeV_barrelOnly_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 21.13, 1000., 1000., 1000.] ],
60 '50GeV_barrelOnly_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 21.13, 1000., 1000., 1000.] ],
61 '60GeV_barrelOnly_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 21.13, 1000., 1000., 1000.] ],
62 }
63
64muCombThresholds = {
65 # added for Run3 low-mu 2mu3
66 '3GeV_v22a' : [ [0,1.05,1.5,2.0,9.9], [ 2.82, 2.76, 2.64, 2.64] ],
67 # original + 2015 tuning
68 '2GeV_v15a' : [ [0,9.9], [ 2.000] ],
69 '3GeV_v15a' : [ [0,9.9], [ 3.000] ],
70 '4GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.86, 3.77, 3.69, 3.70] ],
71 '5GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 4.9, 4.8, 4.8, 4.8] ],
72 '6GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 5.87, 5.79, 5.70, 5.62] ],
73 '7GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 6.8, 6.7, 6.7, 6.6] ],
74 '8GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 7.80, 7.72, 7.59, 7.46] ],
75 '10GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 9.73, 9.63, 9.45, 9.24] ],
76 '11GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 10.8, 10.4, 10.6, 10.6] ],
77 '12GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 11.7, 11.3, 11.4, 11.5] ],
78 '13GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 12.62, 12.48, 12.24, 11.88] ],
79 '14GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 13.57, 13.44, 13.21, 12.77] ],
80 '15GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 14.50, 14.00, 14.00, 14.50] ],
81 '16GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 15.47, 15.09, 14.98, 15.08] ], # Lidia - extrapolated not optimized
82 '18GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 17.41, 17.27, 16.95, 16.25] ],
83 '20GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 16.50, 19.19, 18.80, 17.00] ], # new
84 '22GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 18.70, 21.07, 19.13, 18.80] ], # new
85 '23GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 18.70, 21.07, 19.13, 18.80] ], # new
86 '24GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 18.10, 21.07, 18.60, 19.35] ], # new
87 '25GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 24.20, 23.20, 23.20, 22.60] ],
88 '26GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 21.50, 21.07, 20.22, 19.65] ], # new
89 '27GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 26.20, 25.10, 25.10, 24.40] ],
90 '28GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 18.30, 21.07, 20.77, 20.00] ], # new
91 '30GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 18.80, 21.00, 21.00, 20.10] ], # new
92 '32GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 16.50, 22.50, 20.00, 21.50] ], # new
93 '34GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 18.40, 24.10, 21.45, 23.00] ], # new
94 '35GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 17.40, 25.90, 23.40, 23.80] ], # new
95 '36GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 16.90, 25.60, 24.20, 24.00] ], # new
96 '38GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 35.80, 35.40, 35.40, 33.60] ],
97 '40GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 13.20, 27.90, 27.30, 27.60] ], # new
98 '40GeV_slow_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 40.00, 40.00, 40.00, 40.00] ],
99 '45GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 17.70, 33.10, 31.60, 33.30] ], # new
100 '48GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 14.00, 33.80, 34.20, 35.90] ], # new
101 '50GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 8.30, 33.55, 32.40, 37.70] ], # new
102 '60GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 45.0, 45.0, 45.0, 45.0] ],
103 '60GeV_slow_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 47.0, 47.0, 47.0, 47.0] ],
104 '70GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 49.0, 49.0, 49.0, 49.0] ],
105 '80GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 56.0, 56.0, 56.0, 56.0] ],
106 '100GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 70.0, 70.0, 70.0, 70.0] ],
107
108 '5GeV_v16' : [ [0,1.05,1.5,2.0,9.9], [ 4.9, 4.8, 4.8, 4.8] ],
109 '8GeV_v16' : [ [0,1.05,1.5,2.0,9.9], [ 7.8, 7.7, 7.7, 7.7] ],
110 '10GeV_v16' : [ [0,1.05,1.5,2.0,9.9], [ 9.8, 9.5, 9.6, 9.7] ],
111 '15GeV_v16' : [ [0,1.05,1.5,2.0,9.9], [ 14.50, 14.00, 14.00, 14.50] ],
112 '20GeV_v16' : [ [0,1.05,1.5,2.0,9.9], [ 19.31, 19.19, 18.80, 17.95] ],
113 '25GeV_v16' : [ [0,1.05,1.5,2.0,9.9], [ 24.2, 23.2, 23.2, 22.6] ],
114 '30GeV_v16' : [ [0,1.05,1.5,2.0,9.9], [ 29.0, 28.0, 28.0, 27.0] ],
115 '50GeV_v16' : [ [0,1.05,1.5,2.0,9.9], [ 40.0, 40.0, 40.0, 40.0] ],
116 }
117
118trigMuonEFSAThresholds = {
119 # added for Run3 low-mu 2mu3
120 '3GeV_v22a' : [ [0,9.9], [ 1.0 ] ],
121 #
122 '0GeV' : [ [0,9.9], [ 0.100 ] ],
123 '2GeV' : [ [0,9.9], [ 2.000 ] ],
124 '3GeV' : [ [0,9.9], [ 3.000 ] ],
125 '4GeV' : [ [0,1.05,1.5,2.0,9.9], [ 3.0, 2.5, 2.5, 2.5] ],
126 '4GeV_barrelOnly' : [ [0,1.05,1.5,2.0,9.9], [ 3.0,1000.0,1000.0,1000.0]],
127 '5GeV' : [ [0,1.05,1.5,2.0,9.9], [ 4.6, 3.3, 4.0, 4.5] ],
128 '6GeV' : [ [0,1.05,1.5,2.0,9.9], [ 5.4, 4.5, 4.9, 5.3] ],
129 '7GeV' : [ [0,1.05,1.5,2.0,9.9], [ 6.3, 5.6, 5.6, 6.3] ],
130 '8GeV' : [ [0,1.05,1.5,2.0,9.9], [ 7.2, 6.7, 6.4, 7.3] ],
131 '10GeV' : [ [0,1.05,1.5,2.0,9.9], [ 8.9, 9.0, 8.4, 9.2] ],
132 '11GeV' : [ [0,1.05,1.5,2.0,9.9], [ 9.8, 10.1, 9.3, 10.1] ],
133 '12GeV' : [ [0,1.05,1.5,2.0,9.9], [ 10.6, 11.0, 10.2, 11.0] ],
134 '13GeV' : [ [0,1.05,1.5,2.0,9.9], [ 11.4, 12.0, 11.1, 12.0] ],
135 '14GeV' : [ [0,1.05,1.5,2.0,9.9], [ 12.2, 13.0, 12.1, 13.0] ],
136 '15GeV' : [ [0,1.05,1.5,2.0,9.9], [ 13.0, 14.0, 13.0, 14.0] ],
137 '16GeV' : [ [0,1.05,1.5,2.0,9.9], [ 13.0, 14.0, 13.0, 14.0] ], # not optimized
138 '18GeV' : [ [0,1.05,1.5,2.0,9.9], [ 15.7, 16.6, 15.4, 16.3] ],
139 '20GeV' : [ [0,1.05,1.5,2.0,9.9], [ 18.20, 16.50, 17.00, 18.00] ], # new
140 '22GeV' : [ [0,1.05,1.5,2.0,9.9], [ 20.20, 18.00, 17.00, 19.00] ], # new
141 '23GeV' : [ [0,1.05,1.5,2.0,9.9], [ 21.20, 18.75, 17.80, 19.60] ], # new
142 '24GeV' : [ [0,1.05,1.5,2.0,9.9], [ 22.20, 19.50, 18.60, 20.20] ], # new
143 '26GeV' : [ [0,1.05,1.5,2.0,9.9], [ 23.50, 21.00, 20.15, 22.00] ], # new
144 '28GeV' : [ [0,1.05,1.5,2.0,9.9], [ 23.40, 21.00, 20.55, 22.50] ], # new
145 '30GeV' : [ [0,1.05,1.5,2.0,9.9], [ 25.20, 22.10, 21.70, 24.40] ], # new
146 '32GeV' : [ [0,1.05,1.5,2.0,9.9], [ 27.05, 20.50, 22.30, 26.12] ], # new
147 '34GeV' : [ [0,1.05,1.5,2.0,9.9], [ 28.90, 22.00, 24.00, 27.88] ], # new
148 '35GeV' : [ [0,1.05,1.5,2.0,9.9], [ 30.00, 20.90, 24.90, 28.85] ], # new
149 '36GeV' : [ [0,1.05,1.5,2.0,9.9], [ 30.50, 23.77, 26.40, 28.00] ], # new
150 '40GeV' : [ [0,1.05,1.5,2.0,9.9], [ 33.00, 27.30, 30.50, 32.90] ], # new
151 '40GeV_barrelOnly' : [ [0,1.05,1.5,2.0,9.9], [ 31.50,1000.0,1000.0,1000.0] ],
152 '40GeV_uptoEC2' : [ [0,1.05,1.5,2.0,9.9], [ 31.50, 30.00, 28.50, 1000.0] ],
153 '45GeV' : [ [0,1.05,1.5,2.0,9.9], [ 41.20, 31.90, 35.10, 37.50] ], # new
154 '48GeV' : [ [0,1.05,1.5,2.0,9.9], [ 43.00, 34.45, 38.00, 40.30] ], # new
155 '50GeV' : [ [0,1.05,1.5,2.0,9.9], [ 40.00, 36.30, 40.00, 42.10] ], # new
156 '50GeV_barrelOnly' : [ [0,1.05,1.5,2.0,9.9], [ 45.0,1000.0,1000.0,1000.0]],
157 '60GeV' : [ [0,1.05,1.5,2.0,9.9], [ 54.0, 54.0, 54.0, 54.0] ],
158 '60GeV_barrelOnly' : [ [0,1.05,1.5,2.0,9.9], [ 54.0,1000.0,1000.0,1000.0]],
159 '70GeV' : [ [0,1.05,1.5,2.0,9.9], [ 63.0, 63.0, 63.0, 63.0] ],
160 '80GeV' : [ [0,1.05,1.5,2.0,9.9], [ 72.0, 72.0, 72.0, 72.0] ],
161 '100GeV' : [ [0,1.05,1.5,2.0,9.9], [ 90.0, 90.0, 90.0, 90.0] ],
162 }
163
164efCombinerThresholds = {
165 #
166 # added for Run3 low-mu 2mu3
167 '3GeV_v22a' : [ [0,1.05,1.5,2.0,9.9], [ 2.94, 2.91, 2.77, 2.72] ],
168 # original + 2015 tuning
169 '2GeV_v15a' : [ [0,9.9], [2.000] ],
170 '3GeV_v15a' : [ [0,9.9], [3.000] ],
171 '4GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.94, 3.91, 3.77, 3.72] ],
172 '5GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 4.91, 4.86, 4.84, 4.83] ],
173 '6GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 5.92, 5.86, 5.70, 5.64] ],
174 '7GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 6.85, 6.77, 6.74, 6.74] ],
175 '8GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 7.89, 7.81, 7.60, 7.53] ],
176 '10GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 9.84, 9.77, 9.54, 9.47] ],
177 '11GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 10.74, 10.64, 10.58, 10.53] ],
178 '12GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 11.70, 11.59, 11.53, 11.49] ],
179 '13GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 12.80, 12.67, 12.43, 12.38] ],
180 '14GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 13.75, 13.62, 13.38, 13.36] ],
181 '15GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 14.63, 14.49, 14.42, 14.38] ],
182 '16GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 15.65, 15.50, 15.39, 15.37] ], # Lidia - extrapolated not optimized
183 '18GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 17.68, 17.51, 17.34, 17.34] ],
184 '20GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 19.65, 19.50, 19.20, 19.30] ], # new
185 '22GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 21.64, 21.32, 21.30, 21.30] ], # new
186 '23GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 22.59, 22.27, 22.25, 22.27] ], # new
187 '24GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 23.55, 23.21, 23.20, 23.25] ], # new
188 '26GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 25.60, 25.15, 25.20, 25.20] ], # new
189 '27GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 26.26, 26.12, 26.11, 26.02] ],
190 '28GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 27.28, 27.09, 27.15, 27.20] ], # new
191 '30GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 29.20, 29.00, 29.00, 29.00] ], # new
192 '32GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 31.20, 30.95, 30.90, 30.84] ], # new
193 '34GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 33.16, 32.88, 32.80, 32.70] ], # new
194 '35GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 34.15, 33.82, 33.65, 33.65] ], # new
195 '36GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 35.23, 34.75, 34.50, 34.60] ], # new
196 '38GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 36.87, 36.67, 36.55, 36.48] ],
197 '40GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 38.80, 38.56, 38.40, 38.90] ], # new
198 '45GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 43.75, 43.30, 43.10, 43.90] ], # new
199 '48GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 46.50, 46.20, 46.00, 46.80] ], # new
200 '50GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 48.00, 48.20, 48.00, 48.80] ], # new
201 '60GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 54.00, 54.00, 54.00, 54.00] ],
202 '70GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 63.00, 63.00, 63.00, 63.00] ],
203 '80GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 72.00, 72.00, 72.00, 72.00] ],
204 '100GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 90.00, 90.00, 90.00, 90.00] ],
205 }
206
207
208muFastThresholdsForECWeakBRegion = {
209 #
210 # added for Run3 low-mu 2mu3
211 '3GeV_v22a' : [ 0.1, 0.1 ],
212 # 2011a tuning + 2015 tuning
213 '4GeV_v15a' : [ 2.72, 1.58],
214 '4GeV_barrelOnly_v15a' : [ 1000., 1000. ],
215 '6GeV_v15a' : [ 3.91, 2.22],
216 '8GeV_v15a' : [ 4.65, 3.26],
217 '10GeV_v15a' : [ 5.96, 4.24],
218 #not optimized: ATR-20049
219 '11GeV_v15a' : [ 6.19, 4.37 ],
220 '13GeV_v15a' : [ 6.65, 4.64 ],
221 '14GeV_v15a' : [ 6.78, 5.03 ],
222 '15GeV_v15a' : [ 7.61, 7.81 ],
223 '18GeV_v15a' : [ 8.48, 7.26 ],
224 '20GeV_v15a' : [ 8.63, 7.26 ],
225 '22GeV_v15a' : [ 9.53, 7.77 ],
226 '23GeV_v15a' : [ 9.53, 7.77 ],
227 '24GeV_v15a' : [ 9.02, 8.31 ],
228 '26GeV_v15a' : [ 9.89, 8.77 ],
229 '28GeV_v15a' : [ 9.89, 8.77 ], # copy of 26
230 '30GeV_v15a' : [ 14.41, 17.43 ],
231 '32GeV_v15a' : [ 14.41, 17.43 ], # copy of 30
232 '34GeV_v15a' : [ 14.41, 17.43 ], # copy of 30
233 '35GeV_v15a' : [ 14.41, 17.43 ], # copy of 30
234 '36GeV_v15a' : [ 10.78, 10.66 ],
235 '40GeV_v15a' : [ 15.07, 18.02 ],
236 '45GeV_v15a' : [ 15.07, 18.02 ], # copy of 40
237 '48GeV_v15a' : [ 15.07, 18.02 ], # copy of 50
238 '50GeV_v15a' : [ 15.07, 18.02 ], # lixia, not optimized
239 '60GeV_v15a' : [ 15.07, 18.02 ],
240 '80GeV_v15a' : [ 15.07, 18.02 ],
241 '40GeV_uptoEC2_v15a' : [ 15.07, 18.02 ],
242 '40GeV_barrelOnly_v15a' : [ 1000., 1000. ],
243 '50GeV_barrelOnly_v15a' : [ 1000., 1000. ],
244 '60GeV_barrelOnly_v15a' : [ 1000., 1000. ],
245 }
246
247
248# Working points for EF track isolation algorithm
249# syntax is:
250# 'WPname' : cut on 0.3 cone
251# put < 0 for no cut
252trigMuonEFTrkIsoThresholds = {
253 'ivarloose' : 0.16, #ivarloose
254 'ivarmedium' : 0.07, #ivarmedium
255 'ivartight' : 0.06, #ivartight
256 'ivarverytight' : 0.04, #ivarverytight
257 'iloosems' : 3000.0 #ms-only iso
258 }
259
260trigMuonLrtd0Cut = {
261 'd0loose' : 2.0,
262 'd0medium' : 3.0,
263 'd0tight' : 5.0
264 }
265
266#Possible dimuon mass window cuts
267#Fomat is [lower bound, upper bound] in GeV
268# <0 for no cut
269trigMuonEFInvMassThresholds = {
270 'invmJPsiOS' : [2.5, 4.3],
271 'invmDimu' : [1.5, 14.],
272 'idZmumu' : [50., 130.],
273 'idJpsimumu' : [1., 5.],
274}
275
276# Monitoring groups to monitor
277muonHypoMonGroups = ['muonMon:online']
278idHypoMonGroups = ['idMon:t0','idMon:shifter']
279
280def getThresholdsFromDict( chainDict ):
281 cparts = [i for i in chainDict['chainParts'] if i['signature']=='Muon' or i['signature']=='Bphysics']
282 return sum( [ [part['threshold']]*int(part['multiplicity']) for part in cparts ], [])
283
284
285def TrigMufastHypoAlgCfg(flags, name="UNSPECIFIED", **kwargs):
286 return CompFactory.TrigMufastHypoAlg(name, **kwargs)
287
288def TrigMufastHypoToolFromDict(flags, chainDict):
289
290 chainPart = chainDict['chainParts'][0]
291
292 doOverlapRemoval = False
293 if chainPart['signature'] == 'Bphysics' or 'l2io' in chainPart['l2AlgInfo']:
294 doOverlapRemoval = False
295 elif int(chainPart['multiplicity']) > 1:
296 doOverlapRemoval = True
297 elif len(chainDict['signatures']) > 1 and not chainPart['extra']:
298 doOverlapRemoval = True
299
300 doMonitoring = monitorAll or any(group in muonHypoMonGroups for group in chainDict['monGroups'])
301
302 config = TrigMufastHypoToolConfig(chainDict['chainName'], chainPart, chainDict['eventBuildType'], doOverlapRemoval, doMonitoring)
303 config.compile(flags)
304 return config.tool()
305
306
308 def __init__(self, name, cpart, eventBuildType, doOverlapRemoval = False, doMonitoring = False):
309
310 from AthenaCommon.Logging import logging
311 self.__log = logging.getLogger('TrigMufastHypoToolConfig')
312 self.__name = name
313
314 self.__threshold = int(cpart['threshold'])
315 self.__multiplicity = int(cpart['multiplicity'])
316 self.__isPassThrough = 'mucombTag' in cpart['extra']
317 self.__isCalibration = 'muoncalib' in cpart['extra']
318 self.__isMuonDSCalibration = 'MuonDS' in eventBuildType
319 self.__isBarrelOnly = '0eta105' in cpart['etaRange']
320 self.__useGeV_v15a = any(x in cpart['addInfo'] for x in ['idperf', 'idtp', '3layersEC'])
321 self.__doL2MT = 'l2mt' in cpart['l2AlgInfo']
322 self.__doOverlapRemoval = doOverlapRemoval
323 self.__doMonitoring = doMonitoring
324
325 from AthenaConfiguration.ComponentFactory import CompFactory
326 tool = CompFactory.TrigMufastHypoTool(name)
327 self.__tool = tool
328
329 def multiplicity(self):
330 return self.__multiplicity
331
332 def tool(self):
333 return self.__tool
334
335 def toolName(self):
336 return self.__name
337
338 def log(self):
339 return self.__log
340
341 def isPassThrough(self):
342 return self.__isPassThrough
343
344 def isCalibration(self):
345 return self.__isCalibration
346
348 return self.__isMuonDSCalibration
349
350 def isBarrelOnly(self):
351 return self.__isBarrelOnly
352
353 def useGeV_v15a(self):
354 return self.__useGeV_v15a or self.getThresholdValue() < 5
355
356 def doMonitoring(self):
357 return self.__doMonitoring
358
359 def doL2MT(self):
360 return self.__doL2MT
361
363 return self.__doOverlapRemoval
364
366 return self.__threshold
367
369 threshold = str(self.getThresholdValue())
370 key = '6GeV_v15a'
371 if self.useGeV_v15a():
372 key = threshold + 'GeV_v15a'
373 if self.getThresholdValue() == 3:
374 key = threshold + 'GeV_v22a'
375 elif self.isBarrelOnly():
376 key = threshold + 'GeV_barrelOnly_v15a'
377 elif self.getThresholdValue() >= 20:
378 key = threshold + 'GeV_v15a'
379 return key
380
382 self.tool().ApplyOR = True
383 # cut defintion
384 self.tool().RequireDR = True
385 self.tool().RequireMass = True
386 self.tool().RequireSameSign = True
387 # BB
388 self.tool().DRThresBB = 0.05
389 self.tool().MassThresBB = 0.20
390 # BE
391 self.tool().DRThresBE = 0.05
392 self.tool().MassThresBE = 0.20
393 # EE
394 self.tool().EtaBinsEC = [0.0, 1.9, 2.1, 9.9]
395 self.tool().DRThresEC = [0.06, 0.05, 0.05]
396 self.tool().MassThresEC = [0.20, 0.15, 0.10]
397
398 def setL2MT(self):
399 self.tool().ApplyOR = True
400 # cut defintion
401 self.tool().RequireDR = True
402 self.tool().RequireMass = True
403 self.tool().RequireSameSign = True
404 # BB
405 self.tool().DRThresBB = 0.05
406 self.tool().MassThresBB = 0.20
407 # BE
408 self.tool().DRThresBE = 0.05
409 self.tool().MassThresBE = 0.20
410 # EE
411 self.tool().EtaBinsEC = [0.0, 1.9, 2.1, 9.9]
412 self.tool().DRThresEC = [0.06, 0.05, 0.05]
413 self.tool().MassThresEC = [0.20, 0.15, 0.10]
414
415 def compile(self, flags):
416
417 nt = self.multiplicity()
418
419 if self.isCalibration():
420 if self.isMuonDSCalibration():
421 self.tool().AcceptAll = True
422 else:
423 self.tool().AcceptAll = False
424 self.tool().DoCalib = True
425 self.tool().PtBins = [ [ 0.0, 2.5 ] ] * nt
426
427 elif self.isPassThrough():
428 self.tool().AcceptAll = True
429 self.tool().PtBins = [ [-10000.,10000.] ]
430 self.tool().PtThresholds = [ [ -1. * GeV ] ]
431 self.tool().PtThresholdForECWeakBRegionA = [ 3. * GeV ]
432 self.tool().PtThresholdForECWeakBRegionB = [ 3. * GeV ]
433
434 else:
435 if(nt==0): # for zero multiplicity
436 nt = 1
437 self.log().debug('Set %d thresholds', nt)
438 self.tool().AcceptAll = False
439 self.tool().PtBins = [ [ 0.0, 2.5 ] ] * nt
440 self.tool().PtThresholds = [ [ 5.49 * GeV ] ] * nt
441 self.tool().PtThresholdForECWeakBRegionA = [ 3. * GeV ] * nt
442 self.tool().PtThresholdForECWeakBRegionB = [ 3. * GeV ] * nt
443
444 thvaluename = self.getThresholdName()
445
446 for th in range(nt):
447 try:
448 values = muFastThresholds[thvaluename]
449 self.tool().PtBins[th] = values[0]
450 self.tool().PtThresholds[th] = [ x * GeV for x in values[1] ]
451 self.log().debug('Configration of threshold[%d] %s', th, self.tool().PtThresholds[th])
452 self.log().debug('Configration of PtBins[%d] %s', th, self.tool().PtBins[th])
453 if thvaluename in muFastThresholdsForECWeakBRegion:
454 spThres = muFastThresholdsForECWeakBRegion[thvaluename]
455 self.tool().PtThresholdForECWeakBRegionA[th] = spThres[0] * GeV
456 self.tool().PtThresholdForECWeakBRegionB[th] = spThres[1] * GeV
457 else:
458 self.log().debug('No special thresholds for EC weak Bfield regions for %s. Copy EC1 for region A, EC2 for region B.', thvaluename)
459 spThres = values[0][1]
460 if thvaluename == '2GeV' or thvaluename == '3GeV':
461 self.tool().PtThresholdForECWeakBRegionA[th] = spThres[0] * GeV
462 self.tool().PtThresholdForECWeakBRegionB[th] = spThres[0] * GeV
463 else:
464 self.tool().PtThresholdForECWeakBRegionA[th] = spThres[1] * GeV
465 self.tool().PtThresholdForECWeakBRegionB[th] = spThres[2] * GeV
466
467 self.log().debug('Thresholds for A[%d]/B[%d] = %d/%d', th, th, self.tool().PtThresholdForECWeakBRegionA[th], self.tool().PtThresholdForECWeakBRegionB[th])
468
469 except LookupError:
470 raise Exception('MuFast Hypo Misconfigured: threshold %r not supported' % thvaluename)
471
472 if self.doL2MT():
473 self.setL2MT()
474 elif self.doOverlapRemoval():
475 self.setOverlapRemoval()
476
477 if self.doMonitoring():
478 if self.doOverlapRemoval():
479 from TrigMuonHypo.TrigMuonHypoMonitoring import TrigL2MuonOverlapRemoverMonitoringMufast
480 self.tool().MonTool = TrigL2MuonOverlapRemoverMonitoringMufast(flags, 'TrigMufastHypoTool/' + self.toolName())
481 else:
482 from TrigMuonHypo.TrigMuonHypoMonitoring import TrigMufastHypoMonitoring
483 self.tool().MonTool = TrigMufastHypoMonitoring(flags, 'TrigMufastHypoTool/' + self.toolName())
484
485
486def TrigmuCombHypoAlgCfg(flags, name="UNSPECIFIED", **kwargs):
487 return CompFactory.TrigmuCombHypoAlg(name, **kwargs)
488
489def TrigmuCombHypoToolFromDict( flags, chainDict ):
490
491 if 'idperf' in chainDict['chainParts'][0]['addInfo'] or 'idtp' in chainDict['chainParts'][0]['addInfo'] :
492 thresholds = ['passthrough']
493 elif chainDict['chainParts'][0]['multiplicity']=="0":
494 thresholds = [chainDict['chainParts'][0]['threshold']]
495 else:
496 thresholds = getThresholdsFromDict( chainDict )
497
498 config = TrigmuCombHypoConfig()
499
500 tight = False # can be probably decoded from some of the proprties of the chain, expert work
501
502 acceptAll = False
503
504 if 'mucombTag' in chainDict['chainParts'][0]['extra']:
505 domuCombTag = True
506 else:
507 domuCombTag = False
508
509 if chainDict['chainParts'][0]['signature'] == 'Bphysics':
510 acceptAll = True
511
512 tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds, tight, acceptAll, domuCombTag )
513
514 if monitorAll:
515 tool.MonTool = TrigmuCombHypoMonitoring(flags, "TrigmuCombHypoTool/"+chainDict['chainName'])
516 else:
517 if any(group in muonHypoMonGroups for group in chainDict['monGroups']):
518 tool.MonTool = TrigmuCombHypoMonitoring(flags, "TrigmuCombHypoTool/"+chainDict['chainName'])
519
520 d0cut=0.
521 if 'd0loose' in chainDict['chainParts'][0]['lrtInfo']:
522 d0cut=trigMuonLrtd0Cut['d0loose']
523 elif 'd0medium' in chainDict['chainParts'][0]['lrtInfo']:
524 d0cut=trigMuonLrtd0Cut['d0medium']
525 elif 'd0tight' in chainDict['chainParts'][0]['lrtInfo']:
526 d0cut=trigMuonLrtd0Cut['d0tight']
527 tool.MinimumD0=d0cut
528
529 return tool
530
531
532def TrigmuCombHypoToolwORFromDict( flags, chainDict ):
533
534 if 'idperf' in chainDict['chainParts'][0]['addInfo'] or 'idtp' in chainDict['chainParts'][0]['addInfo'] :
535 thresholds = ['passthrough']
536 elif chainDict['chainParts'][0]['multiplicity']=="0":
537 thresholds = [chainDict['chainParts'][0]['threshold']]
538 else:
539 thresholds = getThresholdsFromDict( chainDict )
540
541 config = TrigmuCombHypoConfig()
542
543 tight = False # can be probably decoded from some of the proprties of the chain, expert work
544
545 acceptAll = False
546 if 'mucombTag' in chainDict['chainParts'][0]['extra']:
547 domuCombTag = True
548 else:
549 domuCombTag = False
550
551 tool = config.ConfigurationHypoTool( chainDict['chainName'], thresholds, tight, acceptAll, domuCombTag )
552
553 if monitorAll:
554 tool.MonTool = TrigL2MuonOverlapRemoverMonitoringMucomb(flags, "TrigmuCombHypoTool/"+chainDict['chainName'])
555 else:
556 if any(group in muonHypoMonGroups for group in chainDict['monGroups']):
557 tool.MonTool = TrigL2MuonOverlapRemoverMonitoringMucomb(flags, "TrigmuCombHypoTool/"+chainDict['chainName'])
558
559 # Overlap Removal
560 tool.ApplyOR = True
561 tool.RequireDR = True
562 tool.RequireMufastDR = True
563 tool.RequireMass = True
564 tool.RequireSameSign = True
565 tool.EtaBins = [0, 0.9, 1.1, 1.9, 2.1, 9.9]
566 tool.DRThres = [0.002, 0.001, 0.002, 0.002, 0.002]
567 tool.MufastDRThres = [0.4, 0.4, 0.4, 0.4, 0.4]
568 tool.MassThres = [0.004, 0.002, 0.006, 0.006, 0.006]
569
570 return tool
571
572
573# muComb Hypo for L2 inside-out
574def Trigl2IOHypoToolwORFromDict( flags, chainDict ):
575
576 thresholds = getThresholdsFromDict( chainDict )
577 if chainDict['chainParts'][0]['multiplicity']=="0":
578 thresholds = [chainDict['chainParts'][0]['threshold']]
579
580 config = TrigmuCombHypoConfig()
581
582 tight = False # can be probably decoded from some of the proprties of the chain, expert work
583
584 acceptAll = False
585 domuCombTag=False
586
587 tool=config.ConfigurationHypoTool( chainDict['chainName'], thresholds, tight, acceptAll, domuCombTag )
588
589 # Overlap Removal
590 tool.ApplyOR = True
591 tool.RequireDR = True
592 tool.RequireMufastDR = False
593 tool.RequireMass = True
594 tool.RequireSameSign = True
595 tool.EtaBins = [0, 0.9, 1.1, 1.9, 2.1, 9.9]
596 tool.DRThres = [0.002, 0.001, 0.002, 0.002, 0.002]
597 tool.MufastDRThres = [0]
598 tool.MassThres = [0.004, 0.002, 0.006, 0.006, 0.006]
599
600 return tool
601
602
603# muComb Hypo for L2 multi-track SA mode
604def Trigl2mtCBHypoToolwORFromDict( flags, chainDict ):
605
606 if 'idperf' in chainDict['chainParts'][0]['addInfo'] or 'idtp' in chainDict['chainParts'][0]['addInfo'] :
607 thresholds = ['passthrough']
608 elif chainDict['chainParts'][0]['multiplicity']=="0":
609 thresholds = [chainDict['chainParts'][0]['threshold']]
610 else:
611 thresholds = getThresholdsFromDict( chainDict )
612
613 config = TrigmuCombHypoConfig()
614
615 tight = False # can be probably decoded from some of the proprties of the chain, expert work
616
617 acceptAll = False
618 domuCombTag = False
619
620 tool=config.ConfigurationHypoTool( chainDict['chainName'], thresholds, tight, acceptAll, domuCombTag )
621
622 # Overlap Removal
623 tool.ApplyOR = True
624 tool.RequireDR = True
625 tool.RequireMufastDR = True
626 tool.RequireMass = True
627 tool.RequireSameSign = True
628 tool.EtaBins = [0, 0.9, 1.1, 1.9, 2.1, 9.9]
629 tool.DRThres = [0.002, 0.001, 0.002, 0.002, 0.002]
630 tool.MufastDRThres = [0.4, 0.4, 0.4, 0.4, 0.4]
631 tool.MassThres = [0.004, 0.002, 0.006, 0.006, 0.006]
632
633 return tool
634
635
637
638 log = logging.getLogger('TrigmuCombHypoConfig')
639
640 def ConfigurationHypoTool( self, thresholdHLT, thresholds, tight, acceptAll, domuCombTag ):
641
642 tool = CompFactory.TrigmuCombHypoTool( thresholdHLT )
643 tool.AcceptAll = acceptAll
644
645 nt = len(thresholds)
646 log.debug('Set %d thresholds', nt)
647 tool.PtBins = [ [ 0.0, 2.5 ] ] * nt
648 tool.PtThresholds = [ [ 5.83 * GeV ] ] * nt
649
650 for th, thvalue in enumerate(thresholds):
651 if thvalue == 'passthrough':
652 tool.AcceptAll = True
653 tool.PtBins[th] = [-10000.,10000.]
654 tool.PtThresholds[th] = [ -1. * GeV ]
655 else:
656 # 15.03.2022: original flow, commented to allow use of the new HLT algo thresholds
657 #if int(thvalue) >= 24:
658 # thvaluename = '22GeV_v15a'
659 #else:
660 # thvaluename = thvalue + 'GeV_v15a'
661 if domuCombTag:
662 thvaluename = thvalue + 'GeV_v16'
663 else:
664 thvaluename = thvalue + 'GeV_v15a'
665
666 if int(thvalue)==3:
667 thvaluename = thvalue + 'GeV_v22a'
668 log.debug('Number of threshold = %d, Value of threshold = %s', th, thvaluename)
669
670 try:
671 values = muCombThresholds[thvaluename]
672 tool.PtBins[th] = values[0]
673 tool.PtThresholds[th] = [ x * GeV for x in values[1] ]
674 if (tight is True):
675 tool.ApplyPikCuts = True
676 tool.MaxPtToApplyPik = 25.
677 tool.MaxChi2IDPik = 3.5
678 except LookupError:
679 raise Exception('MuComb Hypo Misconfigured: threshold %r not supported' % thvaluename)
680
681 return tool
682
683def TrigMuonEFHypoAlgCfg(flags, name="UNSPECIFIED", **kwargs):
684 return CompFactory.TrigMuonEFHypoAlg(name, **kwargs)
685
686
687def TrigMuonEFMSonlyHypoToolFromDict( flags, chainDict ) :
688 thresholds = getThresholdsFromDict( chainDict )
689 if chainDict['chainParts'][0]['multiplicity']=="0":
690 thresholds = [chainDict['chainParts'][0]['threshold']]
691 kwargs={}
692 kwargs.setdefault("RequireSAMuons",True)
693 if 'msonly' in chainDict['chainParts'][0]['msonlyInfo'] and 'noL1' not in chainDict['chainParts'][0]['extra']:
694 kwargs.setdefault("RemoveOverlaps",True)
695
696
697 if monitorAll:
698 monTool = TrigMuonEFHypoMonitoring(flags, "TrigMuonEFMSonlyHypoTool/"+chainDict['chainName'])
699 kwargs.setdefault("MonTool", monTool)
700 else:
701 if any(group in muonHypoMonGroups for group in chainDict['monGroups']):
702 monTool = TrigMuonEFHypoMonitoring(flags, "TrigMuonEFMSonlyHypoTool/"+chainDict['chainName'])
703 kwargs.setdefault("MonTool", monTool)
704 if '3layersEC' in chainDict['chainParts'][0]['addInfo']:
705 kwargs.setdefault("RequireThreeStations", True)
706 muonflags = flags.cloneAndReplace('Muon', 'Trigger.Offline.SA.Muon')
707 if muonflags.Muon.runCommissioningChain:
708 kwargs.setdefault("RunCommissioningChain",True)
709
710
711 if 'nscan10' in chainDict['chainParts'][0]['addInfo']:
712 conesize = 0.1
713 narrowscan = True
714 elif 'nscan20' in chainDict['chainParts'][0]['addInfo']:
715 conesize = 0.2
716 narrowscan = True
717 elif 'nscan30' in chainDict['chainParts'][0]['addInfo']:
718 conesize = 0.3
719 narrowscan = True
720 elif 'nscan40' in chainDict['chainParts'][0]['addInfo']:
721 conesize = 0.4
722 narrowscan = True
723 elif 'nscan' in chainDict['chainParts'][0]['addInfo']:
724 conesize = 0.5
725 narrowscan = True
726 else:
727 narrowscan = False
728 conesize = 0.0
729
730 kwargs.setdefault("ConeSize", conesize)
731 kwargs.setdefault("NarrowScan", narrowscan)
732
733 return TrigMuonEFHypoToolCfg( chainDict['chainName'], thresholds, doSA=True, **kwargs )
734
735def TrigMuonEFMSonlyHypoToolFromName( flags, chainDict):
736 #For full scan chains, we need to configure the thresholds based on all muons
737 #in the chain to get the counting correct.
738 thresholds=[]
739 chainName = chainDict["chainName"]
740 hltChainName = chainName.rsplit("_L1",1)[0]
741 cparts = hltChainName.split("_")
742
743 if 'HLT' in hltChainName:
744 cparts.remove('HLT')
745 for part in cparts:
746 if 'mu' in part:
747 thrPart = part.split('mu')
748 if not thrPart[0] or thrPart[0] == "0":
749 mult = 1
750 else:
751 mult=thrPart[0]
752 thr = thrPart[1]
753 if 'noL1' in part:
754 thr =thr.replace('noL1','')
755 for i in range(1,int(mult)+1):
756 thresholds.append(thr)
757
758 monTool=None
759 if monitorAll:
760 monTool = TrigMuonEFHypoMonitoring(flags, "TrigMuonEFMSonlyHypoTool/"+chainDict['chainName'])
761 else:
762 if any(group in muonHypoMonGroups for group in chainDict['monGroups']):
763 monTool = TrigMuonEFHypoMonitoring(flags, "TrigMuonEFMSonlyHypoTool/"+chainDict['chainName'])
764
765 if 'nscan10' in chainDict['chainParts'][0]['addInfo']:
766 conesize = 0.1
767 narrowscan = True
768 elif 'nscan20' in chainDict['chainParts'][0]['addInfo']:
769 conesize = 0.2
770 narrowscan = True
771 elif 'nscan30' in chainDict['chainParts'][0]['addInfo']:
772 conesize = 0.3
773 narrowscan = True
774 elif 'nscan40' in chainDict['chainParts'][0]['addInfo']:
775 conesize = 0.4
776 narrowscan = True
777 elif 'nscan' in chainDict['chainParts'][0]['addInfo']:
778 conesize = 0.5
779 narrowscan = True
780 else:
781 narrowscan = False
782 conesize = 0.0
783
784
785 return TrigMuonEFHypoToolCfg( chainDict['chainName'], thresholds, doSA=True, MonTool=monTool, RequireSAMuons=True, NarrowScan=narrowscan, ConeSize=conesize)
786
787def TrigMuonEFHypoToolCfg(name, thresholds, doSA=False, **kwargs):
788
789
790 log = logging.getLogger(name)
791
792 nt = len(thresholds)
793 log.debug('Set %d thresholds', nt)
794 PtBins = [ [ 0.0, 2.5 ] ] * nt
795 PtThresholds = [ [ 5.49 * GeV ] ] * nt
796 passthrough=False
797 for th, thvalue in enumerate(thresholds):
798 if (thvalue=='passthrough'):
799 passthrough = True
800 PtBins[th] = [-10000.,10000.]
801 PtThresholds[th] = [ -1. * GeV ]
802 else:
803 if "0eta105" in name:
804 thvaluename = thvalue+ "GeV_barrelOnly"
805 else:
806 if int(thvalue)==3:
807 thvaluename = thvalue + 'GeV_v22a'
808 else:
809 if doSA:
810 thvaluename = thvalue + 'GeV'
811 else:
812 thvaluename = thvalue + 'GeV_v15a'
813 log.debug('Number of threshold = %d, Value of threshold = %s', th, thvaluename)
814
815 if doSA:
816 values = trigMuonEFSAThresholds[thvaluename]
817 else:
818 values = efCombinerThresholds[thvaluename]
819 PtBins[th] = values[0]
820 PtThresholds[th] = [ x * GeV for x in values[1] ]
821
822
823 kwargs.setdefault("AcceptAll", passthrough)
824 kwargs.setdefault("PtBins", PtBins)
825 kwargs.setdefault("PtThresholds", PtThresholds)
826 return CompFactory.TrigMuonEFHypoTool(name, **kwargs)
827
828
829def TrigMuonEFCombinerHypoToolFromDict( flags, chainDict ) :
830 if 'idperf' in chainDict['chainParts'][0]['addInfo'] or 'idtp' in chainDict['chainParts'][0]['addInfo']:
831 thresholds = ['passthrough']
832 elif chainDict['chainParts'][0]['multiplicity']=="0":
833 thresholds = [chainDict['chainParts'][0]['threshold']]
834 else:
835 thresholds = getThresholdsFromDict( chainDict )
836
837 if 'muonqual' in chainDict['chainParts'][0]['addInfo']:
838 muonquality = True
839 else:
840 muonquality = False
841
842 if 'nscan10' in chainDict['chainParts'][0]['addInfo']:
843 conesize = 0.1
844 narrowscan = True
845 elif 'nscan20' in chainDict['chainParts'][0]['addInfo']:
846 conesize = 0.2
847 narrowscan = True
848 elif 'nscan30' in chainDict['chainParts'][0]['addInfo']:
849 conesize = 0.3
850 narrowscan = True
851 elif 'nscan40' in chainDict['chainParts'][0]['addInfo']:
852 conesize = 0.4
853 narrowscan = True
854 elif 'nscan' in chainDict['chainParts'][0]['addInfo']:
855 conesize = 0.5
856 narrowscan = True
857 else:
858 narrowscan = False
859 conesize = 0.0
860
861 if 'noL1' not in chainDict['chainParts'][0]['extra']:
862 overlap=True
863 else:
864 overlap=False
865
866 monTool=None
867 if monitorAll:
868 monTool = TrigMuonEFHypoMonitoring(flags, "TrigMuonEFCombinerHypoTool/"+chainDict['chainName'])
869 else:
870 if any(group in muonHypoMonGroups for group in chainDict['monGroups']):
871 monTool = TrigMuonEFHypoMonitoring(flags, "TrigMuonEFCombinerHypoTool/"+chainDict['chainName'])
872
873 d0cut=0.
874 if 'd0loose' in chainDict['chainParts'][0]['lrtInfo']:
875 d0cut=trigMuonLrtd0Cut['d0loose']
876 elif 'd0medium' in chainDict['chainParts'][0]['lrtInfo']:
877 d0cut=trigMuonLrtd0Cut['d0medium']
878 elif 'd0tight' in chainDict['chainParts'][0]['lrtInfo']:
879 d0cut=trigMuonLrtd0Cut['d0tight']
880
881
882 tool = TrigMuonEFHypoToolCfg(chainDict['chainName'], thresholds, doSA=False, MuonQualityCut=muonquality, MonTool=monTool,
883 NarrowScan=narrowscan, RemoveOverlaps=overlap, ConeSize=conesize, MinimumD0=d0cut)
884
885 return tool
886
888 #For full scan chains, we need to configure the thresholds based on all muons
889 #in the chain to get the counting correct. Currently a bit convoluted as
890 #the chain dict is (improperly) overwritten when merging for FS chains.
891 #Can probably improve this once serial merging is officially implemented
892 thresholds=[]
893 chainName = chainDict["chainName"]
894 hltChainName = chainName.rsplit("_L1",1)[0]
895 cparts = hltChainName.split("_")
896 if 'HLT' in hltChainName:
897 cparts.remove('HLT')
898 for part in cparts:
899 if 'mu' in part:
900 thrPart = part.split('mu')
901 if not thrPart[0] or thrPart[0] == "0":
902 mult = 1
903 else:
904 mult=thrPart[0]
905 thr = thrPart[1]
906 if 'noL1' in part:
907 thr =thr.replace('noL1','')
908 for i in range(1,int(mult)+1):
909 thresholds.append(thr)
910 if 'nscan10' in chainDict['chainParts'][0]['addInfo']:
911 conesize = 0.1
912 narrowscan = True
913 elif 'nscan20' in chainDict['chainParts'][0]['addInfo']:
914 conesize = 0.2
915 narrowscan = True
916 elif 'nscan30' in chainDict['chainParts'][0]['addInfo']:
917 conesize = 0.3
918 narrowscan = True
919 elif 'nscan40' in chainDict['chainParts'][0]['addInfo']:
920 conesize = 0.4
921 narrowscan = True
922 if 'nscan' in chainDict['chainParts'][0]['addInfo']:
923 conesize = 0.5
924 narrowscan = True
925 else:
926 narrowscan = False
927 conesize = 0.0
928
929 if 'muonqual' in chainDict['chainParts'][0]['addInfo']:
930 muonquality = True
931 else:
932 muonquality = False
933
934 monTool=None
935 if monitorAll:
936 monTool = TrigMuonEFHypoMonitoring(flags, "TrigMuonEFCombinerHypoTool/"+chainDict['chainName'])
937 else:
938 if any(group in muonHypoMonGroups for group in chainDict['monGroups']):
939 monTool = TrigMuonEFHypoMonitoring(flags, "TrigMuonEFCombinerHypoTool/"+chainDict['chainName'])
940
941 tool = TrigMuonEFHypoToolCfg(chainDict['chainName'], thresholds, doSA=False, MuonQualityCut=muonquality, MonTool=monTool,
942 NarrowScan=narrowscan, ConeSize=conesize)
943
944 return tool
945
946
947
949 cparts = [i for i in chainDict['chainParts'] if i['signature']=='Muon']
950 if 'ivarperf' in chainDict['chainParts'][0]['isoInfo']:
951 thresholds = 'passthrough'
952 else:
953 thresholds = cparts[0]['isoInfo']
954
955 tool = TrigMuonEFTrackIsolationHypoCfg(flags, chainDict['chainName'], thresholds)
956
957
958 if monitorAll:
959 tool.MonTool = TrigMuonEFTrackIsolationMonitoring(flags, 'TrigMuonEFTrackIsolationHypoTool/'+chainDict['chainName'])
960 else:
961 if any(group in muonHypoMonGroups for group in chainDict['monGroups']):
962 tool.MonTool = TrigMuonEFTrackIsolationMonitoring(flags, 'TrigMuonEFTrackIsolationHypoTool/'+chainDict['chainName'])
963
964 return tool
965
966def TrigMuonEFTrackIsolationHypoCfg(flags, name, isoCut, **kwargs) :
967
968
969 if(isoCut=='passthrough') :
970 kwargs.setdefault("AcceptAll", True)
971
972 else:
973 ptcone03 = trigMuonEFTrkIsoThresholds[ isoCut ]
974
975 kwargs.setdefault("PtCone02Cut", 0.0)
976 kwargs.setdefault("PtCone03Cut", ptcone03)
977 kwargs.setdefault("AcceptAll", False)
978
979 if 'ms' in isoCut:
980 kwargs.setdefault("RequireCombinedMuon", False)
981 kwargs.setdefault("DoAbsCut", True)
982 else:
983 kwargs.setdefault("RequireCombinedMuon", True)
984 kwargs.setdefault("DoAbsCut", False)
985
986
987 if 'var' in isoCut :
988 kwargs.setdefault("useVarIso", True)
989 else :
990 kwargs.setdefault("useVarIso", False)
991
992 tool = CompFactory.TrigMuonEFTrackIsolationHypoTool(name, **kwargs)
993 return tool
994
995def TrigMuonEFTrackIsolationHypoAlgCfg(flags, name="TrigMuonEFTrackIsolationHypoAlg", **kwargs):
996 return CompFactory.TrigMuonEFTrackIsolationHypoAlg(name, **kwargs)
997
998def TrigMuonEFInvMassHypoToolFromDict( flags, chainDict ) :
999 cparts = [i for i in chainDict['chainParts'] if i['signature']=='Muon']
1000 #The invariant mass is specified at end of chain, so only shows up in the last chainPart
1001 thresholds = cparts[-1]['invMassInfo']
1002 if "os" in cparts[-1]['addInfo']:
1003 osCut=True
1004 else:
1005 osCut = False
1006
1007 tool = TrigMuonEFInvMassHypoCfg( flags, chainDict['chainName'], thresholds, SelectOppositeSign=osCut )
1008
1009 if monitorAll:
1010 tool.MonTool = TrigMuonEFInvMassHypoMonitoring(flags, "TrigMuonEFInvMassHypoTool/"+chainDict['chainName'])
1011 else:
1012 if any(group in muonHypoMonGroups for group in chainDict['monGroups']):
1013 tool.MonTool = TrigMuonEFInvMassHypoMonitoring(flags, "TrigMuonEFInvMassHypoTool/"+chainDict['chainName'])
1014
1015 return tool
1016
1017def TrigMuonEFInvMassHypoCfg(flags, toolName, thresholds, **kwargs):
1018
1019 massWindow = trigMuonEFInvMassThresholds[thresholds]
1020
1021 kwargs.setdefault("InvMassLow", massWindow[0])
1022 kwargs.setdefault("InvMassHigh", massWindow[1])
1023 kwargs.setdefault("AcceptAll", False)
1024
1025 tool = CompFactory.TrigMuonEFInvMassHypoTool(toolName, **kwargs)
1026 return tool
1027
1028def TrigMuonEFIdtpHypoToolFromDict( flags, chainDict ) :
1029 thresholds = getThresholdsFromDict( chainDict )
1030 monTool=None
1031 if any(group in idHypoMonGroups for group in chainDict['monGroups']):
1032 monTool = TrigMuonEFIdtpHypoMonitoring(flags, "TrigMuonEFIdtpHypoTool/"+chainDict['chainName'])
1033 tool = TrigMuonEFIdtpHypoCfg( chainDict['chainName'], thresholds, MonTool=monTool )
1034 return tool
1035
1036
1037def TrigMuonEFIdtpHypoCfg(name, thresholds, **kwargs):
1038
1039 log = logging.getLogger(name)
1040
1041 nt = len(thresholds)
1042 log.debug('Set %d thresholds', nt)
1043 ptBins = [ [ 0, 2.5 ] ] * nt
1044 ptThresholds = [ [ 5.49 * GeV ] ] * nt
1045 for th, thvalue in enumerate(thresholds):
1046 thvaluename = thvalue + 'GeV'
1047 if int(thvalue)==3:
1048 thvaluename = thvalue + 'GeV_v22a'
1049 log.debug('Number of threshold = %d, Value of threshold = %s', th, thvaluename)
1050 if (thvalue=='passthrough'):
1051 ptBins[th] = [-10000.,10000.]
1052 ptThresholds[th] = [ -1. * GeV ]
1053 else:
1054 values = trigMuonEFSAThresholds[thvaluename]
1055 ptBins[th] = values[0]
1056 ptThresholds[th] = [ x * GeV for x in values[1] ]
1057
1058
1059 if (thvalue=='passthrough'):
1060 kwargs.setdefault("AcceptAll", True)
1061 else:
1062 kwargs.setdefault("AcceptAll", False)
1063
1064 kwargs.setdefault("PtBins", ptBins)
1065 kwargs.setdefault("PtThresholds", ptThresholds)
1066
1067
1068 return CompFactory.TrigMuonEFIdtpHypoTool( name, **kwargs )
1069
1071 cname = chainDict['chainName']
1072 if 'idZmumu' in cname :
1073 thresholds = 'idZmumu'
1074 elif 'idJpsimumu' in cname :
1075 thresholds = 'idJpsimumu'
1076 else :
1077 log.warning("unknown chain name for IdtpInvmassHypo, chain name= %s, setting threshold of Z mass",cname)
1078 thresholds = 'idZmumu'
1079
1080 tool = TrigMuonEFIdtpInvMassHypoCfg( chainDict['chainName'], thresholds )
1081
1082 if any(group in idHypoMonGroups for group in chainDict['monGroups']):
1083 tool.MonTool = TrigMuonEFIdtpInvMassHypoMonitoring(flags, "TrigMuonEFIdtpInvMassHypoTool/"+chainDict['chainName'])
1084
1085 return tool
1086
1087def TrigMuonEFIdtpInvMassHypoCfg(name, thresholds, **kwargs) :
1088
1089 massWindow = trigMuonEFInvMassThresholds[thresholds]
1090 kwargs.setdefault("InvMassLow", massWindow[0])
1091 kwargs.setdefault("InvMassHigh", massWindow[1])
1092 kwargs.setdefault("AcceptAll", False)
1093
1094 return CompFactory.TrigMuonEFIdtpInvMassHypoTool(name, **kwargs)
1095
1096
1097def TrigMuonEFIdtpHypoAlgCfg(flags, name="TrigMuonEFIdtpHypoAlg", **kwargs):
1098 return CompFactory.TrigMuonEFIdtpHypoAlg(name, **kwargs)
1099
1100def TrigMuonLateMuRoIHypoAlgCfg(flags, name="TrigMuRoIHypoAlg", **kwargs):
1101 return CompFactory.TrigMuonLateMuRoIHypoAlg(name, **kwargs)
1102
1104 tool = TrigMuonLateMuRoIHypoCfg(flags, chainDict['chainName'])
1105 return tool
1106
1107def TrigMuonLateMuRoIHypoCfg(flags, name="TrigMuRoIHypoTool") :
1108
1109 tool = CompFactory.TrigMuonLateMuRoIHypoTool(name, AcceptAll=False)
1110 return tool
if(febId1==febId2)
const bool debug
__init__(self, name, cpart, eventBuildType, doOverlapRemoval=False, doMonitoring=False)
ConfigurationHypoTool(self, thresholdHLT, thresholds, tight, acceptAll, domuCombTag)
TrigMuonEFTrackIsolationHypoAlgCfg(flags, name="TrigMuonEFTrackIsolationHypoAlg", **kwargs)
TrigMuonEFInvMassHypoCfg(flags, toolName, thresholds, **kwargs)
TrigmuCombHypoAlgCfg(flags, name="UNSPECIFIED", **kwargs)
TrigMuonEFIdtpHypoAlgCfg(flags, name="TrigMuonEFIdtpHypoAlg", **kwargs)
TrigMuonEFIdtpInvMassHypoCfg(name, thresholds, **kwargs)
TrigMuonLateMuRoIHypoCfg(flags, name="TrigMuRoIHypoTool")
TrigmuCombHypoToolFromDict(flags, chainDict)
TrigMuonEFIdtpHypoToolFromDict(flags, chainDict)
TrigMuonEFInvMassHypoToolFromDict(flags, chainDict)
TrigMuonEFIdtpHypoCfg(name, thresholds, **kwargs)
TrigMuonEFIdtpInvMassHypoToolFromDict(flags, chainDict)
TrigMuonEFHypoAlgCfg(flags, name="UNSPECIFIED", **kwargs)
TrigmuCombHypoToolwORFromDict(flags, chainDict)
TrigMuonEFMSonlyHypoToolFromName(flags, chainDict)
TrigMuonLateMuRoIHypoToolFromDict(flags, chainDict)
TrigMuonLateMuRoIHypoAlgCfg(flags, name="TrigMuRoIHypoAlg", **kwargs)
Trigl2IOHypoToolwORFromDict(flags, chainDict)
TrigMuonEFMSonlyHypoToolFromDict(flags, chainDict)
TrigMufastHypoToolFromDict(flags, chainDict)
Trigl2mtCBHypoToolwORFromDict(flags, chainDict)
TrigMuonEFHypoToolCfg(name, thresholds, doSA=False, **kwargs)
TrigMufastHypoAlgCfg(flags, name="UNSPECIFIED", **kwargs)
TrigMuonEFCombinerHypoToolFromDict(flags, chainDict)
TrigMuonEFTrackIsolationHypoCfg(flags, name, isoCut, **kwargs)
TrigMuonEFCombinerHypoToolFromName(flags, chainDict)
TrigMuonEFTrackIsolationHypoToolFromDict(flags, chainDict)