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 no special extra information is supplied for the threshold type return base class
72 return std::make_unique<L1ThrExtraInfoBase>(thrTypeName, data);
73}
74
75void
80
81
82std::weak_ptr<TrigConf::L1ThrExtraInfoBase>
83TrigConf::L1ThrExtraInfo::addExtraInfo(const std::string & thrTypeName, const boost::property_tree::ptree & data) {
84 try {
85 if( auto extraInfo = L1ThrExtraInfo::createExtraInfo( thrTypeName, data) ) {
86 auto success = m_thrExtraInfo.emplace(thrTypeName, std::shared_ptr<TrigConf::L1ThrExtraInfoBase>(std::move(extraInfo)));
87 return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( success.first->second );
88 }
89 }
90 catch(std::exception & ex) {
91 std::cerr << "L1ThrExtraInfo::addExtraInfo: exception occured when building extra info for " << thrTypeName << std::endl;
92 throw;
93 }
94 return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( m_emptyInfo );
95}
96
97bool
98TrigConf::L1ThrExtraInfo::hasInfo(const std::string & typeName) const
99{
100 return ( m_thrExtraInfo.find(typeName) != m_thrExtraInfo.end() );
101}
102
105 return dynamic_cast<const TrigConf::L1ThrExtraInfo_EMTAULegacy&>( * m_thrExtraInfo.at("EM") );
106}
107
110 return dynamic_cast<const TrigConf::L1ThrExtraInfo_EMTAULegacy&>( * m_thrExtraInfo.at("TAU") );
111}
112
115 return dynamic_cast<const TrigConf::L1ThrExtraInfo_XSLegacy&>( * m_thrExtraInfo.at("XS") );
116}
117
120 return dynamic_cast<const TrigConf::L1ThrExtraInfo_JETLegacy&>( * m_thrExtraInfo.at("JET") );
121}
122
125 return dynamic_cast<const TrigConf::L1ThrExtraInfo_eEM&>( * m_thrExtraInfo.at("eEM") );
126}
127
130 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jEM&>( * m_thrExtraInfo.at("jEM") );
131}
132
135 return dynamic_cast<const TrigConf::L1ThrExtraInfo_eTAU&>( * m_thrExtraInfo.at("eTAU") );
136}
137
140 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jTAU&>( * m_thrExtraInfo.at("jTAU") );
141}
142
145 return dynamic_cast<const TrigConf::L1ThrExtraInfo_cTAU&>( * m_thrExtraInfo.at("cTAU") );
146}
147
150 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jJ&>( * m_thrExtraInfo.at("jJ") );
151}
152
155 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jLJ&>( * m_thrExtraInfo.at("jLJ") );
156}
157
160 return dynamic_cast<const TrigConf::L1ThrExtraInfo_gJ&>( * m_thrExtraInfo.at("gJ") );
161}
162
165 return dynamic_cast<const TrigConf::L1ThrExtraInfo_gLJ&>( * m_thrExtraInfo.at("gLJ") );
166}
167
170 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jXE&>( * m_thrExtraInfo.at("jXE") );
171}
172
175 return dynamic_cast<const TrigConf::L1ThrExtraInfo_jTE&>( * m_thrExtraInfo.at("jTE") );
176}
177
180 return dynamic_cast<const TrigConf::L1ThrExtraInfo_gXE&>( * m_thrExtraInfo.at("gXE") );
181}
182
185 return dynamic_cast<const TrigConf::L1ThrExtraInfo_gTE&>( * m_thrExtraInfo.at("gTE") );
186}
187
190 return dynamic_cast<const TrigConf::L1ThrExtraInfo_MU&>( * m_thrExtraInfo.at("MU") );
191}
192
194TrigConf::L1ThrExtraInfo::thrExtraInfo(const std::string & thrTypeName) const
195{
196 try {
197 return * m_thrExtraInfo.at(thrTypeName);
198 }
199 catch(std::exception & ex) {
200 std::cerr << "Threshold type " << thrTypeName << " does not have extra info defined" << endl;
201 throw;
202 }
203}
204
209TrigConf::L1ThrExtraInfo_EMTAULegacy::isolation(const std::string & thrType, size_t bit) const
210{
211 if(bit<1 or bit>5) {
212 throw std::out_of_range("When accessing the legacy L1Calo EM or TAU isolation bit must be between 1 and 5, but bit="
213 + std::to_string(bit) + " was requested");
214 }
215 try {
216 return m_isolation.at(thrType)[bit-1];
217 }
218 catch(std::exception & ex) {
219 std::cerr << "Threshold type " << name() << " does not have isolation parameters for type " << thrType << endl;
220 throw;
221 }
222}
223
224void
226{
227 for( auto & x : m_extraInfo ) {
228 if( x.first == "ptMinToTopo" ) {
229 m_ptMinToTopoMeV = std::lround( 1000 * x.second.getValue<float>() );
230 } else if( x.first == "isolation" ) {
231 for( auto & y : x.second.data() ) {
232 auto & isoV = m_isolation[y.first] = std::vector<IsolationLegacy>(5);
233 for(auto & c : y.second.get_child("Parametrization") ) {
234 auto iso = IsolationLegacy(c.second);
235 isoV[iso.isobit()-1] = iso;
236 }
237 }
238 }
239 }
240}
241
242
243void
245{
246 if( hasExtraInfo("significance") ) {
247 auto & sig = m_extraInfo["significance"];
248 m_xeMin = sig.getAttribute<unsigned int>("xeMin");
249 m_xeMax = sig.getAttribute<unsigned int>("xeMax");
250 m_teSqrtMin = sig.getAttribute<unsigned int>("teSqrtMin");
251 m_teSqrtMax = sig.getAttribute<unsigned int>("teSqrtMax");
252 m_xsSigmaScale = sig.getAttribute<unsigned int>("xsSigmaScale");
253 m_xsSigmaOffset = sig.getAttribute<unsigned int>("xsSigmaOffset");
254 }
255}
256
257
258
262void
264{
265 for( auto & x : m_extraInfo ) {
266 if( x.first == "ptMinToTopoLargeWindow" ) {
267 m_ptMinToTopoLargeWindowMeV = std::lround( 1000 * x.second.getValue<float>() );
268 } else if( x.first == "ptMinToTopoSmallWindow" ) {
269 m_ptMinToTopoSmallWindowMeV = std::lround( 1000 * x.second.getValue<float>() );
270 }
271 }
272}
273
274
275/***********************************
276 *
277 * Extra info for new thresholds
278 *
279 ***********************************/
280
281/*******
282 * eEM
283 *******/
285 m_isDefined = true;
286 m_reta_d = pt.get_optional<float>("reta").get_value_or(0);
287 m_wstot_d = pt.get_optional<float>("wstot").get_value_or(0);
288 m_rhad_d = pt.get_optional<float>("rhad").get_value_or(0);
289 m_reta_fw = pt.get_optional<int>("reta_fw").get_value_or(0);
290 m_wstot_fw = pt.get_optional<int>("wstot_fw").get_value_or(0);
291 m_rhad_fw = pt.get_optional<int>("rhad_fw").get_value_or(0);
292}
293
294std::ostream &
296 os << "reta_fw=" << iso.reta_fw() << ", wstot_fw=" << iso.wstot_fw() << ", rhad_fw=" << iso.rhad_fw();
297 return os;
298}
299
300void
302{
303 for( auto & x : m_extraInfo ) {
304 if( x.first == "maxEt" ){
305 m_maxEt = 1000*x.second.getValue<unsigned int>();
306 } else if( x.first == "ptMinToTopo" ) {
307 m_ptMinToTopoMeV = lround(1000 * x.second.getValue<float>());
308 } else if( x.first == "workingPoints" ) {
309 for( auto & y : x.second.data() ) {
310 auto wp = Selection::stringToWP(y.first);
311 auto & iso = m_isolation.emplace(wp, string("eEM_WP_" + y.first)).first->second;
312 for(auto & c : y.second ) {
313 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
314 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
315 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
316 iso.addRangeValue(WorkingPoints_eEM(c.second), etamin, etamax, priority, /*symmetric=*/ false);
317 }
318 }
319 } else if (x.first == "algoVersion") {
320 m_algoVersion = x.second.getValue<unsigned int>();
321 }
322 }
323}
324
325/*******
326 * jEM
327 *******/
329 m_isDefined = true;
330 m_iso_d = pt.get_optional<float>("iso").get_value_or(0);
331 m_frac_d = pt.get_optional<float>("frac").get_value_or(0);
332 m_frac2_d = pt.get_optional<float>("frac2").get_value_or(0);
333 m_iso_fw = pt.get_optional<int>("iso_fw").get_value_or(0);
334 m_frac_fw = pt.get_optional<int>("frac_fw").get_value_or(0);
335 m_frac2_fw = pt.get_optional<int>("frac2_fw").get_value_or(0);
336}
337
338std::ostream &
340 os << "iso_fw=" << iso.iso_fw() << ", frac_fw=" << iso.frac_fw() << ", frac2_fw=" << iso.frac2_fw();
341 return os;
342}
343
344void
346{
347 for( auto & x : m_extraInfo ) {
348 if( x.first == "maxEt" ){
349 m_maxEt = 1000*x.second.getValue<unsigned int>();
350 } else if( x.first == "ptMinToTopo1" ) {
351 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
352 } else if( x.first == "ptMinToTopo2" ){
353 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
354 } else if( x.first == "ptMinToTopo3" ){
355 m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
356 } else if( x.first == "ptMinxTOB1" ){
357 m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
358 } else if( x.first == "ptMinxTOB2" ){
359 m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
360 } else if( x.first == "ptMinxTOB3" ){
361 m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
362 } else if( x.first == "workingPoints" ) {
363 for( auto & y : x.second.data() ) {
364 auto wp = Selection::stringToWP(y.first);
365 auto & iso = m_isolation.emplace(wp, string("jEM_WP_" + y.first)).first->second;
366 for(auto & c : y.second ) {
367 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
368 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
369 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
370 iso.addRangeValue(WorkingPoints_jEM(c.second), etamin, etamax, priority, /*symmetric=*/ false);
371 }
372 }
373 }
374 }
375}
376
377/*******
378 * eTAU
379 *******/
381 m_isDefined = true;
382 m_rCore_d = pt.get_optional<float>("rCore").get_value_or(0);
383 m_rHad_d = pt.get_optional<float>("rHad").get_value_or(0);
384 m_rCore_fw = pt.get_optional<float>("rCore_fw").get_value_or(0);
385 m_rHad_fw = pt.get_optional<float>("rHad_fw").get_value_or(0);
386}
387
388std::ostream &
390 os << "rCore_fw=" << iso.rCore_fw() << ", rHad_fw=" << iso.rHad_fw() ;
391 return os;
392}
393
394void
396{
397 for( auto & x : m_extraInfo ) {
398 if( x.first == "maxEt" ){
399 m_maxEt = 1000*x.second.getValue<unsigned int>(); // Original in units of GeV
400 } else if( x.first == "minIsoEt" ){
401 m_minIsoEt = lround(1000 * x.second.getValue<float>()); // Original in units of GeV
402 } else if( x.first == "ptMinToTopo" ) {
403 m_ptMinToTopoMeV = lround(1000 * x.second.getValue<float>());
404 } else if( x.first == "workingPoints" ) {
405 for( auto & y : x.second.data() ) {
406 auto wp = TrigConf::Selection::stringToWP(y.first);
407 auto & iso = m_isolation.emplace(wp, string("eTAU_WP_" + y.first)).first->second;
408 for(auto & c : y.second ) {
409 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
410 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
411 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
412 iso.addRangeValue(WorkingPoints_eTAU(c.second), etamin, etamax, priority, /*symmetric=*/ false);
413 }
414 }
415 } else if (x.first == "algoVersion") {
416 m_algoVersion = x.second.getValue<unsigned int>();
417 }
418 }
419}
420
421/*******
422 * jTAU
423 *******/
425 m_isDefined = true;
426 m_isolation_d = pt.get_optional<float>("isolation").get_value_or(0);
427 m_isolation_fw = pt.get_optional<float>("isolation_fw").get_value_or(0);
428}
429
430std::ostream &
432 os << "isolation_fw=" << iso.isolation_fw() ;
433 return os;
434}
435
436void
438{
439 for( auto & x : m_extraInfo ) {
440 if( x.first == "maxEt" ){
441 m_maxEt = 1000*x.second.getValue<unsigned int>();
442 } else if( x.first == "ptMinToTopo1" ) {
443 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
444 } else if( x.first == "ptMinToTopo2" ){
445 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
446 } else if( x.first == "ptMinToTopo3" ){
447 m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
448 } else if( x.first == "ptMinxTOB1" ){
449 m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
450 } else if( x.first == "ptMinxTOB2" ){
451 m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
452 } else if( x.first == "ptMinxTOB3" ){
453 m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
454 } else if( x.first == "workingPoints" ) {
455 for( auto & y : x.second.data() ) {
456 auto wp = TrigConf::Selection::stringToWP(y.first);
457 auto & iso = m_isolation.emplace(wp, string("jTAU_WP_" + y.first)).first->second;
458 for(auto & c : y.second ) {
459 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
460 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
461 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
462 iso.addRangeValue(WorkingPoints_jTAU(c.second), etamin, etamax, priority, /*symmetric=*/ false);
463 }
464 }
465 }
466 }
467}
468
469/*******
470 * cTAU
471 *******/
473 m_isDefined = true;
474 m_isolation_d = pt.get_optional<float>("isolation").get_value_or(0);
475 m_isolation_fw = pt.get_optional<unsigned int>("isolation_fw").get_value_or(0);
476 m_isolation_jTAUCoreScale_d = pt.get_optional<float>("isolation_jTAUCoreScale").get_value_or(0);
477 m_isolation_jTAUCoreScale_fw = pt.get_optional<unsigned int>("isolation_jTAUCoreScale_fw").get_value_or(0);
478 m_eTAU_rCoreMin_WP_d = pt.get_optional<float>("eTAU_rCoreMin").get_value_or(0);
479 m_eTAU_rCoreMin_WP_fw = pt.get_optional<unsigned int>("eTAU_rCoreMin_WP_fw").get_value_or(0);
480 m_eTAU_rHadMin_WP_d = pt.get_optional<float>("eTAU_rHadMin").get_value_or(0);
481 m_eTAU_rHadMin_WP_fw = pt.get_optional<unsigned int>("eTAU_rHadMin_WP_fw").get_value_or(0);
482}
483
484std::ostream &
486 os << "isolation_fw=" << iso.isolation_fw() << ", isolation_jTAUCoreScale_fw=" << iso.isolation_jTAUCoreScale_fw();
487 os << ", eTAU_rCoreMin_WP_fw=" << iso.eTAU_rCoreMin_WP_fw() << ", eTAU_rHadMin_WP_fw=" << iso.eTAU_rHadMin_WP_fw();
488 return os;
489}
490
491void
493{
494 for( auto & x : m_extraInfo ) {
495 if( x.first == "workingPoints" ) {
496 for( auto & y : x.second.data() ) {
497 auto wp = TrigConf::Selection::stringToWP(y.first);
498 auto & iso = m_isolation.emplace(wp, string("cTAU_WP_" + y.first)).first->second;
499 for(auto & c : y.second ) {
500 int etamin = c.second.get_optional<int>("etamin").get_value_or(-49);
501 int etamax = c.second.get_optional<int>("etamax").get_value_or(49);
502 unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0);
503 iso.addRangeValue(WorkingPoints_cTAU(c.second), etamin, etamax, priority, /*symmetric=*/ false);
504 }
505 }
506 }
507 }
508}
509
510
511/*******
512 * jJ
513 *******/
514void
516{
517 for( auto & x : m_extraInfo ) {
518 if( x.first == "ptMinToTopo1" ) {
519 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
520 } else if( x.first == "ptMinToTopo2" ){
521 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
522 } else if( x.first == "ptMinToTopo3" ){
523 m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
524 } else if( x.first == "ptMinxTOB1" ){
525 m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
526 } else if( x.first == "ptMinxTOB2" ){
527 m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
528 } else if( x.first == "ptMinxTOB3" ){
529 m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
530 } else if( x.first == "seedThreshold1" ){
531 m_seedThresholdMeV1 = int(1000*x.second.getValue<float>());
532 } else if( x.first == "seedThreshold2" ){
533 m_seedThresholdMeV2 = int(1000*x.second.getValue<float>());
534 } else if( x.first == "seedThreshold3" ){
535 m_seedThresholdMeV3 = int(1000*x.second.getValue<float>());
536 }
537 }
538}
539
540/*******
541 * jLJ
542 *******/
543void
545{
546 for( auto & x : m_extraInfo ) {
547 if( x.first == "ptMinToTopo1" ) {
548 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
549 } else if( x.first == "ptMinToTopo2" ){
550 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
551 } else if( x.first == "ptMinToTopo3" ){
552 m_ptMinToTopoMeV3 = 1000*x.second.getValue<unsigned int>();
553 } else if( x.first == "ptMinxTOB1" ){
554 m_ptMinxTOBMeV1 = 1000*x.second.getValue<unsigned int>();
555 } else if( x.first == "ptMinxTOB2" ){
556 m_ptMinxTOBMeV2 = 1000*x.second.getValue<unsigned int>();
557 } else if( x.first == "ptMinxTOB3" ){
558 m_ptMinxTOBMeV3 = 1000*x.second.getValue<unsigned int>();
559 }
560 }
561}
562
563/*******
564 * gJ
565 *******/
566void
568{
569 for( auto & x : m_extraInfo ) {
570 if( x.first == "ptMinToTopo1" ) {
571 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
572 } else if( x.first == "ptMinToTopo2" ){
573 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
574 }
575 }
576}
577
578/*******
579 * gLJ
580 *******/
581void
583{
584 for( auto & x : m_extraInfo ) {
585 if( x.first == "ptMinToTopo1" ) {
586 m_ptMinToTopoMeV1 = 1000*x.second.getValue<unsigned int>();
587 } else if( x.first == "ptMinToTopo2" ){
588 m_ptMinToTopoMeV2 = 1000*x.second.getValue<unsigned int>();
589 } else if( x.first == "seedThrA" ){
590 m_seedThrMeVA = 1000*x.second.getValue<unsigned int>();
591 } else if( x.first == "seedThrB" ){
592 m_seedThrMeVB = 1000*x.second.getValue<unsigned int>();
593 } else if( x.first == "seedThrC" ){
594 m_seedThrMeVC = 1000*x.second.getValue<unsigned int>();
595 } else if( x.first == "rhoTowerMinA" ){
596 float rhoTower_tmp = 1000*x.second.getValue<float>();
597 if( (int)rhoTower_tmp != rhoTower_tmp)
598 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
599 m_rhoTowerMinMeVA = (int)rhoTower_tmp;
600 } else if( x.first == "rhoTowerMinB" ){
601 float rhoTower_tmp = 1000*x.second.getValue<float>();
602 if( (int)rhoTower_tmp != rhoTower_tmp)
603 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
604 m_rhoTowerMinMeVB = (int)rhoTower_tmp;
605 } else if( x.first == "rhoTowerMinC" ){
606 float rhoTower_tmp = 1000*x.second.getValue<float>();
607 if( (int)rhoTower_tmp != rhoTower_tmp)
608 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
609 m_rhoTowerMinMeVC = (int)rhoTower_tmp;
610 } else if( x.first == "rhoTowerMaxA" ){
611 float rhoTower_tmp = 1000*x.second.getValue<float>();
612 if( (int)rhoTower_tmp != rhoTower_tmp)
613 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
614 m_rhoTowerMaxMeVA = (int)rhoTower_tmp;
615 } else if( x.first == "rhoTowerMaxB" ){
616 float rhoTower_tmp = 1000*x.second.getValue<float>();
617 if( (int)rhoTower_tmp != rhoTower_tmp)
618 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
619 m_rhoTowerMaxMeVB = (int)rhoTower_tmp;
620 } else if( x.first == "rhoTowerMaxC" ){
621 float rhoTower_tmp = 1000*x.second.getValue<float>();
622 if( (int)rhoTower_tmp != rhoTower_tmp)
623 throw std::runtime_error("gLJ: rhoTower param " + std::to_string(rhoTower_tmp/1000.) + " cannot be converted in MeV" );
624 m_rhoTowerMaxMeVC = (int)rhoTower_tmp;
625 }
626 }
627}
628
629/*******
630 * jXE
631 *******/
632void
636
637/*******
638 * jTE
639 *******/
640void
642{
643 for( auto & x : m_extraInfo ) {
644 if( x.first == "etaBoundary1" ) {
645 m_etaBoundary1 = x.second.getValue<unsigned int>();
646 } else if( x.first == "etaBoundary1_fw" ) {
647 m_etaBoundary1_fw = x.second.getValue<unsigned int>();
648 } else if( x.first == "etaBoundary2" ) {
649 m_etaBoundary2 = x.second.getValue<unsigned int>();
650 } else if( x.first == "etaBoundary2_fw" ) {
651 m_etaBoundary2_fw = x.second.getValue<unsigned int>();
652 } else if( x.first == "etaBoundary3" ) {
653 m_etaBoundary3 = x.second.getValue<unsigned int>();
654 } else if( x.first == "etaBoundary3_fw" ) {
655 m_etaBoundary3_fw = x.second.getValue<unsigned int>();
656 }
657 }
658}
659
660/*******
661 * gXE
662 *******/
663void
665{
666 for( auto & x : m_extraInfo ) {
667 if( x.first == "seedThrA" ){
668 m_seedThrMeVA = 200*x.second.getValue<unsigned int>();
669 } else if( x.first == "seedThrB" ){
670 m_seedThrMeVB = 200*x.second.getValue<unsigned int>();
671 } else if( x.first == "seedThrC" ){
672 m_seedThrMeVC = 200*x.second.getValue<unsigned int>();
673 } else if( x.first == "XERHO_sigmaPosA" ){
674 m_XERHO_sigmaPosA = x.second.getValue<unsigned int>();
675 } else if( x.first == "XERHO_sigmaPosB" ){
676 m_XERHO_sigmaPosB = x.second.getValue<unsigned int>();
677 } else if( x.first == "XERHO_sigmaPosC" ){
678 m_XERHO_sigmaPosC = x.second.getValue<unsigned int>();
679 } else if( x.first == "XERHO_sigmaNegA" ){
680 m_XERHO_sigmaNegA = x.second.getValue<unsigned int>();
681 } else if( x.first == "XERHO_sigmaNegB" ){
682 m_XERHO_sigmaNegB = x.second.getValue<unsigned int>();
683 } else if( x.first == "XERHO_sigmaNegC" ){
684 m_XERHO_sigmaNegC = x.second.getValue<unsigned int>();
685 } else if( x.first == "XEJWOJ_a_A" ){
686 m_XEJWOJ_a_A = x.second.getValue<unsigned int>();
687 } else if( x.first == "XEJWOJ_a_B" ){
688 m_XEJWOJ_a_B = x.second.getValue<unsigned int>();
689 } else if( x.first == "XEJWOJ_a_C" ){
690 m_XEJWOJ_a_C = x.second.getValue<unsigned int>();
691 } else if( x.first == "XEJWOJ_b_A" ){
692 m_XEJWOJ_b_A = x.second.getValue<unsigned int>();
693 } else if( x.first == "XEJWOJ_b_B" ){
694 m_XEJWOJ_b_B = x.second.getValue<unsigned int>();
695 } else if( x.first == "XEJWOJ_b_C" ){
696 m_XEJWOJ_b_C = x.second.getValue<unsigned int>();
697 } else if( x.first == "XEJWOJ_c_A" ){
698 m_XEJWOJ_c_A = x.second.getValue<unsigned int>();
699 } else if( x.first == "XEJWOJ_c_B" ){
700 m_XEJWOJ_c_B = x.second.getValue<unsigned int>();
701 } else if( x.first == "XEJWOJ_c_C" ){
702 m_XEJWOJ_c_C = x.second.getValue<unsigned int>();
703 }
704 }
705}
706
707/*******
708 * gTE
709 *******/
710void
714
715/*******
716 * MU
717 *******/
718unsigned int
720{
721 try {
722 return m_rpcPtMap.at(pt);
723 }
724 catch(std::exception & ex) {
725 std::cerr << "No RPC index defined for pt " << pt << endl;
726 throw;
727 }
728}
729
730
731unsigned int
733{
734 try {
735 return m_tgcPtMap.at(pt);
736 }
737 catch(std::exception & ex) {
738 std::cerr << "No TGC index defined for pt " << pt << endl;
739 throw;
740 }
741}
742
743unsigned int
745{
746
747 for(auto & x : m_rpcPtMap){
748 if(x.second==idx) return x.first;
749 }
750 throw std::runtime_error("index "+std::to_string(idx)+" not found for RPC roads");
751
752}
753
754unsigned int
756{
757
758 for(auto & x : m_tgcPtMap){
759 if(x.second==idx) return x.first;
760 }
761 throw std::runtime_error("index "+std::to_string(idx)+" not found for TGC roads");
762
763}
764
765unsigned int
767{
768
769 int ptValue = ptForRpcIdx(rpcIdx);
770 return tgcIdxForPt(ptValue);
771}
772
773std::vector<unsigned int>
775{
776 std::vector<unsigned int> ptValues;
777 for( auto & x : m_rpcPtMap ) {
778 ptValues.emplace_back(x.first);
779 }
780 return ptValues;
781}
782
783std::vector<unsigned int>
785{
786 std::vector<unsigned int> ptValues;
787 for( auto & x : m_tgcPtMap ) {
788 ptValues.emplace_back(x.first);
789 }
790 return ptValues;
791}
792
793
794std::vector<std::string>
796{
797 std::vector<std::string> listNames;
798 for( auto & x : m_roiExclusionLists ) {
799 listNames.emplace_back(x.first);
800 }
801 return listNames;
802}
803
804
805const std::map<std::string, std::vector<unsigned int> > &
806TrigConf::L1ThrExtraInfo_MU::exclusionList(const std::string & listName) const
807{
808 try {
809 return m_roiExclusionLists.at(listName);
810 }
811 catch(std::exception & ex) {
812 std::cerr << "No exclusion list '" << listName << "' defined in MU threshold exlusionLists" << endl;
813 throw;
814 }
815}
816
817void
819{
820 {
821 DataStructure ds = m_extraInfo["roads"].getObject("rpc");
822 for( const auto & x : ds.data() ) {
823 m_rpcPtMap.emplace( static_cast<unsigned int>(std::stoul(x.first)),
824 static_cast<unsigned int>(std::stoul(x.second.data())));
825 }
826 }
827 {
828 DataStructure ds = m_extraInfo["roads"].getObject("tgc");
829 for( auto & x : ds.data() ) {
830 m_tgcPtMap.emplace( static_cast<unsigned int>(std::stoul(x.first)),
831 static_cast<unsigned int>(std::stoul(x.second.data())));
832 }
833 }
834 for( auto & x : m_extraInfo["exclusionLists"].data() ) {
835 const std::string & listName = x.first;
836 std::map<std::string, std::vector<unsigned int>> roisBySector;
837 for( auto & list : x.second ) {
838 const std::string & sectorName = list.second.get_child("sectorName").get_value<std::string>();
839 std::vector<unsigned int> rois;
840 for( auto & roi : list.second.get_child("rois") ) {
841 rois.push_back( static_cast<unsigned int>(std::stoul( roi.second.data() )) );
842 }
843 roisBySector.emplace(sectorName, std::move(rois));
844 }
845 m_roiExclusionLists.emplace(listName, std::move(roisBySector));
846 }
847}
848
849
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.
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
static WP stringToWP(const std::string &)
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
STL namespace.