Skip to content
Snippets Groups Projects
Commit 5a1481e1 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

intersection fcn for EventIDRange

added a static function to EventIDRange which takes a
variable number of EventIDRange arguments, and returns the
intersection of them, but getting the maximum of the
`start()` and minimum of the `stop()`.

See merge request see atlas/Gaudi!22, !167
parents c8d7b8b2 5c7124ca
No related branches found
No related tags found
1 merge request!167intersection fcn for EventIDRange
Pipeline #
......@@ -34,6 +34,17 @@ public:
return ( t>=m_start && t<m_stop );
}
static EventIDRange intersect(const EventIDRange& it) { return it; }
template <typename ... T>
static EventIDRange intersect(const EventIDRange& first, const T& ... rest) {
EventIDRange r = intersect(rest...);
EventIDBase i1 = std::max(first.start(), r.start());
EventIDBase i2 = std::min(first.stop(), r.stop());
return EventIDRange(i1,i2);
}
friend bool operator==(const EventIDRange& lhs, const EventIDRange& rhs);
friend bool operator!=(const EventIDRange& lhs, const EventIDRange& rhs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment