16 parseTriggerString(L1Phase1_thresholds);
19 TrigTauInfo::TrigTauInfo(
const std::string& trigger,
const std::map<std::string, float>& L1Phase1_thresholds,
const std::map<std::string, uint64_t>& L1Phase1_threshold_patterns)
22 parseTriggerString(L1Phase1_thresholds, L1Phase1_threshold_patterns);
25 TrigTauInfo::TrigTauInfo(
const std::string& trigger,
const std::map<int, int>& L1Phase1ThrMap_eTAU,
const std::map<int, int>& L1Phase1ThrMap_jTAU)
28 parseTriggerString(L1Phase1ThrMap_eTAU, L1Phase1ThrMap_jTAU);
36 if(clean_trigger.size() > 3 && clean_trigger.rfind(
"L1_", 0) == 0) {
37 clean_trigger =
"L1" + clean_trigger.substr(3);
40 std::vector<std::string> sections;
51 std::regex l1_tau_rgx(
"(\\d*)(e|j|c|)TAU(\\d+)(L|M|T|HL|HM|HT|H|IM|I|)");
52 std::regex l1_toposeparate_rgx(
"^(\\d{0,2})(DETA|DPHI)(\\d{0,2})$");
53 std::regex topo_rgx(
"^.*(invm|dR|deta|dphi)AB.*$");
54 std::vector<std::regex*> all_regexes = {&tau_rgx, &elec_rgx, &muon_rgx, &gamma_rgx, &jet_rgx, &met_rgx, &l1_rgx};
56 std::regex tau_type_rgx(
"^(ptonly|tracktwoMVA|tracktwoMVABDT|tracktwoLLP|trackLRT)$");
57 std::regex tau_ID_rgx(
"^(perf|idperf|veryloose.*|loose.*|medium.*|tight.*)$");
60 std::regex_token_iterator<std::string::iterator> rend;
63 std::vector<std::string>
leg;
64 for(
size_t i = 0;
i < sections.size();
i++) {
65 leg.push_back(sections[
i]);
68 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); }))) {
70 if(std::regex_match(
leg[0],
match, tau_rgx)) {
71 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
75 auto itr = find_if(
leg.begin(),
leg.end(), [tau_type_rgx](
const std::string&
s) { return std::regex_match(s, tau_type_rgx); });
76 std::string
type = itr !=
leg.end() ? *itr :
"";
79 itr = find_if(
leg.begin(),
leg.end(), [tau_ID_rgx](
const std::string&
s) { return std::regex_match(s, tau_ID_rgx); });
80 std::string tau_id = itr !=
leg.end() ? *itr :
"";
81 if(boost::starts_with(tau_id,
"veryloose")) tau_id = tau_id.substr(9);
82 else if(boost::starts_with(tau_id,
"loose")) tau_id = tau_id.substr(5);
83 else if(boost::starts_with(tau_id,
"medium")) tau_id = tau_id.substr(6);
84 else if(boost::starts_with(tau_id,
"tight")) tau_id = tau_id.substr(5);
88 if(
type ==
"tracktwoMVA") tau_id =
"DeepSet";
89 if(
type ==
"tracktwoLLP" ||
type ==
"trackLRT") tau_id =
"RNNLLP";
93 if(tau_id ==
"DS") tau_id =
"DeepSet";
94 else if(tau_id ==
"GNT") tau_id =
"GNTau";
96 for(
size_t j = 0; j < multiplicity; j++) {
101 }
else if(std::regex_match(
leg[0],
match, elec_rgx)) {
102 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
105 }
else if(std::regex_match(
leg[0],
match, muon_rgx)) {
106 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
109 }
else if(std::regex_match(
leg[0],
match, gamma_rgx)) {
110 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
113 }
else if(std::regex_match(
leg[0],
match, jet_rgx)) {
114 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
117 }
else if(std::regex_match(
leg[0],
match, met_rgx)) {
120 }
else if(std::regex_match(
leg[0],
match, noalg_rgx)) {
122 }
else if(std::regex_match(
leg[0], l1_rgx)) {
123 for(
size_t j = 0; j <
leg.size(); j++) {
124 if(std::regex_match(
leg[j], topo_rgx))
continue;
127 if(
leg[j].
find(
'-') != std::string::npos || std::regex_match(
leg[j], l1_toposeparate_rgx)) {
130 if(
leg[0] ==
"L1TAU60" &&
leg[j] ==
"DR-TAU12ITAU12I")
leg[j] =
"TAU12IM";
131 else if(
leg.size() == 1 && (
leg[0] ==
"L1DR-TAU20ITAU12I" ||
leg[0] ==
"L1DR-TAU20ITAU12I-J25")) {
133 leg[0] =
"L1TAU20IM";
134 leg.push_back(
"TAU12IM");
155 std::regex_token_iterator<std::string::iterator> rgx_iter(
m_L1Item.begin(),
m_L1Item.end(), l1_tau_rgx);
156 while(rgx_iter != rend) {
157 std::string
s = *rgx_iter;
158 std::regex_match(
s,
match, l1_tau_rgx);
159 size_t multiplicity =
match[1].str() ==
"" ? 1 : std::stoi(
match[1].
str());
160 std::string item_type =
match[2].str();
162 std::string item_isolation =
match[4].str();
165 if(remove_L1_phase1_thresholds && (item_type ==
"e" || item_type ==
"j" || item_type ==
"c"))
threshold = -1;
167 for(
size_t j = 0; j < multiplicity; j++) {
215 if(item_type ==
"eTAU" || item_type ==
"cTAU") {
217 }
else if(item_type ==
"jTAU") {