ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrigTauInfo Class Reference

#include <TrigTauInfo.h>

Collaboration diagram for TrigTauInfo:

Public Member Functions

 TrigTauInfo ()
 
 TrigTauInfo (const std::string &trigger)
 
 TrigTauInfo (const std::string &trigger, const std::map< std::string, float > &L1Phase1_thresholds)
 
 TrigTauInfo (const std::string &trigger, const std::map< std::string, float > &L1Phase1_thresholds, const std::map< std::string, uint64_t > &L1Phase1_threshold_patterns)
 
 TrigTauInfo (const std::string &trigger, const std::map< int, int > &L1Phase1ThrMap_eTAU, const std::map< int, int > &L1Phase1ThrMap_jTAU)
 
const std::string & getTriggerName () const
 
bool isStreamer () const
 
float getHLTTauThreshold () const
 
const std::vector< float > & getHLTTauThresholds () const
 
const std::string getHLTTauType () const
 
const std::vector< std::string > & getHLTTauTypes () const
 
const std::string getHLTTauID () const
 
const std::vector< std::string > & getHLTTauIDs () const
 
const std::string & getTriggerL1Name () const
 
const std::vector< std::string > & getTriggerL1Items () const
 
const std::string getL1TauItem () const
 
const std::vector< std::string > & getL1TauItems () const
 
float getL1TauThreshold () const
 
const std::vector< float > & getL1TauThresholds () const
 
const std::string getL1TauType () const
 
const std::vector< std::string > & getL1TauTypes () const
 
const std::string getL1TauIsolation () const
 
const std::vector< std::string > & getL1TauIsolations () const
 
bool isL1TauIsolated (const size_t idx=0) const
 
bool areAnyL1TauIsolated () const
 
int64_t getL1TauThresholdPattern () const
 
const std::vector< int64_t > & getL1TauThresholdPatterns () const
 
const std::vector< std::string > & getHLTBoostedDitauName () const
 
bool isHLTSingleTau () const
 
bool isHLTDiTau () const
 
bool isHLTBoostedDiTau () const
 
bool isHLTTandP () const
 
bool isL1TauOnly () const
 
bool isTauStreamer () const
 
bool hasHLTElectronLeg () const
 
bool hasHLTMuonLeg () const
 
bool hasHLTGammaLeg () const
 
bool hasHLTJetLeg () const
 
bool hasHLTMETLeg () const
 
float getHLTElecThreshold () const
 
const std::vector< float > & getHLTElecThresholds () const
 
float getHLTMuonThreshold () const
 
const std::vector< float > & getHLTMuonThresholds () const
 
float getHLTGammaThreshold () const
 
const std::vector< float > & getHLTGammaThresholds () const
 
float getHLTJetThreshold () const
 
const std::vector< float > & getHLTJetThresholds () const
 
float getHLTMETThreshold () const
 
const std::vector< float > & getHLTMETThresholds () const
 

Private Member Functions

bool is_number (const std::string &s)
 
void parseTriggerString (bool remove_L1_phase1_thresholds=true)
 
void parseTriggerString (const std::map< std::string, float > &L1Phase1_thresholds)
 
void parseTriggerString (const std::map< std::string, float > &L1Phase1_thresholds, const std::map< std::string, uint64_t > &L1Phase1_threshold_patterns)
 
void parseTriggerString (const std::map< int, int > &L1Phase1ThrMap_eTAU, const std::map< int, int > &L1Phase1ThrMap_jTAU)
 

Private Attributes

std::string m_trigger
 
bool m_isStreamer = false
 
std::vector< float > m_HLTThr
 
std::vector< std::string > m_HLTTauTypes
 
std::vector< std::string > m_HLTTauIDs
 
std::string m_L1Item
 
std::vector< std::string > m_L1Items
 
std::vector< float > m_tauL1Thr
 
std::vector< std::string > m_tauL1Items
 
std::vector< std::string > m_tauL1Type
 
std::vector< std::string > m_tauL1Iso
 
std::vector< int64_t > m_tauL1ThresholdPattern
 
std::vector< float > m_HLTElecThr
 
std::vector< float > m_HLTMuonThr
 
std::vector< float > m_HLTGammaThr
 
std::vector< float > m_HLTJetThr
 
std::vector< float > m_HLTMETThr
 
std::vector< std::string > m_HLTBoostedDitauName
 

Detailed Description

Definition at line 14 of file TrigTauInfo.h.

Constructor & Destructor Documentation

◆ TrigTauInfo() [1/5]

TrigTauInfo::TrigTauInfo ( )
inline

Definition at line 16 of file TrigTauInfo.h.

