#include <string>
#include <cstring>
#include <vector>
#include "TROOT.h"
#include "TObjArray.h"
Go to the source code of this file.
Functions | |
std::vector< std::string > | getHistList () |
std::vector< std::string > | getHistList (std::string path) |
Variables | |
const double | CC = 2.99792458E10 |
const double | PI = 3.141592653 |
const double | PI2 = 6.283185307 |
const double | HFPI = 1.570796327 |
const int | WIRENMAX = 6796 |
const int | LAYERNMAX = 43 |
const int | CELLNMAX = 288 |
const int | INNERNMAX = 8 |
const int | NEP = 16 |
const int | NTRKPAR = 5 |
const int | NTRKPARALL = 10 |
std::vector<std::string> getHistList | ( | std::string | path | ) |
std::vector<std::string> getHistList | ( | ) |
Definition at line 14 of file fun.cpp.
00015 { 00016 vector<string> fnames; 00017 00018 string command( 00019 "JobOutputDir=`/bin/ls -dt1 joboutput-* 2>/dev/null | head -1`\n" 00020 "if [ -d \"${JobOutputDir}\" ]; then\n" 00021 " find ${JobOutputDir} -name hist.root\n" 00022 "fi\n" 00023 ); 00024 00025 stringstream fnstream; 00026 00027 char* fnbuf = new char[1024]; 00028 FILE* fstream = popen(command.c_str(), "r"); 00029 00030 while ( fgets(fnbuf, 1024, fstream) != NULL ) { 00031 fnstream << fnbuf; 00032 } 00033 00034 string fname; 00035 while ( ! (fnstream>>fname).eof() ) { 00036 fnames.push_back(fname); 00037 } 00038 00039 pclose(fstream); 00040 delete [] fnbuf; 00041 00042 if ( fnames.empty() ) { 00043 cout << "WARNING: Failed to retrieve hist files in the current directory!" << endl; 00044 // exit(1); 00045 } 00046 return fnames; 00047 }
const int NTRKPARALL = 10 |