15 vector<string> fnames;
17 string command(
"JobOutputDir=`/bin/ls -dt1 joboutput-* 2>/dev/null | head -1`\n"
18 "if [ -d \"${JobOutputDir}\" ]; then\n"
19 " find ${JobOutputDir} -name hist.root\n"
22 stringstream fnstream;
24 char* fnbuf =
new char[1024];
25 FILE* fstream = popen( command.c_str(),
"r" );
27 while ( fgets( fnbuf, 1024, fstream ) != NULL ) { fnstream << fnbuf; }
30 while ( !( fnstream >> fname ).eof() ) { fnames.push_back( fname ); }
37 cout <<
"WARNING: Failed to retrieve hist files in the current directory!" << endl;
44 vector<string> fnames;
45 string newpath = path;
46 string::size_type strl = newpath.length();
47 if ( ( strl > 1 ) && (
'/' == newpath[strl - 1] ) ) newpath.erase( strl - 1 );
50 sprintf( com1,
"JobOutputDir=`/bin/ls -dt1 %s/joboutput-* 2>/dev/null | head -1`\n",
52 string command1( com1 );
53 string command2(
"if [ -d \"${JobOutputDir}\" ]; then\n"
54 " find ${JobOutputDir} -name hist.root\n"
56 string command = command1 + command2;
57 stringstream fnstream;
59 char* fnbuf =
new char[1024];
60 FILE* fstream = popen( command.c_str(),
"r" );
62 while ( fgets( fnbuf, 1024, fstream ) != NULL ) { fnstream << fnbuf; }
65 while ( !( fnstream >> fname ).eof() ) { fnames.push_back( fname ); }
72 cout <<
"ERROR: Failed to retrieve hist files!" << endl;
sprintf(cut, "kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_" "pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)