16 {} // Required for the dictionary

◆ TrigTauInfo() [2/5]

TrigTauInfo::TrigTauInfo ( const std::string &  trigger)

Definition at line 9 of file TrigTauInfo.cxx.

10  : m_trigger{trigger}
11 {
13 }

◆ TrigTauInfo() [3/5]

TrigTauInfo::TrigTauInfo ( const std::string &  trigger,
const std::map< std::string, float > &  L1Phase1_thresholds 
)

Definition at line 15 of file TrigTauInfo.cxx.

16  : m_trigger{trigger}
17 {
18  parseTriggerString(L1Phase1_thresholds);
19 }

◆ TrigTauInfo() [4/5]

TrigTauInfo::TrigTauInfo ( const std::string &  trigger,
const std::map< std::string, float > &  L1Phase1_thresholds,
const std::map< std::string, uint64_t > &  L1Phase1_threshold_patterns 
)

Definition at line 21 of file TrigTauInfo.cxx.

22  : m_trigger{trigger}
23 {
24  parseTriggerString(L1Phase1_thresholds, L1Phase1_threshold_patterns);
25 }

◆ TrigTauInfo() [5/5]

TrigTauInfo::TrigTauInfo ( const std::string &  trigger,
const std::map< int, int > &  L1Phase1ThrMap_eTAU,
const std::map< int, int > &  L1Phase1ThrMap_jTAU 
)

Definition at line 27 of file TrigTauInfo.cxx.

28  : m_trigger{trigger}
29 {
30  parseTriggerString(L1Phase1ThrMap_eTAU, L1Phase1ThrMap_jTAU);
31 }

Member Function Documentation

◆ areAnyL1TauIsolated()

bool TrigTauInfo::areAnyL1TauIsolated ( ) const
inline

Definition at line 43 of file TrigTauInfo.h.

43 { for(const std::string& iso : m_tauL1Iso) { if(iso.size()) return true; }; return false; } // Returns true any of the L1 items are isolated

◆ getHLTBoostedDitauName()

const std::vector<std::string>& TrigTauInfo::getHLTBoostedDitauName ( ) const
inline

Definition at line 46 of file TrigTauInfo.h.

46 { return m_HLTBoostedDitauName; }

◆ getHLTElecThreshold()

float TrigTauInfo::getHLTElecThreshold ( ) const
inline

Definition at line 63 of file TrigTauInfo.h.

63 { return m_HLTElecThr.size() ? m_HLTElecThr[0] : -1; } // Returns the main leg threshold

◆ getHLTElecThresholds()

const std::vector<float>& TrigTauInfo::getHLTElecThresholds ( ) const
inline

Definition at line 64 of file TrigTauInfo.h.

64 { return m_HLTElecThr; }

◆ getHLTGammaThreshold()

float TrigTauInfo::getHLTGammaThreshold ( ) const
inline

Definition at line 67 of file TrigTauInfo.h.

67 { return m_HLTGammaThr.size() ? m_HLTGammaThr[0] : -1; } // Returns the main leg threshold

◆ getHLTGammaThresholds()

const std::vector<float>& TrigTauInfo::getHLTGammaThresholds ( ) const
inline

Definition at line 68 of file TrigTauInfo.h.

68 { return m_HLTGammaThr; }

◆ getHLTJetThreshold()

float TrigTauInfo::getHLTJetThreshold ( ) const
inline

Definition at line 69 of file TrigTauInfo.h.

69 { return m_HLTJetThr.size() ? m_HLTJetThr[0] : -1; } // Returns the main leg threshold

◆ getHLTJetThresholds()

const std::vector<float>& TrigTauInfo::getHLTJetThresholds ( ) const
inline

Definition at line 70 of file TrigTauInfo.h.

70 { return m_HLTJetThr; }

◆ getHLTMETThreshold()

float TrigTauInfo::getHLTMETThreshold ( ) const
inline

Definition at line 71 of file TrigTauInfo.h.

71 { return m_HLTMETThr.size() ? m_HLTMETThr[0] : -1; } // Returns the main leg threshold

◆ getHLTMETThresholds()

const std::vector<float>& TrigTauInfo::getHLTMETThresholds ( ) const
inline

Definition at line 72 of file TrigTauInfo.h.

72 { return m_HLTMETThr; }

◆ getHLTMuonThreshold()

float TrigTauInfo::getHLTMuonThreshold ( ) const
inline

Definition at line 65 of file TrigTauInfo.h.

65 { return m_HLTMuonThr.size() ? m_HLTMuonThr[0] : -1; } // Returns the main leg threshold

◆ getHLTMuonThresholds()

