15#ifndef ANALYSIS_LUMILIST_H
16#define ANALYSIS_LUMILIST_H
27class lumiList :
public std::map< int, grl_run > {
35 typedef std::map< int, grl_run >::iterator
iterator;
53 std::pair< iterator, bool > in = insert( std::pair<int, grl_run >(
run,
grl_run(
run ) ) );
57 it->second.add_range( start, stop );
59 if ( !
m_terse ) std::cout <<
"lumiList::addRange() run " <<
run <<
";\t" << start <<
" - " << stop << std::endl;
71 if ( itr == end() )
return true;
74 for (
unsigned i=0 ; i<v.size() ; i++ ) {
75 if (
lb>=v[i].first &&
lb<=v[i].second )
return true;
85 std::cout <<
"lumiList::sort() sorting ..." << std::endl;
87 std::vector< const grl_run* >
vec;
91 while ( itr!=end() ) {
92 vec.push_back( &(itr->second) );
102 for (
unsigned i=
vec.size() ; i-- ; ) total +=
vec[i]->lbsize();
106 for (
unsigned i=0 ; i<
vec.size() ; i++ ) {
111 <<
"\t" << int(100*(i+1.0)/
vec.size())
112 <<
"\t" << int(
integral/total*1000)*0.1
113 <<
"\t" << *
vec[i] <<
"\tfraction: " <<
vec[i]->lbsize()/total << std::endl;
139 s <<
"lumilist: " << ll.size() <<
" runs" <<
"\n";
141 while ( itr!=ll.end() ) {
143 s <<
"lumiList: run " << itr->first <<
" range: " << itr->second.first() <<
"\t- " << itr->second.last() <<
"\t : size " << itr->second.lbsize() <<
"\n";
std::vector< size_t > vec
static bool comparison(const grl_run *r1, const grl_run *r2)
std::map< int, grl_run > full_type
full map type
void sort()
sort the runs by the number of good lumi blocks
std::map< int, grl_run >::iterator iterator
iterators over the full map
bool inRange(int run, int lb)
is this run, lumiblock in any of the ranges?
void addRange(int run, int start, int stop)
add a lumi block range for a given run
std::map< int, grl_run >::const_iterator const_iterator
@basic basic run class for the good runs list
std::string find(const std::string &s)
return a remapped string
std::ostream & operator<<(std::ostream &s, const lumiList &ll)
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.