35{
37
38
39 if(clean_trigger.size() > 3 && clean_trigger.rfind("L1_", 0) == 0) {
40 clean_trigger = "L1" + clean_trigger.substr(3);
41 }
42
43 std::vector<std::string> sections;
44 for (
auto&& subrange : std::views::split(
m_trigger,
'_')) sections.emplace_back(subrange.begin(), subrange.end());
45
46 std::regex tau_rgx("^(\\d*)tau(\\d+)$");
47 std::regex elec_rgx("^(\\d*)e(\\d+)$");
48 std::regex muon_rgx("^(\\d*)mu(\\d+)$");
49 std::regex gamma_rgx("^(\\d*)g(\\d+)$");
50 std::regex jet_rgx("^(\\d*)j(\\d+)$");
51 std::regex met_rgx("^xe(\\d+)$");
52 std::regex noalg_rgx("^noalg$");
53 std::regex l1_rgx("^L1.*$");
54 std::regex l1_tau_rgx("(\\d*)(e|j|c|)TAU(\\d+)(L|M|T|HL|HM|HT|H|IM|I|)");
55 std::regex l1_toposeparate_rgx("^(\\d{0,2})(DETA|DPHI)(\\d{0,2})$");
56 std::regex topo_rgx("^.*(invm|dR|deta|dphi)AB.*$");
57 std::regex ditauomni_rgx("^ditauOmni(\\d)+Trk(\\d)+$");
58 std::vector<std::regex*> all_regexes = {&tau_rgx, &elec_rgx, &muon_rgx, &gamma_rgx, &jet_rgx, &met_rgx, &l1_rgx, &ditauomni_rgx};
59
60 std::regex tau_type_rgx("^(ptonly|tracktwoMVA|tracktwoMVABDT|tracktwoLLP|trackLRT)$");
61 std::regex tau_ID_rgx("^(perf|idperf|veryloose.*|loose.*|medium.*|tight.*)$");
62
64 std::regex_token_iterator<std::string::iterator> rend;
65
66
67 std::vector<std::string>
leg;
68 for(
size_t i = 0;
i < sections.size();
i++) {
69 leg.push_back(sections[i]);
70
71 if(i == sections.size() - 1 || (std::any_of(all_regexes.begin(), all_regexes.end(), [§ions, i](const std::regex* rgx) { return std::regex_match(sections[i+1], *rgx); }))) {
72
73 if(std::regex_match(leg[0],
match, tau_rgx)) {
74 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
76
77
78 auto itr = find_if(
leg.begin(),
leg.end(), [tau_type_rgx](
const std::string& s) { return std::regex_match(s, tau_type_rgx); });
79 std::string
type = itr !=
leg.end() ? *itr :
"tracktwoMVA";
80
81
82 itr = find_if(
leg.begin(),
leg.end(), [tau_ID_rgx](
const std::string& s) { return std::regex_match(s, tau_ID_rgx); });
83 std::string tau_id = itr !=
leg.end() ? *itr :
"";
84 if(tau_id.starts_with( "veryloose")) tau_id = tau_id.substr(9);
85 else if(tau_id.starts_with( "loose")) tau_id = tau_id.substr(5);
86 else if(tau_id.starts_with( "medium")) tau_id = tau_id.substr(6);
87 else if(tau_id.starts_with( "tight")) tau_id = tau_id.substr(5);
88
89
90 if(tau_id == "RNN") {
91 if(type == "tracktwoMVA") tau_id = "DeepSet";
92 if(type == "tracktwoLLP" || type == "trackLRT") tau_id = "RNNLLP";
93 }
94
95
96 if(tau_id == "DS") tau_id = "DeepSet";
97 else if(tau_id == "GNT") tau_id = "GNTau";
98
99 for(
size_t j = 0;
j < multiplicity;
j++) {
103 }
104 }
else if(std::regex_match(leg[0],
match, elec_rgx)) {
105 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
107 for(
size_t j = 0;
j < multiplicity;
j++)
m_HLTElecThr.push_back(threshold);
108 }
else if(std::regex_match(leg[0],
match, muon_rgx)) {
109 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
111 for(
size_t j = 0;
j < multiplicity;
j++)
m_HLTMuonThr.push_back(threshold);
112 }
else if(std::regex_match(leg[0],
match, gamma_rgx)) {
113 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
115 for(
size_t j = 0;
j < multiplicity;
j++)
m_HLTGammaThr.push_back(threshold);
116 }
else if(std::regex_match(leg[0],
match, jet_rgx)) {
117 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
119 for(
size_t j = 0;
j < multiplicity;
j++)
m_HLTJetThr.push_back(threshold);
120 }
else if(std::regex_match(leg[0],
match, met_rgx)) {
123 }
else if(std::regex_match(leg[0],
match, noalg_rgx)) {
125 }
else if (std::regex_match(leg[0],
match, ditauomni_rgx)) {
127 } else if(std::regex_match(leg[0], l1_rgx)){
128 for(
size_t j = 0;
j <
leg.size();
j++) {
129 if(std::regex_match(leg[j], topo_rgx)) continue;
130
131
132 if(leg[j].
find(
'-') != std::string::npos || std::regex_match(leg[j], l1_toposeparate_rgx)) {
133
134
135 if(leg[0] ==
"L1TAU60" && leg[j] ==
"DR-TAU12ITAU12I")
leg[
j] =
"TAU12IM";
136 else if(
leg.size() == 1 && (leg[0] ==
"L1DR-TAU20ITAU12I" || leg[0] ==
"L1DR-TAU20ITAU12I-J25")) {
137
138 leg[0] =
"L1TAU20IM";
139 leg.push_back(
"TAU12IM");
140
141 }
142 else continue;
143 }
144
145 m_L1Items.push_back(j == 0 ? leg[j].substr(2, leg[j].size()) : leg[j]);
146 }
147 }
148
149
151 }
152 }
153
155
158
159
160 std::regex_token_iterator<std::string::iterator> rgx_iter(
m_L1Item.begin(),
m_L1Item.end(), l1_tau_rgx);
161 while(rgx_iter != rend) {
162 const std::string &
s = *rgx_iter;
163 if (std::regex_match(s,
match, l1_tau_rgx)){
164 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
165 std::string item_type =
match[2].str();
167 std::string item_isolation =
match[4].str();
168
169
170 if(remove_L1_phase1_thresholds && (item_type ==
"e" || item_type ==
"j" || item_type ==
"c"))
threshold = -1;
171
172 for(
size_t j = 0;
j < multiplicity;
j++) {
178 }
179 }
180 rgx_iter++;
181 }
182
184 }
185}
std::string find(const std::string &s)
return a remapped string
bool match(std::string s1, std::string s2)
match the individual directories of two strings
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)