const std::vector<float>& TrigTauInfo::getHLTMuonThresholds ( ) const
inline

Definition at line 66 of file TrigTauInfo.h.

66 { return m_HLTMuonThr; }

◆ getHLTTauID()

const std::string TrigTauInfo::getHLTTauID ( ) const
inline

Definition at line 29 of file TrigTauInfo.h.

29 { return m_HLTTauIDs.size() ? m_HLTTauIDs[0] : ""; } // Returns the main HLT tau leg ID algorithm

◆ getHLTTauIDs()

const std::vector<std::string>& TrigTauInfo::getHLTTauIDs ( ) const
inline

Definition at line 30 of file TrigTauInfo.h.

30 { return m_HLTTauIDs; }

◆ getHLTTauThreshold()

float TrigTauInfo::getHLTTauThreshold ( ) const
inline

Definition at line 25 of file TrigTauInfo.h.

25 { return m_HLTThr.size() ? m_HLTThr[0] : -1; } // Returns the main HLT threshold

◆ getHLTTauThresholds()

const std::vector<float>& TrigTauInfo::getHLTTauThresholds ( ) const
inline

Definition at line 26 of file TrigTauInfo.h.

26 { return m_HLTThr; }

◆ getHLTTauType()

const std::string TrigTauInfo::getHLTTauType ( ) const
inline

Definition at line 27 of file TrigTauInfo.h.

27 { return m_HLTTauTypes.size() ? m_HLTTauTypes[0] : ""; } // Returns the main HLT tau leg type

◆ getHLTTauTypes()

const std::vector<std::string>& TrigTauInfo::getHLTTauTypes ( ) const
inline

Definition at line 28 of file TrigTauInfo.h.

28 { return m_HLTTauTypes; }

◆ getL1TauIsolation()

const std::string TrigTauInfo::getL1TauIsolation ( ) const
inline

Definition at line 40 of file TrigTauInfo.h.

40 { return m_tauL1Iso.size() ? m_tauL1Iso[0] : ""; } // Returns the main L1 item isolation

◆ getL1TauIsolations()

const std::vector<std::string>& TrigTauInfo::getL1TauIsolations ( ) const
inline

Definition at line 41 of file TrigTauInfo.h.

41 { return m_tauL1Iso; }

◆ getL1TauItem()

const std::string TrigTauInfo::getL1TauItem ( ) const
inline

Definition at line 34 of file TrigTauInfo.h.

34 { return m_tauL1Items.size() ? m_tauL1Items[0] : ""; } // Returns the main L1 tau item

◆ getL1TauItems()

const std::vector<std::string>& TrigTauInfo::getL1TauItems ( ) const
inline

Definition at line 35 of file TrigTauInfo.h.

35 { return m_tauL1Items; }

◆ getL1TauThreshold()

float TrigTauInfo::getL1TauThreshold ( ) const
inline

Definition at line 36 of file TrigTauInfo.h.

36 { return m_tauL1Thr.size() ? m_tauL1Thr[0] : -1; } // Returns the main L1 item threshold

◆ getL1TauThresholdPattern()

int64_t TrigTauInfo::getL1TauThresholdPattern ( ) const
inline

Definition at line 44 of file TrigTauInfo.h.

44 { return m_tauL1ThresholdPattern.size() ? m_tauL1ThresholdPattern[0] : -1; } // Returns the main L1 item thresholdPattern mask

◆ getL1TauThresholdPatterns()

const std::vector<int64_t>& TrigTauInfo::getL1TauThresholdPatterns ( ) const
inline

Definition at line 45 of file TrigTauInfo.h.

45 { return m_tauL1ThresholdPattern; }

◆ getL1TauThresholds()

const std::vector<float>& TrigTauInfo::getL1TauThresholds ( ) const
inline

Definition at line 37 of file TrigTauInfo.h.

37 { return m_tauL1Thr; }

◆ getL1TauType()

const std::string TrigTauInfo::getL1TauType ( ) const
inline

Definition at line 38 of file TrigTauInfo.h.

38 { return m_tauL1Items.size() ? m_tauL1Type[0] : ""; } // Returns the main L1 item type

◆ getL1TauTypes()

const std::vector<std::string>& TrigTauInfo::getL1TauTypes ( ) const
inline

Definition at line 39 of file TrigTauInfo.h.

39 { return m_tauL1Type; }

◆ getTriggerL1Items()

const std::vector<std::string>& TrigTauInfo::getTriggerL1Items ( ) const
inline

Definition at line 33 of file TrigTauInfo.h.

33 { return m_L1Items; }

◆ getTriggerL1Name()

