ATLAS Offline Software
L1MenuResources.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "L1MenuResources.h"
6 
7 #include "TrigConfData/L1Menu.h"
9 #include "TrigConfData/L1TopoAlgorithm.h" // VariableParameter declaration
10 
11 #include <sstream>
12 
13 
14 namespace GlobalSim {
15 
17  const std::string& confAlgName,
18  const std::string& confAlgTypeLabel
19  ):
20  m_l1menu{l1menu},
21  m_confAlgName{confAlgName},
22  m_confAlgTypeLabel{confAlgTypeLabel}{
23  std::vector<std::string> permittedTypeLabels{"MULTTOPO", "TOPO"};
24  if (std::find(permittedTypeLabels.cbegin(),
25  permittedTypeLabels.cend(),
26  m_confAlgTypeLabel) == permittedTypeLabels.cend()) {
27  throw std::runtime_error("L1TopoMenuResources unknown alg type label " +
28  m_confAlgTypeLabel);
29  }
30 
31  }
32 
33 
34 
35  std::map<std::string, int> L1MenuResources::isolationFW_CTAU() const {
36  const TrigConf::L1ThrExtraInfo_cTAU &ctauExtraInfo =
38 
39  const auto& LooseSel = TrigConf::Selection::WP::LOOSE;
40  const auto& MediumSel = TrigConf::Selection::WP::MEDIUM;
41  const auto& TightSel = TrigConf::Selection::WP::TIGHT;
42 
43  int CTAU_iso_fw_loose =
44  static_cast<int>(ctauExtraInfo.isolation(LooseSel, 0).isolation_fw());
45 
46  int CTAU_iso_fw_medium =
47  static_cast<int>(ctauExtraInfo.isolation(MediumSel, 0).isolation_fw());
48 
49  int CTAU_iso_fw_tight =
50  static_cast<int>(ctauExtraInfo.isolation(TightSel, 0).isolation_fw());
51 
52  std::map<std::string, int> isolationMap;
53 
54  isolationMap[TrigConf::Selection::wpToString(LooseSel)] =
55  CTAU_iso_fw_loose;
56 
57  isolationMap[TrigConf::Selection::wpToString(MediumSel)] =
58  CTAU_iso_fw_medium;
59 
60  isolationMap[TrigConf::Selection::wpToString(TightSel)] =
61  CTAU_iso_fw_tight;
62 
63  return isolationMap;
64 
65  }
66 
67 
68  std::map<std::string, int>
70 
71  const TrigConf::L1ThrExtraInfo_cTAU &ctauExtraInfo =
73 
74  const auto& LooseSel = TrigConf::Selection::WP::LOOSE;
75  const auto& MediumSel = TrigConf::Selection::WP::MEDIUM;
76  const auto& TightSel = TrigConf::Selection::WP::TIGHT;
77 
78  int CTAU_iso_fw_loose =
79  static_cast<int>(ctauExtraInfo.isolation(LooseSel,
81 
82  int CTAU_iso_fw_medium =
83  static_cast<int>(ctauExtraInfo.isolation(MediumSel,
85 
86  int CTAU_iso_fw_tight =
87  static_cast<int>(ctauExtraInfo.isolation(TightSel,
89 
90  std::map<std::string, int> isolationMap;
91 
92  isolationMap[TrigConf::Selection::wpToString(LooseSel)] =
93  CTAU_iso_fw_loose;
94 
95  isolationMap[TrigConf::Selection::wpToString(MediumSel)] =
96  CTAU_iso_fw_medium;
97 
98  isolationMap[TrigConf::Selection::wpToString(TightSel)] =
99  CTAU_iso_fw_tight;
100 
101  return isolationMap;
102 
103  }
104 
105 
108  return m_l1menu.threshold(l1algo.outputs().at(0));
109  }
110 
111 
112  std::string L1MenuResources::to_string() const {
113 
115  const auto & a_name = l1alg.name();
116  auto parameters = l1alg.parameters();
117  std::stringstream ss;
118  ss<< "L1Menu resources for alg " << a_name;
119  for (const auto& param : parameters){
120  ss << " parameter: " << std::setw(20) << std::left << param.name()
121  << " value: " << std::setw(3) << std::left << param.value()
122  << " selection: " << param.selection() << '\n';
123  }
124 
125  ss << "inputs [" << l1alg.inputs().size() << "]:\n";
126  for (const auto& p : l1alg.inputs()) {
127  ss << " input: " << p << '\n';
128  }
129 
130  ss << "outputs [" << l1alg.outputs().size() << "]:\n";
131  for (const auto& p : l1alg.outputs()) {
132  ss << " output: " << p << '\n';
133  }
134 
135  return ss.str();
136  }
137 
138  const std::string& L1MenuResources::menuName() {return m_l1menu.name();}
139 }
140 
TrigConf::Selection::WP::LOOSE
@ LOOSE
TrigConf::L1Menu::algorithm
const TrigConf::L1TopoAlgorithm & algorithm(const std::string &algoName, const std::string &category) const
Access to topo algorithm by name.
Definition: L1Menu.cxx:382
TrigConf::L1ThrExtraInfo_cTAU::WorkingPoints_cTAU::isolation_fw
unsigned int isolation_fw() const
Definition: L1ThrExtraInfo.h:355
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigConf::L1ThrExtraInfo_cTAU::WorkingPoints_cTAU::isolation_jTAUCoreScale_fw
unsigned int isolation_jTAUCoreScale_fw() const
Definition: L1ThrExtraInfo.h:357
TrigConf::Selection::wpToString
static std::string wpToString(WP)
Definition: L1ThresholdBase.cxx:347
TrigConf::L1Menu::thrExtraInfo
const L1ThrExtraInfo & thrExtraInfo() const
Access to extra info for threshold types.
Definition: L1Menu.cxx:307
GlobalSim::L1MenuResources::m_l1menu
const TrigConf::L1Menu & m_l1menu
Definition: L1MenuResources.h:53
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
TrigConf::DataStructure::name
virtual const std::string & name() const final
Definition: DataStructure.cxx:109
L1MenuResources.h
L1Threshold.h
TrigConf::L1ThrExtraInfo_cTAU::isolation
const WorkingPoints_cTAU & isolation(TrigConf::Selection::WP wp, int eta) const
Definition: L1ThrExtraInfo.h:380
GlobalSim::L1MenuResources::isolationFW_CTAU_jTAUCoreScale
std::map< std::string, int > isolationFW_CTAU_jTAUCoreScale() const
Definition: L1MenuResources.cxx:69
GlobalSim::L1MenuResources::threshold
const TrigConf::L1Threshold & threshold() const
Definition: L1MenuResources.cxx:106
GlobalSim
AlgTool to obtain a GlobalSim::cTAUTOBArray This class uses ReadHandls to jFex and eFex Tau Rois If t...
Definition: dump.h:8
GlobalSim::L1MenuResources::isolationFW_CTAU
std::map< std::string, int > isolationFW_CTAU() const
Definition: L1MenuResources.cxx:35
GlobalSim::L1MenuResources::menuName
const std::string & menuName()
Definition: L1MenuResources.cxx:138
GlobalSim::L1MenuResources::m_confAlgName
std::string m_confAlgName
Definition: L1MenuResources.h:54
TrigConf::L1ThrExtraInfo_cTAU
Definition: L1ThrExtraInfo.h:349
GlobalSim::L1MenuResources::m_confAlgTypeLabel
std::string m_confAlgTypeLabel
Definition: L1MenuResources.h:57
TrigConf::L1Menu::threshold
const TrigConf::L1Threshold & threshold(const std::string &thresholdName) const
Access to L1Threshold by name.
Definition: L1Menu.cxx:279
TrigConf::Selection::WP::MEDIUM
@ MEDIUM
TrigConf::Selection::WP::TIGHT
@ TIGHT
GlobalSim::L1MenuResources::to_string
std::string to_string() const
Definition: L1MenuResources.cxx:112
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
TrigConf::L1ThrExtraInfo::cTAU
const L1ThrExtraInfo_cTAU & cTAU() const
Definition: L1ThrExtraInfo.cxx:143
L1TopoAlgorithm.h
L1Menu.h
GlobalSim::L1MenuResources::L1MenuResources
L1MenuResources(const TrigConf::L1Menu &l1menu, const std::string &confAlgName, const std::string &confAlgTypeLabel)
Definition: L1MenuResources.cxx:16
TrigConf::L1Threshold
Standard L1 threshold configuration.
Definition: L1ThresholdBase.h:125