Skip to content

Commit 50d1341

Browse files
Add a trigger function to check triggers by tags
1 parent 5bf8d0d commit 50d1341

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

rooutil/inc/Trigger.hh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ namespace rooutil {
3939
return Fired(_nameToIndex.at(name));
4040
}
4141

42+
// Check if any trigger with this pattern string was fired
43+
bool FiredByTag(const std::string pattern) const {
44+
bool fired = false;
45+
for(const auto& itr : NameToIndexMap()) {
46+
const std::string name = itr.first;
47+
if(name.find(pattern) != std::string::npos) fired |= Fired(itr.second);
48+
if(fired) break;
49+
}
50+
return fired;
51+
}
52+
4253
// Data accessors
4354
const mu2e::TrigInfo* TrigInfo () const { return _trig; }
4455
const std::map<std::string, int>& NameToIndexMap() const { return _nameToIndex; }

0 commit comments

Comments
 (0)