const std::string& TrigTauInfo::getTriggerL1Name ( ) const
inline

Definition at line 32 of file TrigTauInfo.h.

32 { return m_L1Item; }

◆ getTriggerName()

const std::string& TrigTauInfo::getTriggerName ( ) const
inline

Definition at line 22 of file TrigTauInfo.h.

22 { return m_trigger; }

◆ hasHLTElectronLeg()

bool TrigTauInfo::hasHLTElectronLeg ( ) const
inline

Definition at line 57 of file TrigTauInfo.h.

57 { return m_HLTElecThr.size() >= 1; }

◆ hasHLTGammaLeg()

bool TrigTauInfo::hasHLTGammaLeg ( ) const
inline

Definition at line 59 of file TrigTauInfo.h.

59 { return m_HLTGammaThr.size() >= 1; }

◆ hasHLTJetLeg()

bool TrigTauInfo::hasHLTJetLeg ( ) const
inline

Definition at line 60 of file TrigTauInfo.h.

60 { return m_HLTJetThr.size() >= 1; }

◆ hasHLTMETLeg()

bool TrigTauInfo::hasHLTMETLeg ( ) const
inline

Definition at line 61 of file TrigTauInfo.h.

61 { return m_HLTMETThr.size() >= 1; }

◆ hasHLTMuonLeg()

bool TrigTauInfo::hasHLTMuonLeg ( ) const
inline

Definition at line 58 of file TrigTauInfo.h.

58 { return m_HLTMuonThr.size() >= 1; }

◆ is_number()

bool TrigTauInfo::is_number ( const std::string &  s)
inlineprivate

Definition at line 98 of file TrigTauInfo.h.

98  {
99  return !s.empty() && std::find_if(s.begin(), s.end(), [](unsigned char c) {return !std::isdigit(c);}) == s.end();
100  }

◆ isHLTBoostedDiTau()

bool TrigTauInfo::isHLTBoostedDiTau ( ) const
inline

Definition at line 52 of file TrigTauInfo.h.

52 { return m_HLTBoostedDitauName.size() > 0 && (m_HLTThr.size() + m_HLTElecThr.size() + m_HLTMuonThr.size() + m_HLTGammaThr.size() + m_HLTMETThr.size()) == 0; }

◆ isHLTDiTau()

bool TrigTauInfo::isHLTDiTau ( ) const
inline

Definition at line 51 of file TrigTauInfo.h.

51 { return m_HLTThr.size() > 1 && (m_HLTElecThr.size() + m_HLTMuonThr.size() + m_HLTGammaThr.size() + m_HLTJetThr.size() + m_HLTMETThr.size()) == 0; }

◆ isHLTSingleTau()

bool TrigTauInfo::isHLTSingleTau ( ) const
inline

Definition at line 50 of file TrigTauInfo.h.

50 { return m_HLTThr.size() == 1 && (m_HLTElecThr.size() + m_HLTMuonThr.size() + m_HLTGammaThr.size() + m_HLTJetThr.size() + m_HLTMETThr.size()) == 0; }

◆ isHLTTandP()

bool TrigTauInfo::isHLTTandP ( ) const
inline

Definition at line 53 of file TrigTauInfo.h.

53 { return m_HLTThr.size() == 1 && (m_HLTElecThr.size() + m_HLTMuonThr.size()) == 1 && (m_HLTGammaThr.size() + m_HLTJetThr.size() + m_HLTMETThr.size()) == 0; }

◆ isL1TauIsolated()

bool TrigTauInfo::isL1TauIsolated ( const size_t  idx = 0) const
inline

Definition at line 42 of file TrigTauInfo.h.

42 { return idx < m_tauL1Iso.size() ? m_tauL1Iso[idx].size() : false; } // Returns true if the (main by default) L1 item is isolated

◆ isL1TauOnly()

bool TrigTauInfo::isL1TauOnly ( ) const
inline

Definition at line 54 of file TrigTauInfo.h.

54 { return (m_HLTThr.size() + m_HLTElecThr.size() + m_HLTMuonThr.size() + m_HLTGammaThr.size() + m_HLTJetThr.size() + m_HLTMETThr.size()) == 0 && !m_tauL1Items.empty(); }

◆ isStreamer()

bool TrigTauInfo::isStreamer ( ) const
inline

Definition at line 23 of file TrigTauInfo.h.

23 { return m_isStreamer; }

◆ isTauStreamer()

bool TrigTauInfo::isTauStreamer ( ) const
inline

Definition at line 55 of file TrigTauInfo.h.

55 { return m_isStreamer && !m_tauL1Items.empty(); }

