ATLAS Offline Software
Loading...
Searching...
No Matches
L1ThrExtraInfo.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <stdexcept>
8#include <cmath>
9
10
11using namespace std;
12
13std::unique_ptr<TrigConf::L1ThrExtraInfoBase>
14TrigConf::L1ThrExtraInfo::createExtraInfo(const std::string & thrTypeName, const boost::property_tree::ptree & data) {
15 std::unique_ptr<TrigConf::L1ThrExtraInfoBase> extraInfo(nullptr);
16
17 if( thrTypeName == "EM" )
18 return std::make_unique<L1ThrExtraInfo_EMTAULegacy>(thrTypeName, data);
19
20 if( thrTypeName == "TAU" )
21 return std::make_unique<L1ThrExtraInfo_EMTAULegacy>(thrTypeName, data);
22
23 if( thrTypeName == "JET" )
24 return std::make_unique<L1ThrExtraInfo_JETLegacy>(thrTypeName, data);
25
26 if( thrTypeName == "XS" )
27 return std::make_unique<L1ThrExtraInfo_XSLegacy>(thrTypeName, data);
28
29 if( thrTypeName == "MU" )
30 return std::make_unique<L1ThrExtraInfo_MU>(thrTypeName, data);
31
32 if( thrTypeName == "eEM" )
33 return std::make_unique<L1ThrExtraInfo_eEM>(thrTypeName, data);
34
35 if( thrTypeName == "jEM" )
36 return std::make_unique<L1ThrExtraInfo_jEM>(thrTypeName, data);
37
38 if( thrTypeName == "eTAU" )
39 return std::make_unique<L1ThrExtraInfo_eTAU>(thrTypeName, data);
40
41 if( thrTypeName == "jTAU" )
42 return std::make_unique<L1ThrExtraInfo_jTAU>(thrTypeName, data);
43
44 if( thrTypeName == "cTAU" )
45 return std::make_unique<L1ThrExtraInfo_cTAU>(thrTypeName, data);
46
47 if( thrTypeName == "jJ" )
48 return std::make_unique<L1ThrExtraInfo_jJ>(thrTypeName, data);
49
50 if( thrTypeName == "jLJ" )
51 return std::make_unique<L1ThrExtraInfo_jLJ>(thrTypeName, data);
52
53 if( thrTypeName == "gJ" )
54 return std::make_unique<L1ThrExtraInfo_gJ>(thrTypeName, data);
55
56 if( thrTypeName == "gLJ" )
57 return std::make_unique<L1ThrExtraInfo_gLJ>(thrTypeName, data);
58
59 if( thrTypeName == "jXE" )
60 return std::make_unique<L1ThrExtraInfo_jXE>(thrTypeName, data);
61
62 if( thrTypeName == "jTE" )
63 return std::make_unique<L1ThrExtraInfo_jTE>(thrTypeName, data);
64
65 if( thrTypeName == "gXE" )
66 return std::make_unique<L1ThrExtraInfo_gXE>(thrTypeName, data);
67
68 if( thrTypeName == "gTE" )
69 return std::make_unique<L1ThrExtraInfo_gTE>(thrTypeName, data);
70
71 if( thrTypeName == "cXE" )
72 return std::make_unique<L1ThrExtraInfo_cXE>(thrTypeName, data);
73
74 // if no special extra information is supplied for the threshold type return base class
75 return std::make_unique<L1ThrExtraInfoBase>(thrTypeName, data);
76}
77
78void
83
84
85std::weak_ptr<TrigConf::L1ThrExtraInfoBase>
86TrigConf::L1ThrExtraInfo::addExtraInfo(const std::string & thrTypeName, const boost::property_tree::ptree & data) {
87 try {
88 if( auto extraInfo = L1ThrExtraInfo::createExtraInfo( thrTypeName, data) ) {
89 auto success = m_thrExtraInfo.emplace(thrTypeName, std::shared_ptr<TrigConf::L1ThrExtraInfoBase>(std::move(extraInfo)));
90 return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( success.first->second );
91 }
92 }
93 catch(std::exception & ex) {
94 std::cerr << "L1ThrExtraInfo::addExtraInfo: exception occured when building extra info for " << thrTypeName << std::endl;
95 throw;
96 }
97 return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( m_emptyInfo );
98}
99
100bool
101TrigConf::L1ThrExtraInfo::hasInfo(const std::string & typeName) const
102{
103 return ( m_thrExtraInfo.find(typeName) != m_thrExtraInfo.end() );
104}
105
108 return dynamic_cast<const TrigConf::L1ThrExtraInfo_EMTAULegacy&>( * m_thrExtraInfo.at("EM") );
109}
110
113 return dynamic_cast<const TrigConf::L1ThrExtraInfo_EMTAULegacy&>( * m_thrExtraInfo.at("TAU") );
114}
115
118 return dynamic_cast<const TrigConf::L1ThrExtraInfo_XSLegacy&>( * m_thrExtraInfo.at("XS") );
119}
120
123 return dynamic_cast<const TrigConf::L1ThrExtraInfo_JETLegacy&>( * m_thrExtraInfo.at("JET") );
124}
125
128 return dynamic_cast<const TrigConf::L1ThrExtraInfo_eEM&>( * m_thrExtraInfo.at("eEM") );
129}
130
133 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jEM&>( * m_thrExtraInfo.at("jEM") );
134}
135
138 return dynamic_cast<const TrigConf::L1ThrExtraInfo_eTAU&>( * m_thrExtraInfo.at("eTAU") );
139}
140
143 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jTAU&>( * m_thrExtraInfo.at("jTAU") );
144}
145
148 return dynamic_cast<const TrigConf::L1ThrExtraInfo_cTAU&>( * m_thrExtraInfo.at("cTAU") );
149}
150
153 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jJ&>( * m_thrExtraInfo.at("jJ") );
154}
155
158 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jLJ&>( * m_thrExtraInfo.at("jLJ") );
159}
160
163 return dynamic_cast<const TrigConf::L1ThrExtraInfo_gJ&>( * m_thrExtraInfo.at("gJ") );
164}
165
168 return dynamic_cast<const TrigConf::L1ThrExtraInfo_gLJ&>( * m_thrExtraInfo.at("gLJ") );
169}
170
173 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jXE&>( * m_thrExtraInfo.at("jXE") );
174}
175
178 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jTE&>( * m_thrExtraInfo.at("jTE") );
179}
180
183 return dynamic_cast<const TrigConf::L1ThrExtraInfo_gXE&>( * m_thrExtraInfo.at("gXE") );
184}
185
188 return dynamic_cast<const TrigConf::L1ThrExtraInfo_gTE&>( * m_thrExtraInfo.at("gTE") );
189}
190
193 return dynamic_cast<const TrigConf::L1ThrExtraInfo_cXE&>( * m_thrExtraInfo.at("cXE") );
194}
195
198 return dynamic_cast<const TrigConf::L1ThrExtraInfo_MU&>( * m_thrExtraInfo.at("MU") );
199}
200
202TrigConf::L1ThrExtraInfo::thrExtraInfo(const std::string & thrTypeName) const
203{
204 try {
205 return * m_thrExtraInfo.at(thrTypeName);
206 }
207 catch(std::exception & ex) {
208 std::cerr << "Threshold type " << thrTypeName << " does not have extra info defined" << endl;
209 throw;
210 }
211}
212
217TrigConf::L1ThrExtraInfo_EMTAULegacy::isolation(const std::string & thrType, size_t bit) const
218{
219 if(bit<1 or bit>5) {
220 throw std::out_of_range("When accessing the legacy L1Calo EM or TAU isolation bit must be between 1 and 5, but bit="
221 + std::to_string(bit) + " was requested");
222 }
223 try {
224 return m_isolation.at(thrType)[bit-1];
225 }
226 catch(std::exception & ex) {
227 std::cerr << "Threshold type " << name() << " does not have isolation parameters for type " << thrType << endl;
228 throw;
229 }
230}
231
232void
234{
235 for( auto & x : m_extraInfo ) {
236 if( x.first == "ptMinToTopo" ) {
237 m_ptMinToTopoMeV = std::lround( 1000 * x.second.getValue<float>() );
238 } else if( x.first == "isolation" ) {
239 for( auto & y : x.second.data() ) {
240 auto & isoV = m_isolation[y.first] = std::vector<IsolationLegacy>(5);
241 for(auto & c : y.second.get_child("Parametrization") ) {
242 auto iso = IsolationLegacy(c.second);
243 isoV[iso.isobit()-1] = iso;
244 }
245 }
246 }
247 }
248}
249
250
251void
253{
254 if( hasExtraInfo("significance") ) {
255 auto & sig = m_extraInfo["significance"];
256 m_xeMin = sig.getAttribute<unsigned int>("xeMin");
257 m_xeMax = sig.getAttribute<unsigned int>("xeMax");
258 m_teSqrtMin = sig.getAttribute<unsigned int>("teSqrtMin");
259 m_teSqrtMax = sig.getAttribute<unsigned int>("teSqrtMax");
260 m_xsSigmaScale = sig.getAttribute<unsigned int>("xsSigmaScale");
261 m_xsSigmaOffset = sig.getAttribute<unsigned int>("xsSigmaOffset");
262 }
263}
264
265
266
270void
272{
273 for( auto & x : m_extraInfo ) {
274 if( x.first == "ptMinToTopoLargeWindow" ) {
275 m_ptMinToTopoLargeWindowMeV = std::lround( 1000 * x.second.getValue<float>() );
276 } else if( x.first == "ptMinToTopoSmallWindow" ) {
277 m_ptMinToTopoSmallWindowMeV = std::lround( 1000 * x.second.getValue<float>() );
278 }
279 }
280}
281
282
283/***********************************
284 *
285 * Extra info for new thresholds
286 *
287 ***********************************/
288
289/*******
290 * eEM
291 *******/
293 m_isDefined = true;
294 m_reta_d = pt.get_optional<float>("reta").get_value_or(0);
295 m_wstot_d = pt.get_optional<float>("wstot").get_value_or(0);
296 m_rhad_d = pt.get_optional<float>("rhad").get_value_or(0);
297 m_reta_fw = pt.get_optional<int>("reta_fw").get_value_or(0);
298 m_wstot_fw = pt.get_optional<int>("wstot_fw").get_value_or(0);
299 m_rhad_fw = pt.get_optional<int>("rhad_fw").get_value_or(0);
300}
301
302std::ostream &
304 os << "reta_fw=" << iso.reta_fw() << ", wstot_fw=" << iso.wstot_fw() << ", rhad_fw=" << iso.rhad_fw();
305 return os;
306}
307
308void
310{
311 for( auto & x : m_extraInfo ) {
312 if( x.first == "maxEt" ){
313 m_maxEt = 1000*x.second.getValue<unsigned int>();
314 } else if( x.first == "ptMinToTopo" ) {
315 m_ptMinToTopoMeV = lround(1000 * x.second.getValue<float>());
316 } else if( x.first == "workingPoints" ) {
317 for( auto & y : x.second.data() ) {
318 auto wp = Selection::stringToWP(y.first);
319 auto & iso = m_isolation.emplace(wp, string("eEM_WP_" + y.first)).first->second;
320 for(auto & c : y.second ) {
321 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
322 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
323 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
324 iso.addRangeValue(WorkingPoints_eEM(c.second), etamin, etamax, priority, /*symmetric=*/ false);
325 }
326 }
327 } else if (x.first == "algoVersion") {
328 m_algoVersion = x.second.getValue<unsigned int>();
329 }
330 }
331}
332
333/*******
334 * jEM
335 *******/
337 m_isDefined = true;
338 m_iso_d = pt.get_optional<float>("iso").get_value_or(0);
339 m_frac_d = pt.get_optional<float>("frac").get_value_or(0);
340 m_frac2_d = pt.get_optional<float>("frac2").get_value_or(0);
341 m_iso_fw = pt.get_optional<int>("iso_fw").get_value_or(0);
342 m_frac_fw = pt.get_optional<int>("frac_fw").get_value_or(0);
343 m_frac2_fw = pt.get_optional<int>("frac2_fw").get_value_or(0);
344}
345
346std::ostream &
348 os << "iso_fw=" << iso.iso_fw() << ", frac_fw=" << iso.frac_fw() << ", frac2_fw=" << iso.frac2_fw();
349 return os;
350}
351
352void
354{
355 for( auto & x : m_extraInfo ) {
356 if( x.first == "maxEt" ){
357 m_maxEt = 1000*x.second.getValue<unsigned int>();
358 } else if( x.first == "ptMinToTopo1" ) {
359 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
360 } else if( x.first == "ptMinToTopo2" ){
361 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
362 } else if( x.first == "ptMinToTopo3" ){
363 m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
364 } else if( x.first == "ptMinxTOB1" ){
365 m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
366 } else if( x.first == "ptMinxTOB2" ){
367 m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
368 } else if( x.first == "ptMinxTOB3" ){
369 m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
370 } else if( x.first == "workingPoints" ) {
371 for( auto & y : x.second.data() ) {
372 auto wp = Selection::stringToWP(y.first);
373 auto & iso = m_isolation.emplace(wp, string("jEM_WP_" + y.first)).first->second;
374 for(auto & c : y.second ) {
375 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
376 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
377 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
378 iso.addRangeValue(WorkingPoints_jEM(c.second), etamin, etamax, priority, /*symmetric=*/ false);
379 }
380 }
381 }
382 }
383}
384
385/*******
386 * eTAU
387 *******/
389 m_isDefined = true;
390 m_rCore_d = pt.get_optional<float>("rCore").get_value_or(0);
391 m_rHad_d = pt.get_optional<float>("rHad").get_value_or(0);
392 m_rCore_fw = pt.get_optional<float>("rCore_fw").get_value_or(0);
393 m_rHad_fw = pt.get_optional<float>("rHad_fw").get_value_or(0);
394}
395
396std::ostream &
398 os << "rCore_fw=" << iso.rCore_fw() << ", rHad_fw=" << iso.rHad_fw() ;
399 return os;
400}
401
402void
404{
405 for( auto & x : m_extraInfo ) {
406 if( x.first == "maxEt" ){
407 m_maxEt = 1000*x.second.getValue<unsigned int>(); // Original in units of GeV
408 } else if( x.first == "minIsoEt" ){
409 m_minIsoEt = lround(1000 * x.second.getValue<float>()); // Original in units of GeV
410 } else if( x.first == "ptMinToTopo" ) {
411 m_ptMinToTopoMeV = lround(1000 * x.second.getValue<float>());
412 } else if( x.first == "workingPoints" ) {
413 for( auto & y : x.second.data() ) {
414 auto wp = TrigConf::Selection::stringToWP(y.first);
415 auto & iso = m_isolation.emplace(wp, string("eTAU_WP_" + y.first)).first->second;
416 for(auto & c : y.second ) {
417 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
418 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
419 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
420 iso.addRangeValue(WorkingPoints_eTAU(c.second), etamin, etamax, priority, /*symmetric=*/ false);
421 }
422 }
423 } else if (x.first == "algoVersion") {
424 m_algoVersion = x.second.getValue<unsigned int>();
425 }
426 }
427}
428
429/*******
430 * jTAU
431 *******/
433 m_isDefined = true;
434 m_isolation_d = pt.get_optional<float>("isolation").get_value_or(0);
435 m_isolation_fw = pt.get_optional<float>("isolation_fw").get_value_or(0);
436}
437
438std::ostream &
440 os << "isolation_fw=" << iso.isolation_fw() ;
441 return os;
442}
443
444void
446{
447 for( auto & x : m_extraInfo ) {
448 if( x.first == "maxEt" ){
449 m_maxEt = 1000*x.second.getValue<unsigned int>();
450 } else if( x.first == "ptMinToTopo1" ) {
451 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
452 } else if( x.first == "ptMinToTopo2" ){
453 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
454 } else if( x.first == "ptMinToTopo3" ){
455 m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
456 } else if( x.first == "ptMinxTOB1" ){
457 m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
458 } else if( x.first == "ptMinxTOB2" ){
459 m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
460 } else if( x.first == "ptMinxTOB3" ){
461 m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
462 } else if( x.first == "workingPoints" ) {
463 for( auto & y : x.second.data() ) {
464 auto wp = TrigConf::Selection::stringToWP(y.first);
465 auto & iso = m_isolation.emplace(wp, string("jTAU_WP_" + y.first)).first->second;
466 for(auto & c : y.second ) {
467 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
468 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
469 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
470 iso.addRangeValue(WorkingPoints_jTAU(c.second), etamin, etamax, priority, /*symmetric=*/ false);
471 }
472 }
473 }
474 }
475}
476
477/*******
478 * cTAU
479 *******/
481 m_isDefined = true;
482 m_isolation_d = pt.get_optional<float>("isolation").get_value_or(0);
483 m_isolation_fw = pt.get_optional<unsigned int>("isolation_fw").get_value_or(0);
484 m_isolation_jTAUCoreScale_d = pt.get_optional<float>("isolation_jTAUCoreScale").get_value_or(0);
485 m_isolation_jTAUCoreScale_fw = pt.get_optional<unsigned int>("isolation_jTAUCoreScale_fw").get_value_or(0);
486 m_eTAU_rCoreMin_WP_d = pt.get_optional<float>("eTAU_rCoreMin").get_value_or(0);
487 m_eTAU_rCoreMin_WP_fw = pt.get_optional<unsigned int>("eTAU_rCoreMin_WP_fw").get_value_or(0);
488 m_eTAU_rHadMin_WP_d = pt.get_optional<float>("eTAU_rHadMin").get_value_or(0);
489 m_eTAU_rHadMin_WP_fw = pt.get_optional<unsigned int>("eTAU_rHadMin_WP_fw").get_value_or(0);
490}
491
492std::ostream &
494 os << "isolation_fw=" << iso.isolation_fw() << ", isolation_jTAUCoreScale_fw=" << iso.isolation_jTAUCoreScale_fw();
495 os << ", eTAU_rCoreMin_WP_fw=" << iso.eTAU_rCoreMin_WP_fw() << ", eTAU_rHadMin_WP_fw=" << iso.eTAU_rHadMin_WP_fw();
496 return os;
497}
498
499void
501{
502 for( auto & x : m_extraInfo ) {
503 if( x.first == "workingPoints" ) {
504 for( auto & y : x.second.data() ) {
505 auto wp = TrigConf::Selection::stringToWP(y.first);
506 auto & iso = m_isolation.emplace(wp, string("cTAU_WP_" + y.first)).first->second;
507 for(auto & c : y.second ) {
508 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
509 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
510 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
511 iso.addRangeValue(WorkingPoints_cTAU(c.second), etamin, etamax, priority, /*symmetric=*/ false);
512 }
513 }
514 }
515 }
516}
517
518
519/*******
520 * jJ
521 *******/
522void
524{
525 for( auto & x : m_extraInfo ) {
526 if( x.first == "ptMinToTopo1" ) {
527 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
528 } else if( x.first == "ptMinToTopo2" ){
529 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
530 } else if( x.first == "ptMinToTopo3" ){
531 m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
532 } else if( x.first == "ptMinxTOB1" ){
533 m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
534 } else if( x.first == "ptMinxTOB2" ){
535 m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
536 } else if( x.first == "ptMinxTOB3" ){
537 m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
538 } else if( x.first == "seedThreshold1" ){
539 m_seedThresholdMeV1 = int(1000*x.second.getValue<float>());
540 } else if( x.first == "seedThreshold2" ){
541 m_seedThresholdMeV2 = int(1000*x.second.getValue<float>());
542 } else if( x.first == "seedThreshold3" ){
543 m_seedThresholdMeV3 = int(1000*x.second.getValue<float>());
544 }
545 }
546}
547
548/*******
549 * jLJ
550 *******/
551void
553{
554 for( auto & x : m_extraInfo ) {
555 if( x.first == "ptMinToTopo1" ) {
556 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
557 } else if( x.first == "ptMinToTopo2" ){
558 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
559 } else if( x.first == "ptMinToTopo3" ){
560 m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
561 } else if( x.first == "ptMinxTOB1" ){
562 m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
563 } else if( x.first == "ptMinxTOB2" ){
564 m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
565 } else if( x.first == "ptMinxTOB3" ){
566 m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
567 }
568 }
569}
570
571/*******
572 * gJ
573 *******/
574void
576{
577 for( auto & x : m_extraInfo ) {
578 if( x.first == "ptMinToTopo1" ) {
579 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
580 } else if( x.first == "ptMinToTopo2" ){
581 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
582 }
583 }
584}
585
586/*******
587 * gLJ
588 *******/
589void
591{
592 for( auto & x : m_extraInfo ) {
593 if( x.first == "ptMinToTopo1" ) {
594 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
595 } else if( x.first == "ptMinToTopo2" ){
596 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
597 } else if( x.first == "seedThrA" ){
598 m_seedThrMeVA = 1000*x.second.getValue<unsigned int>();
599 } else if( x.first == "seedThrB" ){
600 m_seedThrMeVB = 1000*x.second.getValue<unsigned int>();
601 } else if( x.first == "seedThrC" ){
602 m_seedThrMeVC = 1000*x.second.getValue<unsigned int>();
603 } else if( x.first == "rhoTowerMinA" ){
604 float rhoTower_tmp = 1000*x.second.getValue<float>();
605 if( (int)rhoTower_tmp != rhoTower_tmp)
606 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
607 m_rhoTowerMinMeVA = (int)rhoTower_tmp;
608 } else if( x.first == "rhoTowerMinB" ){
609 float rhoTower_tmp = 1000*x.second.getValue<float>();
610 if( (int)rhoTower_tmp != rhoTower_tmp)
611 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
612 m_rhoTowerMinMeVB = (int)rhoTower_tmp;
613 } else if( x.first == "rhoTowerMinC" ){
614 float rhoTower_tmp = 1000*x.second.getValue<float>();
615 if( (int)rhoTower_tmp != rhoTower_tmp)
616 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
617 m_rhoTowerMinMeVC = (int)rhoTower_tmp;
618 } else if( x.first == "rhoTowerMaxA" ){
619 float rhoTower_tmp = 1000*x.second.getValue<float>();
620 if( (int)rhoTower_tmp != rhoTower_tmp)
621 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
622 m_rhoTowerMaxMeVA = (int)rhoTower_tmp;
623 } else if( x.first == "rhoTowerMaxB" ){
624 float rhoTower_tmp = 1000*x.second.getValue<float>();
625 if( (int)rhoTower_tmp != rhoTower_tmp)
626 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
627 m_rhoTowerMaxMeVB = (int)rhoTower_tmp;
628 } else if( x.first == "rhoTowerMaxC" ){
629 float rhoTower_tmp = 1000*x.second.getValue<float>();
630 if( (int)rhoTower_tmp != rhoTower_tmp)
631 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
632 m_rhoTowerMaxMeVC = (int)rhoTower_tmp;
633 }
634 }
635}
636
637/*******
638 * jXE
639 *******/
640void
644
645/*******
646 * jTE
647 *******/
648void
650{
651 for( auto & x : m_extraInfo ) {
652 if( x.first == "etaBoundary1" ) {
653 m_etaBoundary1 = x.second.getValue<unsigned int>();
654 } else if( x.first == "etaBoundary1_fw" ) {
655 m_etaBoundary1_fw = x.second.getValue<unsigned int>();
656 } else if( x.first == "etaBoundary2" ) {
657 m_etaBoundary2 = x.second.getValue<unsigned int>();
658 } else if( x.first == "etaBoundary2_fw" ) {
659 m_etaBoundary2_fw = x.second.getValue<unsigned int>();
660 } else if( x.first == "etaBoundary3" ) {
661 m_etaBoundary3 = x.second.getValue<unsigned int>();
662 } else if( x.first == "etaBoundary3_fw" ) {
663 m_etaBoundary3_fw = x.second.getValue<unsigned int>();
664 }
665 }
666}
667
668/*******
669 * gXE
670 *******/
671void
673{
674 for( auto & x : m_extraInfo ) {
675 if( x.first == "seedThrA" ){
676 m_seedThrMeVA = 200*x.second.getValue<unsigned int>();
677 } else if( x.first == "seedThrB" ){
678 m_seedThrMeVB = 200*x.second.getValue<unsigned int>();
679 } else if( x.first == "seedThrC" ){
680 m_seedThrMeVC = 200*x.second.getValue<unsigned int>();
681 } else if( x.first == "XERHO_sigmaPosA" ){
682 m_XERHO_sigmaPosA = x.second.getValue<unsigned int>();
683 } else if( x.first == "XERHO_sigmaPosB" ){
684 m_XERHO_sigmaPosB = x.second.getValue<unsigned int>();
685 } else if( x.first == "XERHO_sigmaPosC" ){
686 m_XERHO_sigmaPosC = x.second.getValue<unsigned int>();
687 } else if( x.first == "XERHO_sigmaNegA" ){
688 m_XERHO_sigmaNegA = x.second.getValue<unsigned int>();
689 } else if( x.first == "XERHO_sigmaNegB" ){
690 m_XERHO_sigmaNegB = x.second.getValue<unsigned int>();
691 } else if( x.first == "XERHO_sigmaNegC" ){
692 m_XERHO_sigmaNegC = x.second.getValue<unsigned int>();
693 } else if( x.first == "XEJWOJ_a_A" ){
694 m_XEJWOJ_a_A = x.second.getValue<unsigned int>();
695 } else if( x.first == "XEJWOJ_a_B" ){
696 m_XEJWOJ_a_B = x.second.getValue<unsigned int>();
697 } else if( x.first == "XEJWOJ_a_C" ){
698 m_XEJWOJ_a_C = x.second.getValue<unsigned int>();
699 } else if( x.first == "XEJWOJ_b_A" ){
700 m_XEJWOJ_b_A = x.second.getValue<unsigned int>();
701 } else if( x.first == "XEJWOJ_b_B" ){
702 m_XEJWOJ_b_B = x.second.getValue<unsigned int>();
703 } else if( x.first == "XEJWOJ_b_C" ){
704 m_XEJWOJ_b_C = x.second.getValue<unsigned int>();
705 } else if( x.first == "XEJWOJ_c_A" ){
706 m_XEJWOJ_c_A = x.second.getValue<unsigned int>();
707 } else if( x.first == "XEJWOJ_c_B" ){
708 m_XEJWOJ_c_B = x.second.getValue<unsigned int>();
709 } else if( x.first == "XEJWOJ_c_C" ){
710 m_XEJWOJ_c_C = x.second.getValue<unsigned int>();
711 } else if( x.first == "XENOISECUT_noiseCutThrA" ){
712 m_noiseCutThrA = x.second.getValue<unsigned int>();
713 } else if( x.first == "XENOISECUT_noiseCutThrB" ){
714 m_noiseCutThrB = x.second.getValue<unsigned int>();
715 } else if( x.first == "XENOISECUT_noiseCutThrC" ){
716 m_noiseCutThrC = x.second.getValue<unsigned int>();
717 }
718 }
719}
720
721/*******
722 * gTE
723 *******/
724void
728
729/*******
730 * cXE
731 *******/
732void
734{
735 for( auto & x : m_extraInfo ) {
736 if( x.first == "jXeWeight" ){
737 m_jXeWeight = x.second.getValue<float>();
738 } else if( x.first == "gXeWeight" ){
739 m_gXeWeight = x.second.getValue<float>();
740 }
741 }
742}
743
744/*******
745 * MU
746 *******/
747unsigned int
749{
750 try {
751 return m_rpcPtMap.at(pt);
752 }
753 catch(std::exception & ex) {
754 std::cerr << "No RPC index defined for pt " << pt << endl;
755 throw;
756 }
757}
758
759
760unsigned int
762{
763 try {
764 return m_tgcPtMap.at(pt);
765 }
766 catch(std::exception & ex) {
767 std::cerr << "No TGC index defined for pt " << pt << endl;
768 throw;
769 }
770}
771
772unsigned int
774{
775
776 for(auto & x : m_rpcPtMap){
777 if(x.second==idx) return x.first;
778 }
779 throw std::runtime_error("index "+std::to_string(idx)+" not found for RPC roads");
780
781}
782
783unsigned int
785{
786
787 for(auto & x : m_tgcPtMap){
788 if(x.second==idx) return x.first;
789 }
790 throw std::runtime_error("index "+std::to_string(idx)+" not found for TGC roads");
791
792}
793
794unsigned int
796{
797
798 int ptValue = ptForRpcIdx(rpcIdx);
799 return tgcIdxForPt(ptValue);
800}
801
802std::vector<unsigned int>
804{
805 std::vector<unsigned int> ptValues;
806 for( auto & x : m_rpcPtMap ) {
807 ptValues.emplace_back(x.first);
808 }
809 return ptValues;
810}
811
812std::vector<unsigned int>
814{
815 std::vector<unsigned int> ptValues;
816 for( auto & x : m_tgcPtMap ) {
817 ptValues.emplace_back(x.first);
818 }
819 return ptValues;
820}
821
822
823std::vector<std::string>
825{
826 std::vector<std::string> listNames;
827 for( auto & x : m_roiExclusionLists ) {
828 listNames.emplace_back(x.first);
829 }
830 return listNames;
831}
832
833
834const std::map<std::string, std::vector<unsigned int> > &
835TrigConf::L1ThrExtraInfo_MU::exclusionList(const std::string & listName) const
836{
837 try {
838 return m_roiExclusionLists.at(listName);
839 }
840 catch(std::exception & ex) {
841 std::cerr << "No exclusion list '" << listName << "' defined in MU threshold exlusionLists" << endl;
842 throw;
843 }
844}
845
846void
848{
849 {
850 DataStructure ds = m_extraInfo["roads"].getObject("rpc");
851 for( const auto & x : ds.data() ) {
852 m_rpcPtMap.emplace( static_cast<unsigned int>(std::stoul(x.first)),
853 static_cast<unsigned int>(std::stoul(x.second.data())));
854 }
855 }
856 {
857 DataStructure ds = m_extraInfo["roads"].getObject("tgc");
858 for( auto & x : ds.data() ) {
859 m_tgcPtMap.emplace( static_cast<unsigned int>(std::stoul(x.first)),
860 static_cast<unsigned int>(std::stoul(x.second.data())));
861 }
862 }
863 for( auto & x : m_extraInfo["exclusionLists"].data() ) {
864 const std::string & listName = x.first;
865 std::map<std::string, std::vector<unsigned int>> roisBySector;
866 for( auto & list : x.second ) {
867 const std::string & sectorName = list.second.get_child("sectorName").get_value<std::string>();
868 std::vector<unsigned int> rois;
869 for( auto & roi : list.second.get_child("rois") ) {
870 rois.push_back( static_cast<unsigned int>(std::stoul( roi.second.data() )) );
871 }
872 roisBySector.emplace(sectorName, std::move(rois));
873 }
874 m_roiExclusionLists.emplace(listName, std::move(roisBySector));
875 }
876}
877
878
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
#define y
#define x
Base class for Trigger configuration data and wrapper around underlying representation.
L1 extra information for certain threshold types.
std::map< std::string, DataStructure > m_extraInfo
bool hasExtraInfo(const std::string &key="") const
const IsolationLegacy & isolation(const std::string &thrType, size_t bit) const
EM legacy extra info.
std::map< std::string, std::vector< IsolationLegacy > > m_isolation
void load()
Update the internal members.
unsigned int m_ptMinToTopoMeV
EM specific data.
void load()
Update the internal members.
unsigned int m_ptMinToTopoLargeWindowMeV
JET specific data.
const std::map< std::string, std::vector< unsigned int > > & exclusionList(const std::string &listName) const
std::map< unsigned int, unsigned int > m_rpcPtMap
MU specific data.
std::vector< std::string > exclusionListNames() const
unsigned int rpcIdxForPt(unsigned int pt) const
unsigned int ptForTgcIdx(unsigned int idx) const
std::map< unsigned int, unsigned int > m_tgcPtMap
std::vector< unsigned int > knownTgcPtValues() const
unsigned int tgcIdxForRpcIdx(unsigned int rpcIdx) const
unsigned int tgcIdxForPt(unsigned int pt) const
std::vector< unsigned int > knownRpcPtValues() const
unsigned int ptForRpcIdx(unsigned int idx) const
std::map< std::string, std::map< std::string, std::vector< unsigned int > > > m_roiExclusionLists
void load()
Update the internal members.
unsigned int m_xeMin
XS specific data.
void load()
Update the internal members.
WorkingPoints_cTAU(const boost::property_tree::ptree &)
std::map< TrigConf::Selection::WP, ValueWithEtaDependence< WorkingPoints_cTAU > > m_isolation
cTAU specific data
void load()
Update the internal members.
void load()
Update the internal members.
float m_jXeWeight
cXE specific data
std::map< TrigConf::Selection::WP, ValueWithEtaDependence< WorkingPoints_eEM > > m_isolation
void load()
Update the internal members.
unsigned int m_ptMinToTopoMeV
eEM specific data
WorkingPoints_eTAU(const boost::property_tree::ptree &)
void load()
Update the internal members.
unsigned int m_minIsoEt
eTAU specific data
std::map< TrigConf::Selection::WP, ValueWithEtaDependence< WorkingPoints_eTAU > > m_isolation
unsigned int m_ptMinToTopoMeV1
gJ specific data
void load()
Update the internal members.
unsigned int m_ptMinToTopoMeV1
gLJ specific data
void load()
Update the internal members.
void load()
Update the internal members.
void load()
Update the internal members.
unsigned int m_XERHO_sigmaPosA
gXE specific data
unsigned int m_maxEt
jEM specific data
std::map< TrigConf::Selection::WP, ValueWithEtaDependence< WorkingPoints_jEM > > m_isolation
void load()
Update the internal members.
void load()
Update the internal members.
unsigned int m_ptMinToTopoMeV1
jJ specific data
void load()
Update the internal members.
unsigned int m_ptMinToTopoMeV1
jLJ specific data
WorkingPoints_jTAU(const boost::property_tree::ptree &)
unsigned int m_maxEt
jTAU specific data
std::map< TrigConf::Selection::WP, ValueWithEtaDependence< WorkingPoints_jTAU > > m_isolation
void load()
Update the internal members.
void load()
Update the internal members.
unsigned int m_etaBoundary1
jTE specific data
void load()
Update the internal members.
const L1ThrExtraInfo_eTAU & eTAU() const
const L1ThrExtraInfo_gXE & gXE() const
const L1ThrExtraInfo_jEM & jEM() const
std::map< std::string, std::shared_ptr< TrigConf::L1ThrExtraInfoBase > > m_thrExtraInfo
const L1ThrExtraInfo_XSLegacy & XS() const
const L1ThrExtraInfo_MU & MU() const
std::shared_ptr< TrigConf::L1ThrExtraInfoBase > m_emptyInfo
const L1ThrExtraInfoBase & thrExtraInfo(const std::string &thrTypeName) const
const L1ThrExtraInfo_jJ & jJ() const
const L1ThrExtraInfo_jLJ & jLJ() const
const L1ThrExtraInfo_cTAU & cTAU() const
const L1ThrExtraInfo_JETLegacy & JET() const
const L1ThrExtraInfo_EMTAULegacy & TAU() const
const L1ThrExtraInfo_gLJ & gLJ() const
std::weak_ptr< TrigConf::L1ThrExtraInfoBase > addExtraInfo(const std::string &thrTypeName, const boost::property_tree::ptree &data)
static std::unique_ptr< L1ThrExtraInfoBase > createExtraInfo(const std::string &thrTypeName, const boost::property_tree::ptree &data)
const L1ThrExtraInfo_gJ & gJ() const
const L1ThrExtraInfo_gTE & gTE() const
const L1ThrExtraInfo_eEM & eEM() const
const L1ThrExtraInfo_jTE & jTE() const
const L1ThrExtraInfo_jTAU & jTAU() const
const L1ThrExtraInfo_jXE & jXE() const
const L1ThrExtraInfo_EMTAULegacy & EM() const
bool hasInfo(const std::string &typeName) const
const L1ThrExtraInfo_cXE & cXE() const
static WP stringToWP(const std::string &)
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
STL namespace.