ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfData
src
L1Threshold.cxx
Go to the documentation of this file.
1
/* Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration */
2
3
#include "
TrigConfData/L1Threshold.h
"
4
#include "
TrigConfData/L1ThrExtraInfo.h
"
5
#include <charconv>
6
#include <stdexcept>
7
8
9
/******************************************
10
*
11
* Legacy L1Calo thresholds
12
*
13
******************************************/
14
18
void
19
TrigConf::L1Threshold_EM::load
(){
20
// read the isolation
21
if
(
const
auto
& thrVs =
data
().get_child_optional(
"thrValues"
) ) {
22
for
(
auto
&
x
: thrVs.get() ) {
23
auto
isobits =
x
.second.get_child(
"isobits"
).get_value<std::string>();
24
auto
etamin =
x
.second.get_child(
"etamin"
).get_value<
unsigned
int
>();
25
auto
etamax =
x
.second.get_child(
"etamax"
).get_value<
unsigned
int
>();
26
auto
priority =
x
.second.get_child(
"priority"
).get_value<
unsigned
int
>();
27
// turn bin string into uint, e.g. "01001" -> 9
28
uint16_t isomask(0);
29
auto
[ptr, ec] = std::from_chars(isobits.data(),
30
isobits.data() + isobits.size(), isomask, 2);
31
if
(ec != std::errc{} || ptr != isobits.data() + isobits.size()) {
32
throw
std::invalid_argument(
"Invalid isobits value: "
+ isobits);
33
}
34
m_isolationMask
.addRangeValue(isomask, etamin, etamax, priority,
/*symmetric=*/
false
);
35
}
36
}
37
}
38
39
void
40
TrigConf::L1Threshold_EM::print
(std::ostream & os)
const
{
41
os <<
"EM threshold "
<<
name
() <<
" with mapping "
<<
mapping
() << std::endl;
42
for
(
int
eta
= -49;
eta
<49;
eta
++ ) {
43
auto
value =
thrValue
(
eta
);
44
auto
valueMeV =
thrValueMeV
(
eta
);
45
auto
counts =
thrValueCounts
(
eta
);
46
auto
value100MeV =
thrValue100MeV
(
eta
);
47
auto
iso =
isolationMask
(
eta
);
48
os <<
" eta = "
<<
eta
<<
" : "
<< value <<
" GeV "
<< valueMeV <<
" MeV "
<< value100MeV <<
" 100MeV "
49
<< counts <<
" counts , isoMaks "
<< iso << std::endl;
50
}
51
}
52
56
void
57
TrigConf::L1Threshold_TAU::load
(){
58
const
std::string isobits =
getAttribute
(
"isobits"
);
59
auto
[ptr, ec] = std::from_chars(isobits.data(),
60
isobits.data() + isobits.size(),
61
m_isolationMask
,
62
2);
63
if
(ec != std::errc{} || ptr != isobits.data() + isobits.size()) {
64
throw
std::invalid_argument(
"Invalid isobits value: "
+ isobits);
65
}
66
}
67
71
void
72
TrigConf::L1Threshold_JET::load
()
73
{
74
// allowed values for eta-range boundaries are 0, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5, 1.7, 1.9, 2.1, 2.3, 2.5, 2.8, 3.1, 4.9 and their negatives
75
76
static
const
std::vector<int> allowedBoundaries{0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 28, 31, 49};
77
if
(
const
auto
& thrVs =
data
().get_child_optional(
"thrValues"
) ) {
78
for
(
auto
&
x
: thrVs.get() ) {
79
auto
etamin =
x
.second.get_child(
"etamin"
).get_value<
int
>();
80
// will be re-enabled once we have the faulty configurations in the TriggerDB removed
81
// if(std::find(begin(allowedBoundaries), end(allowedBoundaries), abs(etamin)) == allowedBoundaries.end()) {
82
// throw std::runtime_error(name() + ": etamin value " + std::to_string(etamin) + " not an allowed value for legacy JETs");
83
// }
84
auto
etamax =
x
.second.get_child(
"etamax"
).get_value<
int
>();
85
// will be re-enabled once we have the faulty configurations in the TriggerDB removed
86
// if(std::find(begin(allowedBoundaries), end(allowedBoundaries), abs(etamax)) == allowedBoundaries.end()) {
87
// throw std::runtime_error(name() + ": etamax value " + std::to_string(etamax) + " not an allowed value for legacy JETs");
88
// }
89
auto
priority =
x
.second.get_child(
"priority"
).get_value<
unsigned
int
>();
90
auto
window
=
x
.second.get_child(
"window"
).get_value<
unsigned
int
>();
91
m_etaDepWindow
.addRangeValue(
window
, etamin, etamax, priority,
/*symmetric=*/
false
);
92
}
93
}
94
}
95
unsigned
int
96
TrigConf::L1Threshold_JET::window
(
int
eta
)
const
{
97
return
m_etaDepWindow
.at(
eta
);
98
}
99
103
void
104
TrigConf::L1Threshold_ZB::load
()
105
{
106
m_seed
=
getAttribute
(
"seed"
);
107
m_seedBcdelay
=
getAttribute<unsigned int>
(
"seedBcdelay"
);
108
m_seedMultiplicity
=
getAttribute<unsigned int>
(
"seedMultiplicity"
);
109
}
110
114
void
115
TrigConf::L1Threshold_ZBTopo::load
()
116
{
117
m_mask0
=
getAttribute<unsigned int>
(
"mask0"
);
118
m_mask1
=
getAttribute<unsigned int>
(
"mask1"
);
119
m_mask2
=
getAttribute<unsigned int>
(
"mask2"
);
120
m_mask3
=
getAttribute<unsigned int>
(
"mask3"
);
121
m_mask4
=
getAttribute<unsigned int>
(
"mask4"
);
122
m_mask5
=
getAttribute<unsigned int>
(
"mask5"
);
123
124
m_seedBcdelay
=
getAttribute<unsigned int>
(
"delay"
);
125
126
}
127
128
/******************************************
129
*
130
* New L1Calo thresholds
131
*
132
******************************************/
133
134
void
135
TrigConf::L1Threshold_eEM::load
()
136
{
137
// read the isolation requirements
138
m_reta
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"reta"
).value_or(
"None"
));
139
m_rhad
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"rhad"
).value_or(
"None"
));
140
m_wstot
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"wstot"
).value_or(
"None"
));
141
// reject TOBs outside explicitly defined eta ranges
142
// by requiring an impossibly high threshold
143
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
144
}
145
146
void
147
TrigConf::L1Threshold_jEM::load
()
148
{
149
// read the isolation requirements
150
m_iso
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"iso"
).value_or(
"None"
));
151
m_frac
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"frac"
).value_or(
"None"
));
152
m_frac2
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"frac2"
).value_or(
"None"
));
153
// reject TOBs outside explicitly defined eta ranges
154
// by requiring an impossibly high threshold
155
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
156
}
157
158
void
159
TrigConf::L1Threshold_eTAU::load
()
160
{
161
// read the isolation requirements
162
m_rCore
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"rCore"
).value_or(
"None"
));
163
m_rHad
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"rHad"
).value_or(
"None"
));
164
// Correction for older L1 menus which used the HAD WPs that don't fit in L1Topo bits
165
// This will result in no rHad isolation being applied, but there were no
166
// active L1 items (eTAU40HA threshold defined but unused) -- ATR-25329
167
if
(
m_rHad
==
Selection::WP::HADMEDIUM
) {
m_rHad
=
Selection::WP::MEDIUM
;}
168
// reject TOBs outside explicitly defined eta ranges
169
// by requiring an impossibly high threshold
170
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
171
}
172
173
const
std::shared_ptr<TrigConf::L1ThrExtraInfo_jTAU>
174
TrigConf::L1Threshold_jTAU::getExtraInfo
()
const
175
{
176
return
dynamic_pointer_cast<TrigConf::L1ThrExtraInfo_jTAU>(
m_extraInfo
.lock());
177
}
178
179
void
180
TrigConf::L1Threshold_jTAU::load
()
181
{
182
// read the isolation requirements
183
m_isolation
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"isolation"
).value_or(
"None"
));
184
// reject TOBs outside explicitly defined eta ranges
185
// by requiring an impossibly high threshold
186
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
187
}
188
189
const
std::shared_ptr<TrigConf::L1ThrExtraInfo_cTAU>
190
TrigConf::L1Threshold_cTAU::getExtraInfo
()
const
191
{
192
return
dynamic_pointer_cast<TrigConf::L1ThrExtraInfo_cTAU>(
m_extraInfo
.lock());
193
}
194
195
void
196
TrigConf::L1Threshold_cTAU::load
()
197
{
198
// read the isolation requirements
199
m_isolation
=
Selection::stringToWP
(
getAttribute_optional<std::string>
(
"isolation"
).value_or(
"None"
));
200
// reject TOBs outside explicitly defined eta ranges
201
// by requiring an impossibly high threshold
202
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
203
}
204
205
void
206
TrigConf::L1Threshold_jJ::load
()
207
{
208
// reject TOBs outside explicitly defined eta ranges
209
// by requiring an impossibly high threshold
210
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
211
}
212
213
void
214
TrigConf::L1Threshold_jLJ::load
()
215
{
216
// reject TOBs outside explicitly defined eta ranges
217
// by requiring an impossibly high threshold
218
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
219
}
220
221
void
222
TrigConf::L1Threshold_gJ::load
()
223
{
224
// reject TOBs outside explicitly defined eta ranges
225
// by requiring an impossibly high threshold
226
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
227
}
228
229
void
230
TrigConf::L1Threshold_gLJ::load
()
231
{
232
// reject TOBs outside explicitly defined eta ranges
233
// by requiring an impossibly high threshold
234
m_etaDepThrValue
.setOutsideRangeValue(
getAttribute
(
"maxValue"
,
true
, 14000000));
235
}
236
237
void
238
TrigConf::L1Threshold_jXE::load
()
239
{}
240
241
void
242
TrigConf::L1Threshold_jTE::load
()
243
{}
244
245
void
246
TrigConf::L1Threshold_gXE::load
()
247
{}
248
249
void
250
TrigConf::L1Threshold_gTE::load
()
251
{}
252
253
/******************************************
254
*
255
* Muon threshold
256
*
257
******************************************/
258
262
float
263
TrigConf::L1Threshold_MU::thrValue
(
int
)
const
264
{
265
return
static_cast<
float
>
(
m_ptBarrel
);
266
}
267
268
void
269
TrigConf::L1Threshold_MU::load
()
270
{
271
auto
muInfo = std::dynamic_pointer_cast<L1ThrExtraInfo_MU>(
m_extraInfo
.lock());
272
273
m_ptBarrel
=
getAttribute<unsigned int>
(
"baThr"
);
274
m_ptEndcap
=
getAttribute<unsigned int>
(
"ecThr"
);
275
m_ptForward
=
getAttribute<unsigned int>
(
"fwThr"
);
276
m_idxBarrel
= muInfo->rpcIdxForPt(
m_ptBarrel
);
277
m_idxEndcap
= muInfo->tgcIdxForPt(
m_ptEndcap
);
278
m_idxForward
= muInfo->tgcIdxForPt(
m_ptForward
);
279
280
m_rpcExclROIList
=
getAttribute
(
"rpcExclROIList"
,
true
,
""
);
281
m_tgcFlags
=
getAttribute
(
"tgcFlags"
);
282
m_rpcFlags
=
getAttribute_optional<std::string>
(
"rpcFlags"
).value_or(
""
);
283
m_region
=
getAttribute
(
"region"
);
284
}
285
286
287
288
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
L1ThrExtraInfo.h
L1Threshold.h
x
#define x
TrigConf::DataStructure::data
const ptree & data() const
Access to the underlying data, if needed.
Definition
DataStructure.h:83
TrigConf::DataStructure::getAttribute_optional
std::optional< T > getAttribute_optional(const std::string &key) const
Definition
DataStructure.h:165
TrigConf::DataStructure::getAttribute
T getAttribute(const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
Access to simple attribute.
Definition
DataStructure.h:152
TrigConf::L1Threshold_Calo::thrValue
virtual float thrValue(int eta=0) const override
Accessor to the threshold value for eta-dependent threholds.
Definition
L1ThresholdBase.cxx:272
TrigConf::L1Threshold_Calo::m_etaDepThrValue
ValueWithEtaDependence< unsigned int > m_etaDepThrValue
eta-dependent threshold value in MeV
Definition
L1ThresholdBase.h:255
TrigConf::L1Threshold_Calo::thrValueMeV
virtual unsigned int thrValueMeV(int eta=0) const
Definition
L1ThresholdBase.cxx:289
TrigConf::L1Threshold_Calo::thrValueCounts
virtual unsigned int thrValueCounts(int eta=0) const
Definition
L1ThresholdBase.cxx:278
TrigConf::L1Threshold_Calo::thrValue100MeV
virtual unsigned int thrValue100MeV(int eta=0) const
as above above but in 100 MeV
Definition
L1ThresholdBase.cxx:284
TrigConf::L1Threshold_EM::isolationMask
uint16_t isolationMask(int eta) const
Definition
L1Threshold.h:29
TrigConf::L1Threshold_EM::print
void print(std::ostream &os=std::cout) const override
Definition
L1Threshold.cxx:40
TrigConf::L1Threshold_EM::m_isolationMask
ValueWithEtaDependence< uint16_t > m_isolationMask
Definition
L1Threshold.h:38
TrigConf::L1Threshold_EM::load
void load()
EM.
Definition
L1Threshold.cxx:19
TrigConf::L1Threshold_JET::m_etaDepWindow
ValueWithEtaDependence< unsigned int > m_etaDepWindow
eta-dependent threshold value in MeV
Definition
L1Threshold.h:73
TrigConf::L1Threshold_JET::load
void load()
JET.
Definition
L1Threshold.cxx:72
TrigConf::L1Threshold_JET::window
unsigned int window(int eta=0) const
Definition
L1Threshold.cxx:96
TrigConf::L1Threshold_MU::m_ptForward
unsigned int m_ptForward
Definition
L1Threshold.h:437
TrigConf::L1Threshold_MU::m_idxBarrel
unsigned int m_idxBarrel
Definition
L1Threshold.h:438
TrigConf::L1Threshold_MU::thrValue
float thrValue(int eta=0) const override
this function is only to satisfy the base class interface.
Definition
L1Threshold.cxx:263
TrigConf::L1Threshold_MU::m_idxEndcap
unsigned int m_idxEndcap
Definition
L1Threshold.h:439
TrigConf::L1Threshold_MU::m_region
std::string m_region
comma-separated list of BA, EC, FW or the string ALL
Definition
L1Threshold.h:442
TrigConf::L1Threshold_MU::load
void load()
Definition
L1Threshold.cxx:269
TrigConf::L1Threshold_MU::m_idxForward
unsigned int m_idxForward
Definition
L1Threshold.h:440
TrigConf::L1Threshold_MU::m_tgcFlags
std::string m_tgcFlags
a logical expression like 'F & C | F & H | C & H'
Definition
L1Threshold.h:443
TrigConf::L1Threshold_MU::m_rpcFlags
std::string m_rpcFlags
a logical expression like 'M'
Definition
L1Threshold.h:444
TrigConf::L1Threshold_MU::m_ptBarrel
unsigned int m_ptBarrel
Definition
L1Threshold.h:435
TrigConf::L1Threshold_MU::m_ptEndcap
unsigned int m_ptEndcap
Definition
L1Threshold.h:436
TrigConf::L1Threshold_MU::m_rpcExclROIList
std::string m_rpcExclROIList
a string sepcifying the list of ROIs to be excluded (the lists are defined in the extraInfo_MU)
Definition
L1Threshold.h:445
TrigConf::L1Threshold_TAU::load
void load()
TAU.
Definition
L1Threshold.cxx:57
TrigConf::L1Threshold_TAU::m_isolationMask
uint16_t m_isolationMask
Definition
L1Threshold.h:57
TrigConf::L1Threshold_ZBTopo::m_mask2
unsigned int m_mask2
Definition
L1Threshold.h:142
TrigConf::L1Threshold_ZBTopo::m_mask1
unsigned int m_mask1
Definition
L1Threshold.h:141
TrigConf::L1Threshold_ZBTopo::m_mask5
unsigned int m_mask5
Definition
L1Threshold.h:145
TrigConf::L1Threshold_ZBTopo::m_mask3
unsigned int m_mask3
Definition
L1Threshold.h:143
TrigConf::L1Threshold_ZBTopo::m_seedBcdelay
unsigned int m_seedBcdelay
Definition
L1Threshold.h:146
TrigConf::L1Threshold_ZBTopo::load
void load()
ZBTopo.
Definition
L1Threshold.cxx:115
TrigConf::L1Threshold_ZBTopo::m_mask0
unsigned int m_mask0
Definition
L1Threshold.h:140
TrigConf::L1Threshold_ZBTopo::m_mask4
unsigned int m_mask4
Definition
L1Threshold.h:144
TrigConf::L1Threshold_ZB::m_seed
std::string m_seed
Definition
L1Threshold.h:118
TrigConf::L1Threshold_ZB::m_seedMultiplicity
unsigned int m_seedMultiplicity
Definition
L1Threshold.h:120
TrigConf::L1Threshold_ZB::m_seedBcdelay
unsigned int m_seedBcdelay
Definition
L1Threshold.h:119
TrigConf::L1Threshold_ZB::load
void load()
ZB.
Definition
L1Threshold.cxx:104
TrigConf::L1Threshold_cTAU::m_isolation
Selection::WP m_isolation
Definition
L1Threshold.h:277
TrigConf::L1Threshold_cTAU::load
void load()
Definition
L1Threshold.cxx:196
TrigConf::L1Threshold_cTAU::getExtraInfo
const std::shared_ptr< L1ThrExtraInfo_cTAU > getExtraInfo() const
Definition
L1Threshold.cxx:190
TrigConf::L1Threshold_eEM::m_rhad
Selection::WP m_rhad
Definition
L1Threshold.h:190
TrigConf::L1Threshold_eEM::m_reta
Selection::WP m_reta
Definition
L1Threshold.h:189
TrigConf::L1Threshold_eEM::load
void load()
Definition
L1Threshold.cxx:135
TrigConf::L1Threshold_eEM::m_wstot
Selection::WP m_wstot
Definition
L1Threshold.h:191
TrigConf::L1Threshold_eTAU::m_rHad
Selection::WP m_rHad
Definition
L1Threshold.h:235
TrigConf::L1Threshold_eTAU::load
void load()
Definition
L1Threshold.cxx:159
TrigConf::L1Threshold_eTAU::m_rCore
Selection::WP m_rCore
Definition
L1Threshold.h:234
TrigConf::L1Threshold_gJ::load
void load()
Definition
L1Threshold.cxx:222
TrigConf::L1Threshold_gLJ::load
void load()
Definition
L1Threshold.cxx:230
TrigConf::L1Threshold_gTE::load
void load()
Definition
L1Threshold.cxx:250
TrigConf::L1Threshold_gXE::load
void load()
Definition
L1Threshold.cxx:246
TrigConf::L1Threshold_jEM::load
void load()
Definition
L1Threshold.cxx:147
TrigConf::L1Threshold_jEM::m_frac2
Selection::WP m_frac2
Definition
L1Threshold.h:214
TrigConf::L1Threshold_jEM::m_iso
Selection::WP m_iso
Definition
L1Threshold.h:212
TrigConf::L1Threshold_jEM::m_frac
Selection::WP m_frac
Definition
L1Threshold.h:213
TrigConf::L1Threshold_jJ::load
void load()
Definition
L1Threshold.cxx:206
TrigConf::L1Threshold_jLJ::load
void load()
Definition
L1Threshold.cxx:214
TrigConf::L1Threshold_jTAU::load
void load()
Definition
L1Threshold.cxx:180
TrigConf::L1Threshold_jTAU::getExtraInfo
const std::shared_ptr< L1ThrExtraInfo_jTAU > getExtraInfo() const
Definition
L1Threshold.cxx:174
TrigConf::L1Threshold_jTAU::m_isolation
Selection::WP m_isolation
Definition
L1Threshold.h:256
TrigConf::L1Threshold_jTE::load
void load()
Definition
L1Threshold.cxx:242
TrigConf::L1Threshold_jXE::load
void load()
Definition
L1Threshold.cxx:238
TrigConf::L1Threshold::mapping
unsigned int mapping() const
Accessor to the mapping number The mapping is unique within a type.
Definition
L1ThresholdBase.h:163
TrigConf::L1Threshold::m_extraInfo
std::weak_ptr< L1ThrExtraInfoBase > m_extraInfo
Definition
L1ThresholdBase.h:177
TrigConf::Selection::WP::HADMEDIUM
@ HADMEDIUM
Definition
L1ThresholdBase.h:299
TrigConf::Selection::WP::MEDIUM
@ MEDIUM
Definition
L1ThresholdBase.h:298
TrigConf::Selection::stringToWP
static WP stringToWP(const std::string &)
Definition
L1ThresholdBase.cxx:405
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0