◆ parseTriggerString() [1/4]

void TrigTauInfo::parseTriggerString ( bool  remove_L1_phase1_thresholds = true)
private

Definition at line 33 of file TrigTauInfo.cxx.

34 {
35  std::string clean_trigger = m_trigger;
36 
37  // Change the "L1_" prefix to "L1" internally, in case the trigger being parsed is a pure L1 trigger with the usual L1 standalone naming scheme
38  if(clean_trigger.size() > 3 && clean_trigger.rfind("L1_", 0) == 0) {
39  clean_trigger = "L1" + clean_trigger.substr(3);
40  }
41 
42  std::vector<std::string> sections;
43  for (auto&& subrange : std::views::split(m_trigger, '_')) sections.emplace_back(subrange.begin(), subrange.end());
44 
45  std::regex tau_rgx("^(\\d*)tau(\\d+)$");
46  std::regex elec_rgx("^(\\d*)e(\\d+)$");
47  std::regex muon_rgx("^(\\d*)mu(\\d+)$");
48  std::regex gamma_rgx("^(\\d*)g(\\d+)$");
49  std::regex jet_rgx("^(\\d*)j(\\d+)$");
50  std::regex met_rgx("^xe(\\d+)$");
51  std::regex noalg_rgx("^noalg$");
52  std::regex l1_rgx("^L1.*$");
53  std::regex l1_tau_rgx("(\\d*)(e|j|c|)TAU(\\d+)(L|M|T|HL|HM|HT|H|IM|I|)");
54  std::regex l1_toposeparate_rgx("^(\\d{0,2})(DETA|DPHI)(\\d{0,2})$");
55  std::regex topo_rgx("^.*(invm|dR|deta|dphi)AB.*$");
56  std::regex ditauomni_rgx("^ditauOmni(\\d)+Trk(\\d)+$");
57  std::vector<std::regex*> all_regexes = {&tau_rgx, &elec_rgx, &muon_rgx, &gamma_rgx, &jet_rgx, &met_rgx, &l1_rgx, &ditauomni_rgx};
58 
59  std::regex tau_type_rgx("^(ptonly|tracktwoMVA|tracktwoMVABDT|tracktwoLLP|trackLRT)$");
60  std::regex tau_ID_rgx("^(perf|idperf|veryloose.*|loose.*|medium.*|tight.*)$");
61 
62  std::smatch match;
63  std::regex_token_iterator<std::string::iterator> rend;
64 
65  // Check each leg
66  std::vector<std::string> leg;
67  for(size_t i = 0; i < sections.size(); i++) {
68  leg.push_back(sections[i]); // Attach to the current leg
69  //Match the beginning of a new leg, or the end of the chain
70  if(i == sections.size() - 1 || (std::any_of(all_regexes.begin(), all_regexes.end(), [&sections, i](const std::regex* rgx) { return std::regex_match(sections[i+1], *rgx); }))) {
71  // Process the previous leg, which starts with the item, multiplicity, and threshold
72  if(std::regex_match(leg[0], match, tau_rgx)) {
73  size_t multiplicity = match[1].str() == "" ? 1 : std::stoi(match[1].str());
74  unsigned int threshold = std::stoi(match[2].str());
75 
76  // HLT Tau sequence
77  auto itr = find_if(leg.begin(), leg.end(), [tau_type_rgx](const std::string& s) { return std::regex_match(s, tau_type_rgx); });
78  std::string type = itr != leg.end() ? *itr : "tracktwoMVA"; // Default to the tracktwoMVA sequence
79 
80  // HLT Tau ID
81  itr = find_if(leg.begin(), leg.end(), [tau_ID_rgx](const std::string& s) { return std::regex_match(s, tau_ID_rgx); });
82  std::string tau_id = itr != leg.end() ? *itr : "";
83  if(tau_id.starts_with( "veryloose")) tau_id = tau_id.substr(9);
84  else if(tau_id.starts_with( "loose")) tau_id = tau_id.substr(5);
85  else if(tau_id.starts_with( "medium")) tau_id = tau_id.substr(6);
86  else if(tau_id.starts_with( "tight")) tau_id = tau_id.substr(5);
87 
88  // Override for the old trigger names
89  if(tau_id == "RNN") {
90  if(type == "tracktwoMVA") tau_id = "DeepSet";
91  if(type == "tracktwoLLP" || type == "trackLRT") tau_id = "RNNLLP";
92  }
93 
94  // Replacements (this is temprary, the entire TrigTauInfo class will be removed soon, and all this will be handled centrally in Python using the already available infrastructure)
95  if(tau_id == "DS") tau_id = "DeepSet";
96  else if(tau_id == "GNT") tau_id = "GNTau";
97 
98  for(size_t j = 0; j < multiplicity; j++) {
99  m_HLTThr.push_back(threshold);
100  m_HLTTauTypes.push_back(type);
101  m_HLTTauIDs.push_back(tau_id);
102  }
103  } else if(std::regex_match(leg[0], match, elec_rgx)) {
104  size_t multiplicity = match[1].str() == "" ? 1 : std::stoi(match[1].str());
105  unsigned int threshold = std::stoi(match[2].str());
106  for(size_t j = 0; j < multiplicity; j++) m_HLTElecThr.push_back(threshold);
107  } else if(std::regex_match(leg[0], match, muon_rgx)) {
108  size_t multiplicity = match[1].str() == "" ? 1 : std::stoi(match[1].str());
109  unsigned int threshold = std::stoi(match[2].str());
110  for(size_t j = 0; j < multiplicity; j++) m_HLTMuonThr.push_back(threshold);
111  } else if(std::regex_match(leg[0], match, gamma_rgx)) {
112  size_t multiplicity = match[1].str() == "" ? 1 : std::stoi(match[1].str());
113  unsigned int threshold = std::stoi(match[2].str());
114  for(size_t j = 0; j < multiplicity; j++) m_HLTGammaThr.push_back(threshold);
115  } else if(std::regex_match(leg[0], match, jet_rgx)) {
116  size_t multiplicity = match[1].str() == "" ? 1 : std::stoi(match[1].str());
117  unsigned int threshold = std::stoi(match[2].str());
118  for(size_t j = 0; j < multiplicity; j++) m_HLTJetThr.push_back(threshold);
119  } else if(std::regex_match(leg[0], match, met_rgx)) {
120  unsigned int threshold = std::stoi(match[2].str());
121  m_HLTMETThr.push_back(threshold);
122  } else if(std::regex_match(leg[0], match, noalg_rgx)) {
123  m_isStreamer = true;
124  } else if (std::regex_match(leg[0], match, ditauomni_rgx)) {
125  m_HLTBoostedDitauName.push_back(leg[0]);
126  } else if(std::regex_match(leg[0], l1_rgx)){ // Treat the L1 items as a leg
127  for(size_t j = 0; j < leg.size(); j++) {
128  if(std::regex_match(leg[j], topo_rgx)) continue; // Remove HLT topo sections, not part of the L1 item
129 
130  // L1Topo items (they all include a "-" in the name, or have a separate "##DETA/PHI##_" prefix):
131  if(leg[j].find('-') != std::string::npos || std::regex_match(leg[j], l1_toposeparate_rgx)) {
132  // We only keep information from the legacy L1Topo item, from which we will not always use all thresholds
133  // Since we won't be adding any more Legacy thresholds, let's hard-code it...
134  if(leg[0] == "L1TAU60" && leg[j] == "DR-TAU12ITAU12I") leg[j] = "TAU12IM"; // L1_TAU60_DR-TAU20ITAU12I, uses "TAU12IM" threshold from the L1Topo item
135  else if(leg.size() == 1 && (leg[0] == "L1DR-TAU20ITAU12I" || leg[0] == "L1DR-TAU20ITAU12I-J25")) {
136  // Uses both TAU items, in the M isolation threshold
137  leg[0] = "L1TAU20IM";
138  leg.push_back("TAU12IM");
139  // Even on combined chains using jets, we don't use the jets threshold
140  }
141  else continue; // Remove the Phase 1 L1Topo items, since we always use a multiplicity threshold
142  }
143 
144  m_L1Items.push_back(j == 0 ? leg[j].substr(2, leg[j].size()) : leg[j]); // Remove the "L1" prefix on the first L1 item
145  }
146  }
147 
148  // Start a new leg
149  leg = {};
150  }
151  }
152 
153  if(!m_L1Items.empty()) {
154  // Build the full L1 string
155  m_L1Item = m_L1Items[0];
156  for(size_t j = 1; j < m_L1Items.size(); j++) m_L1Item += "_" + m_L1Items[j];
157 
158  // Get all individual L1 TAU items
159  std::regex_token_iterator<std::string::iterator> rgx_iter(m_L1Item.begin(), m_L1Item.end(), l1_tau_rgx);
160  while(rgx_iter != rend) {
161  std::string s = *rgx_iter;
162  std::regex_match(s, match, l1_tau_rgx);
163  size_t multiplicity = match[1].str() == "" ? 1 : std::stoi(match[1].str());
164  std::string item_type = match[2].str(); // e, j, c, or ""
165  int threshold = std::stoi(match[3].str());
166  std::string item_isolation = match[4].str(); // "", L, M, T, HL, HM, HT, IM, H
167 
168  // Set the Phase 1 thresholds to -1
169  if(remove_L1_phase1_thresholds && (item_type == "e" || item_type == "j" || item_type == "c")) threshold = -1;
170 
171  for(size_t j = 0; j < multiplicity; j++) {
172  m_tauL1Items.push_back(s.substr(match[1].str().size()));
173  m_tauL1Thr.push_back(threshold);
174  m_tauL1Type.push_back(item_type + "TAU");
175  m_tauL1Iso.push_back(item_isolation);
176  m_tauL1ThresholdPattern.push_back(-1);
177  }
178  rgx_iter++;
179  }
180 
181  m_L1Item = "L1" + m_L1Items[0];
182  }
183 }

