|
ATLAS Offline Software
|
Go to the documentation of this file.
36 void read(
const std::string&
f ) {
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;
135 if (
pos!=std::string::npos )
s.erase(
pos,
s.size() );
140 if (
pos!=std::string::npos )
s.erase( 0,
pos+
regex.size() );
145 while(
pos!=std::string::npos ) {
153 while(
pos!=std::string::npos ) {
161 for (
unsigned i=0 ;
i<
t.size() ;
i++ )
if (
t[
i]>=
'a' &&
t[
i]<=
'z' )
t[
i] +=
'A'-
'a';
168 for (
unsigned i=0 ;
i<
t.size() ;
i++ )
if (
t[
i]>=
'A' &&
t[
i]<=
'Z' )
t[
i] -=
'A'-
'a';
183 #endif // LUMIPARSER_H
void chomp(std::string &s, const std::string ®ex)
all these string manipulation routines should all be available from elsewhere
void clean(std::string &s, const std::string ®ex)
std::string find(const std::string &s)
return a remapped string
void read(const std::string &f)
std::ostream & operator<<(std::ostream &s, const lumiParser &lp)
std::string toupper(const std::string &s)
int run(int argc, char *argv[])
void addRange(int run, int start, int stop)
add a lumi block range for a given run
void chop(std::string &s, const std::string ®ex)
void tail(std::string &s, const std::string ®ex)
std::string tolower(const std::string &s)
lumiParser(const std::string &file)
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
standalone implementation of a good lumi block list