12 #ifndef ANALYSIS_DATASET_H
13 #define ANALYSIS_DATASET_H
27 class dataset :
public std::vector<std::string> {
32 std::cout <<
"dataset::dataset() reading files from " << st << std::endl;
36 if (
s.find(
"root://eos")!=std::string::npos ) {
41 size_t pos=
s.find(
"//");
42 while(
pos!=std::string::npos ) {
43 s =
s.substr(
pos+1,
s.length());
47 std::string xcmd =
"eos ls "+
s+
"/";
48 std::system( (xcmd+
" > .eosfiles-$$.log").c_str() );
50 std::string
cmd =
"export EOSFILES=$("+xcmd+
")";
51 std::system(
cmd.c_str() );
53 std::ifstream
infile(
".eosfiles-$$.log");
59 file.find(
".root")!=std::string::npos &&
60 file.find(
".part")==std::string::npos &&
61 file.find(
".bak")==std::string::npos &&
62 file.find(
".skimmed")==std::string::npos ) push_back(
s+
"/"+
file );
76 if( ( dirp = opendir(
s.c_str()) ) ) {
77 while( (
entry = readdir(dirp) ) ) {
79 if (
file.find(
".root")!=std::string::npos ) {
80 push_back(
s+
"/"+
file );
86 std::cout <<
"dataset::dataset() " <<
size() <<
" files in dataset" << std::endl;
94 const std::vector<std::string>&
datafiles() {
return *
this; }
103 return s <<
ds.directory() <<
" " <<
ds.size();
107 #endif // ANALYSIS_DATASET_H