◆ parseTriggerString() [2/4]

void TrigTauInfo::parseTriggerString ( const std::map< int, int > &  L1Phase1ThrMap_eTAU,
const std::map< int, int > &  L1Phase1ThrMap_jTAU 
)
private

Definition at line 212 of file TrigTauInfo.cxx.

213 {
214  parseTriggerString(false);
215 
216  // Correct the Phase 1 thresholds:
217  for(size_t i = 0; i < m_tauL1Items.size(); i++) {
218  const std::string& item_type = m_tauL1Type.at(i);
219  if(item_type == "eTAU" || item_type == "cTAU") {
220  m_tauL1Thr[i] = L1Phase1ThrMap_eTAU.at(m_tauL1Thr.at(i));
221  } else if(item_type == "jTAU") {
222  m_tauL1Thr[i] = L1Phase1ThrMap_jTAU.at(m_tauL1Thr.at(i));
223  }
224  }
225 }

◆ parseTriggerString() [3/4]

void TrigTauInfo::parseTriggerString ( const std::map< std::string, float > &  L1Phase1_thresholds)
private

Definition at line 185 of file TrigTauInfo.cxx.

186 {
188 
189  for(size_t i = 0; i < m_tauL1Items.size(); i++) {
190  if(m_tauL1Type.at(i) == "TAU") continue; // Skip the legacy items
191 
192  const std::string& item = m_tauL1Items.at(i);
193 
194  m_tauL1Thr[i] = L1Phase1_thresholds.at(item);
195  }
196 }

