-
Notifications
You must be signed in to change notification settings - Fork 95
Allow filtering by trigger bits, add accessor #1670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,8 +43,21 @@ namespace mu2e { | |
| return findTrigPathID(name); | ||
| } | ||
|
|
||
| std::string const& getTrigNameByBit(size_t const bit) const { | ||
| for (const auto& pair : _trigPathMap) { | ||
| if (pair.second == bit) { | ||
| return pair.first; | ||
| } | ||
| } | ||
| throw cet::exception("TRIGGER") << "TriggerResultsNavigator: Bit " << bit << " not found"; | ||
| } | ||
|
|
||
| // Has ith path accepted the event? | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please avoid implementing functions in the header because any change can trigger massive recompilation (exception: simple accessor /setter). Could you implement this in the cc file? |
||
| bool accepted(std::string const& name) const; | ||
| bool accepted(unsigned int const bit) const { | ||
| auto name = getTrigNameByBit(bit); | ||
| return accepted(name); | ||
| } | ||
|
|
||
| bool wasrun(std::string const& name) const; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that the trigger navigators relies a lot on strings, which is slow. IS there a way to improve this? |
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, it would be nice if you could align the different fields, this makes the code easier to read