#include <lumiParser.h>
|
void | chomp (std::string &s, const std::string ®ex) |
| all these string manipulation routines should all be available from elsewhere More...
|
|
void | chop (std::string &s, const std::string ®ex) |
|
void | tail (std::string &s, const std::string ®ex) |
|
void | clean (std::string &s, const std::string ®ex) |
|
std::string | toupper (const std::string &s) |
|
std::string | tolower (const std::string &s) |
|
Definition at line 28 of file lumiParser.h.
◆ const_iterator
◆ full_type
◆ iterator
iterators over the full map
Definition at line 35 of file lumiList.h.
◆ lumiParser() [1/2]
lumiParser::lumiParser |
( |
| ) |
|
|
inline |
◆ lumiParser() [2/2]
lumiParser::lumiParser |
( |
const std::string & |
file | ) |
|
|
inline |
◆ ~lumiParser()
virtual lumiParser::~lumiParser |
( |
| ) |
|
|
inlinevirtual |
◆ addRange()
void lumiList::addRange |
( |
int |
run, |
|
|
int |
start, |
|
|
int |
stop |
|
) |
| |
|
inlineinherited |
add a lumi block range for a given run
Definition at line 48 of file lumiList.h.
53 std::pair< iterator, bool > in = insert( std::pair<int, grl_run >(
run,
grl_run(
run ) ) );
59 if ( !
m_terse ) std::cout <<
"lumiList::addRange() run " <<
run <<
";\t" <<
start <<
" - " <<
stop << std::endl;
◆ chomp()
void lumiParser::chomp |
( |
std::string & |
s, |
|
|
const std::string & |
regex |
|
) |
| |
|
inlineprivate |
all these string manipulation routines should all be available from elsewhere
Definition at line 133 of file lumiParser.h.
135 if (
pos!=std::string::npos )
s.erase(
pos,
s.size() );
◆ chop()
void lumiParser::chop |
( |
std::string & |
s, |
|
|
const std::string & |
regex |
|
) |
| |
|
inlineprivate |
◆ clean()
void lumiParser::clean |
( |
std::string & |
s, |
|
|
const std::string & |
regex |
|
) |
| |
|
inlineprivate |
◆ inRange()
bool lumiList::inRange |
( |
int |
run, |
|
|
int |
lb |
|
) |
| |
|
inlineinherited |
is this run, lumiblock in any of the ranges? if the run is not in the list, it is assumed that all events from that run are required
Definition at line 67 of file lumiList.h.
71 if ( itr ==
end() )
return true;
74 for (
unsigned i=0 ;
i<
v.size() ;
i++ ) {
◆ read()
void lumiParser::read |
( |
const std::string & |
f | ) |
|
|
inline |
read GRL from web if required
save file if it exists to download again in case it has changed
open the file
go through all the lines ...
got a run
parse the run number
really need to check for upper or lower case in addition
parse the lumiblock ranges
Definition at line 36 of file lumiParser.h.
41 if (
pos!=std::string::npos ) {
42 std::string
cmd =
"wget ";
48 std::string mvcmd =
"mv ";
50 std::system( mvcmd.c_str() );
52 std::system(
cmd.c_str() );
55 std::cout <<
"lumiParser file: " <<
file << std::endl;
61 std::vector<int> lbstart;
62 std::vector<int> lbend;
73 if ( inputline.find(
"run:")!=std::string::npos ||
74 inputline.find(
"<run>")!=std::string::npos ) {
93 for( std::string fline ; getline(
input, fline ) ; ) {
94 if (
tolower(fline).find(
"from:")!=std::string::npos ) {
95 chop( fline,
"From:" );
97 std::string
start = fline;
101 lbend.push_back(
std::atoi(fline.c_str()) );
103 else if (
tolower(fline).
find(
"lbrange")!=std::string::npos ) {
104 clean( fline,
"\"" );
106 chop( fline,
"LBRange");
107 chomp( fline,
"/>" );
108 chop( fline,
"Start=" );
109 std::string
start = fline;
111 chop( fline,
"End=");
113 lbend.push_back(
std::atoi(fline.c_str()) );
118 for (
unsigned il=0 ;
il<lbstart.size() ;
il++ ) this->
addRange( run, lbstart[
il], lbend[
il] );
123 std::cout <<
"lumiParser: read " <<
size() <<
" runs" << std::endl;
◆ setterse()
void lumiList::setterse |
( |
bool |
b | ) |
|
|
inlineinherited |
◆ sort()
sort the runs by the number of good lumi blocks
sort the vector
print out
Definition at line 83 of file lumiList.h.
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())
113 <<
"\t" << *
vec[
i] <<
"\tfraction: " <<
vec[
i]->lbsize()/total << std::endl;
◆ tail()
void lumiParser::tail |
( |
std::string & |
s, |
|
|
const std::string & |
regex |
|
) |
| |
|
inlineprivate |
◆ tolower()
std::string lumiParser::tolower |
( |
const std::string & |
s | ) |
|
|
inlineprivate |
Definition at line 166 of file lumiParser.h.
168 for (
unsigned i=0 ;
i<
t.size() ;
i++ )
if (
t[
i]>=
'A' &&
t[
i]<=
'Z' )
t[
i] -=
'A'-
'a';
◆ toupper()
std::string lumiParser::toupper |
( |
const std::string & |
s | ) |
|
|
inlineprivate |
Definition at line 159 of file lumiParser.h.
161 for (
unsigned i=0 ;
i<
t.size() ;
i++ )
if (
t[
i]>=
'a' &&
t[
i]<=
'z' )
t[
i] +=
'A'-
'a';
◆ elements
T std::map< K, T >::elements |
|
inherited |
◆ keys
◆ m_terse
The documentation for this class was generated from the following file:
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.