◆ parseTriggerString() [4/4]

void TrigTauInfo::parseTriggerString ( const std::map< std::string, float > &  L1Phase1_thresholds,
const std::map< std::string, uint64_t > &  L1Phase1_threshold_patterns 
)
private

Definition at line 198 of file TrigTauInfo.cxx.

199 {
201 
202  for(size_t i = 0; i < m_tauL1Items.size(); i++) {
203  if(m_tauL1Type.at(i) == "TAU") continue; // Skip the legacy items
204 
205  const std::string& item = m_tauL1Items.at(i);
206 
207  m_tauL1Thr[i] = L1Phase1_thresholds.at(item);
208  m_tauL1ThresholdPattern[i] = L1Phase1_threshold_patterns.at(item);
209  }
210 }

Member Data Documentation

◆ m_HLTBoostedDitauName

std::vector<std::string> TrigTauInfo::m_HLTBoostedDitauName
private

Definition at line 95 of file TrigTauInfo.h.

◆ m_HLTElecThr

std::vector<float> TrigTauInfo::m_HLTElecThr
private

Definition at line 89 of file TrigTauInfo.h.

◆ m_HLTGammaThr

std::vector<float> TrigTauInfo::m_HLTGammaThr
private

Definition at line 91 of file TrigTauInfo.h.

◆ m_HLTJetThr

std::vector<float> TrigTauInfo::m_HLTJetThr
private

Definition at line 92 of file TrigTauInfo.h.

◆ m_HLTMETThr

std::vector<float> TrigTauInfo::m_HLTMETThr
private

Definition at line 93 of file TrigTauInfo.h.

◆ m_HLTMuonThr

std::vector<float> TrigTauInfo::m_HLTMuonThr
private

Definition at line 90 of file TrigTauInfo.h.

◆ m_HLTTauIDs

std::vector<std::string> TrigTauInfo::m_HLTTauIDs
private

Definition at line 79 of file TrigTauInfo.h.

◆ m_HLTTauTypes

std::vector<std::string> TrigTauInfo::m_HLTTauTypes
private

Definition at line 78 of file TrigTauInfo.h.

◆ m_HLTThr

std::vector<float> TrigTauInfo::m_HLTThr
private

Definition at line 77 of file TrigTauInfo.h.

