ATLAS Offline Software
Loading...
Searching...
No Matches
L1Threshold.cxx
Go to the documentation of this file.
1/* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */
2
5
6
7/******************************************
8 *
9 * Legacy L1Calo thresholds
10 *
11 ******************************************/
12
16void
18{
19 // read the isolation
20 if( const auto & thrVs = data().get_child_optional("thrValues") ) {
21 for( auto & x : thrVs.get() ) {
22 auto isobits = x.second.get_child("isobits").get_value<std::string>();
23 auto etamin = x.second.get_child("etamin").get_value<unsigned int>();
24 auto etamax = x.second.get_child("etamax").get_value<unsigned int>();
25 auto priority = x.second.get_child("priority").get_value<unsigned int>();
26 // turn bin string into uint, e.g. "01001" -> 9
27 uint16_t isomask(0);
28 for(char c: isobits) {
29 isomask <<= 1;
30 if(c=='1') isomask += 1;
31 }
32 m_isolationMask.addRangeValue(isomask, etamin, etamax, priority, /*symmetric=*/ false);
33 }
34 }
35}
36
37void
38TrigConf::L1Threshold_EM::print(std::ostream & os) const {
39 os << "EM threshold " << name() << " with mapping " << mapping() << std::endl;
40 for( int eta = -49; eta<49; eta++ ) {
41 auto value = thrValue(eta);
42 auto valueMeV = thrValueMeV(eta);
43 auto counts = thrValueCounts(eta);
44 auto value100MeV = thrValue100MeV(eta);
45 auto iso = isolationMask(eta);
46 os << " eta = " << eta << " : " << value << " GeV " << valueMeV << " MeV " << value100MeV << " 100MeV "
47 << counts << " counts , isoMaks " << iso << std::endl;
48 }
49}
50
54void
56{
57 // read the isolation
58 std::string isobits = getAttribute("isobits");
60 for(char c: isobits) {
61 m_isolationMask <<= 1;
62 if(c=='1') m_isolationMask += 1;
63 }
64}
65
69void
71{
72 // 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
73
74 static const std::vector<int> allowedBoundaries{0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 28, 31, 49};
75 if( const auto & thrVs = data().get_child_optional("thrValues") ) {
76 for( auto & x : thrVs.get() ) {
77 auto etamin = x.second.get_child("etamin").get_value<int>();
78 // will be re-enabled once we have the faulty configurations in the TriggerDB removed
79 // if(std::find(begin(allowedBoundaries), end(allowedBoundaries), abs(etamin)) == allowedBoundaries.end()) {
80 // throw std::runtime_error(name() + ": etamin value " + std::to_string(etamin) + " not an allowed value for legacy JETs");
81 // }
82 auto etamax = x.second.get_child("etamax").get_value<int>();
83 // will be re-enabled once we have the faulty configurations in the TriggerDB removed
84 // if(std::find(begin(allowedBoundaries), end(allowedBoundaries), abs(etamax)) == allowedBoundaries.end()) {
85 // throw std::runtime_error(name() + ": etamax value " + std::to_string(etamax) + " not an allowed value for legacy JETs");
86 // }
87 auto priority = x.second.get_child("priority").get_value<unsigned int>();
88 auto window = x.second.get_child("window").get_value<unsigned int>();
89 m_etaDepWindow.addRangeValue(window, etamin, etamax, priority, /*symmetric=*/ false);
90 }
91 }
92}
93unsigned int
97
101void
108
112void
125
126/******************************************
127 *
128 * New L1Calo thresholds
129 *
130 ******************************************/
131
132void
134{
135 // read the isolation requirements
139 // reject TOBs outside explicitly defined eta ranges
140 // by requiring an impossibly high threshold
141 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
142}
143
144void
146{
147 // read the isolation requirements
151 // reject TOBs outside explicitly defined eta ranges
152 // by requiring an impossibly high threshold
153 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
154}
155
156void
158{
159 // read the isolation requirements
162 // Correction for older L1 menus which used the HAD WPs that don't fit in L1Topo bits
163 // This will result in no rHad isolation being applied, but there were no
164 // active L1 items (eTAU40HA threshold defined but unused) -- ATR-25329
166 // reject TOBs outside explicitly defined eta ranges
167 // by requiring an impossibly high threshold
168 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
169}
170
171const std::shared_ptr<TrigConf::L1ThrExtraInfo_jTAU>
173{
174 return dynamic_pointer_cast<TrigConf::L1ThrExtraInfo_jTAU>(m_extraInfo.lock());
175}
176
177void
179{
180 // read the isolation requirements
182 // reject TOBs outside explicitly defined eta ranges
183 // by requiring an impossibly high threshold
184 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
185}
186
187const std::shared_ptr<TrigConf::L1ThrExtraInfo_cTAU>
189{
190 return dynamic_pointer_cast<TrigConf::L1ThrExtraInfo_cTAU>(m_extraInfo.lock());
191}
192
193void
195{
196 // read the isolation requirements
198 // reject TOBs outside explicitly defined eta ranges
199 // by requiring an impossibly high threshold
200 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
201}
202
203void
205{
206 // reject TOBs outside explicitly defined eta ranges
207 // by requiring an impossibly high threshold
208 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
209}
210
211void
213{
214 // reject TOBs outside explicitly defined eta ranges
215 // by requiring an impossibly high threshold
216 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
217}
218
219void
221{
222 // reject TOBs outside explicitly defined eta ranges
223 // by requiring an impossibly high threshold
224 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
225}
226
227void
229{
230 // reject TOBs outside explicitly defined eta ranges
231 // by requiring an impossibly high threshold
232 m_etaDepThrValue.setOutsideRangeValue(getAttribute("maxValue", true, 14000000));
233}
234
235void
238
239void
242
243void
246
247void
250
251/******************************************
252 *
253 * Muon threshold
254 *
255 ******************************************/
256
260float
262{
263 return static_cast<float>(m_ptBarrel);
264}
265
266void
268{
269 auto muInfo = std::dynamic_pointer_cast<L1ThrExtraInfo_MU>(m_extraInfo.lock());
270
274 m_idxBarrel = muInfo->rpcIdxForPt(m_ptBarrel);
275 m_idxEndcap = muInfo->tgcIdxForPt(m_ptEndcap);
276 m_idxForward = muInfo->tgcIdxForPt(m_ptForward);
277
278 m_rpcExclROIList = getAttribute("rpcExclROIList", true, "");
279 m_tgcFlags = getAttribute("tgcFlags");
280 m_rpcFlags = getAttribute_optional<std::string>("rpcFlags").value_or("");
281 m_region = getAttribute("region");
282}
283
284
285
286
Scalar eta() const
pseudorapidity method
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
#define x
const ptree & data() const
Access to the underlying data, if needed.
std::optional< T > getAttribute_optional(const std::string &key) const
T getAttribute(const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
Access to simple attribute.
virtual float thrValue(int eta=0) const override
Accessor to the threshold value for eta-dependent threholds.
ValueWithEtaDependence< unsigned int > m_etaDepThrValue
eta-dependent threshold value in MeV
virtual unsigned int thrValueMeV(int eta=0) const
virtual unsigned int thrValueCounts(int eta=0) const
virtual unsigned int thrValue100MeV(int eta=0) const
as above above but in 100 MeV
uint16_t isolationMask(int eta) const
Definition L1Threshold.h:24
void print(std::ostream &os=std::cout) const override
ValueWithEtaDependence< uint16_t > m_isolationMask
Definition L1Threshold.h:33
ValueWithEtaDependence< unsigned int > m_etaDepWindow
eta-dependent threshold value in MeV
Definition L1Threshold.h:68
unsigned int window(int eta=0) const
float thrValue(int eta=0) const override
this function is only to satisfy the base class interface.
std::string m_region
comma-separated list of BA, EC, FW or the string ALL
std::string m_tgcFlags
a logical expression like 'F & C | F & H | C & H'
std::string m_rpcFlags
a logical expression like 'M'
std::string m_rpcExclROIList
a string sepcifying the list of ROIs to be excluded (the lists are defined in the extraInfo_MU)
unsigned int m_seedMultiplicity
const std::shared_ptr< L1ThrExtraInfo_cTAU > getExtraInfo() const
const std::shared_ptr< L1ThrExtraInfo_jTAU > getExtraInfo() const
unsigned int mapping() const
Accessor to the mapping number The mapping is unique within a type.
std::weak_ptr< L1ThrExtraInfoBase > m_extraInfo
static WP stringToWP(const std::string &)