20 if (trigger_name.compare(0, 3,
"HLT") != 0 && trigger_name.compare(0, 2,
"L1") != 0) {
23 auto vfound = trigger_name.rfind(
"_v");
24 if (vfound == std::string::npos) {
27 trigger_name.replace(vfound, trigger_name.size() - vfound,
"");
31 return name.compare(0, 3,
"HLT") == 0 ||
name.compare(0, 4,
"Flag") == 0 ||
name.compare(0, 2,
"L1") == 0;
38 : m_triggerName(
name), m_triggerIndex(
index) {
58 if (
nullptr ==
pset || !
pset->existsAs<std::vector<std::string>>(
"@trigger_paths",
true)) {
63 throw cms::Exception(
"LogicError") <<
"TriggerOutputFields::getTriggerNames " 64 "Encountered vector\n of trigger names and a TriggerResults object with\n" 65 "different sizes. This should be impossible.\n" 66 "Please send information to reproduce this problem to\nthe edm developers.\n";
68 return names.triggerNames();
80 if (!isNanoaodTrigger(
name)) {
83 trimVersionSuffix(
name);
97 for (std::size_t
j = 0;
j < newNames.size();
j++) {
98 auto&
name = newNames[
j];
99 if (!isNanoaodTrigger(
name)) {
102 trimVersionSuffix(
name);
103 if (
name ==
t.getTriggerName()) {
109 for (std::size_t
j = 0;
j < newNames.size();
j++) {
110 auto&
name = newNames[
j];
111 if (!isNanoaodTrigger(
name)) {
114 trimVersionSuffix(
name);
116 return t.getTriggerName() ==
name;
119 edm::LogWarning(
"TriggerOutputFields") <<
"Skipping output of TriggerField " <<
name <<
"\n";
126 const auto* existing_field =
model.Get<
bool>(
name);
127 if (!existing_field) {
132 <<
" to the new branch.\n";
void makeUniqueFieldName(RNTupleModel &model, std::string &name)
bool accept() const
Has at least one path accepted the event?
void fill(const edm::EventForOutput &event)
void updateTriggerFields(const edm::TriggerResults &triggerResults)
bool getMapped(key_type const &k, value_type &result) const
TriggerFieldPtr()=default
void fill(const T &value)
const std::string names[nVars_]
std::vector< TriggerFieldPtr > m_triggerFields
std::string m_processName
void fill(const edm::TriggerResults &triggers)
static std::string const triggerResults
void createFields(const edm::EventForOutput &event, RNTupleModel &model)
static std::vector< std::string > getTriggerNames(const edm::TriggerResults &triggerResults)
Log< level::Warning, false > LogWarning
static Registry * instance()
RNTupleFieldPtr< bool > m_field