◆ m_isStreamer

bool TrigTauInfo::m_isStreamer = false
private

Definition at line 76 of file TrigTauInfo.h.

◆ m_L1Item

std::string TrigTauInfo::m_L1Item
private

Definition at line 81 of file TrigTauInfo.h.

◆ m_L1Items

std::vector<std::string> TrigTauInfo::m_L1Items
private

Definition at line 82 of file TrigTauInfo.h.

◆ m_tauL1Iso

std::vector<std::string> TrigTauInfo::m_tauL1Iso
private

Definition at line 86 of file TrigTauInfo.h.

◆ m_tauL1Items

std::vector<std::string> TrigTauInfo::m_tauL1Items
private

Definition at line 84 of file TrigTauInfo.h.

◆ m_tauL1Thr

std::vector<float> TrigTauInfo::m_tauL1Thr
private

Definition at line 83 of file TrigTauInfo.h.

◆ m_tauL1ThresholdPattern

std::vector<int64_t> TrigTauInfo::m_tauL1ThresholdPattern
private

Definition at line 87 of file TrigTauInfo.h.

◆ m_tauL1Type

std::vector<std::string> TrigTauInfo::m_tauL1Type
private

Definition at line 85 of file TrigTauInfo.h.

◆ m_trigger

std::string TrigTauInfo::m_trigger
private

Definition at line 75 of file TrigTauInfo.h.


The documentation for this class was generated from the following files:
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigTauInfo::m_HLTElecThr
std::vector< float > m_HLTElecThr
Definition: TrigTauInfo.h:89
TrigTauInfo::m_HLTTauIDs
std::vector< std::string > m_HLTTauIDs
Definition: TrigTauInfo.h:79
TrigTauInfo::m_L1Item
std::string m_L1Item
Definition: TrigTauInfo.h:81
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
TrigTauInfo::m_HLTMETThr
std::vector< float > m_HLTMETThr
Definition: TrigTauInfo.h:93
TrigTauInfo::m_isStreamer
bool m_isStreamer
Definition: TrigTauInfo.h:76
TrigTauInfo::m_L1Items
std::vector< std::string > m_L1Items
Definition: TrigTauInfo.h:82
TrigTauInfo::m_HLTMuonThr
std::vector< float > m_HLTMuonThr
Definition: TrigTauInfo.h:90
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
columnar::rend
auto rend() const noexcept
Definition: ObjectRange.h:164
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
PyPoolBrowser.item
item
Definition: PyPoolBrowser.py:129
lumiFormat.i
int i
Definition: lumiFormat.py:85
python.CaloAddPedShiftConfig.str
str
Definition: CaloAddPedShiftConfig.py:42
TrigTauInfo::m_tauL1ThresholdPattern
std::vector< int64_t > m_tauL1ThresholdPattern
Definition: TrigTauInfo.h:87
TrigTauInfo::m_trigger
std::string m_trigger
Definition: TrigTauInfo.h:75
compute_lumi.leg
leg
Definition: compute_lumi.py:95
TrigTauInfo::m_HLTJetThr
std::vector< float > m_HLTJetThr
Definition: TrigTauInfo.h:92
TrigTauInfo::m_tauL1Items
std::vector< std::string > m_tauL1Items
Definition: TrigTauInfo.h:84
TrigTauInfo::m_HLTTauTypes
std::vector< std::string > m_HLTTauTypes
Definition: TrigTauInfo.h:78
threshold
Definition: chainparser.cxx:74
TrigTauInfo::m_HLTGammaThr
std::vector< float > m_HLTGammaThr
Definition: TrigTauInfo.h:91
TrigTauInfo::m_HLTBoostedDitauName
std::vector< std::string > m_HLTBoostedDitauName
Definition: TrigTauInfo.h:95
TrigTauInfo::m_tauL1Type
std::vector< std::string > m_tauL1Type
Definition: TrigTauInfo.h:85
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
TrigTauInfo::m_tauL1Iso
std::vector< std::string > m_tauL1Iso
Definition: TrigTauInfo.h:86
python.prefilter_mask.rgx
rgx
Definition: prefilter_mask.py:14
TrigTauInfo::m_tauL1Thr
std::vector< float > m_tauL1Thr
Definition: TrigTauInfo.h:83
python.compressB64.c
def c
Definition: compressB64.py:93
TrigTauInfo::parseTriggerString
void parseTriggerString(bool remove_L1_phase1_thresholds=true)
Definition: TrigTauInfo.cxx:33
TrigTauInfo::m_HLTThr
std::vector< float > m_HLTThr
Definition: TrigTauInfo.h:77
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356