27 disjoint(vector<EventRange>
const&
ranges)
29 if (ranges.size() < 2ull) {
32 auto it = ranges.cbegin();
33 auto const end = ranges.cend();
34 for (
auto nxt = next(it); nxt !=
end; ++it, ++nxt) {
35 if (!it->is_disjoint(*nxt)) {
51 RangeSet::forRun(
RunID const rid)
64 RangeSet::~RangeSet() =
default;
65 RangeSet::RangeSet() =
default;
66 RangeSet::RangeSet(
RangeSet const& rhs) =
default;
67 RangeSet::RangeSet(
RangeSet&& rhs) =
default;
94 vector<EventRange>
const&
108 for (
auto const& range :
ranges_) {
109 if (range.contains(s, e)) {
125 return ranges_.size() == 1ull &&
132 return (
ranges_.size() == 1ull) &&
ranges_.front().is_full_subRun();
175 return tmp.has_disjoint_ranges();
181 for (
auto const& range :
ranges_) {
228 return range.subRun() !=
sr;
230 return static_cast<size_t>(
pos -
ranges_.cbegin());
254 vector<EventRange>
result;
273 <<
"A range set must be sorted before it is collapsed.\n";
303 vector<EventRange> merged;
308 back_inserter(merged));
309 unique(merged.begin(), merged.end());
320 if (!rs.
ranges_.empty() && (e >= 1) && (e <= rs.
ranges_.size())) {
344 pair<std::size_t, bool>
348 bool did_split =
false;
352 return r.contains(s, e);
358 if ((foundRange !=
ranges_.cend()) && foundRange->is_valid() &&
359 (foundRange->size() > 1ull)) {
360 auto const begin = foundRange->begin();
361 auto const end = foundRange->end();
368 return make_pair(static_cast<size_t>(
result -
ranges_.cbegin()), did_split);
394 <<
"\nA RangeSet created using RangeSet::forRun cannot be modified.\n";
440 auto const& rranges = rtmp.collapse().ranges();
442 std::vector<EventRange> merged;
443 std::merge(lranges.begin(),
447 back_inserter(merged));
449 return disjoint(merged);
460 <<
"Attempt to merge event ranges that both contain one or more of the " 462 <<
" Run: " << rn <<
'\n' 463 <<
" " <<
left <<
" vs.\n" 464 <<
" " <<
right <<
'\n';
479 os <<
" Run: " << rs.
run();
484 for (
auto const& er : rs.
ranges()) {
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
bool operator==(Provenance const &a, Provenance const &b) noexcept
void set_end(EventNumber_t const e)
std::pair< std::size_t, bool > split_range(SubRunNumber_t, EventNumber_t)
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
std::vector< EventRange >::const_iterator const_iterator
bool has_disjoint_ranges() const
std::vector< EventRange > const & ranges() const
std::vector< EventRange > ranges_
void set_run(RunNumber_t const r)
EventRange full_run_event_range()
void assign_ranges(RangeSet const &rs, std::size_t const b, std::size_t const e)
EventNumber_t end() const noexcept
void throw_if_not_disjoint(RunNumber_t const rn, EventRange const &left, EventRange const &right) noexcept(false)
void sort_all(RandCont &)
std::ostream & operator<<(std::ostream &os, const GroupSelector &gs)
void swap(Handle< T > &a, Handle< T > &b)
std::size_t end_idx() const
std::enable_if_t< detail::are_handles< T, U >::value, bool > disjoint_ranges(T const &a, U const &b)
IDNumber_t< Level::SubRun > SubRunNumber_t
const_iterator end() const
std::vector< EventRange > extract_ranges(std::size_t const b, std::size_t const e)
bool contains(RunNumber_t, SubRunNumber_t, EventNumber_t) const
std::string to_compact_string() const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
void require_not_full_run()
void update(EventID const &)
std::enable_if_t< detail::are_handles< T, U >::value, bool > overlapping_ranges(T const &a, U const &b)
std::enable_if_t< detail::are_handles< T, U >::value, bool > same_ranges(T const &a, U const &b)
const_iterator begin() const
SubRunNumber_t subRun() const noexcept
IDNumber_t< Level::Event > EventNumber_t
RangeSet & merge(RangeSet const &other)
bool is_full_subRun() const
bool merge(EventRange const &other)
SubRunNumber_t subRun() const
std::size_t next_subrun_or_end(std::size_t const b) const
static constexpr double sr
bool is_adjacent(EventRange const &other) const noexcept
EventRange & at(std::size_t)
std::string to_string(ModuleType const mt)
unsigned checksum() const
bool is_collapsed() const
std::size_t begin_idx() const
IDNumber_t< Level::Run > RunNumber_t