1 #ifndef DataFormats_PatCandidates_PackedTriggerPrescales_h 2 #define DataFormats_PatCandidates_PackedTriggerPrescales_h 22 template <
typename T =
int>
28 template <
typename T =
int>
49 static_assert(std::is_same_v<T, double>,
50 "\n\n\tPlease use getPrescaleForIndex<double> " 51 "(other types for trigger prescales are not supported anymore by PackedTriggerPrescales)");
59 static_assert(std::is_same_v<T, double>,
60 "\n\n\tPlease use getPrescaleForName<double> " 61 "(other types for trigger prescales are not supported anymore by PackedTriggerPrescales)");
63 throw cms::Exception(
"LogicError",
"getPrescaleForName called without having called setTriggerNames first");
68 "getPrescaleForName called with invalid arguments (name is empty, prefixOnly=true");
69 size_t siz =
name.length() - 1;
70 while (siz > 0 && (
name[siz] ==
'*' ||
name[siz] ==
'\0'))
72 for (
unsigned int i = 0,
n =
names.size();
i <
n; ++
i) {
73 if (strncmp(
name.c_str(),
names[
i].c_str(), siz) == 0) {
74 return getPrescaleForIndex<T>(
i);
80 return getPrescaleForIndex<T>(
index);
86 #endif // DataFormats_PatCandidates_PackedTriggerPrescales_h T getPrescaleForName(const std::string &name, bool prefixOnly=false) const
Strings const & triggerNames() const
const std::string names[nVars_]
const edm::TriggerResults & triggerResults() const
unsigned int triggerIndex(std::string_view name) const
edm::RefCore triggerResults_
std::vector< double > prescaleValues_
T getPrescaleForIndex(int index) const
const edm::TriggerNames * triggerNames_
~PackedTriggerPrescales()=default
void setTriggerNames(const edm::TriggerNames &names)
void addPrescaledTrigger(int index, double prescale)